diff --git a/.gitignore b/.gitignore index 20898f7..eeec7ab 100644 --- a/.gitignore +++ b/.gitignore @@ -339,8 +339,11 @@ # BeatPulse healthcheck temp database healthchecksdb -/Language/Assets/Client.json -/Test/qpdgo +!/ChromaSDK/Assets/ARM64 +!/ChromaSDK/Assets/x64 + +!/FMODAPI/Assets/ARM64 +!/FMODAPI/Assets/x64 !/Qwilight/Assets/ARM64 /Qwilight/Assets/ARM64/Flint.exe @@ -353,9 +356,16 @@ /Qwilight/Assets/x64/NVIDIA.dll /Qwilight/Assets/x64/Xwindow.exe +/Language/Assets/Client.json + +!/LedCSharp/Assets/ARM64 +!/LedCSharp/Assets/x64 + !/Qwilight/sdk/tools/ContentBuilder/builder/steamcmd !/Qwilight/sdk/tools/ContentBuilder/scripts/simple_app_build.vdf /Qwilight/sdk/tools/ContentBuilder/builder /Qwilight/sdk/tools/ContentBuilder/output -/Qwilight.zip \ No newline at end of file +/Qwilight.zip + +/Test/qpdgo \ No newline at end of file diff --git a/ChromaSDK/Assets/x64/CChromaEditorLibrary64.dll b/ChromaSDK/Assets/x64/CChromaEditorLibrary64.dll new file mode 100644 index 0000000..608576a --- /dev/null +++ b/ChromaSDK/Assets/x64/CChromaEditorLibrary64.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14e5709b9de7c454ecfb0b9386591ed64f67af6e35be27b8b695bcafc8ac256a +size 436112 diff --git a/ChromaSDK/ChromaAnimationAPI.cs b/ChromaSDK/ChromaAnimationAPI.cs new file mode 100644 index 0000000..1b2977b --- /dev/null +++ b/ChromaSDK/ChromaAnimationAPI.cs @@ -0,0 +1,10071 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; + +namespace ChromaSDK +{ + public class Keyboard + { + //! Definitions of keys. + public enum RZKEY + { + RZKEY_ESC = 0x0001, /*!< Esc (VK_ESCAPE) */ + RZKEY_F1 = 0x0003, /*!< F1 (VK_F1) */ + RZKEY_F2 = 0x0004, /*!< F2 (VK_F2) */ + RZKEY_F3 = 0x0005, /*!< F3 (VK_F3) */ + RZKEY_F4 = 0x0006, /*!< F4 (VK_F4) */ + RZKEY_F5 = 0x0007, /*!< F5 (VK_F5) */ + RZKEY_F6 = 0x0008, /*!< F6 (VK_F6) */ + RZKEY_F7 = 0x0009, /*!< F7 (VK_F7) */ + RZKEY_F8 = 0x000A, /*!< F8 (VK_F8) */ + RZKEY_F9 = 0x000B, /*!< F9 (VK_F9) */ + RZKEY_F10 = 0x000C, /*!< F10 (VK_F10) */ + RZKEY_F11 = 0x000D, /*!< F11 (VK_F11) */ + RZKEY_F12 = 0x000E, /*!< F12 (VK_F12) */ + RZKEY_1 = 0x0102, /*!< 1 (VK_1) */ + RZKEY_2 = 0x0103, /*!< 2 (VK_2) */ + RZKEY_3 = 0x0104, /*!< 3 (VK_3) */ + RZKEY_4 = 0x0105, /*!< 4 (VK_4) */ + RZKEY_5 = 0x0106, /*!< 5 (VK_5) */ + RZKEY_6 = 0x0107, /*!< 6 (VK_6) */ + RZKEY_7 = 0x0108, /*!< 7 (VK_7) */ + RZKEY_8 = 0x0109, /*!< 8 (VK_8) */ + RZKEY_9 = 0x010A, /*!< 9 (VK_9) */ + RZKEY_0 = 0x010B, /*!< 0 (VK_0) */ + RZKEY_A = 0x0302, /*!< A (VK_A) */ + RZKEY_B = 0x0407, /*!< B (VK_B) */ + RZKEY_C = 0x0405, /*!< C (VK_C) */ + RZKEY_D = 0x0304, /*!< D (VK_D) */ + RZKEY_E = 0x0204, /*!< E (VK_E) */ + RZKEY_F = 0x0305, /*!< F (VK_F) */ + RZKEY_G = 0x0306, /*!< G (VK_G) */ + RZKEY_H = 0x0307, /*!< H (VK_H) */ + RZKEY_I = 0x0209, /*!< I (VK_I) */ + RZKEY_J = 0x0308, /*!< J (VK_J) */ + RZKEY_K = 0x0309, /*!< K (VK_K) */ + RZKEY_L = 0x030A, /*!< L (VK_L) */ + RZKEY_M = 0x0409, /*!< M (VK_M) */ + RZKEY_N = 0x0408, /*!< N (VK_N) */ + RZKEY_O = 0x020A, /*!< O (VK_O) */ + RZKEY_P = 0x020B, /*!< P (VK_P) */ + RZKEY_Q = 0x0202, /*!< Q (VK_Q) */ + RZKEY_R = 0x0205, /*!< R (VK_R) */ + RZKEY_S = 0x0303, /*!< S (VK_S) */ + RZKEY_T = 0x0206, /*!< T (VK_T) */ + RZKEY_U = 0x0208, /*!< U (VK_U) */ + RZKEY_V = 0x0406, /*!< V (VK_V) */ + RZKEY_W = 0x0203, /*!< W (VK_W) */ + RZKEY_X = 0x0404, /*!< X (VK_X) */ + RZKEY_Y = 0x0207, /*!< Y (VK_Y) */ + RZKEY_Z = 0x0403, /*!< Z (VK_Z) */ + RZKEY_NUMLOCK = 0x0112, /*!< Numlock (VK_NUMLOCK) */ + RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 (VK_NUMPAD0) */ + RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 (VK_NUMPAD1) */ + RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 (VK_NUMPAD2) */ + RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 (VK_NUMPAD3) */ + RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 (VK_NUMPAD4) */ + RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 (VK_NUMPAD5) */ + RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 (VK_NUMPAD6) */ + RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 (VK_NUMPAD7) */ + RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 (VK_NUMPAD8) */ + RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9 (VK_ NUMPAD9*/ + RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide (VK_DIVIDE) */ + RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply (VK_MULTIPLY) */ + RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract (VK_SUBTRACT) */ + RZKEY_NUMPAD_ADD = 0x0215, /*!< Add (VK_ADD) */ + RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter (VK_RETURN - Extended) */ + RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal (VK_DECIMAL) */ + RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen (VK_PRINT) */ + RZKEY_SCROLL = 0x0010, /*!< Scroll Lock (VK_SCROLL) */ + RZKEY_PAUSE = 0x0011, /*!< Pause (VK_PAUSE) */ + RZKEY_INSERT = 0x010F, /*!< Insert (VK_INSERT) */ + RZKEY_HOME = 0x0110, /*!< Home (VK_HOME) */ + RZKEY_PAGEUP = 0x0111, /*!< Page Up (VK_PRIOR) */ + RZKEY_DELETE = 0x020f, /*!< Delete (VK_DELETE) */ + RZKEY_END = 0x0210, /*!< End (VK_END) */ + RZKEY_PAGEDOWN = 0x0211, /*!< Page Down (VK_NEXT) */ + RZKEY_UP = 0x0410, /*!< Up (VK_UP) */ + RZKEY_LEFT = 0x050F, /*!< Left (VK_LEFT) */ + RZKEY_DOWN = 0x0510, /*!< Down (VK_DOWN) */ + RZKEY_RIGHT = 0x0511, /*!< Right (VK_RIGHT) */ + RZKEY_TAB = 0x0201, /*!< Tab (VK_TAB) */ + RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock(VK_CAPITAL) */ + RZKEY_BACKSPACE = 0x010E, /*!< Backspace (VK_BACK) */ + RZKEY_ENTER = 0x030E, /*!< Enter (VK_RETURN) */ + RZKEY_LCTRL = 0x0501, /*!< Left Control(VK_LCONTROL) */ + RZKEY_LWIN = 0x0502, /*!< Left Window (VK_LWIN) */ + RZKEY_LALT = 0x0503, /*!< Left Alt (VK_LMENU) */ + RZKEY_SPACE = 0x0507, /*!< Spacebar (VK_SPACE) */ + RZKEY_RALT = 0x050B, /*!< Right Alt (VK_RMENU) */ + RZKEY_FN = 0x050C, /*!< Function key. */ + RZKEY_RMENU = 0x050D, /*!< Right Menu (VK_APPS) */ + RZKEY_RCTRL = 0x050E, /*!< Right Control (VK_RCONTROL) */ + RZKEY_LSHIFT = 0x0401, /*!< Left Shift (VK_LSHIFT) */ + RZKEY_RSHIFT = 0x040E, /*!< Right Shift (VK_RSHIFT) */ + RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1 */ + RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2 */ + RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ + RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4 */ + RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ + RZKEY_OEM_1 = 0x0101, /*!< ~ (tilde/半角/全角) (VK_OEM_3) */ + RZKEY_OEM_2 = 0x010C, /*!< -- (minus) (VK_OEM_MINUS) */ + RZKEY_OEM_3 = 0x010D, /*!< = (equal) (VK_OEM_PLUS) */ + RZKEY_OEM_4 = 0x020C, /*!< [ (left sqaure bracket) (VK_OEM_4) */ + RZKEY_OEM_5 = 0x020D, /*!< ] (right square bracket) (VK_OEM_6) */ + RZKEY_OEM_6 = 0x020E, /*!< \ (backslash) (VK_OEM_5) */ + RZKEY_OEM_7 = 0x030B, /*!< ; (semi-colon) (VK_OEM_1) */ + RZKEY_OEM_8 = 0x030C, /*!< ' (apostrophe) (VK_OEM_7) */ + RZKEY_OEM_9 = 0x040A, /*!< , (comma) (VK_OEM_COMMA) */ + RZKEY_OEM_10 = 0x040B, /*!< . (period) (VK_OEM_PERIOD) */ + RZKEY_OEM_11 = 0x040C, /*!< / (forward slash) (VK_OEM_2) */ + RZKEY_EUR_1 = 0x030D, /*!< "#" (VK_OEM_5) */ + RZKEY_EUR_2 = 0x0402, /*!< \ (VK_OEM_102) */ + RZKEY_JPN_1 = 0x0015, /*!< ¥ (0xFF) */ + RZKEY_JPN_2 = 0x040D, /*!< \ (0xC1) */ + RZKEY_JPN_3 = 0x0504, /*!< 無変換 (VK_OEM_PA1) */ + RZKEY_JPN_4 = 0x0509, /*!< 変換 (0xFF) */ + RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ (0xFF) */ + RZKEY_KOR_1 = 0x0015, /*!< | (0xFF) */ + RZKEY_KOR_2 = 0x030D, /*!< (VK_OEM_5) */ + RZKEY_KOR_3 = 0x0402, /*!< (VK_OEM_102) */ + RZKEY_KOR_4 = 0x040D, /*!< (0xC1) */ + RZKEY_KOR_5 = 0x0504, /*!< (VK_OEM_PA1) */ + RZKEY_KOR_6 = 0x0509, /*!< 한/영 (0xFF) */ + RZKEY_KOR_7 = 0x050A, /*!< (0xFF) */ + RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ + } + + //! Definition of LEDs. + public enum RZLED + { + RZLED_LOGO = 0x0014 /*!< Razer logo */ + }; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct APPINFOTYPE + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string Title; //TCHAR Title[256]; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] + public string Description; //TCHAR Description[1024]; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string Author_Name; //TCHAR Name[256]; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string Author_Contact; //TCHAR Contact[256]; + + public UInt32 SupportedDevice; //DWORD SupportedDevice; + + public UInt32 Category; //DWORD Category; + } + + [StructLayout(LayoutKind.Sequential)] + public struct FChromaSDKGuid + { + Guid Data; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DEVICE_INFO_TYPE + { + int DeviceType; + uint Connected; + } + + public enum EFFECT_TYPE + { + CHROMA_NONE = 0, //!< No effect. + CHROMA_WAVE, //!< Wave effect (This effect type has deprecated and should not be used). + CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (This effect type has deprecated and should not be used). + CHROMA_BREATHING, //!< Breathing effect (This effect type has deprecated and should not be used). + CHROMA_BLINKING, //!< Blinking effect (This effect type has deprecated and should not be used). + CHROMA_REACTIVE, //!< Reactive effect (This effect type has deprecated and should not be used). + CHROMA_STATIC, //!< Static effect. + CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. + CHROMA_RESERVED, //!< Reserved + CHROMA_INVALID //!< Invalid effect. + } + + namespace Stream + { + public enum StreamStatusType + { + READY = 0, // ready for commands + AUTHORIZING = 1, // the session is being authorized + BROADCASTING = 2, // the session is being broadcast + WATCHING = 3, // A stream is being watched + NOT_AUTHORIZED = 4, // The session is not authorized + BROADCAST_DUPLICATE = 5, // The session has duplicate broadcasters + SERVICE_OFFLINE = 6, // The service is offline + } + + public class Default + { + const uint LENGTH_SHORTCODE = 6; + const uint LENGTH_STREAM_ID = 48; + const uint LENGTH_STREAM_KEY = 48; + const uint LENGTH_STREAM_FOCUS = 48; + + static string GetDefaultString(uint length) + { + string result = string.Empty; + for (uint i = 0; i < length; ++i) + { + result += " "; + } + return result; + } + + public readonly static string Shortcode = GetDefaultString(LENGTH_SHORTCODE); + public readonly static string StreamId = GetDefaultString(LENGTH_STREAM_ID); + public readonly static string StreamKey = GetDefaultString(LENGTH_STREAM_KEY); + public readonly static string StreamFocus = GetDefaultString(LENGTH_STREAM_FOCUS); + } + } + + public class ChromaAnimationAPI + { + +#if X64 + const string DLL_NAME = "CChromaEditorLibrary64"; +#else + const string DLL_NAME = "CChromaEditorLibrary"; +#endif + +#region Data Structures + + public enum DeviceType + { + Invalid = -1, + DE_1D = 0, + DE_2D = 1, + MAX = 2, + } + + public enum Device + { + Invalid = -1, + ChromaLink = 0, + Headset = 1, + Keyboard = 2, + Keypad = 3, + Mouse = 4, + Mousepad = 5, + KeyboardExtended = 6, + MAX = 7, + } + + public enum Device1D + { + Invalid = -1, + ChromaLink = 0, + Headset = 1, + Mousepad = 2, + MAX = 3, + } + + public enum Device2D + { + Invalid = -1, + Keyboard = 0, + Keypad = 1, + Mouse = 2, + KeyboardExtended = 3, + MAX = 4, + } + + public class FChromaSDKDeviceFrameIndex + { + // Index corresponds to EChromaSDKDeviceEnum; + public int[] _mFrameIndex = new int[(int)Device.MAX]; + + public FChromaSDKDeviceFrameIndex() + { + _mFrameIndex[(int)Device.ChromaLink] = 0; + _mFrameIndex[(int)Device.Headset] = 0; + _mFrameIndex[(int)Device.Keyboard] = 0; + _mFrameIndex[(int)Device.Keypad] = 0; + _mFrameIndex[(int)Device.Mouse] = 0; + _mFrameIndex[(int)Device.Mousepad] = 0; + _mFrameIndex[(int)Device.KeyboardExtended] = 0; + } + } + + public enum EChromaSDKSceneBlend + { + SB_None, + SB_Invert, + SB_Threshold, + SB_Lerp, + }; + + public enum EChromaSDKSceneMode + { + SM_Replace, + SM_Max, + SM_Min, + SM_Average, + SM_Multiply, + SM_Add, + SM_Subtract, + }; + + public class FChromaSDKSceneEffect + { + public string _mAnimation = ""; + public bool _mState = false; + public int _mPrimaryColor = 0; + public int _mSecondaryColor = 0; + public int _mSpeed = 1; + public EChromaSDKSceneBlend _mBlend = EChromaSDKSceneBlend.SB_None; + public EChromaSDKSceneMode _mMode = EChromaSDKSceneMode.SM_Replace; + + public FChromaSDKDeviceFrameIndex _mFrameIndex = new FChromaSDKDeviceFrameIndex(); + } + + public class FChromaSDKScene + { + public List _mEffects = new List(); + public bool GetState(int effect) + { + if (effect >= 0 && effect < _mEffects.Count) + { + return _mEffects[effect]._mState; + } + else + { + return false; + } + } + public void ToggleState(int effect) + { + if (effect >= 0 && effect < _mEffects.Count) + { + _mEffects[effect]._mState = !_mEffects[effect]._mState; + } + } + } + + +#endregion + +#region Helpers (handle path conversions) + + /// + /// Helper to convert path string to IntPtr + /// + /// + /// + private static IntPtr GetPathIntPtr(string path) + { + if (string.IsNullOrEmpty(path)) + { + return IntPtr.Zero; + } + FileInfo fi = new FileInfo(path); + byte[] array = ASCIIEncoding.ASCII.GetBytes(fi.FullName + "\0"); + IntPtr lpData = Marshal.AllocHGlobal(array.Length); + Marshal.Copy(array, 0, lpData, array.Length); + return lpData; + } + + /// + /// Helper to Ascii path string to IntPtr + /// + /// + /// + private static IntPtr GetAsciiIntPtr(string str) + { + if (string.IsNullOrEmpty(str)) + { + return IntPtr.Zero; + } + byte[] array = ASCIIEncoding.ASCII.GetBytes(str + "\0"); + IntPtr lpData = Marshal.AllocHGlobal(array.Length); + Marshal.Copy(array, 0, lpData, array.Length); + return lpData; + } + + /// + /// Helper to Unicode path string to IntPtr + /// + /// + /// + private static IntPtr GetUnicodeIntPtr(string str) + { + if (string.IsNullOrEmpty(str)) + { + return IntPtr.Zero; + } + byte[] array = UnicodeEncoding.Unicode.GetBytes(str + "\0"); + IntPtr lpData = Marshal.AllocHGlobal(array.Length); + Marshal.Copy(array, 0, lpData, array.Length); + return lpData; + } + + /// + /// Helper to recycle the IntPtr + /// + /// + private static void FreeIntPtr(IntPtr lpData) + { + if (lpData != IntPtr.Zero) + { + Marshal.FreeHGlobal(lpData); + } + } + + public static int UninitAPI() + { + UnloadLibrarySDK(); + UnloadLibraryStreamingPlugin(); + + return 0; + } + +#endregion + + + #region Public API Methods + /// + /// Return the sum of colors + /// + public static int AddColor(int color1, int color2) + { + int result = PluginAddColor(color1, color2); + return result; + } + /// + /// Adds a frame to the `Chroma` animation and sets the `duration` (in seconds). + /// The `color` is expected to be an array of the dimensions for the `deviceType/device`. + /// The `length` parameter is the size of the `color` array. For `EChromaSDKDevice1DEnum` + /// the array size should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array + /// size should be `MAX ROW` times `MAX COLUMN`. Returns the animation id upon + /// success. Returns negative one upon failure. + /// + public static int AddFrame(int animationId, float duration, int[] colors, int length) + { + int result = PluginAddFrame(animationId, duration, colors, length); + return result; + } + /// + /// Add source color to target where color is not black for frame id, reference + /// source and target by id. + /// + public static void AddNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) + { + PluginAddNonZeroAllKeys(sourceAnimationId, targetAnimationId, frameId); + } + /// + /// Add source color to target where color is not black for all frames, reference + /// source and target by id. + /// + public static void AddNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) + { + PluginAddNonZeroAllKeysAllFrames(sourceAnimationId, targetAnimationId); + } + /// + /// Add source color to target where color is not black for all frames, reference + /// source and target by name. + /// + public static void AddNonZeroAllKeysAllFramesName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginAddNonZeroAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double AddNonZeroAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginAddNonZeroAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Add source color to target where color is not black for all frames starting + /// at offset for the length of the source, reference source and target by + /// id. + /// + public static void AddNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) + { + PluginAddNonZeroAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); + } + /// + /// Add source color to target where color is not black for all frames starting + /// at offset for the length of the source, reference source and target by + /// name. + /// + public static void AddNonZeroAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginAddNonZeroAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double AddNonZeroAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginAddNonZeroAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Add source color to target where color is not black for frame id, reference + /// source and target by name. + /// + public static void AddNonZeroAllKeysName(string sourceAnimation, string targetAnimation, int frameId) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginAddNonZeroAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// Add source color to target where color is not black for the source frame + /// and target offset frame, reference source and target by id. + /// + public static void AddNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) + { + PluginAddNonZeroAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); + } + /// + /// Add source color to target where color is not black for the source frame + /// and target offset frame, reference source and target by name. + /// + public static void AddNonZeroAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginAddNonZeroAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double AddNonZeroAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginAddNonZeroAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Add source color to target where the target color is not black for all frames, + /// reference source and target by id. + /// + public static void AddNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) + { + PluginAddNonZeroTargetAllKeysAllFrames(sourceAnimationId, targetAnimationId); + } + /// + /// Add source color to target where the target color is not black for all frames, + /// reference source and target by name. + /// + public static void AddNonZeroTargetAllKeysAllFramesName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginAddNonZeroTargetAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double AddNonZeroTargetAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginAddNonZeroTargetAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Add source color to target where the target color is not black for all frames + /// starting at offset for the length of the source, reference source and target + /// by id. + /// + public static void AddNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) + { + PluginAddNonZeroTargetAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); + } + /// + /// Add source color to target where the target color is not black for all frames + /// starting at offset for the length of the source, reference source and target + /// by name. + /// + public static void AddNonZeroTargetAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginAddNonZeroTargetAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double AddNonZeroTargetAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginAddNonZeroTargetAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Add source color to target where target color is not blank from the source + /// frame to the target offset frame, reference source and target by id. + /// + public static void AddNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) + { + PluginAddNonZeroTargetAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); + } + /// + /// Add source color to target where target color is not blank from the source + /// frame to the target offset frame, reference source and target by name. + /// + /// + public static void AddNonZeroTargetAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginAddNonZeroTargetAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double AddNonZeroTargetAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginAddNonZeroTargetAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Append all source frames to the target animation, reference source and target + /// by id. + /// + public static void AppendAllFrames(int sourceAnimationId, int targetAnimationId) + { + PluginAppendAllFrames(sourceAnimationId, targetAnimationId); + } + /// + /// Append all source frames to the target animation, reference source and target + /// by name. + /// + public static void AppendAllFramesName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginAppendAllFramesName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double AppendAllFramesNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginAppendAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// `PluginClearAll` will issue a `CLEAR` effect for all devices. + /// + public static void ClearAll() + { + PluginClearAll(); + } + /// + /// `PluginClearAnimationType` will issue a `CLEAR` effect for the given device. + /// + /// + public static void ClearAnimationType(int deviceType, int device) + { + PluginClearAnimationType(deviceType, device); + } + /// + /// `PluginCloseAll` closes all open animations so they can be reloaded from + /// disk. The set of animations will be stopped if playing. + /// + public static void CloseAll() + { + PluginCloseAll(); + } + /// + /// Closes the `Chroma` animation to free up resources referenced by id. Returns + /// the animation id upon success. Returns negative one upon failure. This + /// might be used while authoring effects if there was a change necessitating + /// re-opening the animation. The animation id can no longer be used once closed. + /// + /// + public static int CloseAnimation(int animationId) + { + int result = PluginCloseAnimation(animationId); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double CloseAnimationD(double animationId) + { + double result = PluginCloseAnimationD(animationId); + return result; + } + /// + /// Closes the `Chroma` animation referenced by name so that the animation can + /// be reloaded from disk. + /// + public static void CloseAnimationName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginCloseAnimationName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double CloseAnimationNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginCloseAnimationNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// `PluginCloseComposite` closes a set of animations so they can be reloaded + /// from disk. The set of animations will be stopped if playing. + /// + public static void CloseComposite(string name) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + PluginCloseComposite(lp_Name); + FreeIntPtr(lp_Name); + } + /// + /// D suffix for limited data types. + /// + public static double CloseCompositeD(string name) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + double result = PluginCloseCompositeD(lp_Name); + FreeIntPtr(lp_Name); + return result; + } + /// + /// Copy source animation to target animation for the given frame. Source and + /// target are referenced by id. + /// + public static void CopyAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) + { + PluginCopyAllKeys(sourceAnimationId, targetAnimationId, frameId); + } + /// + /// Copy source animation to target animation for the given frame. Source and + /// target are referenced by id. + /// + public static void CopyAllKeysName(string sourceAnimation, string targetAnimation, int frameId) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// Copy animation to named target animation in memory. If target animation + /// exists, close first. Source is referenced by id. + /// + public static int CopyAnimation(int sourceAnimationId, string targetAnimation) + { + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + int result = PluginCopyAnimation(sourceAnimationId, lp_TargetAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy animation to named target animation in memory. If target animation + /// exists, close first. Source is referenced by name. + /// + public static void CopyAnimationName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyAnimationName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyAnimationNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyAnimationNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy blue channel to other channels for all frames. Intensity range is 0.0 + /// to 1.0. Reference the animation by id. + /// + public static void CopyBlueChannelAllFrames(int animationId, float redIntensity, float greenIntensity) + { + PluginCopyBlueChannelAllFrames(animationId, redIntensity, greenIntensity); + } + /// + /// Copy blue channel to other channels for all frames. Intensity range is 0.0 + /// to 1.0. Reference the animation by name. + /// + public static void CopyBlueChannelAllFramesName(string path, float redIntensity, float greenIntensity) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginCopyBlueChannelAllFramesName(lp_Path, redIntensity, greenIntensity); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double CopyBlueChannelAllFramesNameD(string path, double redIntensity, double greenIntensity) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginCopyBlueChannelAllFramesNameD(lp_Path, redIntensity, greenIntensity); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Copy green channel to other channels for all frames. Intensity range is + /// 0.0 to 1.0. Reference the animation by id. + /// + public static void CopyGreenChannelAllFrames(int animationId, float redIntensity, float blueIntensity) + { + PluginCopyGreenChannelAllFrames(animationId, redIntensity, blueIntensity); + } + /// + /// Copy green channel to other channels for all frames. Intensity range is + /// 0.0 to 1.0. Reference the animation by name. + /// + public static void CopyGreenChannelAllFramesName(string path, float redIntensity, float blueIntensity) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginCopyGreenChannelAllFramesName(lp_Path, redIntensity, blueIntensity); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double CopyGreenChannelAllFramesNameD(string path, double redIntensity, double blueIntensity) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginCopyGreenChannelAllFramesNameD(lp_Path, redIntensity, blueIntensity); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Copy animation key color from the source animation to the target animation + /// for the given frame. Reference the source and target by id. + /// + public static void CopyKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey) + { + PluginCopyKeyColor(sourceAnimationId, targetAnimationId, frameId, rzkey); + } + /// + /// Copy animation key color from the source animation to the target animation + /// for all frames. Reference the source and target by id. + /// + public static void CopyKeyColorAllFrames(int sourceAnimationId, int targetAnimationId, int rzkey) + { + PluginCopyKeyColorAllFrames(sourceAnimationId, targetAnimationId, rzkey); + } + /// + /// Copy animation key color from the source animation to the target animation + /// for all frames. Reference the source and target by name. + /// + public static void CopyKeyColorAllFramesName(string sourceAnimation, string targetAnimation, int rzkey) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyKeyColorAllFramesName(lp_SourceAnimation, lp_TargetAnimation, rzkey); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyKeyColorAllFramesNameD(string sourceAnimation, string targetAnimation, double rzkey) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyKeyColorAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation, rzkey); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy animation key color from the source animation to the target animation + /// for all frames, starting at the offset for the length of the source animation. + /// Source and target are referenced by id. + /// + public static void CopyKeyColorAllFramesOffset(int sourceAnimationId, int targetAnimationId, int rzkey, int offset) + { + PluginCopyKeyColorAllFramesOffset(sourceAnimationId, targetAnimationId, rzkey, offset); + } + /// + /// Copy animation key color from the source animation to the target animation + /// for all frames, starting at the offset for the length of the source animation. + /// Source and target are referenced by name. + /// + public static void CopyKeyColorAllFramesOffsetName(string sourceAnimation, string targetAnimation, int rzkey, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyKeyColorAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, rzkey, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyKeyColorAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double rzkey, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyKeyColorAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, rzkey, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy animation key color from the source animation to the target animation + /// for the given frame. + /// + public static void CopyKeyColorName(string sourceAnimation, string targetAnimation, int frameId, int rzkey) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyKeyColorName(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyKeyColorNameD(string sourceAnimation, string targetAnimation, double frameId, double rzkey) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyKeyColorNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation for the given frame. Reference the source and target by + /// id. + /// + public static void CopyKeysColor(int sourceAnimationId, int targetAnimationId, int frameId, int[] keys, int size) + { + PluginCopyKeysColor(sourceAnimationId, targetAnimationId, frameId, keys, size); + } + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation for all frames. Reference the source and target by id. + /// + /// + public static void CopyKeysColorAllFrames(int sourceAnimationId, int targetAnimationId, int[] keys, int size) + { + PluginCopyKeysColorAllFrames(sourceAnimationId, targetAnimationId, keys, size); + } + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation for all frames. Reference the source and target by name. + /// + /// + public static void CopyKeysColorAllFramesName(string sourceAnimation, string targetAnimation, int[] keys, int size) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyKeysColorAllFramesName(lp_SourceAnimation, lp_TargetAnimation, keys, size); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation for the given frame. Reference the source and target by + /// name. + /// + public static void CopyKeysColorName(string sourceAnimation, string targetAnimation, int frameId, int[] keys, int size) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyKeysColorName(lp_SourceAnimation, lp_TargetAnimation, frameId, keys, size); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation from the source frame to the target frame. Reference the + /// source and target by id. + /// + public static void CopyKeysColorOffset(int sourceAnimationId, int targetAnimationId, int sourceFrameId, int targetFrameId, int[] keys, int size) + { + PluginCopyKeysColorOffset(sourceAnimationId, targetAnimationId, sourceFrameId, targetFrameId, keys, size); + } + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation from the source frame to the target frame. Reference the + /// source and target by name. + /// + public static void CopyKeysColorOffsetName(string sourceAnimation, string targetAnimation, int sourceFrameId, int targetFrameId, int[] keys, int size) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyKeysColorOffsetName(lp_SourceAnimation, lp_TargetAnimation, sourceFrameId, targetFrameId, keys, size); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// Copy source animation to target animation for the given frame. Source and + /// target are referenced by id. + /// + public static void CopyNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) + { + PluginCopyNonZeroAllKeys(sourceAnimationId, targetAnimationId, frameId); + } + /// + /// Copy nonzero colors from a source animation to a target animation for all + /// frames. Reference source and target by id. + /// + public static void CopyNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) + { + PluginCopyNonZeroAllKeysAllFrames(sourceAnimationId, targetAnimationId); + } + /// + /// Copy nonzero colors from a source animation to a target animation for all + /// frames. Reference source and target by name. + /// + public static void CopyNonZeroAllKeysAllFramesName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyNonZeroAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyNonZeroAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyNonZeroAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy nonzero colors from a source animation to a target animation for all + /// frames starting at the offset for the length of the source animation. The + /// source and target are referenced by id. + /// + public static void CopyNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) + { + PluginCopyNonZeroAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); + } + /// + /// Copy nonzero colors from a source animation to a target animation for all + /// frames starting at the offset for the length of the source animation. The + /// source and target are referenced by name. + /// + public static void CopyNonZeroAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyNonZeroAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyNonZeroAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyNonZeroAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy nonzero colors from source animation to target animation for the specified + /// frame. Source and target are referenced by id. + /// + public static void CopyNonZeroAllKeysName(string sourceAnimation, string targetAnimation, int frameId) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyNonZeroAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyNonZeroAllKeysNameD(string sourceAnimation, string targetAnimation, double frameId) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyNonZeroAllKeysNameD(lp_SourceAnimation, lp_TargetAnimation, frameId); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy nonzero colors from the source animation to the target animation from + /// the source frame to the target offset frame. Source and target are referenced + /// by id. + /// + public static void CopyNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) + { + PluginCopyNonZeroAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); + } + /// + /// Copy nonzero colors from the source animation to the target animation from + /// the source frame to the target offset frame. Source and target are referenced + /// by name. + /// + public static void CopyNonZeroAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyNonZeroAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyNonZeroAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyNonZeroAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy animation key color from the source animation to the target animation + /// for the given frame where color is not zero. + /// + public static void CopyNonZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey) + { + PluginCopyNonZeroKeyColor(sourceAnimationId, targetAnimationId, frameId, rzkey); + } + /// + /// Copy animation key color from the source animation to the target animation + /// for the given frame where color is not zero. + /// + public static void CopyNonZeroKeyColorName(string sourceAnimation, string targetAnimation, int frameId, int rzkey) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyNonZeroKeyColorName(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyNonZeroKeyColorNameD(string sourceAnimation, string targetAnimation, double frameId, double rzkey) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyNonZeroKeyColorNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for the specified frame. Source and target + /// are referenced by id. + /// + public static void CopyNonZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) + { + PluginCopyNonZeroTargetAllKeys(sourceAnimationId, targetAnimationId, frameId); + } + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for all frames. Source and target are referenced + /// by id. + /// + public static void CopyNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) + { + PluginCopyNonZeroTargetAllKeysAllFrames(sourceAnimationId, targetAnimationId); + } + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for all frames. Source and target are referenced + /// by name. + /// + public static void CopyNonZeroTargetAllKeysAllFramesName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyNonZeroTargetAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyNonZeroTargetAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyNonZeroTargetAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for all frames. Source and target are referenced + /// by name. + /// + public static void CopyNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) + { + PluginCopyNonZeroTargetAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); + } + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for all frames starting at the target offset + /// for the length of the source animation. Source and target animations are + /// referenced by name. + /// + public static void CopyNonZeroTargetAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyNonZeroTargetAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyNonZeroTargetAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyNonZeroTargetAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for the specified frame. The source and target + /// are referenced by name. + /// + public static void CopyNonZeroTargetAllKeysName(string sourceAnimation, string targetAnimation, int frameId) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyNonZeroTargetAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyNonZeroTargetAllKeysNameD(string sourceAnimation, string targetAnimation, double frameId) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyNonZeroTargetAllKeysNameD(lp_SourceAnimation, lp_TargetAnimation, frameId); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for the specified source frame and target offset + /// frame. The source and target are referenced by id. + /// + public static void CopyNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) + { + PluginCopyNonZeroTargetAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); + } + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for the specified source frame and target offset + /// frame. The source and target are referenced by name. + /// + public static void CopyNonZeroTargetAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyNonZeroTargetAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyNonZeroTargetAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyNonZeroTargetAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is zero for all frames. Source and target are referenced + /// by id. + /// + public static void CopyNonZeroTargetZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) + { + PluginCopyNonZeroTargetZeroAllKeysAllFrames(sourceAnimationId, targetAnimationId); + } + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is zero for all frames. Source and target are referenced + /// by name. + /// + public static void CopyNonZeroTargetZeroAllKeysAllFramesName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyNonZeroTargetZeroAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyNonZeroTargetZeroAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyNonZeroTargetZeroAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy red channel to other channels for all frames. Intensity range is 0.0 + /// to 1.0. Reference the animation by id. + /// + public static void CopyRedChannelAllFrames(int animationId, float greenIntensity, float blueIntensity) + { + PluginCopyRedChannelAllFrames(animationId, greenIntensity, blueIntensity); + } + /// + /// Copy green channel to other channels for all frames. Intensity range is + /// 0.0 to 1.0. Reference the animation by name. + /// + public static void CopyRedChannelAllFramesName(string path, float greenIntensity, float blueIntensity) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginCopyRedChannelAllFramesName(lp_Path, greenIntensity, blueIntensity); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double CopyRedChannelAllFramesNameD(string path, double greenIntensity, double blueIntensity) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginCopyRedChannelAllFramesNameD(lp_Path, greenIntensity, blueIntensity); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Copy zero colors from source animation to target animation for the frame. + /// Source and target are referenced by id. + /// + public static void CopyZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) + { + PluginCopyZeroAllKeys(sourceAnimationId, targetAnimationId, frameId); + } + /// + /// Copy zero colors from source animation to target animation for all frames. + /// Source and target are referenced by id. + /// + public static void CopyZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) + { + PluginCopyZeroAllKeysAllFrames(sourceAnimationId, targetAnimationId); + } + /// + /// Copy zero colors from source animation to target animation for all frames. + /// Source and target are referenced by name. + /// + public static void CopyZeroAllKeysAllFramesName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyZeroAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyZeroAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyZeroAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy zero colors from source animation to target animation for all frames + /// starting at the target offset for the length of the source animation. Source + /// and target are referenced by id. + /// + public static void CopyZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) + { + PluginCopyZeroAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); + } + /// + /// Copy zero colors from source animation to target animation for all frames + /// starting at the target offset for the length of the source animation. Source + /// and target are referenced by name. + /// + public static void CopyZeroAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyZeroAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyZeroAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyZeroAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy zero colors from source animation to target animation for the frame. + /// Source and target are referenced by name. + /// + public static void CopyZeroAllKeysName(string sourceAnimation, string targetAnimation, int frameId) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyZeroAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// Copy zero colors from source animation to target animation for the frame + /// id starting at the target offset for the length of the source animation. + /// Source and target are referenced by id. + /// + public static void CopyZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) + { + PluginCopyZeroAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); + } + /// + /// Copy zero colors from source animation to target animation for the frame + /// id starting at the target offset for the length of the source animation. + /// Source and target are referenced by name. + /// + public static void CopyZeroAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyZeroAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// Copy zero key color from source animation to target animation for the specified + /// frame. Source and target are referenced by id. + /// + public static void CopyZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey) + { + PluginCopyZeroKeyColor(sourceAnimationId, targetAnimationId, frameId, rzkey); + } + /// + /// Copy zero key color from source animation to target animation for the specified + /// frame. Source and target are referenced by name. + /// + public static void CopyZeroKeyColorName(string sourceAnimation, string targetAnimation, int frameId, int rzkey) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyZeroKeyColorName(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyZeroKeyColorNameD(string sourceAnimation, string targetAnimation, double frameId, double rzkey) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyZeroKeyColorNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy nonzero color from source animation to target animation where target + /// is zero for the frame. Source and target are referenced by id. + /// + public static void CopyZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) + { + PluginCopyZeroTargetAllKeys(sourceAnimationId, targetAnimationId, frameId); + } + /// + /// Copy nonzero color from source animation to target animation where target + /// is zero for all frames. Source and target are referenced by id. + /// + public static void CopyZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) + { + PluginCopyZeroTargetAllKeysAllFrames(sourceAnimationId, targetAnimationId); + } + /// + /// Copy nonzero color from source animation to target animation where target + /// is zero for all frames. Source and target are referenced by name. + /// + public static void CopyZeroTargetAllKeysAllFramesName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyZeroTargetAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double CopyZeroTargetAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginCopyZeroTargetAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Copy nonzero color from source animation to target animation where target + /// is zero for the frame. Source and target are referenced by name. + /// + public static void CopyZeroTargetAllKeysName(string sourceAnimation, string targetAnimation, int frameId) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginCopyZeroTargetAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// Direct access to low level API. + /// + public static int CoreCreateChromaLinkEffect(int effect, IntPtr pParam, out Guid pEffectId) + { + int result = PluginCoreCreateChromaLinkEffect(effect, pParam, out pEffectId); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreCreateEffect(Guid deviceId, EFFECT_TYPE effect, IntPtr pParam, out Guid pEffectId) + { + int result = PluginCoreCreateEffect(deviceId, (int)effect, pParam, out pEffectId); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreCreateHeadsetEffect(int effect, IntPtr pParam, out Guid pEffectId) + { + int result = PluginCoreCreateHeadsetEffect(effect, pParam, out pEffectId); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreCreateKeyboardEffect(int effect, IntPtr pParam, out Guid pEffectId) + { + int result = PluginCoreCreateKeyboardEffect(effect, pParam, out pEffectId); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreCreateKeypadEffect(int effect, IntPtr pParam, out Guid pEffectId) + { + int result = PluginCoreCreateKeypadEffect(effect, pParam, out pEffectId); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreCreateMouseEffect(int effect, IntPtr pParam, out Guid pEffectId) + { + int result = PluginCoreCreateMouseEffect(effect, pParam, out pEffectId); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreCreateMousepadEffect(int effect, IntPtr pParam, out Guid pEffectId) + { + int result = PluginCoreCreateMousepadEffect(effect, pParam, out pEffectId); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreDeleteEffect(Guid effectId) + { + int result = PluginCoreDeleteEffect(effectId); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreInit() + { + int result = PluginCoreInit(); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreInitSDK(ref ChromaSDK.APPINFOTYPE appInfo) + { + int result = PluginCoreInitSDK(ref appInfo); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreQueryDevice(Guid deviceId, out DEVICE_INFO_TYPE deviceInfo) + { + int result = PluginCoreQueryDevice(deviceId, out deviceInfo); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreSetEffect(Guid effectId) + { + int result = PluginCoreSetEffect(effectId); + return result; + } + /// + /// Begin broadcasting Chroma RGB data using the stored stream key as the endpoint. + /// Intended for Cloud Gaming Platforms, restore the streaming key when the + /// game instance is launched to continue streaming. streamId is a null terminated + /// string streamKey is a null terminated string StreamGetStatus() should return + /// the READY status to use this method. + /// + public static bool CoreStreamBroadcast(string streamId, string streamKey) + { + string str_StreamId = streamId; + IntPtr lp_StreamId = GetAsciiIntPtr(str_StreamId); + string str_StreamKey = streamKey; + IntPtr lp_StreamKey = GetAsciiIntPtr(str_StreamKey); + bool result = PluginCoreStreamBroadcast(lp_StreamId, lp_StreamKey); + FreeIntPtr(lp_StreamId); + FreeIntPtr(lp_StreamKey); + return result; + } + /// + /// End broadcasting Chroma RGB data. StreamGetStatus() should return the BROADCASTING + /// status to use this method. + /// + public static bool CoreStreamBroadcastEnd() + { + bool result = PluginCoreStreamBroadcastEnd(); + return result; + } + /// + /// shortcode: Pass the address of a preallocated character buffer to get the + /// streaming auth code. The buffer should have a minimum length of 6. length: + /// Length will return as zero if the streaming auth code could not be obtained. + /// If length is greater than zero, it will be the length of the returned streaming + /// auth code. Once you have the shortcode, it should be shown to the user + /// so they can associate the stream with their Razer ID StreamGetStatus() + /// should return the READY status before invoking this method. platform: is + /// the null terminated string that identifies the source of the stream: { + /// GEFORCE_NOW, LUNA, STADIA, GAME_PASS } title: is the null terminated string + /// that identifies the application or game. + /// + public static void CoreStreamGetAuthShortcode(ref string shortcode, out byte length, string platform, string title) + { + string str_Shortcode = shortcode; + IntPtr lp_Shortcode = GetAsciiIntPtr(str_Shortcode); + string str_Platform = platform; + IntPtr lp_Platform = GetUnicodeIntPtr(str_Platform); + string str_Title = title; + IntPtr lp_Title = GetUnicodeIntPtr(str_Title); + PluginCoreStreamGetAuthShortcode(lp_Shortcode, out length, lp_Platform, lp_Title); + if (lp_Shortcode != IntPtr.Zero) + { + shortcode = Marshal.PtrToStringAnsi(lp_Shortcode); + } + FreeIntPtr(lp_Shortcode); + FreeIntPtr(lp_Platform); + FreeIntPtr(lp_Title); + } + /// + /// focus: Pass the address of a preallocated character buffer to get the stream + /// focus. The buffer should have a length of 48 length: Length will return + /// as zero if the stream focus could not be obtained. If length is greater + /// than zero, it will be the length of the returned stream focus. + /// + public static bool CoreStreamGetFocus(ref string focus, out byte length) + { + string str_Focus = focus; + IntPtr lp_Focus = GetAsciiIntPtr(str_Focus); + bool result = PluginCoreStreamGetFocus(lp_Focus, out length); + if (lp_Focus != IntPtr.Zero) + { + focus = Marshal.PtrToStringAnsi(lp_Focus); + } + FreeIntPtr(lp_Focus); + return result; + } + /// + /// Intended for Cloud Gaming Platforms, store the stream id to persist in user + /// preferences to continue streaming if the game is suspended or closed. shortcode: + /// The shortcode is a null terminated string. Use the shortcode that authorized + /// the stream to obtain the stream id. streamId should be a preallocated buffer + /// to get the stream key. The buffer should have a length of 48. length: Length + /// will return zero if the key could not be obtained. If the length is greater + /// than zero, it will be the length of the returned streaming id. Retrieve + /// the stream id after authorizing the shortcode. The authorization window + /// will expire in 5 minutes. Be sure to save the stream key before the window + /// expires. StreamGetStatus() should return the READY status to use this method. + /// + /// + public static void CoreStreamGetId(string shortcode, ref string streamId, out byte length) + { + string str_Shortcode = shortcode; + IntPtr lp_Shortcode = GetAsciiIntPtr(str_Shortcode); + string str_StreamId = streamId; + IntPtr lp_StreamId = GetAsciiIntPtr(str_StreamId); + PluginCoreStreamGetId(lp_Shortcode, lp_StreamId, out length); + FreeIntPtr(lp_Shortcode); + if (lp_StreamId != IntPtr.Zero) + { + streamId = Marshal.PtrToStringAnsi(lp_StreamId); + } + FreeIntPtr(lp_StreamId); + } + /// + /// Intended for Cloud Gaming Platforms, store the streaming key to persist + /// in user preferences to continue streaming if the game is suspended or closed. + /// shortcode: The shortcode is a null terminated string. Use the shortcode + /// that authorized the stream to obtain the stream key. If the status is in + /// the BROADCASTING or WATCHING state, passing a NULL shortcode will return + /// the active streamId. streamKey should be a preallocated buffer to get the + /// stream key. The buffer should have a length of 48. length: Length will + /// return zero if the key could not be obtained. If the length is greater + /// than zero, it will be the length of the returned streaming key. Retrieve + /// the stream key after authorizing the shortcode. The authorization window + /// will expire in 5 minutes. Be sure to save the stream key before the window + /// expires. StreamGetStatus() should return the READY status to use this method. + /// + /// + public static void CoreStreamGetKey(string shortcode, ref string streamKey, out byte length) + { + string str_Shortcode = shortcode; + IntPtr lp_Shortcode = GetAsciiIntPtr(str_Shortcode); + string str_StreamKey = streamKey; + IntPtr lp_StreamKey = GetAsciiIntPtr(str_StreamKey); + PluginCoreStreamGetKey(lp_Shortcode, lp_StreamKey, out length); + FreeIntPtr(lp_Shortcode); + if (lp_StreamKey != IntPtr.Zero) + { + streamKey = Marshal.PtrToStringAnsi(lp_StreamKey); + } + FreeIntPtr(lp_StreamKey); + } + /// + /// Returns StreamStatus, the current status of the service + /// + public static ChromaSDK.Stream.StreamStatusType CoreStreamGetStatus() + { + ChromaSDK.Stream.StreamStatusType result = PluginCoreStreamGetStatus(); + return result; + } + /// + /// Convert StreamStatusType to a printable string + /// + public static string CoreStreamGetStatusString(ChromaSDK.Stream.StreamStatusType status) + { + string result = Marshal.PtrToStringAnsi(PluginCoreStreamGetStatusString(status)); + return result; + } + /// + /// This prevents the stream id and stream key from being obtained through the + /// shortcode. This closes the auth window. shortcode is a null terminated + /// string. StreamGetStatus() should return the READY status to use this method. + /// returns success when shortcode has been released + /// + public static bool CoreStreamReleaseShortcode(string shortcode) + { + string str_Shortcode = shortcode; + IntPtr lp_Shortcode = GetAsciiIntPtr(str_Shortcode); + bool result = PluginCoreStreamReleaseShortcode(lp_Shortcode); + FreeIntPtr(lp_Shortcode); + return result; + } + /// + /// The focus is a null terminated string. Set the focus identifer for the application + /// designated to automatically change the streaming state. Returns true on + /// success. + /// + public static bool CoreStreamSetFocus(string focus) + { + string str_Focus = focus; + IntPtr lp_Focus = GetAsciiIntPtr(str_Focus); + bool result = PluginCoreStreamSetFocus(lp_Focus); + FreeIntPtr(lp_Focus); + return result; + } + /// + /// Returns true if the Chroma streaming is supported. If false is returned, + /// avoid calling stream methods. + /// + public static bool CoreStreamSupportsStreaming() + { + bool result = PluginCoreStreamSupportsStreaming(); + return result; + } + /// + /// Begin watching the Chroma RGB data using streamID parameter. streamId is + /// a null terminated string. StreamGetStatus() should return the READY status + /// to use this method. + /// + public static bool CoreStreamWatch(string streamId, ulong timestamp) + { + string str_StreamId = streamId; + IntPtr lp_StreamId = GetAsciiIntPtr(str_StreamId); + bool result = PluginCoreStreamWatch(lp_StreamId, timestamp); + FreeIntPtr(lp_StreamId); + return result; + } + /// + /// End watching Chroma RGB data stream. StreamGetStatus() should return the + /// WATCHING status to use this method. + /// + public static bool CoreStreamWatchEnd() + { + bool result = PluginCoreStreamWatchEnd(); + return result; + } + /// + /// Direct access to low level API. + /// + public static int CoreUnInit() + { + int result = PluginCoreUnInit(); + return result; + } + /// + /// Creates a `Chroma` animation at the given path. The `deviceType` parameter + /// uses `EChromaSDKDeviceTypeEnum` as an integer. The `device` parameter uses + /// `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` as an integer, respective + /// to the `deviceType`. Returns the animation id upon success. Returns negative + /// one upon failure. Saves a `Chroma` animation file with the `.chroma` extension + /// at the given path. Returns the animation id upon success. Returns negative + /// one upon failure. + /// + public static int CreateAnimation(string path, int deviceType, int device) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginCreateAnimation(lp_Path, deviceType, device); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Creates a `Chroma` animation in memory without creating a file. The `deviceType` + /// parameter uses `EChromaSDKDeviceTypeEnum` as an integer. The `device` parameter + /// uses `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` as an integer, + /// respective to the `deviceType`. Returns the animation id upon success. + /// Returns negative one upon failure. Returns the animation id upon success. + /// Returns negative one upon failure. + /// + public static int CreateAnimationInMemory(int deviceType, int device) + { + int result = PluginCreateAnimationInMemory(deviceType, device); + return result; + } + /// + /// Create a device specific effect. + /// + public static int CreateEffect(Guid deviceId, EFFECT_TYPE effect, int[] colors, int size, out FChromaSDKGuid effectId) + { + int result = PluginCreateEffect(deviceId, (int)effect, colors, size, out effectId); + return result; + } + /// + /// Delete an effect given the effect id. + /// + public static int DeleteEffect(Guid effectId) + { + int result = PluginDeleteEffect(effectId); + return result; + } + /// + /// Duplicate the first animation frame so that the animation length matches + /// the frame count. Animation is referenced by id. + /// + public static void DuplicateFirstFrame(int animationId, int frameCount) + { + PluginDuplicateFirstFrame(animationId, frameCount); + } + /// + /// Duplicate the first animation frame so that the animation length matches + /// the frame count. Animation is referenced by name. + /// + public static void DuplicateFirstFrameName(string path, int frameCount) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginDuplicateFirstFrameName(lp_Path, frameCount); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double DuplicateFirstFrameNameD(string path, double frameCount) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginDuplicateFirstFrameNameD(lp_Path, frameCount); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Duplicate all the frames of the animation to double the animation length. + /// Frame 1 becomes frame 1 and 2. Frame 2 becomes frame 3 and 4. And so on. + /// The animation is referenced by id. + /// + public static void DuplicateFrames(int animationId) + { + PluginDuplicateFrames(animationId); + } + /// + /// Duplicate all the frames of the animation to double the animation length. + /// Frame 1 becomes frame 1 and 2. Frame 2 becomes frame 3 and 4. And so on. + /// The animation is referenced by name. + /// + public static void DuplicateFramesName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginDuplicateFramesName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double DuplicateFramesNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginDuplicateFramesNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Duplicate all the animation frames in reverse so that the animation plays + /// forwards and backwards. Animation is referenced by id. + /// + public static void DuplicateMirrorFrames(int animationId) + { + PluginDuplicateMirrorFrames(animationId); + } + /// + /// Duplicate all the animation frames in reverse so that the animation plays + /// forwards and backwards. Animation is referenced by name. + /// + public static void DuplicateMirrorFramesName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginDuplicateMirrorFramesName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double DuplicateMirrorFramesNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginDuplicateMirrorFramesNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fade the animation to black starting at the fade frame index to the end + /// of the animation. Animation is referenced by id. + /// + public static void FadeEndFrames(int animationId, int fade) + { + PluginFadeEndFrames(animationId, fade); + } + /// + /// Fade the animation to black starting at the fade frame index to the end + /// of the animation. Animation is referenced by name. + /// + public static void FadeEndFramesName(string path, int fade) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFadeEndFramesName(lp_Path, fade); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FadeEndFramesNameD(string path, double fade) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFadeEndFramesNameD(lp_Path, fade); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fade the animation from black to full color starting at 0 to the fade frame + /// index. Animation is referenced by id. + /// + public static void FadeStartFrames(int animationId, int fade) + { + PluginFadeStartFrames(animationId, fade); + } + /// + /// Fade the animation from black to full color starting at 0 to the fade frame + /// index. Animation is referenced by name. + /// + public static void FadeStartFramesName(string path, int fade) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFadeStartFramesName(lp_Path, fade); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FadeStartFramesNameD(string path, double fade) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFadeStartFramesNameD(lp_Path, fade); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the RGB value for all colors in the specified frame. Animation is referenced + /// by id. + /// + public static void FillColor(int animationId, int frameId, int color) + { + PluginFillColor(animationId, frameId, color); + } + /// + /// Set the RGB value for all colors for all frames. Animation is referenced + /// by id. + /// + public static void FillColorAllFrames(int animationId, int color) + { + PluginFillColorAllFrames(animationId, color); + } + /// + /// Set the RGB value for all colors for all frames. Animation is referenced + /// by name. + /// + public static void FillColorAllFramesName(string path, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillColorAllFramesName(lp_Path, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillColorAllFramesNameD(string path, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillColorAllFramesNameD(lp_Path, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the RGB value for all colors for all frames. Use the range of 0 to 255 + /// for red, green, and blue parameters. Animation is referenced by id. + /// + public static void FillColorAllFramesRGB(int animationId, int red, int green, int blue) + { + PluginFillColorAllFramesRGB(animationId, red, green, blue); + } + /// + /// Set the RGB value for all colors for all frames. Use the range of 0 to 255 + /// for red, green, and blue parameters. Animation is referenced by name. + /// + public static void FillColorAllFramesRGBName(string path, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillColorAllFramesRGBName(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillColorAllFramesRGBNameD(string path, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillColorAllFramesRGBNameD(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the RGB value for all colors in the specified frame. Animation is referenced + /// by name. + /// + public static void FillColorName(string path, int frameId, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillColorName(lp_Path, frameId, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillColorNameD(string path, double frameId, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillColorNameD(lp_Path, frameId, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the RGB value for all colors in the specified frame. Animation is referenced + /// by id. + /// + public static void FillColorRGB(int animationId, int frameId, int red, int green, int blue) + { + PluginFillColorRGB(animationId, frameId, red, green, blue); + } + /// + /// Set the RGB value for all colors in the specified frame. Animation is referenced + /// by name. + /// + public static void FillColorRGBName(string path, int frameId, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillColorRGBName(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillColorRGBNameD(string path, double frameId, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillColorRGBNameD(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors in the specified + /// frame. Animation is referenced by id. + /// + public static void FillNonZeroColor(int animationId, int frameId, int color) + { + PluginFillNonZeroColor(animationId, frameId, color); + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors for all frames. + /// Animation is referenced by id. + /// + public static void FillNonZeroColorAllFrames(int animationId, int color) + { + PluginFillNonZeroColorAllFrames(animationId, color); + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors for all frames. + /// Animation is referenced by name. + /// + public static void FillNonZeroColorAllFramesName(string path, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillNonZeroColorAllFramesName(lp_Path, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillNonZeroColorAllFramesNameD(string path, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillNonZeroColorAllFramesNameD(lp_Path, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors for all frames. + /// Use the range of 0 to 255 for red, green, and blue parameters. Animation + /// is referenced by id. + /// + public static void FillNonZeroColorAllFramesRGB(int animationId, int red, int green, int blue) + { + PluginFillNonZeroColorAllFramesRGB(animationId, red, green, blue); + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors for all frames. + /// Use the range of 0 to 255 for red, green, and blue parameters. Animation + /// is referenced by name. + /// + public static void FillNonZeroColorAllFramesRGBName(string path, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillNonZeroColorAllFramesRGBName(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillNonZeroColorAllFramesRGBNameD(string path, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillNonZeroColorAllFramesRGBNameD(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors in the specified + /// frame. Animation is referenced by name. + /// + public static void FillNonZeroColorName(string path, int frameId, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillNonZeroColorName(lp_Path, frameId, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillNonZeroColorNameD(string path, double frameId, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillNonZeroColorNameD(lp_Path, frameId, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors in the specified + /// frame. Use the range of 0 to 255 for red, green, and blue parameters. Animation + /// is referenced by id. + /// + public static void FillNonZeroColorRGB(int animationId, int frameId, int red, int green, int blue) + { + PluginFillNonZeroColorRGB(animationId, frameId, red, green, blue); + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors in the specified + /// frame. Use the range of 0 to 255 for red, green, and blue parameters. Animation + /// is referenced by name. + /// + public static void FillNonZeroColorRGBName(string path, int frameId, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillNonZeroColorRGBName(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillNonZeroColorRGBNameD(string path, double frameId, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillNonZeroColorRGBNameD(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the frame with random RGB values for the given frame. Animation is + /// referenced by id. + /// + public static void FillRandomColors(int animationId, int frameId) + { + PluginFillRandomColors(animationId, frameId); + } + /// + /// Fill the frame with random RGB values for all frames. Animation is referenced + /// by id. + /// + public static void FillRandomColorsAllFrames(int animationId) + { + PluginFillRandomColorsAllFrames(animationId); + } + /// + /// Fill the frame with random RGB values for all frames. Animation is referenced + /// by name. + /// + public static void FillRandomColorsAllFramesName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillRandomColorsAllFramesName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillRandomColorsAllFramesNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillRandomColorsAllFramesNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the frame with random black and white values for the specified frame. + /// Animation is referenced by id. + /// + public static void FillRandomColorsBlackAndWhite(int animationId, int frameId) + { + PluginFillRandomColorsBlackAndWhite(animationId, frameId); + } + /// + /// Fill the frame with random black and white values for all frames. Animation + /// is referenced by id. + /// + public static void FillRandomColorsBlackAndWhiteAllFrames(int animationId) + { + PluginFillRandomColorsBlackAndWhiteAllFrames(animationId); + } + /// + /// Fill the frame with random black and white values for all frames. Animation + /// is referenced by name. + /// + public static void FillRandomColorsBlackAndWhiteAllFramesName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillRandomColorsBlackAndWhiteAllFramesName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillRandomColorsBlackAndWhiteAllFramesNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillRandomColorsBlackAndWhiteAllFramesNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the frame with random black and white values for the specified frame. + /// Animation is referenced by name. + /// + public static void FillRandomColorsBlackAndWhiteName(string path, int frameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillRandomColorsBlackAndWhiteName(lp_Path, frameId); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillRandomColorsBlackAndWhiteNameD(string path, double frameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillRandomColorsBlackAndWhiteNameD(lp_Path, frameId); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the frame with random RGB values for the given frame. Animation is + /// referenced by name. + /// + public static void FillRandomColorsName(string path, int frameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillRandomColorsName(lp_Path, frameId); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillRandomColorsNameD(string path, double frameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillRandomColorsNameD(lp_Path, frameId); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by id. + /// + public static void FillThresholdColors(int animationId, int frameId, int threshold, int color) + { + PluginFillThresholdColors(animationId, frameId, threshold, color); + } + /// + /// Fill all frames with RGB color where the animation color is less than the + /// RGB threshold. Animation is referenced by id. + /// + public static void FillThresholdColorsAllFrames(int animationId, int threshold, int color) + { + PluginFillThresholdColorsAllFrames(animationId, threshold, color); + } + /// + /// Fill all frames with RGB color where the animation color is less than the + /// RGB threshold. Animation is referenced by name. + /// + public static void FillThresholdColorsAllFramesName(string path, int threshold, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillThresholdColorsAllFramesName(lp_Path, threshold, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillThresholdColorsAllFramesNameD(string path, double threshold, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillThresholdColorsAllFramesNameD(lp_Path, threshold, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill all frames with RGB color where the animation color is less than the + /// threshold. Animation is referenced by id. + /// + public static void FillThresholdColorsAllFramesRGB(int animationId, int threshold, int red, int green, int blue) + { + PluginFillThresholdColorsAllFramesRGB(animationId, threshold, red, green, blue); + } + /// + /// Fill all frames with RGB color where the animation color is less than the + /// threshold. Animation is referenced by name. + /// + public static void FillThresholdColorsAllFramesRGBName(string path, int threshold, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillThresholdColorsAllFramesRGBName(lp_Path, threshold, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillThresholdColorsAllFramesRGBNameD(string path, double threshold, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillThresholdColorsAllFramesRGBNameD(lp_Path, threshold, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill all frames with the min RGB color where the animation color is less + /// than the min threshold AND with the max RGB color where the animation is + /// more than the max threshold. Animation is referenced by id. + /// + public static void FillThresholdColorsMinMaxAllFramesRGB(int animationId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) + { + PluginFillThresholdColorsMinMaxAllFramesRGB(animationId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + } + /// + /// Fill all frames with the min RGB color where the animation color is less + /// than the min threshold AND with the max RGB color where the animation is + /// more than the max threshold. Animation is referenced by name. + /// + public static void FillThresholdColorsMinMaxAllFramesRGBName(string path, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillThresholdColorsMinMaxAllFramesRGBName(lp_Path, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillThresholdColorsMinMaxAllFramesRGBNameD(string path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillThresholdColorsMinMaxAllFramesRGBNameD(lp_Path, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the specified frame with the min RGB color where the animation color + /// is less than the min threshold AND with the max RGB color where the animation + /// is more than the max threshold. Animation is referenced by id. + /// + public static void FillThresholdColorsMinMaxRGB(int animationId, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) + { + PluginFillThresholdColorsMinMaxRGB(animationId, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + } + /// + /// Fill the specified frame with the min RGB color where the animation color + /// is less than the min threshold AND with the max RGB color where the animation + /// is more than the max threshold. Animation is referenced by name. + /// + public static void FillThresholdColorsMinMaxRGBName(string path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillThresholdColorsMinMaxRGBName(lp_Path, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillThresholdColorsMinMaxRGBNameD(string path, double frameId, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillThresholdColorsMinMaxRGBNameD(lp_Path, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by name. + /// + public static void FillThresholdColorsName(string path, int frameId, int threshold, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillThresholdColorsName(lp_Path, frameId, threshold, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillThresholdColorsNameD(string path, double frameId, double threshold, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillThresholdColorsNameD(lp_Path, frameId, threshold, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by id. + /// + public static void FillThresholdColorsRGB(int animationId, int frameId, int threshold, int red, int green, int blue) + { + PluginFillThresholdColorsRGB(animationId, frameId, threshold, red, green, blue); + } + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by name. + /// + public static void FillThresholdColorsRGBName(string path, int frameId, int threshold, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillThresholdColorsRGBName(lp_Path, frameId, threshold, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillThresholdColorsRGBNameD(string path, double frameId, double threshold, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillThresholdColorsRGBNameD(lp_Path, frameId, threshold, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill all frames with RGB color where the animation color is less than the + /// RGB threshold. Animation is referenced by id. + /// + public static void FillThresholdRGBColorsAllFramesRGB(int animationId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue) + { + PluginFillThresholdRGBColorsAllFramesRGB(animationId, redThreshold, greenThreshold, blueThreshold, red, green, blue); + } + /// + /// Fill all frames with RGB color where the animation color is less than the + /// RGB threshold. Animation is referenced by name. + /// + public static void FillThresholdRGBColorsAllFramesRGBName(string path, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillThresholdRGBColorsAllFramesRGBName(lp_Path, redThreshold, greenThreshold, blueThreshold, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillThresholdRGBColorsAllFramesRGBNameD(string path, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillThresholdRGBColorsAllFramesRGBNameD(lp_Path, redThreshold, greenThreshold, blueThreshold, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by id. + /// + public static void FillThresholdRGBColorsRGB(int animationId, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue) + { + PluginFillThresholdRGBColorsRGB(animationId, frameId, redThreshold, greenThreshold, blueThreshold, red, green, blue); + } + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by name. + /// + public static void FillThresholdRGBColorsRGBName(string path, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillThresholdRGBColorsRGBName(lp_Path, frameId, redThreshold, greenThreshold, blueThreshold, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillThresholdRGBColorsRGBNameD(string path, double frameId, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillThresholdRGBColorsRGBNameD(lp_Path, frameId, redThreshold, greenThreshold, blueThreshold, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the specified frame with RGB color where the animation color is zero. + /// Animation is referenced by id. + /// + public static void FillZeroColor(int animationId, int frameId, int color) + { + PluginFillZeroColor(animationId, frameId, color); + } + /// + /// Fill all frames with RGB color where the animation color is zero. Animation + /// is referenced by id. + /// + public static void FillZeroColorAllFrames(int animationId, int color) + { + PluginFillZeroColorAllFrames(animationId, color); + } + /// + /// Fill all frames with RGB color where the animation color is zero. Animation + /// is referenced by name. + /// + public static void FillZeroColorAllFramesName(string path, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillZeroColorAllFramesName(lp_Path, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillZeroColorAllFramesNameD(string path, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillZeroColorAllFramesNameD(lp_Path, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill all frames with RGB color where the animation color is zero. Animation + /// is referenced by id. + /// + public static void FillZeroColorAllFramesRGB(int animationId, int red, int green, int blue) + { + PluginFillZeroColorAllFramesRGB(animationId, red, green, blue); + } + /// + /// Fill all frames with RGB color where the animation color is zero. Animation + /// is referenced by name. + /// + public static void FillZeroColorAllFramesRGBName(string path, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillZeroColorAllFramesRGBName(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillZeroColorAllFramesRGBNameD(string path, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillZeroColorAllFramesRGBNameD(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the specified frame with RGB color where the animation color is zero. + /// Animation is referenced by name. + /// + public static void FillZeroColorName(string path, int frameId, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillZeroColorName(lp_Path, frameId, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillZeroColorNameD(string path, double frameId, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillZeroColorNameD(lp_Path, frameId, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Fill the specified frame with RGB color where the animation color is zero. + /// Animation is referenced by id. + /// + public static void FillZeroColorRGB(int animationId, int frameId, int red, int green, int blue) + { + PluginFillZeroColorRGB(animationId, frameId, red, green, blue); + } + /// + /// Fill the specified frame with RGB color where the animation color is zero. + /// Animation is referenced by name. + /// + public static void FillZeroColorRGBName(string path, int frameId, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginFillZeroColorRGBName(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double FillZeroColorRGBNameD(string path, double frameId, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginFillZeroColorRGBNameD(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Get the animation color for a frame given the `1D` `led`. The `led` should + /// be greater than or equal to 0 and less than the `MaxLeds`. Animation is + /// referenced by id. + /// + public static int Get1DColor(int animationId, int frameId, int led) + { + int result = PluginGet1DColor(animationId, frameId, led); + return result; + } + /// + /// Get the animation color for a frame given the `1D` `led`. The `led` should + /// be greater than or equal to 0 and less than the `MaxLeds`. Animation is + /// referenced by name. + /// + public static int Get1DColorName(string path, int frameId, int led) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginGet1DColorName(lp_Path, frameId, led); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double Get1DColorNameD(string path, double frameId, double led) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginGet1DColorNameD(lp_Path, frameId, led); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Get the animation color for a frame given the `2D` `row` and `column`. The + /// `row` should be greater than or equal to 0 and less than the `MaxRow`. + /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. + /// Animation is referenced by id. + /// + public static int Get2DColor(int animationId, int frameId, int row, int column) + { + int result = PluginGet2DColor(animationId, frameId, row, column); + return result; + } + /// + /// Get the animation color for a frame given the `2D` `row` and `column`. The + /// `row` should be greater than or equal to 0 and less than the `MaxRow`. + /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. + /// Animation is referenced by name. + /// + public static int Get2DColorName(string path, int frameId, int row, int column) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginGet2DColorName(lp_Path, frameId, row, column); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double Get2DColorNameD(string path, double frameId, double row, double column) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginGet2DColorNameD(lp_Path, frameId, row, column); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Get the animation id for the named animation. + /// + public static int GetAnimation(string name) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + int result = PluginGetAnimation(lp_Name); + FreeIntPtr(lp_Name); + return result; + } + /// + /// `PluginGetAnimationCount` will return the number of loaded animations. + /// + public static int GetAnimationCount() + { + int result = PluginGetAnimationCount(); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetAnimationD(string name) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + double result = PluginGetAnimationD(lp_Name); + FreeIntPtr(lp_Name); + return result; + } + /// + /// `PluginGetAnimationId` will return the `animationId` given the `index` of + /// the loaded animation. The `index` is zero-based and less than the number + /// returned by `PluginGetAnimationCount`. Use `PluginGetAnimationName` to + /// get the name of the animation. + /// + public static int GetAnimationId(int index) + { + int result = PluginGetAnimationId(index); + return result; + } + /// + /// `PluginGetAnimationName` takes an `animationId` and returns the name of + /// the animation of the `.chroma` animation file. If a name is not available + /// then an empty string will be returned. + /// + public static string GetAnimationName(int animationId) + { + string result = Marshal.PtrToStringAnsi(PluginGetAnimationName(animationId)); + return result; + } + /// + /// Get the current frame of the animation referenced by id. + /// + public static int GetCurrentFrame(int animationId) + { + int result = PluginGetCurrentFrame(animationId); + return result; + } + /// + /// Get the current frame of the animation referenced by name. + /// + public static int GetCurrentFrameName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginGetCurrentFrameName(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetCurrentFrameNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginGetCurrentFrameNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Returns the `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` of a `Chroma` + /// animation respective to the `deviceType`, as an integer upon success. Returns + /// negative one upon failure. + /// + public static int GetDevice(int animationId) + { + int result = PluginGetDevice(animationId); + return result; + } + /// + /// Returns the `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` of a `Chroma` + /// animation respective to the `deviceType`, as an integer upon success. Returns + /// negative one upon failure. + /// + public static int GetDeviceName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginGetDeviceName(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetDeviceNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginGetDeviceNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Returns the `EChromaSDKDeviceTypeEnum` of a `Chroma` animation as an integer + /// upon success. Returns negative one upon failure. + /// + public static int GetDeviceType(int animationId) + { + int result = PluginGetDeviceType(animationId); + return result; + } + /// + /// Returns the `EChromaSDKDeviceTypeEnum` of a `Chroma` animation as an integer + /// upon success. Returns negative one upon failure. + /// + public static int GetDeviceTypeName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginGetDeviceTypeName(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetDeviceTypeNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginGetDeviceTypeNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Get the frame colors and duration (in seconds) for a `Chroma` animation + /// referenced by id. The `color` is expected to be an array of the expected + /// dimensions for the `deviceType/device`. The `length` parameter is the size + /// of the `color` array. For `EChromaSDKDevice1DEnum` the array size should + /// be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should be `MAX + /// ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard + /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the + /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. + /// Returns the animation id upon success. Returns negative one upon failure. + /// + /// + public static int GetFrame(int animationId, int frameIndex, out float duration, int[] colors, int length, int[] keys, int keysLength) + { + int result = PluginGetFrame(animationId, frameIndex, out duration, colors, length, keys, keysLength); + return result; + } + /// + /// Returns the frame count of a `Chroma` animation upon success. Returns negative + /// one upon failure. + /// + public static int GetFrameCount(int animationId) + { + int result = PluginGetFrameCount(animationId); + return result; + } + /// + /// Returns the frame count of a `Chroma` animation upon success. Returns negative + /// one upon failure. + /// + public static int GetFrameCountName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginGetFrameCountName(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetFrameCountNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginGetFrameCountNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Get the frame colors and duration (in seconds) for a `Chroma` animation + /// referenced by name. The `color` is expected to be an array of the expected + /// dimensions for the `deviceType/device`. The `length` parameter is the size + /// of the `color` array. For `EChromaSDKDevice1DEnum` the array size should + /// be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should be `MAX + /// ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard + /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the + /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. + /// Returns the animation id upon success. Returns negative one upon failure. + /// + /// + public static int GetFrameName(string path, int frameIndex, out float duration, int[] colors, int length, int[] keys, int keysLength) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginGetFrameName(lp_Path, frameIndex, out duration, colors, length, keys, keysLength); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Get the color of an animation key for the given frame referenced by id. + /// + /// + public static int GetKeyColor(int animationId, int frameId, int rzkey) + { + int result = PluginGetKeyColor(animationId, frameId, rzkey); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetKeyColorD(string path, double frameId, double rzkey) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginGetKeyColorD(lp_Path, frameId, rzkey); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Get the color of an animation key for the given frame referenced by name. + /// + /// + public static int GetKeyColorName(string path, int frameId, int rzkey) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginGetKeyColorName(lp_Path, frameId, rzkey); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Returns `RZRESULT_SUCCESS` if the plugin has been initialized successfully. + /// Returns `RZRESULT_DLL_NOT_FOUND` if core Chroma library is not found. Returns + /// `RZRESULT_DLL_INVALID_SIGNATURE` if core Chroma library has an invalid + /// signature. + /// + public static int GetLibraryLoadedState() + { + int result = PluginGetLibraryLoadedState(); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetLibraryLoadedStateD() + { + double result = PluginGetLibraryLoadedStateD(); + return result; + } + /// + /// Returns the `MAX COLUMN` given the `EChromaSDKDevice2DEnum` device as an + /// integer upon success. Returns negative one upon failure. + /// + public static int GetMaxColumn(Device2D device) + { + int result = PluginGetMaxColumn((int)device); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetMaxColumnD(double device) + { + double result = PluginGetMaxColumnD(device); + return result; + } + /// + /// Returns the MAX LEDS given the `EChromaSDKDevice1DEnum` device as an integer + /// upon success. Returns negative one upon failure. + /// + public static int GetMaxLeds(Device1D device) + { + int result = PluginGetMaxLeds((int)device); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetMaxLedsD(double device) + { + double result = PluginGetMaxLedsD(device); + return result; + } + /// + /// Returns the `MAX ROW` given the `EChromaSDKDevice2DEnum` device as an integer + /// upon success. Returns negative one upon failure. + /// + public static int GetMaxRow(Device2D device) + { + int result = PluginGetMaxRow((int)device); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetMaxRowD(double device) + { + double result = PluginGetMaxRowD(device); + return result; + } + /// + /// `PluginGetPlayingAnimationCount` will return the number of playing animations. + /// + /// + public static int GetPlayingAnimationCount() + { + int result = PluginGetPlayingAnimationCount(); + return result; + } + /// + /// `PluginGetPlayingAnimationId` will return the `animationId` given the `index` + /// of the playing animation. The `index` is zero-based and less than the number + /// returned by `PluginGetPlayingAnimationCount`. Use `PluginGetAnimationName` + /// to get the name of the animation. + /// + public static int GetPlayingAnimationId(int index) + { + int result = PluginGetPlayingAnimationId(index); + return result; + } + /// + /// Get the RGB color given red, green, and blue. + /// + public static int GetRGB(int red, int green, int blue) + { + int result = PluginGetRGB(red, green, blue); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double GetRGBD(double red, double green, double blue) + { + double result = PluginGetRGBD(red, green, blue); + return result; + } + /// + /// Check if the animation has loop enabled referenced by id. + /// + public static bool HasAnimationLoop(int animationId) + { + bool result = PluginHasAnimationLoop(animationId); + return result; + } + /// + /// Check if the animation has loop enabled referenced by name. + /// + public static bool HasAnimationLoopName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + bool result = PluginHasAnimationLoopName(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double HasAnimationLoopNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginHasAnimationLoopNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Initialize the ChromaSDK. Zero indicates success, otherwise failure. Many + /// API methods auto initialize the ChromaSDK if not already initialized. + /// + public static int Init() + { + int result = PluginInit(); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double InitD() + { + double result = PluginInitD(); + return result; + } + /// + /// Initialize the ChromaSDK. AppInfo populates the details in Synapse. Zero + /// indicates success, otherwise failure. Many API methods auto initialize + /// the ChromaSDK if not already initialized. + /// + public static int InitSDK(ref ChromaSDK.APPINFOTYPE appInfo) + { + int result = PluginInitSDK(ref appInfo); + return result; + } + /// + /// Insert an animation delay by duplicating the frame by the delay number of + /// times. Animation is referenced by id. + /// + public static void InsertDelay(int animationId, int frameId, int delay) + { + PluginInsertDelay(animationId, frameId, delay); + } + /// + /// Insert an animation delay by duplicating the frame by the delay number of + /// times. Animation is referenced by name. + /// + public static void InsertDelayName(string path, int frameId, int delay) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginInsertDelayName(lp_Path, frameId, delay); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double InsertDelayNameD(string path, double frameId, double delay) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginInsertDelayNameD(lp_Path, frameId, delay); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Duplicate the source frame index at the target frame index. Animation is + /// referenced by id. + /// + public static void InsertFrame(int animationId, int sourceFrame, int targetFrame) + { + PluginInsertFrame(animationId, sourceFrame, targetFrame); + } + /// + /// Duplicate the source frame index at the target frame index. Animation is + /// referenced by name. + /// + public static void InsertFrameName(string path, int sourceFrame, int targetFrame) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginInsertFrameName(lp_Path, sourceFrame, targetFrame); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double InsertFrameNameD(string path, double sourceFrame, double targetFrame) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginInsertFrameNameD(lp_Path, sourceFrame, targetFrame); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Invert all the colors at the specified frame. Animation is referenced by + /// id. + /// + public static void InvertColors(int animationId, int frameId) + { + PluginInvertColors(animationId, frameId); + } + /// + /// Invert all the colors for all frames. Animation is referenced by id. + /// + public static void InvertColorsAllFrames(int animationId) + { + PluginInvertColorsAllFrames(animationId); + } + /// + /// Invert all the colors for all frames. Animation is referenced by name. + /// + public static void InvertColorsAllFramesName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginInvertColorsAllFramesName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double InvertColorsAllFramesNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginInvertColorsAllFramesNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Invert all the colors at the specified frame. Animation is referenced by + /// name. + /// + public static void InvertColorsName(string path, int frameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginInvertColorsName(lp_Path, frameId); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double InvertColorsNameD(string path, double frameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginInvertColorsNameD(lp_Path, frameId); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Check if the animation is paused referenced by id. + /// + public static bool IsAnimationPaused(int animationId) + { + bool result = PluginIsAnimationPaused(animationId); + return result; + } + /// + /// Check if the animation is paused referenced by name. + /// + public static bool IsAnimationPausedName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + bool result = PluginIsAnimationPausedName(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double IsAnimationPausedNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginIsAnimationPausedNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// The editor dialog is a non-blocking modal window, this method returns true + /// if the modal window is open, otherwise false. + /// + public static bool IsDialogOpen() + { + bool result = PluginIsDialogOpen(); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double IsDialogOpenD() + { + double result = PluginIsDialogOpenD(); + return result; + } + /// + /// Returns true if the plugin has been initialized. Returns false if the plugin + /// is uninitialized. + /// + public static bool IsInitialized() + { + bool result = PluginIsInitialized(); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double IsInitializedD() + { + double result = PluginIsInitializedD(); + return result; + } + /// + /// If the method can be invoked the method returns true. + /// + public static bool IsPlatformSupported() + { + bool result = PluginIsPlatformSupported(); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double IsPlatformSupportedD() + { + double result = PluginIsPlatformSupportedD(); + return result; + } + /// + /// `PluginIsPlayingName` automatically handles initializing the `ChromaSDK`. + /// The named `.chroma` animation file will be automatically opened. The method + /// will return whether the animation is playing or not. Animation is referenced + /// by id. + /// + public static bool IsPlaying(int animationId) + { + bool result = PluginIsPlaying(animationId); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double IsPlayingD(double animationId) + { + double result = PluginIsPlayingD(animationId); + return result; + } + /// + /// `PluginIsPlayingName` automatically handles initializing the `ChromaSDK`. + /// The named `.chroma` animation file will be automatically opened. The method + /// will return whether the animation is playing or not. Animation is referenced + /// by name. + /// + public static bool IsPlayingName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + bool result = PluginIsPlayingName(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double IsPlayingNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginIsPlayingNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// `PluginIsPlayingType` automatically handles initializing the `ChromaSDK`. + /// If any animation is playing for the `deviceType` and `device` combination, + /// the method will return true, otherwise false. + /// + public static bool IsPlayingType(int deviceType, int device) + { + bool result = PluginIsPlayingType(deviceType, device); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double IsPlayingTypeD(double deviceType, double device) + { + double result = PluginIsPlayingTypeD(deviceType, device); + return result; + } + /// + /// Do a lerp math operation on a float. + /// + public static float Lerp(float start, float end, float amt) + { + float result = PluginLerp(start, end, amt); + return result; + } + /// + /// Lerp from one color to another given t in the range 0.0 to 1.0. + /// + public static int LerpColor(int from, int to, float t) + { + int result = PluginLerpColor(from, to, t); + return result; + } + /// + /// Loads `Chroma` effects so that the animation can be played immediately. + /// Returns the animation id upon success. Returns negative one upon failure. + /// + /// + public static int LoadAnimation(int animationId) + { + int result = PluginLoadAnimation(animationId); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double LoadAnimationD(double animationId) + { + double result = PluginLoadAnimationD(animationId); + return result; + } + /// + /// Load the named animation. + /// + public static void LoadAnimationName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginLoadAnimationName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// Load a composite set of animations. + /// + public static void LoadComposite(string name) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + PluginLoadComposite(lp_Name); + FreeIntPtr(lp_Name); + } + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color defaults to color. Animation + /// is referenced by id. + /// + public static void MakeBlankFrames(int animationId, int frameCount, float duration, int color) + { + PluginMakeBlankFrames(animationId, frameCount, duration, color); + } + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color defaults to color. Animation + /// is referenced by name. + /// + public static void MakeBlankFramesName(string path, int frameCount, float duration, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMakeBlankFramesName(lp_Path, frameCount, duration, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MakeBlankFramesNameD(string path, double frameCount, double duration, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMakeBlankFramesNameD(lp_Path, frameCount, duration, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color is random. Animation is referenced + /// by id. + /// + public static void MakeBlankFramesRandom(int animationId, int frameCount, float duration) + { + PluginMakeBlankFramesRandom(animationId, frameCount, duration); + } + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color is random black and white. Animation + /// is referenced by id. + /// + public static void MakeBlankFramesRandomBlackAndWhite(int animationId, int frameCount, float duration) + { + PluginMakeBlankFramesRandomBlackAndWhite(animationId, frameCount, duration); + } + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color is random black and white. Animation + /// is referenced by name. + /// + public static void MakeBlankFramesRandomBlackAndWhiteName(string path, int frameCount, float duration) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMakeBlankFramesRandomBlackAndWhiteName(lp_Path, frameCount, duration); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MakeBlankFramesRandomBlackAndWhiteNameD(string path, double frameCount, double duration) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMakeBlankFramesRandomBlackAndWhiteNameD(lp_Path, frameCount, duration); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color is random. Animation is referenced + /// by name. + /// + public static void MakeBlankFramesRandomName(string path, int frameCount, float duration) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMakeBlankFramesRandomName(lp_Path, frameCount, duration); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MakeBlankFramesRandomNameD(string path, double frameCount, double duration) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMakeBlankFramesRandomNameD(lp_Path, frameCount, duration); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color defaults to color. Animation + /// is referenced by id. + /// + public static void MakeBlankFramesRGB(int animationId, int frameCount, float duration, int red, int green, int blue) + { + PluginMakeBlankFramesRGB(animationId, frameCount, duration, red, green, blue); + } + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color defaults to color. Animation + /// is referenced by name. + /// + public static void MakeBlankFramesRGBName(string path, int frameCount, float duration, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMakeBlankFramesRGBName(lp_Path, frameCount, duration, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MakeBlankFramesRGBNameD(string path, double frameCount, double duration, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMakeBlankFramesRGBNameD(lp_Path, frameCount, duration, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Flips the color grid horizontally for all `Chroma` animation frames. Returns + /// the animation id upon success. Returns negative one upon failure. + /// + public static int MirrorHorizontally(int animationId) + { + int result = PluginMirrorHorizontally(animationId); + return result; + } + /// + /// Flips the color grid vertically for all `Chroma` animation frames. This + /// method has no effect for `EChromaSDKDevice1DEnum` devices. Returns the + /// animation id upon success. Returns negative one upon failure. + /// + public static int MirrorVertically(int animationId) + { + int result = PluginMirrorVertically(animationId); + return result; + } + /// + /// Multiply the color intensity with the lerp result from color 1 to color + /// 2 using the frame index divided by the frame count for the `t` parameter. + /// Animation is referenced in id. + /// + public static void MultiplyColorLerpAllFrames(int animationId, int color1, int color2) + { + PluginMultiplyColorLerpAllFrames(animationId, color1, color2); + } + /// + /// Multiply the color intensity with the lerp result from color 1 to color + /// 2 using the frame index divided by the frame count for the `t` parameter. + /// Animation is referenced in name. + /// + public static void MultiplyColorLerpAllFramesName(string path, int color1, int color2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyColorLerpAllFramesName(lp_Path, color1, color2); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyColorLerpAllFramesNameD(string path, double color1, double color2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyColorLerpAllFramesNameD(lp_Path, color1, color2); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply all the colors in the frame by the intensity value. The valid the + /// intensity range is from 0.0 to 255.0. RGB components are multiplied equally. + /// An intensity of 0.5 would half the color value. Black colors in the frame + /// will not be affected by this method. + /// + public static void MultiplyIntensity(int animationId, int frameId, float intensity) + { + PluginMultiplyIntensity(animationId, frameId, intensity); + } + /// + /// Multiply all the colors for all frames by the intensity value. The valid + /// the intensity range is from 0.0 to 255.0. RGB components are multiplied + /// equally. An intensity of 0.5 would half the color value. Black colors in + /// the frame will not be affected by this method. + /// + public static void MultiplyIntensityAllFrames(int animationId, float intensity) + { + PluginMultiplyIntensityAllFrames(animationId, intensity); + } + /// + /// Multiply all the colors for all frames by the intensity value. The valid + /// the intensity range is from 0.0 to 255.0. RGB components are multiplied + /// equally. An intensity of 0.5 would half the color value. Black colors in + /// the frame will not be affected by this method. + /// + public static void MultiplyIntensityAllFramesName(string path, float intensity) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyIntensityAllFramesName(lp_Path, intensity); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyIntensityAllFramesNameD(string path, double intensity) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyIntensityAllFramesNameD(lp_Path, intensity); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply all frames by the RBG color intensity. Animation is referenced + /// by id. + /// + public static void MultiplyIntensityAllFramesRGB(int animationId, int red, int green, int blue) + { + PluginMultiplyIntensityAllFramesRGB(animationId, red, green, blue); + } + /// + /// Multiply all frames by the RBG color intensity. Animation is referenced + /// by name. + /// + public static void MultiplyIntensityAllFramesRGBName(string path, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyIntensityAllFramesRGBName(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyIntensityAllFramesRGBNameD(string path, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyIntensityAllFramesRGBNameD(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply the specific frame by the RBG color intensity. Animation is referenced + /// by id. + /// + public static void MultiplyIntensityColor(int animationId, int frameId, int color) + { + PluginMultiplyIntensityColor(animationId, frameId, color); + } + /// + /// Multiply all frames by the RBG color intensity. Animation is referenced + /// by id. + /// + public static void MultiplyIntensityColorAllFrames(int animationId, int color) + { + PluginMultiplyIntensityColorAllFrames(animationId, color); + } + /// + /// Multiply all frames by the RBG color intensity. Animation is referenced + /// by name. + /// + public static void MultiplyIntensityColorAllFramesName(string path, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyIntensityColorAllFramesName(lp_Path, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyIntensityColorAllFramesNameD(string path, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyIntensityColorAllFramesNameD(lp_Path, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply the specific frame by the RBG color intensity. Animation is referenced + /// by name. + /// + public static void MultiplyIntensityColorName(string path, int frameId, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyIntensityColorName(lp_Path, frameId, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyIntensityColorNameD(string path, double frameId, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyIntensityColorNameD(lp_Path, frameId, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply all the colors in the frame by the intensity value. The valid the + /// intensity range is from 0.0 to 255.0. RGB components are multiplied equally. + /// An intensity of 0.5 would half the color value. Black colors in the frame + /// will not be affected by this method. + /// + public static void MultiplyIntensityName(string path, int frameId, float intensity) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyIntensityName(lp_Path, frameId, intensity); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyIntensityNameD(string path, double frameId, double intensity) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyIntensityNameD(lp_Path, frameId, intensity); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply the specific frame by the RBG color intensity. Animation is referenced + /// by id. + /// + public static void MultiplyIntensityRGB(int animationId, int frameId, int red, int green, int blue) + { + PluginMultiplyIntensityRGB(animationId, frameId, red, green, blue); + } + /// + /// Multiply the specific frame by the RBG color intensity. Animation is referenced + /// by name. + /// + public static void MultiplyIntensityRGBName(string path, int frameId, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyIntensityRGBName(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyIntensityRGBNameD(string path, double frameId, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyIntensityRGBNameD(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply the specific frame by the color lerp result between color 1 and + /// 2 using the frame color value as the `t` value. Animation is referenced + /// by id. + /// + public static void MultiplyNonZeroTargetColorLerp(int animationId, int frameId, int color1, int color2) + { + PluginMultiplyNonZeroTargetColorLerp(animationId, frameId, color1, color2); + } + /// + /// Multiply all frames by the color lerp result between color 1 and 2 using + /// the frame color value as the `t` value. Animation is referenced by id. + /// + /// + public static void MultiplyNonZeroTargetColorLerpAllFrames(int animationId, int color1, int color2) + { + PluginMultiplyNonZeroTargetColorLerpAllFrames(animationId, color1, color2); + } + /// + /// Multiply all frames by the color lerp result between color 1 and 2 using + /// the frame color value as the `t` value. Animation is referenced by name. + /// + /// + public static void MultiplyNonZeroTargetColorLerpAllFramesName(string path, int color1, int color2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyNonZeroTargetColorLerpAllFramesName(lp_Path, color1, color2); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyNonZeroTargetColorLerpAllFramesNameD(string path, double color1, double color2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyNonZeroTargetColorLerpAllFramesNameD(lp_Path, color1, color2); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply the specific frame by the color lerp result between RGB 1 and 2 + /// using the frame color value as the `t` value. Animation is referenced by + /// id. + /// + public static void MultiplyNonZeroTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2) + { + PluginMultiplyNonZeroTargetColorLerpAllFramesRGB(animationId, red1, green1, blue1, red2, green2, blue2); + } + /// + /// Multiply the specific frame by the color lerp result between RGB 1 and 2 + /// using the frame color value as the `t` value. Animation is referenced by + /// name. + /// + public static void MultiplyNonZeroTargetColorLerpAllFramesRGBName(string path, int red1, int green1, int blue1, int red2, int green2, int blue2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyNonZeroTargetColorLerpAllFramesRGBName(lp_Path, red1, green1, blue1, red2, green2, blue2); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyNonZeroTargetColorLerpAllFramesRGBNameD(string path, double red1, double green1, double blue1, double red2, double green2, double blue2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyNonZeroTargetColorLerpAllFramesRGBNameD(lp_Path, red1, green1, blue1, red2, green2, blue2); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply the specific frame by the color lerp result between color 1 and + /// 2 using the frame color value as the `t` value. Animation is referenced + /// by id. + /// + public static void MultiplyTargetColorLerp(int animationId, int frameId, int color1, int color2) + { + PluginMultiplyTargetColorLerp(animationId, frameId, color1, color2); + } + /// + /// Multiply all frames by the color lerp result between color 1 and 2 using + /// the frame color value as the `t` value. Animation is referenced by id. + /// + /// + public static void MultiplyTargetColorLerpAllFrames(int animationId, int color1, int color2) + { + PluginMultiplyTargetColorLerpAllFrames(animationId, color1, color2); + } + /// + /// Multiply all frames by the color lerp result between color 1 and 2 using + /// the frame color value as the `t` value. Animation is referenced by name. + /// + /// + public static void MultiplyTargetColorLerpAllFramesName(string path, int color1, int color2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyTargetColorLerpAllFramesName(lp_Path, color1, color2); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyTargetColorLerpAllFramesNameD(string path, double color1, double color2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyTargetColorLerpAllFramesNameD(lp_Path, color1, color2); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply all frames by the color lerp result between RGB 1 and 2 using the + /// frame color value as the `t` value. Animation is referenced by id. + /// + public static void MultiplyTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2) + { + PluginMultiplyTargetColorLerpAllFramesRGB(animationId, red1, green1, blue1, red2, green2, blue2); + } + /// + /// Multiply all frames by the color lerp result between RGB 1 and 2 using the + /// frame color value as the `t` value. Animation is referenced by name. + /// + public static void MultiplyTargetColorLerpAllFramesRGBName(string path, int red1, int green1, int blue1, int red2, int green2, int blue2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyTargetColorLerpAllFramesRGBName(lp_Path, red1, green1, blue1, red2, green2, blue2); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double MultiplyTargetColorLerpAllFramesRGBNameD(string path, double red1, double green1, double blue1, double red2, double green2, double blue2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginMultiplyTargetColorLerpAllFramesRGBNameD(lp_Path, red1, green1, blue1, red2, green2, blue2); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Multiply the specific frame by the color lerp result between color 1 and + /// 2 using the frame color value as the `t` value. Animation is referenced + /// by name. + /// + public static void MultiplyTargetColorLerpName(string path, int frameId, int color1, int color2) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginMultiplyTargetColorLerpName(lp_Path, frameId, color1, color2); + FreeIntPtr(lp_Path); + } + /// + /// Offset all colors in the frame using the RGB offset. Use the range of -255 + /// to 255 for red, green, and blue parameters. Negative values remove color. + /// Positive values add color. + /// + public static void OffsetColors(int animationId, int frameId, int red, int green, int blue) + { + PluginOffsetColors(animationId, frameId, red, green, blue); + } + /// + /// Offset all colors for all frames using the RGB offset. Use the range of + /// -255 to 255 for red, green, and blue parameters. Negative values remove + /// color. Positive values add color. + /// + public static void OffsetColorsAllFrames(int animationId, int red, int green, int blue) + { + PluginOffsetColorsAllFrames(animationId, red, green, blue); + } + /// + /// Offset all colors for all frames using the RGB offset. Use the range of + /// -255 to 255 for red, green, and blue parameters. Negative values remove + /// color. Positive values add color. + /// + public static void OffsetColorsAllFramesName(string path, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginOffsetColorsAllFramesName(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double OffsetColorsAllFramesNameD(string path, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginOffsetColorsAllFramesNameD(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Offset all colors in the frame using the RGB offset. Use the range of -255 + /// to 255 for red, green, and blue parameters. Negative values remove color. + /// Positive values add color. + /// + public static void OffsetColorsName(string path, int frameId, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginOffsetColorsName(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double OffsetColorsNameD(string path, double frameId, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginOffsetColorsNameD(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Offset a subset of colors in the frame using the RGB offset. + /// Use the range of -255 to 255 for red, green, and blue parameters. Negative + /// values remove color. Positive values add color. + /// + public static void OffsetNonZeroColors(int animationId, int frameId, int red, int green, int blue) + { + PluginOffsetNonZeroColors(animationId, frameId, red, green, blue); + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Offset a subset of colors for all frames using the RGB offset. + /// Use the range of -255 to 255 for red, green, and blue parameters. Negative + /// values remove color. Positive values add color. + /// + public static void OffsetNonZeroColorsAllFrames(int animationId, int red, int green, int blue) + { + PluginOffsetNonZeroColorsAllFrames(animationId, red, green, blue); + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Offset a subset of colors for all frames using the RGB offset. + /// Use the range of -255 to 255 for red, green, and blue parameters. Negative + /// values remove color. Positive values add color. + /// + public static void OffsetNonZeroColorsAllFramesName(string path, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginOffsetNonZeroColorsAllFramesName(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double OffsetNonZeroColorsAllFramesNameD(string path, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginOffsetNonZeroColorsAllFramesNameD(lp_Path, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// This method will only update colors in the animation that are not already + /// set to black. Offset a subset of colors in the frame using the RGB offset. + /// Use the range of -255 to 255 for red, green, and blue parameters. Negative + /// values remove color. Positive values add color. + /// + public static void OffsetNonZeroColorsName(string path, int frameId, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginOffsetNonZeroColorsName(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double OffsetNonZeroColorsNameD(string path, double frameId, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginOffsetNonZeroColorsNameD(lp_Path, frameId, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Opens a `Chroma` animation file so that it can be played. Returns an animation + /// id >= 0 upon success. Returns negative one if there was a failure. The + /// animation id is used in most of the API methods. + /// + public static int OpenAnimation(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginOpenAnimation(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double OpenAnimationD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginOpenAnimationD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Opens a `Chroma` animation data from memory so that it can be played. `Data` + /// is a pointer to BYTE array of the loaded animation in memory. `Name` will + /// be assigned to the animation when loaded. Returns an animation id >= 0 + /// upon success. Returns negative one if there was a failure. The animation + /// id is used in most of the API methods. + /// + public static int OpenAnimationFromMemory(byte[] data, string name) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + int result = PluginOpenAnimationFromMemory(data, lp_Name); + FreeIntPtr(lp_Name); + return result; + } + /// + /// Opens a `Chroma` animation file with the `.chroma` extension. Returns zero + /// upon success. Returns negative one if there was a failure. + /// + public static int OpenEditorDialog(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginOpenEditorDialog(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Open the named animation in the editor dialog and play the animation at + /// start. + /// + public static int OpenEditorDialogAndPlay(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginOpenEditorDialogAndPlay(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double OpenEditorDialogAndPlayD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginOpenEditorDialogAndPlayD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double OpenEditorDialogD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginOpenEditorDialogD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Sets the `duration` for all grames in the `Chroma` animation to the `duration` + /// parameter. Returns the animation id upon success. Returns negative one + /// upon failure. + /// + public static int OverrideFrameDuration(int animationId, float duration) + { + int result = PluginOverrideFrameDuration(animationId, duration); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double OverrideFrameDurationD(double animationId, double duration) + { + double result = PluginOverrideFrameDurationD(animationId, duration); + return result; + } + /// + /// Override the duration of all frames with the `duration` value. Animation + /// is referenced by name. + /// + public static void OverrideFrameDurationName(string path, float duration) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginOverrideFrameDurationName(lp_Path, duration); + FreeIntPtr(lp_Path); + } + /// + /// Pause the current animation referenced by id. + /// + public static void PauseAnimation(int animationId) + { + PluginPauseAnimation(animationId); + } + /// + /// Pause the current animation referenced by name. + /// + public static void PauseAnimationName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginPauseAnimationName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double PauseAnimationNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginPauseAnimationNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Plays the `Chroma` animation. This will load the animation, if not loaded + /// previously. Returns the animation id upon success. Returns negative one + /// upon failure. + /// + public static int PlayAnimation(int animationId) + { + int result = PluginPlayAnimation(animationId); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double PlayAnimationD(double animationId) + { + double result = PluginPlayAnimationD(animationId); + return result; + } + /// + /// `PluginPlayAnimationFrame` automatically handles initializing the `ChromaSDK`. + /// The method will play the animation given the `animationId` with looping + /// `on` or `off` starting at the `frameId`. + /// + public static void PlayAnimationFrame(int animationId, int frameId, bool loop) + { + PluginPlayAnimationFrame(animationId, frameId, loop); + } + /// + /// `PluginPlayAnimationFrameName` automatically handles initializing the `ChromaSDK`. + /// The named `.chroma` animation file will be automatically opened. The animation + /// will play with looping `on` or `off` starting at the `frameId`. + /// + public static void PlayAnimationFrameName(string path, int frameId, bool loop) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginPlayAnimationFrameName(lp_Path, frameId, loop); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double PlayAnimationFrameNameD(string path, double frameId, double loop) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginPlayAnimationFrameNameD(lp_Path, frameId, loop); + FreeIntPtr(lp_Path); + return result; + } + /// + /// `PluginPlayAnimationLoop` automatically handles initializing the `ChromaSDK`. + /// The method will play the animation given the `animationId` with looping + /// `on` or `off`. + /// + public static void PlayAnimationLoop(int animationId, bool loop) + { + PluginPlayAnimationLoop(animationId, loop); + } + /// + /// `PluginPlayAnimationName` automatically handles initializing the `ChromaSDK`. + /// The named `.chroma` animation file will be automatically opened. The animation + /// will play with looping `on` or `off`. + /// + public static void PlayAnimationName(string path, bool loop) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginPlayAnimationName(lp_Path, loop); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double PlayAnimationNameD(string path, double loop) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginPlayAnimationNameD(lp_Path, loop); + FreeIntPtr(lp_Path); + return result; + } + /// + /// `PluginPlayComposite` automatically handles initializing the `ChromaSDK`. + /// The named animation files for the `.chroma` set will be automatically opened. + /// The set of animations will play with looping `on` or `off`. + /// + public static void PlayComposite(string name, bool loop) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + PluginPlayComposite(lp_Name, loop); + FreeIntPtr(lp_Name); + } + /// + /// D suffix for limited data types. + /// + public static double PlayCompositeD(string name, double loop) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + double result = PluginPlayCompositeD(lp_Name, loop); + FreeIntPtr(lp_Name); + return result; + } + /// + /// Displays the `Chroma` animation frame on `Chroma` hardware given the `frameIndex`. + /// Returns the animation id upon success. Returns negative one upon failure. + /// + /// + public static int PreviewFrame(int animationId, int frameIndex) + { + int result = PluginPreviewFrame(animationId, frameIndex); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double PreviewFrameD(double animationId, double frameIndex) + { + double result = PluginPreviewFrameD(animationId, frameIndex); + return result; + } + /// + /// Displays the `Chroma` animation frame on `Chroma` hardware given the `frameIndex`. + /// Animaton is referenced by name. + /// + public static void PreviewFrameName(string path, int frameIndex) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginPreviewFrameName(lp_Path, frameIndex); + FreeIntPtr(lp_Path); + } + /// + /// Reduce the frames of the animation by removing every nth element. Animation + /// is referenced by id. + /// + public static void ReduceFrames(int animationId, int n) + { + PluginReduceFrames(animationId, n); + } + /// + /// Reduce the frames of the animation by removing every nth element. Animation + /// is referenced by name. + /// + public static void ReduceFramesName(string path, int n) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginReduceFramesName(lp_Path, n); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double ReduceFramesNameD(string path, double n) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginReduceFramesNameD(lp_Path, n); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Resets the `Chroma` animation to 1 blank frame. Returns the animation id + /// upon success. Returns negative one upon failure. + /// + public static int ResetAnimation(int animationId) + { + int result = PluginResetAnimation(animationId); + return result; + } + /// + /// Resume the animation with loop `ON` or `OFF` referenced by id. + /// + public static void ResumeAnimation(int animationId, bool loop) + { + PluginResumeAnimation(animationId, loop); + } + /// + /// Resume the animation with loop `ON` or `OFF` referenced by name. + /// + public static void ResumeAnimationName(string path, bool loop) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginResumeAnimationName(lp_Path, loop); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double ResumeAnimationNameD(string path, double loop) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginResumeAnimationNameD(lp_Path, loop); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Reverse the animation frame order of the `Chroma` animation. Returns the + /// animation id upon success. Returns negative one upon failure. Animation + /// is referenced by id. + /// + public static int Reverse(int animationId) + { + int result = PluginReverse(animationId); + return result; + } + /// + /// Reverse the animation frame order of the `Chroma` animation. Animation is + /// referenced by id. + /// + public static void ReverseAllFrames(int animationId) + { + PluginReverseAllFrames(animationId); + } + /// + /// Reverse the animation frame order of the `Chroma` animation. Animation is + /// referenced by name. + /// + public static void ReverseAllFramesName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginReverseAllFramesName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double ReverseAllFramesNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginReverseAllFramesNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Save the animation referenced by id to the path specified. + /// + public static int SaveAnimation(int animationId, string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginSaveAnimation(animationId, lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Save the named animation to the target path specified. + /// + public static int SaveAnimationName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + int result = PluginSaveAnimationName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Set the animation color for a frame given the `1D` `led`. The `led` should + /// be greater than or equal to 0 and less than the `MaxLeds`. The animation + /// is referenced by id. + /// + public static void Set1DColor(int animationId, int frameId, int led, int color) + { + PluginSet1DColor(animationId, frameId, led, color); + } + /// + /// Set the animation color for a frame given the `1D` `led`. The `led` should + /// be greater than or equal to 0 and less than the `MaxLeds`. The animation + /// is referenced by name. + /// + public static void Set1DColorName(string path, int frameId, int led, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSet1DColorName(lp_Path, frameId, led, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double Set1DColorNameD(string path, double frameId, double led, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSet1DColorNameD(lp_Path, frameId, led, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the animation color for a frame given the `2D` `row` and `column`. The + /// `row` should be greater than or equal to 0 and less than the `MaxRow`. + /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. + /// The animation is referenced by id. + /// + public static void Set2DColor(int animationId, int frameId, int row, int column, int color) + { + PluginSet2DColor(animationId, frameId, row, column, color); + } + /// + /// Set the animation color for a frame given the `2D` `row` and `column`. The + /// `row` should be greater than or equal to 0 and less than the `MaxRow`. + /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. + /// The animation is referenced by name. + /// + public static void Set2DColorName(string path, int frameId, int row, int column, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSet2DColorName(lp_Path, frameId, row, column, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double Set2DColorNameD(string path, double frameId, double rowColumnIndex, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSet2DColorNameD(lp_Path, frameId, rowColumnIndex, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// When custom color is set, the custom key mode will be used. The animation + /// is referenced by id. + /// + public static void SetChromaCustomColorAllFrames(int animationId) + { + PluginSetChromaCustomColorAllFrames(animationId); + } + /// + /// When custom color is set, the custom key mode will be used. The animation + /// is referenced by name. + /// + public static void SetChromaCustomColorAllFramesName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetChromaCustomColorAllFramesName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetChromaCustomColorAllFramesNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetChromaCustomColorAllFramesNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the Chroma custom key color flag on all frames. `True` changes the layout + /// from grid to key. `True` changes the layout from key to grid. Animation + /// is referenced by id. + /// + public static void SetChromaCustomFlag(int animationId, bool flag) + { + PluginSetChromaCustomFlag(animationId, flag); + } + /// + /// Set the Chroma custom key color flag on all frames. `True` changes the layout + /// from grid to key. `True` changes the layout from key to grid. Animation + /// is referenced by name. + /// + public static void SetChromaCustomFlagName(string path, bool flag) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetChromaCustomFlagName(lp_Path, flag); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetChromaCustomFlagNameD(string path, double flag) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetChromaCustomFlagNameD(lp_Path, flag); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the current frame of the animation referenced by id. + /// + public static void SetCurrentFrame(int animationId, int frameId) + { + PluginSetCurrentFrame(animationId, frameId); + } + /// + /// Set the current frame of the animation referenced by name. + /// + public static void SetCurrentFrameName(string path, int frameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetCurrentFrameName(lp_Path, frameId); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetCurrentFrameNameD(string path, double frameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetCurrentFrameNameD(lp_Path, frameId); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the custom alpha flag on the color array + /// + public static int SetCustomColorFlag2D(int device, int[] colors) + { + int result = PluginSetCustomColorFlag2D(device, colors); + return result; + } + /// + /// Changes the `deviceType` and `device` of a `Chroma` animation. If the device + /// is changed, the `Chroma` animation will be reset with 1 blank frame. Returns + /// the animation id upon success. Returns negative one upon failure. + /// + public static int SetDevice(int animationId, int deviceType, int device) + { + int result = PluginSetDevice(animationId, deviceType, device); + return result; + } + /// + /// SetEffect will display the referenced effect id. + /// + public static int SetEffect(Guid effectId) + { + int result = PluginSetEffect(effectId); + return result; + } + /// + /// SetEffectCustom1D will display the referenced colors immediately + /// + public static int SetEffectCustom1D(int device, int[] colors) + { + int result = PluginSetEffectCustom1D(device, colors); + return result; + } + /// + /// SetEffectCustom2D will display the referenced colors immediately. + /// + public static int SetEffectCustom2D(int device, int[] colors) + { + int result = PluginSetEffectCustom2D(device, colors); + return result; + } + /// + /// SetEffectKeyboardCustom2D will display the referenced custom keyboard colors + /// immediately. Colors represent a visual grid layout. Keys represent the + /// hotkeys for any layout. + /// + public static int SetEffectKeyboardCustom2D(int device, int[] colors, int[] keys) + { + int result = PluginSetEffectKeyboardCustom2D(device, colors, keys); + return result; + } + /// + /// When the idle animation is used, the named animation will play when no other + /// animations are playing. Reference the animation by id. + /// + public static void SetIdleAnimation(int animationId) + { + PluginSetIdleAnimation(animationId); + } + /// + /// When the idle animation is used, the named animation will play when no other + /// animations are playing. Reference the animation by name. + /// + public static void SetIdleAnimationName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetIdleAnimationName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// Set animation key to a static color for the given frame. + /// + public static void SetKeyColor(int animationId, int frameId, int rzkey, int color) + { + PluginSetKeyColor(animationId, frameId, rzkey, color); + } + /// + /// Set the key to the specified key color for all frames. Animation is referenced + /// by id. + /// + public static void SetKeyColorAllFrames(int animationId, int rzkey, int color) + { + PluginSetKeyColorAllFrames(animationId, rzkey, color); + } + /// + /// Set the key to the specified key color for all frames. Animation is referenced + /// by name. + /// + public static void SetKeyColorAllFramesName(string path, int rzkey, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeyColorAllFramesName(lp_Path, rzkey, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetKeyColorAllFramesNameD(string path, double rzkey, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetKeyColorAllFramesNameD(lp_Path, rzkey, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the key to the specified key color for all frames. Animation is referenced + /// by id. + /// + public static void SetKeyColorAllFramesRGB(int animationId, int rzkey, int red, int green, int blue) + { + PluginSetKeyColorAllFramesRGB(animationId, rzkey, red, green, blue); + } + /// + /// Set the key to the specified key color for all frames. Animation is referenced + /// by name. + /// + public static void SetKeyColorAllFramesRGBName(string path, int rzkey, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeyColorAllFramesRGBName(lp_Path, rzkey, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetKeyColorAllFramesRGBNameD(string path, double rzkey, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetKeyColorAllFramesRGBNameD(lp_Path, rzkey, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set animation key to a static color for the given frame. + /// + public static void SetKeyColorName(string path, int frameId, int rzkey, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeyColorName(lp_Path, frameId, rzkey, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetKeyColorNameD(string path, double frameId, double rzkey, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetKeyColorNameD(lp_Path, frameId, rzkey, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the key to the specified key color for the specified frame. Animation + /// is referenced by id. + /// + public static void SetKeyColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue) + { + PluginSetKeyColorRGB(animationId, frameId, rzkey, red, green, blue); + } + /// + /// Set the key to the specified key color for the specified frame. Animation + /// is referenced by name. + /// + public static void SetKeyColorRGBName(string path, int frameId, int rzkey, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeyColorRGBName(lp_Path, frameId, rzkey, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetKeyColorRGBNameD(string path, double frameId, double rzkey, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetKeyColorRGBNameD(lp_Path, frameId, rzkey, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set animation key to a static color for the given frame if the existing + /// color is not already black. + /// + public static void SetKeyNonZeroColor(int animationId, int frameId, int rzkey, int color) + { + PluginSetKeyNonZeroColor(animationId, frameId, rzkey, color); + } + /// + /// Set animation key to a static color for the given frame if the existing + /// color is not already black. + /// + public static void SetKeyNonZeroColorName(string path, int frameId, int rzkey, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeyNonZeroColorName(lp_Path, frameId, rzkey, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetKeyNonZeroColorNameD(string path, double frameId, double rzkey, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetKeyNonZeroColorNameD(lp_Path, frameId, rzkey, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set the key to the specified key color for the specified frame where color + /// is not black. Animation is referenced by id. + /// + public static void SetKeyNonZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue) + { + PluginSetKeyNonZeroColorRGB(animationId, frameId, rzkey, red, green, blue); + } + /// + /// Set the key to the specified key color for the specified frame where color + /// is not black. Animation is referenced by name. + /// + public static void SetKeyNonZeroColorRGBName(string path, int frameId, int rzkey, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeyNonZeroColorRGBName(lp_Path, frameId, rzkey, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetKeyNonZeroColorRGBNameD(string path, double frameId, double rzkey, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetKeyNonZeroColorRGBNameD(lp_Path, frameId, rzkey, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set animation key by row and column to a static color for the given frame. + /// + /// + public static void SetKeyRowColumnColorName(string path, int frameId, int row, int column, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeyRowColumnColorName(lp_Path, frameId, row, column, color); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for the given frame. Animation + /// is referenced by id. + /// + public static void SetKeysColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color) + { + PluginSetKeysColor(animationId, frameId, rzkeys, keyCount, color); + } + /// + /// Set an array of animation keys to a static color for all frames. Animation + /// is referenced by id. + /// + public static void SetKeysColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color) + { + PluginSetKeysColorAllFrames(animationId, rzkeys, keyCount, color); + } + /// + /// Set an array of animation keys to a static color for all frames. Animation + /// is referenced by name. + /// + public static void SetKeysColorAllFramesName(string path, int[] rzkeys, int keyCount, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysColorAllFramesName(lp_Path, rzkeys, keyCount, color); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for all frames. Animation + /// is referenced by id. + /// + public static void SetKeysColorAllFramesRGB(int animationId, int[] rzkeys, int keyCount, int red, int green, int blue) + { + PluginSetKeysColorAllFramesRGB(animationId, rzkeys, keyCount, red, green, blue); + } + /// + /// Set an array of animation keys to a static color for all frames. Animation + /// is referenced by name. + /// + public static void SetKeysColorAllFramesRGBName(string path, int[] rzkeys, int keyCount, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysColorAllFramesRGBName(lp_Path, rzkeys, keyCount, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for the given frame. + /// + public static void SetKeysColorName(string path, int frameId, int[] rzkeys, int keyCount, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysColorName(lp_Path, frameId, rzkeys, keyCount, color); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for the given frame. Animation + /// is referenced by id. + /// + public static void SetKeysColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) + { + PluginSetKeysColorRGB(animationId, frameId, rzkeys, keyCount, red, green, blue); + } + /// + /// Set an array of animation keys to a static color for the given frame. Animation + /// is referenced by name. + /// + public static void SetKeysColorRGBName(string path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysColorRGBName(lp_Path, frameId, rzkeys, keyCount, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for the given frame if + /// the existing color is not already black. + /// + public static void SetKeysNonZeroColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color) + { + PluginSetKeysNonZeroColor(animationId, frameId, rzkeys, keyCount, color); + } + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is not black. Animation is referenced by id. + /// + public static void SetKeysNonZeroColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color) + { + PluginSetKeysNonZeroColorAllFrames(animationId, rzkeys, keyCount, color); + } + /// + /// Set an array of animation keys to a static color for all frames if the existing + /// color is not already black. Reference animation by name. + /// + public static void SetKeysNonZeroColorAllFramesName(string path, int[] rzkeys, int keyCount, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysNonZeroColorAllFramesName(lp_Path, rzkeys, keyCount, color); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for the given frame if + /// the existing color is not already black. Reference animation by name. + /// + public static void SetKeysNonZeroColorName(string path, int frameId, int[] rzkeys, int keyCount, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysNonZeroColorName(lp_Path, frameId, rzkeys, keyCount, color); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is not black. Animation is referenced by id. + /// + public static void SetKeysNonZeroColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) + { + PluginSetKeysNonZeroColorRGB(animationId, frameId, rzkeys, keyCount, red, green, blue); + } + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is not black. Animation is referenced by name. + /// + public static void SetKeysNonZeroColorRGBName(string path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysNonZeroColorRGBName(lp_Path, frameId, rzkeys, keyCount, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is black. Animation is referenced by id. + /// + public static void SetKeysZeroColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color) + { + PluginSetKeysZeroColor(animationId, frameId, rzkeys, keyCount, color); + } + /// + /// Set an array of animation keys to a static color for all frames where the + /// color is black. Animation is referenced by id. + /// + public static void SetKeysZeroColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color) + { + PluginSetKeysZeroColorAllFrames(animationId, rzkeys, keyCount, color); + } + /// + /// Set an array of animation keys to a static color for all frames where the + /// color is black. Animation is referenced by name. + /// + public static void SetKeysZeroColorAllFramesName(string path, int[] rzkeys, int keyCount, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysZeroColorAllFramesName(lp_Path, rzkeys, keyCount, color); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for all frames where the + /// color is black. Animation is referenced by id. + /// + public static void SetKeysZeroColorAllFramesRGB(int animationId, int[] rzkeys, int keyCount, int red, int green, int blue) + { + PluginSetKeysZeroColorAllFramesRGB(animationId, rzkeys, keyCount, red, green, blue); + } + /// + /// Set an array of animation keys to a static color for all frames where the + /// color is black. Animation is referenced by name. + /// + public static void SetKeysZeroColorAllFramesRGBName(string path, int[] rzkeys, int keyCount, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysZeroColorAllFramesRGBName(lp_Path, rzkeys, keyCount, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is black. Animation is referenced by name. + /// + public static void SetKeysZeroColorName(string path, int frameId, int[] rzkeys, int keyCount, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysZeroColorName(lp_Path, frameId, rzkeys, keyCount, color); + FreeIntPtr(lp_Path); + } + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is black. Animation is referenced by id. + /// + public static void SetKeysZeroColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) + { + PluginSetKeysZeroColorRGB(animationId, frameId, rzkeys, keyCount, red, green, blue); + } + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is black. Animation is referenced by name. + /// + public static void SetKeysZeroColorRGBName(string path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeysZeroColorRGBName(lp_Path, frameId, rzkeys, keyCount, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// Set animation key to a static color for the given frame where the color + /// is black. Animation is referenced by id. + /// + public static void SetKeyZeroColor(int animationId, int frameId, int rzkey, int color) + { + PluginSetKeyZeroColor(animationId, frameId, rzkey, color); + } + /// + /// Set animation key to a static color for the given frame where the color + /// is black. Animation is referenced by name. + /// + public static void SetKeyZeroColorName(string path, int frameId, int rzkey, int color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeyZeroColorName(lp_Path, frameId, rzkey, color); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetKeyZeroColorNameD(string path, double frameId, double rzkey, double color) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetKeyZeroColorNameD(lp_Path, frameId, rzkey, color); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Set animation key to a static color for the given frame where the color + /// is black. Animation is referenced by id. + /// + public static void SetKeyZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue) + { + PluginSetKeyZeroColorRGB(animationId, frameId, rzkey, red, green, blue); + } + /// + /// Set animation key to a static color for the given frame where the color + /// is black. Animation is referenced by name. + /// + public static void SetKeyZeroColorRGBName(string path, int frameId, int rzkey, int red, int green, int blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSetKeyZeroColorRGBName(lp_Path, frameId, rzkey, red, green, blue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SetKeyZeroColorRGBNameD(string path, double frameId, double rzkey, double red, double green, double blue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSetKeyZeroColorRGBNameD(lp_Path, frameId, rzkey, red, green, blue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Invokes the setup for a debug logging callback so that `stdout` is redirected + /// to the callback. This is used by `Unity` so that debug messages can appear + /// in the console window. + /// + public static void SetLogDelegate(IntPtr fp) + { + PluginSetLogDelegate(fp); + } + /// + /// Sets the target device to the static color. + /// + public static void SetStaticColor(int deviceType, int device, int color) + { + PluginSetStaticColor(deviceType, device, color); + } + /// + /// Sets all devices to the static color. + /// + public static void SetStaticColorAll(int color) + { + PluginSetStaticColorAll(color); + } + /// + /// Sets the target device to the static color. + /// + public static void StaticColor(int deviceType, int device, int color) + { + PluginStaticColor(deviceType, device, color); + } + /// + /// Sets all devices to the static color. + /// + public static void StaticColorAll(int color) + { + PluginStaticColorAll(color); + } + /// + /// D suffix for limited data types. + /// + public static double StaticColorD(double deviceType, double device, double color) + { + double result = PluginStaticColorD(deviceType, device, color); + return result; + } + /// + /// `PluginStopAll` will automatically stop all animations that are playing. + /// + /// + public static void StopAll() + { + PluginStopAll(); + } + /// + /// Stops animation playback if in progress. Returns the animation id upon success. + /// Returns negative one upon failure. + /// + public static int StopAnimation(int animationId) + { + int result = PluginStopAnimation(animationId); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double StopAnimationD(double animationId) + { + double result = PluginStopAnimationD(animationId); + return result; + } + /// + /// `PluginStopAnimationName` automatically handles initializing the `ChromaSDK`. + /// The named `.chroma` animation file will be automatically opened. The animation + /// will stop if playing. + /// + public static void StopAnimationName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginStopAnimationName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double StopAnimationNameD(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginStopAnimationNameD(lp_Path); + FreeIntPtr(lp_Path); + return result; + } + /// + /// `PluginStopAnimationType` automatically handles initializing the `ChromaSDK`. + /// If any animation is playing for the `deviceType` and `device` combination, + /// it will be stopped. + /// + public static void StopAnimationType(int deviceType, int device) + { + PluginStopAnimationType(deviceType, device); + } + /// + /// D suffix for limited data types. + /// + public static double StopAnimationTypeD(double deviceType, double device) + { + double result = PluginStopAnimationTypeD(deviceType, device); + return result; + } + /// + /// `PluginStopComposite` automatically handles initializing the `ChromaSDK`. + /// The named animation files for the `.chroma` set will be automatically opened. + /// The set of animations will be stopped if playing. + /// + public static void StopComposite(string name) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + PluginStopComposite(lp_Name); + FreeIntPtr(lp_Name); + } + /// + /// D suffix for limited data types. + /// + public static double StopCompositeD(string name) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + double result = PluginStopCompositeD(lp_Name); + FreeIntPtr(lp_Name); + return result; + } + /// + /// Return color1 - color2 + /// + public static int SubtractColor(int color1, int color2) + { + int result = PluginSubtractColor(color1, color2); + return result; + } + /// + /// Subtract the source color from the target color for the frame where the + /// target color is not black. Source and target are referenced by id. + /// + public static void SubtractNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) + { + PluginSubtractNonZeroAllKeys(sourceAnimationId, targetAnimationId, frameId); + } + /// + /// Subtract the source color from the target color for all frames where the + /// target color is not black. Source and target are referenced by id. + /// + public static void SubtractNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) + { + PluginSubtractNonZeroAllKeysAllFrames(sourceAnimationId, targetAnimationId); + } + /// + /// Subtract the source color from the target color for all frames where the + /// target color is not black. Source and target are referenced by name. + /// + public static void SubtractNonZeroAllKeysAllFramesName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginSubtractNonZeroAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double SubtractNonZeroAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginSubtractNonZeroAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Subtract the source color from the target color for all frames where the + /// target color is not black starting at offset for the length of the source. + /// Source and target are referenced by id. + /// + public static void SubtractNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) + { + PluginSubtractNonZeroAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); + } + /// + /// Subtract the source color from the target color for all frames where the + /// target color is not black starting at offset for the length of the source. + /// Source and target are referenced by name. + /// + public static void SubtractNonZeroAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginSubtractNonZeroAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double SubtractNonZeroAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginSubtractNonZeroAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Subtract the source color from the target color for the frame where the + /// target color is not black. Source and target are referenced by name. + /// + public static void SubtractNonZeroAllKeysName(string sourceAnimation, string targetAnimation, int frameId) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginSubtractNonZeroAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// Subtract the source color from the target where color is not black for the + /// source frame and target offset frame, reference source and target by id. + /// + /// + public static void SubtractNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) + { + PluginSubtractNonZeroAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); + } + /// + /// Subtract the source color from the target where color is not black for the + /// source frame and target offset frame, reference source and target by name. + /// + /// + public static void SubtractNonZeroAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginSubtractNonZeroAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double SubtractNonZeroAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginSubtractNonZeroAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Subtract the source color from the target color where the target color is + /// not black for all frames. Reference source and target by id. + /// + public static void SubtractNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) + { + PluginSubtractNonZeroTargetAllKeysAllFrames(sourceAnimationId, targetAnimationId); + } + /// + /// Subtract the source color from the target color where the target color is + /// not black for all frames. Reference source and target by name. + /// + public static void SubtractNonZeroTargetAllKeysAllFramesName(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginSubtractNonZeroTargetAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double SubtractNonZeroTargetAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginSubtractNonZeroTargetAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Subtract the source color from the target color where the target color is + /// not black for all frames starting at the target offset for the length of + /// the source. Reference source and target by id. + /// + public static void SubtractNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) + { + PluginSubtractNonZeroTargetAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); + } + /// + /// Subtract the source color from the target color where the target color is + /// not black for all frames starting at the target offset for the length of + /// the source. Reference source and target by name. + /// + public static void SubtractNonZeroTargetAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginSubtractNonZeroTargetAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double SubtractNonZeroTargetAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginSubtractNonZeroTargetAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Subtract the source color from the target color where the target color is + /// not black from the source frame to the target offset frame. Reference source + /// and target by id. + /// + public static void SubtractNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) + { + PluginSubtractNonZeroTargetAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); + } + /// + /// Subtract the source color from the target color where the target color is + /// not black from the source frame to the target offset frame. Reference source + /// and target by name. + /// + public static void SubtractNonZeroTargetAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + PluginSubtractNonZeroTargetAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + } + /// + /// D suffix for limited data types. + /// + public static double SubtractNonZeroTargetAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) + { + string str_SourceAnimation = sourceAnimation; + IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); + string str_TargetAnimation = targetAnimation; + IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); + double result = PluginSubtractNonZeroTargetAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); + FreeIntPtr(lp_SourceAnimation); + FreeIntPtr(lp_TargetAnimation); + return result; + } + /// + /// Subtract all frames with the min RGB color where the animation color is + /// less than the min threshold AND with the max RGB color where the animation + /// is more than the max threshold. Animation is referenced by id. + /// + public static void SubtractThresholdColorsMinMaxAllFramesRGB(int animationId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) + { + PluginSubtractThresholdColorsMinMaxAllFramesRGB(animationId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + } + /// + /// Subtract all frames with the min RGB color where the animation color is + /// less than the min threshold AND with the max RGB color where the animation + /// is more than the max threshold. Animation is referenced by name. + /// + public static void SubtractThresholdColorsMinMaxAllFramesRGBName(string path, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSubtractThresholdColorsMinMaxAllFramesRGBName(lp_Path, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SubtractThresholdColorsMinMaxAllFramesRGBNameD(string path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSubtractThresholdColorsMinMaxAllFramesRGBNameD(lp_Path, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Subtract the specified frame with the min RGB color where the animation + /// color is less than the min threshold AND with the max RGB color where the + /// animation is more than the max threshold. Animation is referenced by id. + /// + /// + public static void SubtractThresholdColorsMinMaxRGB(int animationId, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) + { + PluginSubtractThresholdColorsMinMaxRGB(animationId, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + } + /// + /// Subtract the specified frame with the min RGB color where the animation + /// color is less than the min threshold AND with the max RGB color where the + /// animation is more than the max threshold. Animation is referenced by name. + /// + /// + public static void SubtractThresholdColorsMinMaxRGBName(string path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginSubtractThresholdColorsMinMaxRGBName(lp_Path, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double SubtractThresholdColorsMinMaxRGBNameD(string path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginSubtractThresholdColorsMinMaxRGBNameD(lp_Path, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Trim the end of the animation. The length of the animation will be the lastFrameId + /// plus one. Reference the animation by id. + /// + public static void TrimEndFrames(int animationId, int lastFrameId) + { + PluginTrimEndFrames(animationId, lastFrameId); + } + /// + /// Trim the end of the animation. The length of the animation will be the lastFrameId + /// plus one. Reference the animation by name. + /// + public static void TrimEndFramesName(string path, int lastFrameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginTrimEndFramesName(lp_Path, lastFrameId); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double TrimEndFramesNameD(string path, double lastFrameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginTrimEndFramesNameD(lp_Path, lastFrameId); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Remove the frame from the animation. Reference animation by id. + /// + public static void TrimFrame(int animationId, int frameId) + { + PluginTrimFrame(animationId, frameId); + } + /// + /// Remove the frame from the animation. Reference animation by name. + /// + public static void TrimFrameName(string path, int frameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginTrimFrameName(lp_Path, frameId); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double TrimFrameNameD(string path, double frameId) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginTrimFrameNameD(lp_Path, frameId); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Trim the start of the animation starting at frame 0 for the number of frames. + /// Reference the animation by id. + /// + public static void TrimStartFrames(int animationId, int numberOfFrames) + { + PluginTrimStartFrames(animationId, numberOfFrames); + } + /// + /// Trim the start of the animation starting at frame 0 for the number of frames. + /// Reference the animation by name. + /// + public static void TrimStartFramesName(string path, int numberOfFrames) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginTrimStartFramesName(lp_Path, numberOfFrames); + FreeIntPtr(lp_Path); + } + /// + /// D suffix for limited data types. + /// + public static double TrimStartFramesNameD(string path, double numberOfFrames) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + double result = PluginTrimStartFramesNameD(lp_Path, numberOfFrames); + FreeIntPtr(lp_Path); + return result; + } + /// + /// Uninitializes the `ChromaSDK`. Returns 0 upon success. Returns negative + /// one upon failure. + /// + public static int Uninit() + { + int result = PluginUninit(); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double UninitD() + { + double result = PluginUninitD(); + return result; + } + /// + /// Unloads `Chroma` effects to free up resources. Returns the animation id + /// upon success. Returns negative one upon failure. Reference the animation + /// by id. + /// + public static int UnloadAnimation(int animationId) + { + int result = PluginUnloadAnimation(animationId); + return result; + } + /// + /// D suffix for limited data types. + /// + public static double UnloadAnimationD(double animationId) + { + double result = PluginUnloadAnimationD(animationId); + return result; + } + /// + /// Unload the animation effects. Reference the animation by name. + /// + public static void UnloadAnimationName(string path) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginUnloadAnimationName(lp_Path); + FreeIntPtr(lp_Path); + } + /// + /// Unload the the composite set of animation effects. Reference the animation + /// by name. + /// + public static void UnloadComposite(string name) + { + string str_Name = name; + IntPtr lp_Name = GetPathIntPtr(str_Name); + PluginUnloadComposite(lp_Name); + FreeIntPtr(lp_Name); + } + /// + /// Unload the Razer Chroma SDK Library before exiting the application. + /// + public static void UnloadLibrarySDK() + { + PluginUnloadLibrarySDK(); + } + /// + /// Unload the Razer Chroma Streaming Plugin Library before exiting the application. + /// + /// + public static void UnloadLibraryStreamingPlugin() + { + PluginUnloadLibraryStreamingPlugin(); + } + /// + /// Updates the `frameIndex` of the `Chroma` animation referenced by id and + /// sets the `duration` (in seconds). The `color` is expected to be an array + /// of the dimensions for the `deviceType/device`. The `length` parameter is + /// the size of the `color` array. For `EChromaSDKDevice1DEnum` the array size + /// should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should + /// be `MAX ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard + /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the + /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. + /// + /// + public static int UpdateFrame(int animationId, int frameIndex, float duration, int[] colors, int length, int[] keys, int keysLength) + { + int result = PluginUpdateFrame(animationId, frameIndex, duration, colors, length, keys, keysLength); + return result; + } + /// + /// Update the `frameIndex` of the `Chroma` animation referenced by name and + /// sets the `duration` (in seconds). The `color` is expected to be an array + /// of the dimensions for the `deviceType/device`. The `length` parameter is + /// the size of the `color` array. For `EChromaSDKDevice1DEnum` the array size + /// should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should + /// be `MAX ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard + /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the + /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. + /// Returns the animation id upon success. Returns negative one upon failure. + /// + /// + public static int UpdateFrameName(string path, int frameIndex, float duration, int[] colors, int length, int[] keys, int keysLength) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + int result = PluginUpdateFrameName(lp_Path, frameIndex, duration, colors, length, keys, keysLength); + FreeIntPtr(lp_Path); + return result; + } + /// + /// When the idle animation flag is true, when no other animations are playing, + /// the idle animation will be used. The idle animation will not be affected + /// by the API calls to PluginIsPlaying, PluginStopAnimationType, PluginGetPlayingAnimationId, + /// and PluginGetPlayingAnimationCount. Then the idle animation flag is false, + /// the idle animation is disabled. `Device` uses `EChromaSDKDeviceEnum` enums. + /// + /// + public static void UseIdleAnimation(int device, bool flag) + { + PluginUseIdleAnimation(device, flag); + } + /// + /// Set idle animation flag for all devices. + /// + public static void UseIdleAnimations(bool flag) + { + PluginUseIdleAnimations(flag); + } + /// + /// Set preloading animation flag, which is set to true by default. Reference + /// animation by id. + /// + public static void UsePreloading(int animationId, bool flag) + { + PluginUsePreloading(animationId, flag); + } + /// + /// Set preloading animation flag, which is set to true by default. Reference + /// animation by name. + /// + public static void UsePreloadingName(string path, bool flag) + { + string str_Path = path; + IntPtr lp_Path = GetPathIntPtr(str_Path); + PluginUsePreloadingName(lp_Path, flag); + FreeIntPtr(lp_Path); + } + #endregion + + #region Private DLL Hooks + /// + /// Return the sum of colors + /// EXPORT_API int PluginAddColor(const int color1, const int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginAddColor(int color1, int color2); + /// + /// Adds a frame to the `Chroma` animation and sets the `duration` (in seconds). + /// The `color` is expected to be an array of the dimensions for the `deviceType/device`. + /// The `length` parameter is the size of the `color` array. For `EChromaSDKDevice1DEnum` + /// the array size should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array + /// size should be `MAX ROW` times `MAX COLUMN`. Returns the animation id upon + /// success. Returns negative one upon failure. + /// EXPORT_API int PluginAddFrame(int animationId, float duration, int* colors, int length); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginAddFrame(int animationId, float duration, int[] colors, int length); + /// + /// Add source color to target where color is not black for frame id, reference + /// source and target by id. + /// EXPORT_API void PluginAddNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + /// Add source color to target where color is not black for all frames, reference + /// source and target by id. + /// EXPORT_API void PluginAddNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + /// Add source color to target where color is not black for all frames, reference + /// source and target by name. + /// EXPORT_API void PluginAddNonZeroAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginAddNonZeroAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginAddNonZeroAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Add source color to target where color is not black for all frames starting + /// at offset for the length of the source, reference source and target by + /// id. + /// EXPORT_API void PluginAddNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + /// Add source color to target where color is not black for all frames starting + /// at offset for the length of the source, reference source and target by + /// name. + /// EXPORT_API void PluginAddNonZeroAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginAddNonZeroAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginAddNonZeroAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); + /// + /// Add source color to target where color is not black for frame id, reference + /// source and target by name. + /// EXPORT_API void PluginAddNonZeroAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); + /// + /// Add source color to target where color is not black for the source frame + /// and target offset frame, reference source and target by id. + /// EXPORT_API void PluginAddNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + /// Add source color to target where color is not black for the source frame + /// and target offset frame, reference source and target by name. + /// EXPORT_API void PluginAddNonZeroAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginAddNonZeroAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginAddNonZeroAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); + /// + /// Add source color to target where the target color is not black for all frames, + /// reference source and target by id. + /// EXPORT_API void PluginAddNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + /// Add source color to target where the target color is not black for all frames, + /// reference source and target by name. + /// EXPORT_API void PluginAddNonZeroTargetAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroTargetAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginAddNonZeroTargetAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginAddNonZeroTargetAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Add source color to target where the target color is not black for all frames + /// starting at offset for the length of the source, reference source and target + /// by id. + /// EXPORT_API void PluginAddNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + /// Add source color to target where the target color is not black for all frames + /// starting at offset for the length of the source, reference source and target + /// by name. + /// EXPORT_API void PluginAddNonZeroTargetAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroTargetAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginAddNonZeroTargetAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginAddNonZeroTargetAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); + /// + /// Add source color to target where target color is not blank from the source + /// frame to the target offset frame, reference source and target by id. + /// EXPORT_API void PluginAddNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + /// Add source color to target where target color is not blank from the source + /// frame to the target offset frame, reference source and target by name. + /// + /// EXPORT_API void PluginAddNonZeroTargetAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAddNonZeroTargetAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginAddNonZeroTargetAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginAddNonZeroTargetAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); + /// + /// Append all source frames to the target animation, reference source and target + /// by id. + /// EXPORT_API void PluginAppendAllFrames(int sourceAnimationId, int targetAnimationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAppendAllFrames(int sourceAnimationId, int targetAnimationId); + /// + /// Append all source frames to the target animation, reference source and target + /// by name. + /// EXPORT_API void PluginAppendAllFramesName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginAppendAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginAppendAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginAppendAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// `PluginClearAll` will issue a `CLEAR` effect for all devices. + /// EXPORT_API void PluginClearAll(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginClearAll(); + /// + /// `PluginClearAnimationType` will issue a `CLEAR` effect for the given device. + /// + /// EXPORT_API void PluginClearAnimationType(int deviceType, int device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginClearAnimationType(int deviceType, int device); + /// + /// `PluginCloseAll` closes all open animations so they can be reloaded from + /// disk. The set of animations will be stopped if playing. + /// EXPORT_API void PluginCloseAll(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCloseAll(); + /// + /// Closes the `Chroma` animation to free up resources referenced by id. Returns + /// the animation id upon success. Returns negative one upon failure. This + /// might be used while authoring effects if there was a change necessitating + /// re-opening the animation. The animation id can no longer be used once closed. + /// + /// EXPORT_API int PluginCloseAnimation(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCloseAnimation(int animationId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCloseAnimationD(double animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCloseAnimationD(double animationId); + /// + /// Closes the `Chroma` animation referenced by name so that the animation can + /// be reloaded from disk. + /// EXPORT_API void PluginCloseAnimationName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCloseAnimationName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCloseAnimationNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCloseAnimationNameD(IntPtr path); + /// + /// `PluginCloseComposite` closes a set of animations so they can be reloaded + /// from disk. The set of animations will be stopped if playing. + /// EXPORT_API void PluginCloseComposite(const char* name); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCloseComposite(IntPtr name); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCloseCompositeD(const char* name); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCloseCompositeD(IntPtr name); + /// + /// Copy source animation to target animation for the given frame. Source and + /// target are referenced by id. + /// EXPORT_API void PluginCopyAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + /// Copy source animation to target animation for the given frame. Source and + /// target are referenced by id. + /// EXPORT_API void PluginCopyAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); + /// + /// Copy animation to named target animation in memory. If target animation + /// exists, close first. Source is referenced by id. + /// EXPORT_API int PluginCopyAnimation(int sourceAnimationId, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCopyAnimation(int sourceAnimationId, IntPtr targetAnimation); + /// + /// Copy animation to named target animation in memory. If target animation + /// exists, close first. Source is referenced by name. + /// EXPORT_API void PluginCopyAnimationName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyAnimationName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyAnimationNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyAnimationNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Copy blue channel to other channels for all frames. Intensity range is 0.0 + /// to 1.0. Reference the animation by id. + /// EXPORT_API void PluginCopyBlueChannelAllFrames(int animationId, float redIntensity, float greenIntensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyBlueChannelAllFrames(int animationId, float redIntensity, float greenIntensity); + /// + /// Copy blue channel to other channels for all frames. Intensity range is 0.0 + /// to 1.0. Reference the animation by name. + /// EXPORT_API void PluginCopyBlueChannelAllFramesName(const char* path, float redIntensity, float greenIntensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyBlueChannelAllFramesName(IntPtr path, float redIntensity, float greenIntensity); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyBlueChannelAllFramesNameD(const char* path, double redIntensity, double greenIntensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyBlueChannelAllFramesNameD(IntPtr path, double redIntensity, double greenIntensity); + /// + /// Copy green channel to other channels for all frames. Intensity range is + /// 0.0 to 1.0. Reference the animation by id. + /// EXPORT_API void PluginCopyGreenChannelAllFrames(int animationId, float redIntensity, float blueIntensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyGreenChannelAllFrames(int animationId, float redIntensity, float blueIntensity); + /// + /// Copy green channel to other channels for all frames. Intensity range is + /// 0.0 to 1.0. Reference the animation by name. + /// EXPORT_API void PluginCopyGreenChannelAllFramesName(const char* path, float redIntensity, float blueIntensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyGreenChannelAllFramesName(IntPtr path, float redIntensity, float blueIntensity); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyGreenChannelAllFramesNameD(const char* path, double redIntensity, double blueIntensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyGreenChannelAllFramesNameD(IntPtr path, double redIntensity, double blueIntensity); + /// + /// Copy animation key color from the source animation to the target animation + /// for the given frame. Reference the source and target by id. + /// EXPORT_API void PluginCopyKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); + /// + /// Copy animation key color from the source animation to the target animation + /// for all frames. Reference the source and target by id. + /// EXPORT_API void PluginCopyKeyColorAllFrames(int sourceAnimationId, int targetAnimationId, int rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeyColorAllFrames(int sourceAnimationId, int targetAnimationId, int rzkey); + /// + /// Copy animation key color from the source animation to the target animation + /// for all frames. Reference the source and target by name. + /// EXPORT_API void PluginCopyKeyColorAllFramesName(const char* sourceAnimation, const char* targetAnimation, int rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeyColorAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation, int rzkey); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyKeyColorAllFramesNameD(const char* sourceAnimation, const char* targetAnimation, double rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyKeyColorAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double rzkey); + /// + /// Copy animation key color from the source animation to the target animation + /// for all frames, starting at the offset for the length of the source animation. + /// Source and target are referenced by id. + /// EXPORT_API void PluginCopyKeyColorAllFramesOffset(int sourceAnimationId, int targetAnimationId, int rzkey, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeyColorAllFramesOffset(int sourceAnimationId, int targetAnimationId, int rzkey, int offset); + /// + /// Copy animation key color from the source animation to the target animation + /// for all frames, starting at the offset for the length of the source animation. + /// Source and target are referenced by name. + /// EXPORT_API void PluginCopyKeyColorAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int rzkey, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeyColorAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int rzkey, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyKeyColorAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double rzkey, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyKeyColorAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double rzkey, double offset); + /// + /// Copy animation key color from the source animation to the target animation + /// for the given frame. + /// EXPORT_API void PluginCopyKeyColorName(const char* sourceAnimation, const char* targetAnimation, int frameId, int rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeyColorName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int rzkey); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyKeyColorNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyKeyColorNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double rzkey); + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation for the given frame. Reference the source and target by + /// id. + /// EXPORT_API void PluginCopyKeysColor(int sourceAnimationId, int targetAnimationId, int frameId, const int* keys, int size); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeysColor(int sourceAnimationId, int targetAnimationId, int frameId, int[] keys, int size); + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation for all frames. Reference the source and target by id. + /// + /// EXPORT_API void PluginCopyKeysColorAllFrames(int sourceAnimationId, int targetAnimationId, const int* keys, int size); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeysColorAllFrames(int sourceAnimationId, int targetAnimationId, int[] keys, int size); + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation for all frames. Reference the source and target by name. + /// + /// EXPORT_API void PluginCopyKeysColorAllFramesName(const char* sourceAnimation, const char* targetAnimation, const int* keys, int size); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeysColorAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation, int[] keys, int size); + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation for the given frame. Reference the source and target by + /// name. + /// EXPORT_API void PluginCopyKeysColorName(const char* sourceAnimation, const char* targetAnimation, int frameId, const int* keys, int size); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeysColorName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int[] keys, int size); + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation from the source frame to the target frame. Reference the + /// source and target by id. + /// EXPORT_API void PluginCopyKeysColorOffset(int sourceAnimationId, int targetAnimationId, int sourceFrameId, int targetFrameId, const int* keys, int size); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeysColorOffset(int sourceAnimationId, int targetAnimationId, int sourceFrameId, int targetFrameId, int[] keys, int size); + /// + /// Copy animation color for a set of keys from the source animation to the + /// target animation from the source frame to the target frame. Reference the + /// source and target by name. + /// EXPORT_API void PluginCopyKeysColorOffsetName(const char* sourceAnimation, const char* targetAnimation, int sourceFrameId, int targetFrameId, const int* keys, int size); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyKeysColorOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int sourceFrameId, int targetFrameId, int[] keys, int size); + /// + /// Copy source animation to target animation for the given frame. Source and + /// target are referenced by id. + /// EXPORT_API void PluginCopyNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + /// Copy nonzero colors from a source animation to a target animation for all + /// frames. Reference source and target by id. + /// EXPORT_API void PluginCopyNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + /// Copy nonzero colors from a source animation to a target animation for all + /// frames. Reference source and target by name. + /// EXPORT_API void PluginCopyNonZeroAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyNonZeroAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyNonZeroAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Copy nonzero colors from a source animation to a target animation for all + /// frames starting at the offset for the length of the source animation. The + /// source and target are referenced by id. + /// EXPORT_API void PluginCopyNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + /// Copy nonzero colors from a source animation to a target animation for all + /// frames starting at the offset for the length of the source animation. The + /// source and target are referenced by name. + /// EXPORT_API void PluginCopyNonZeroAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyNonZeroAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyNonZeroAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); + /// + /// Copy nonzero colors from source animation to target animation for the specified + /// frame. Source and target are referenced by id. + /// EXPORT_API void PluginCopyNonZeroAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyNonZeroAllKeysNameD(const char* sourceAnimation, const char* targetAnimation, double frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyNonZeroAllKeysNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId); + /// + /// Copy nonzero colors from the source animation to the target animation from + /// the source frame to the target offset frame. Source and target are referenced + /// by id. + /// EXPORT_API void PluginCopyNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + /// Copy nonzero colors from the source animation to the target animation from + /// the source frame to the target offset frame. Source and target are referenced + /// by name. + /// EXPORT_API void PluginCopyNonZeroAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyNonZeroAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyNonZeroAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); + /// + /// Copy animation key color from the source animation to the target animation + /// for the given frame where color is not zero. + /// EXPORT_API void PluginCopyNonZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); + /// + /// Copy animation key color from the source animation to the target animation + /// for the given frame where color is not zero. + /// EXPORT_API void PluginCopyNonZeroKeyColorName(const char* sourceAnimation, const char* targetAnimation, int frameId, int rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroKeyColorName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int rzkey); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyNonZeroKeyColorNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyNonZeroKeyColorNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double rzkey); + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for the specified frame. Source and target + /// are referenced by id. + /// EXPORT_API void PluginCopyNonZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for all frames. Source and target are referenced + /// by id. + /// EXPORT_API void PluginCopyNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for all frames. Source and target are referenced + /// by name. + /// EXPORT_API void PluginCopyNonZeroTargetAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroTargetAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyNonZeroTargetAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyNonZeroTargetAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for all frames. Source and target are referenced + /// by name. + /// EXPORT_API void PluginCopyNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for all frames starting at the target offset + /// for the length of the source animation. Source and target animations are + /// referenced by name. + /// EXPORT_API void PluginCopyNonZeroTargetAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroTargetAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyNonZeroTargetAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyNonZeroTargetAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for the specified frame. The source and target + /// are referenced by name. + /// EXPORT_API void PluginCopyNonZeroTargetAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroTargetAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyNonZeroTargetAllKeysNameD(const char* sourceAnimation, const char* targetAnimation, double frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyNonZeroTargetAllKeysNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId); + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for the specified source frame and target offset + /// frame. The source and target are referenced by id. + /// EXPORT_API void PluginCopyNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is nonzero for the specified source frame and target offset + /// frame. The source and target are referenced by name. + /// EXPORT_API void PluginCopyNonZeroTargetAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroTargetAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyNonZeroTargetAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyNonZeroTargetAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is zero for all frames. Source and target are referenced + /// by id. + /// EXPORT_API void PluginCopyNonZeroTargetZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroTargetZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + /// Copy nonzero colors from the source animation to the target animation where + /// the target color is zero for all frames. Source and target are referenced + /// by name. + /// EXPORT_API void PluginCopyNonZeroTargetZeroAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyNonZeroTargetZeroAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyNonZeroTargetZeroAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyNonZeroTargetZeroAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Copy red channel to other channels for all frames. Intensity range is 0.0 + /// to 1.0. Reference the animation by id. + /// EXPORT_API void PluginCopyRedChannelAllFrames(int animationId, float greenIntensity, float blueIntensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyRedChannelAllFrames(int animationId, float greenIntensity, float blueIntensity); + /// + /// Copy green channel to other channels for all frames. Intensity range is + /// 0.0 to 1.0. Reference the animation by name. + /// EXPORT_API void PluginCopyRedChannelAllFramesName(const char* path, float greenIntensity, float blueIntensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyRedChannelAllFramesName(IntPtr path, float greenIntensity, float blueIntensity); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyRedChannelAllFramesNameD(const char* path, double greenIntensity, double blueIntensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyRedChannelAllFramesNameD(IntPtr path, double greenIntensity, double blueIntensity); + /// + /// Copy zero colors from source animation to target animation for the frame. + /// Source and target are referenced by id. + /// EXPORT_API void PluginCopyZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + /// Copy zero colors from source animation to target animation for all frames. + /// Source and target are referenced by id. + /// EXPORT_API void PluginCopyZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + /// Copy zero colors from source animation to target animation for all frames. + /// Source and target are referenced by name. + /// EXPORT_API void PluginCopyZeroAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyZeroAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyZeroAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Copy zero colors from source animation to target animation for all frames + /// starting at the target offset for the length of the source animation. Source + /// and target are referenced by id. + /// EXPORT_API void PluginCopyZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + /// Copy zero colors from source animation to target animation for all frames + /// starting at the target offset for the length of the source animation. Source + /// and target are referenced by name. + /// EXPORT_API void PluginCopyZeroAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyZeroAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyZeroAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); + /// + /// Copy zero colors from source animation to target animation for the frame. + /// Source and target are referenced by name. + /// EXPORT_API void PluginCopyZeroAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); + /// + /// Copy zero colors from source animation to target animation for the frame + /// id starting at the target offset for the length of the source animation. + /// Source and target are referenced by id. + /// EXPORT_API void PluginCopyZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + /// Copy zero colors from source animation to target animation for the frame + /// id starting at the target offset for the length of the source animation. + /// Source and target are referenced by name. + /// EXPORT_API void PluginCopyZeroAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); + /// + /// Copy zero key color from source animation to target animation for the specified + /// frame. Source and target are referenced by id. + /// EXPORT_API void PluginCopyZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); + /// + /// Copy zero key color from source animation to target animation for the specified + /// frame. Source and target are referenced by name. + /// EXPORT_API void PluginCopyZeroKeyColorName(const char* sourceAnimation, const char* targetAnimation, int frameId, int rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroKeyColorName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int rzkey); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyZeroKeyColorNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyZeroKeyColorNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double rzkey); + /// + /// Copy nonzero color from source animation to target animation where target + /// is zero for the frame. Source and target are referenced by id. + /// EXPORT_API void PluginCopyZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + /// Copy nonzero color from source animation to target animation where target + /// is zero for all frames. Source and target are referenced by id. + /// EXPORT_API void PluginCopyZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + /// Copy nonzero color from source animation to target animation where target + /// is zero for all frames. Source and target are referenced by name. + /// EXPORT_API void PluginCopyZeroTargetAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroTargetAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginCopyZeroTargetAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginCopyZeroTargetAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Copy nonzero color from source animation to target animation where target + /// is zero for the frame. Source and target are referenced by name. + /// EXPORT_API void PluginCopyZeroTargetAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCopyZeroTargetAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreCreateChromaLinkEffect(ChromaSDK::ChromaLink::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreCreateChromaLinkEffect(int effect, IntPtr pParam, out Guid pEffectId); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreCreateEffect(RZDEVICEID DeviceId, ChromaSDK::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreCreateEffect(Guid deviceId, int effect, IntPtr pParam, out Guid pEffectId); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreCreateHeadsetEffect(ChromaSDK::Headset::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreCreateHeadsetEffect(int effect, IntPtr pParam, out Guid pEffectId); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreCreateKeyboardEffect(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreCreateKeyboardEffect(int effect, IntPtr pParam, out Guid pEffectId); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreCreateKeypadEffect(ChromaSDK::Keypad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreCreateKeypadEffect(int effect, IntPtr pParam, out Guid pEffectId); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreCreateMouseEffect(ChromaSDK::Mouse::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreCreateMouseEffect(int effect, IntPtr pParam, out Guid pEffectId); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreCreateMousepadEffect(ChromaSDK::Mousepad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreCreateMousepadEffect(int effect, IntPtr pParam, out Guid pEffectId); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreDeleteEffect(RZEFFECTID EffectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreDeleteEffect(Guid effectId); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreInit(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreInit(); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreInitSDK(ChromaSDK::APPINFOTYPE* AppInfo); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreInitSDK(ref ChromaSDK.APPINFOTYPE appInfo); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreQueryDevice(RZDEVICEID DeviceId, ChromaSDK::DEVICE_INFO_TYPE& DeviceInfo); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreQueryDevice(Guid deviceId, out DEVICE_INFO_TYPE deviceInfo); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreSetEffect(RZEFFECTID EffectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreSetEffect(Guid effectId); + /// + /// Begin broadcasting Chroma RGB data using the stored stream key as the endpoint. + /// Intended for Cloud Gaming Platforms, restore the streaming key when the + /// game instance is launched to continue streaming. streamId is a null terminated + /// string streamKey is a null terminated string StreamGetStatus() should return + /// the READY status to use this method. + /// EXPORT_API bool PluginCoreStreamBroadcast(const char* streamId, const char* streamKey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginCoreStreamBroadcast(IntPtr streamId, IntPtr streamKey); + /// + /// End broadcasting Chroma RGB data. StreamGetStatus() should return the BROADCASTING + /// status to use this method. + /// EXPORT_API bool PluginCoreStreamBroadcastEnd(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginCoreStreamBroadcastEnd(); + /// + /// shortcode: Pass the address of a preallocated character buffer to get the + /// streaming auth code. The buffer should have a minimum length of 6. length: + /// Length will return as zero if the streaming auth code could not be obtained. + /// If length is greater than zero, it will be the length of the returned streaming + /// auth code. Once you have the shortcode, it should be shown to the user + /// so they can associate the stream with their Razer ID StreamGetStatus() + /// should return the READY status before invoking this method. platform: is + /// the null terminated string that identifies the source of the stream: { + /// GEFORCE_NOW, LUNA, STADIA, GAME_PASS } title: is the null terminated string + /// that identifies the application or game. + /// EXPORT_API void PluginCoreStreamGetAuthShortcode(char* shortcode, unsigned char* length, const wchar_t* platform, const wchar_t* title); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCoreStreamGetAuthShortcode(IntPtr shortcode, out byte length, IntPtr platform, IntPtr title); + /// + /// focus: Pass the address of a preallocated character buffer to get the stream + /// focus. The buffer should have a length of 48 length: Length will return + /// as zero if the stream focus could not be obtained. If length is greater + /// than zero, it will be the length of the returned stream focus. + /// EXPORT_API bool PluginCoreStreamGetFocus(char* focus, unsigned char* length); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginCoreStreamGetFocus(IntPtr focus, out byte length); + /// + /// Intended for Cloud Gaming Platforms, store the stream id to persist in user + /// preferences to continue streaming if the game is suspended or closed. shortcode: + /// The shortcode is a null terminated string. Use the shortcode that authorized + /// the stream to obtain the stream id. streamId should be a preallocated buffer + /// to get the stream key. The buffer should have a length of 48. length: Length + /// will return zero if the key could not be obtained. If the length is greater + /// than zero, it will be the length of the returned streaming id. Retrieve + /// the stream id after authorizing the shortcode. The authorization window + /// will expire in 5 minutes. Be sure to save the stream key before the window + /// expires. StreamGetStatus() should return the READY status to use this method. + /// + /// EXPORT_API void PluginCoreStreamGetId(const char* shortcode, char* streamId, unsigned char* length); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCoreStreamGetId(IntPtr shortcode, IntPtr streamId, out byte length); + /// + /// Intended for Cloud Gaming Platforms, store the streaming key to persist + /// in user preferences to continue streaming if the game is suspended or closed. + /// shortcode: The shortcode is a null terminated string. Use the shortcode + /// that authorized the stream to obtain the stream key. If the status is in + /// the BROADCASTING or WATCHING state, passing a NULL shortcode will return + /// the active streamId. streamKey should be a preallocated buffer to get the + /// stream key. The buffer should have a length of 48. length: Length will + /// return zero if the key could not be obtained. If the length is greater + /// than zero, it will be the length of the returned streaming key. Retrieve + /// the stream key after authorizing the shortcode. The authorization window + /// will expire in 5 minutes. Be sure to save the stream key before the window + /// expires. StreamGetStatus() should return the READY status to use this method. + /// + /// EXPORT_API void PluginCoreStreamGetKey(const char* shortcode, char* streamKey, unsigned char* length); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginCoreStreamGetKey(IntPtr shortcode, IntPtr streamKey, out byte length); + /// + /// Returns StreamStatus, the current status of the service + /// EXPORT_API ChromaSDK::Stream::StreamStatusType PluginCoreStreamGetStatus(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern ChromaSDK.Stream.StreamStatusType PluginCoreStreamGetStatus(); + /// + /// Convert StreamStatusType to a printable string + /// EXPORT_API const char* PluginCoreStreamGetStatusString(ChromaSDK::Stream::StreamStatusType status); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern IntPtr PluginCoreStreamGetStatusString(ChromaSDK.Stream.StreamStatusType status); + /// + /// This prevents the stream id and stream key from being obtained through the + /// shortcode. This closes the auth window. shortcode is a null terminated + /// string. StreamGetStatus() should return the READY status to use this method. + /// returns success when shortcode has been released + /// EXPORT_API bool PluginCoreStreamReleaseShortcode(const char* shortcode); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginCoreStreamReleaseShortcode(IntPtr shortcode); + /// + /// The focus is a null terminated string. Set the focus identifer for the application + /// designated to automatically change the streaming state. Returns true on + /// success. + /// EXPORT_API bool PluginCoreStreamSetFocus(const char* focus); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginCoreStreamSetFocus(IntPtr focus); + /// + /// Returns true if the Chroma streaming is supported. If false is returned, + /// avoid calling stream methods. + /// EXPORT_API bool PluginCoreStreamSupportsStreaming(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginCoreStreamSupportsStreaming(); + /// + /// Begin watching the Chroma RGB data using streamID parameter. streamId is + /// a null terminated string. StreamGetStatus() should return the READY status + /// to use this method. + /// EXPORT_API bool PluginCoreStreamWatch(const char* streamId, unsigned long long timestamp); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginCoreStreamWatch(IntPtr streamId, ulong timestamp); + /// + /// End watching Chroma RGB data stream. StreamGetStatus() should return the + /// WATCHING status to use this method. + /// EXPORT_API bool PluginCoreStreamWatchEnd(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginCoreStreamWatchEnd(); + /// + /// Direct access to low level API. + /// EXPORT_API RZRESULT PluginCoreUnInit(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCoreUnInit(); + /// + /// Creates a `Chroma` animation at the given path. The `deviceType` parameter + /// uses `EChromaSDKDeviceTypeEnum` as an integer. The `device` parameter uses + /// `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` as an integer, respective + /// to the `deviceType`. Returns the animation id upon success. Returns negative + /// one upon failure. Saves a `Chroma` animation file with the `.chroma` extension + /// at the given path. Returns the animation id upon success. Returns negative + /// one upon failure. + /// EXPORT_API int PluginCreateAnimation(const char* path, int deviceType, int device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCreateAnimation(IntPtr path, int deviceType, int device); + /// + /// Creates a `Chroma` animation in memory without creating a file. The `deviceType` + /// parameter uses `EChromaSDKDeviceTypeEnum` as an integer. The `device` parameter + /// uses `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` as an integer, + /// respective to the `deviceType`. Returns the animation id upon success. + /// Returns negative one upon failure. Returns the animation id upon success. + /// Returns negative one upon failure. + /// EXPORT_API int PluginCreateAnimationInMemory(int deviceType, int device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCreateAnimationInMemory(int deviceType, int device); + /// + /// Create a device specific effect. + /// EXPORT_API RZRESULT PluginCreateEffect(RZDEVICEID deviceId, ChromaSDK::EFFECT_TYPE effect, int* colors, int size, ChromaSDK::FChromaSDKGuid* effectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginCreateEffect(Guid deviceId, int effect, int[] colors, int size, out FChromaSDKGuid effectId); + /// + /// Delete an effect given the effect id. + /// EXPORT_API RZRESULT PluginDeleteEffect(const ChromaSDK::FChromaSDKGuid& effectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginDeleteEffect(Guid effectId); + /// + /// Duplicate the first animation frame so that the animation length matches + /// the frame count. Animation is referenced by id. + /// EXPORT_API void PluginDuplicateFirstFrame(int animationId, int frameCount); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginDuplicateFirstFrame(int animationId, int frameCount); + /// + /// Duplicate the first animation frame so that the animation length matches + /// the frame count. Animation is referenced by name. + /// EXPORT_API void PluginDuplicateFirstFrameName(const char* path, int frameCount); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginDuplicateFirstFrameName(IntPtr path, int frameCount); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginDuplicateFirstFrameNameD(const char* path, double frameCount); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginDuplicateFirstFrameNameD(IntPtr path, double frameCount); + /// + /// Duplicate all the frames of the animation to double the animation length. + /// Frame 1 becomes frame 1 and 2. Frame 2 becomes frame 3 and 4. And so on. + /// The animation is referenced by id. + /// EXPORT_API void PluginDuplicateFrames(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginDuplicateFrames(int animationId); + /// + /// Duplicate all the frames of the animation to double the animation length. + /// Frame 1 becomes frame 1 and 2. Frame 2 becomes frame 3 and 4. And so on. + /// The animation is referenced by name. + /// EXPORT_API void PluginDuplicateFramesName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginDuplicateFramesName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginDuplicateFramesNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginDuplicateFramesNameD(IntPtr path); + /// + /// Duplicate all the animation frames in reverse so that the animation plays + /// forwards and backwards. Animation is referenced by id. + /// EXPORT_API void PluginDuplicateMirrorFrames(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginDuplicateMirrorFrames(int animationId); + /// + /// Duplicate all the animation frames in reverse so that the animation plays + /// forwards and backwards. Animation is referenced by name. + /// EXPORT_API void PluginDuplicateMirrorFramesName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginDuplicateMirrorFramesName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginDuplicateMirrorFramesNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginDuplicateMirrorFramesNameD(IntPtr path); + /// + /// Fade the animation to black starting at the fade frame index to the end + /// of the animation. Animation is referenced by id. + /// EXPORT_API void PluginFadeEndFrames(int animationId, int fade); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFadeEndFrames(int animationId, int fade); + /// + /// Fade the animation to black starting at the fade frame index to the end + /// of the animation. Animation is referenced by name. + /// EXPORT_API void PluginFadeEndFramesName(const char* path, int fade); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFadeEndFramesName(IntPtr path, int fade); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFadeEndFramesNameD(const char* path, double fade); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFadeEndFramesNameD(IntPtr path, double fade); + /// + /// Fade the animation from black to full color starting at 0 to the fade frame + /// index. Animation is referenced by id. + /// EXPORT_API void PluginFadeStartFrames(int animationId, int fade); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFadeStartFrames(int animationId, int fade); + /// + /// Fade the animation from black to full color starting at 0 to the fade frame + /// index. Animation is referenced by name. + /// EXPORT_API void PluginFadeStartFramesName(const char* path, int fade); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFadeStartFramesName(IntPtr path, int fade); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFadeStartFramesNameD(const char* path, double fade); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFadeStartFramesNameD(IntPtr path, double fade); + /// + /// Set the RGB value for all colors in the specified frame. Animation is referenced + /// by id. + /// EXPORT_API void PluginFillColor(int animationId, int frameId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillColor(int animationId, int frameId, int color); + /// + /// Set the RGB value for all colors for all frames. Animation is referenced + /// by id. + /// EXPORT_API void PluginFillColorAllFrames(int animationId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillColorAllFrames(int animationId, int color); + /// + /// Set the RGB value for all colors for all frames. Animation is referenced + /// by name. + /// EXPORT_API void PluginFillColorAllFramesName(const char* path, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillColorAllFramesName(IntPtr path, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillColorAllFramesNameD(const char* path, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillColorAllFramesNameD(IntPtr path, double color); + /// + /// Set the RGB value for all colors for all frames. Use the range of 0 to 255 + /// for red, green, and blue parameters. Animation is referenced by id. + /// EXPORT_API void PluginFillColorAllFramesRGB(int animationId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillColorAllFramesRGB(int animationId, int red, int green, int blue); + /// + /// Set the RGB value for all colors for all frames. Use the range of 0 to 255 + /// for red, green, and blue parameters. Animation is referenced by name. + /// EXPORT_API void PluginFillColorAllFramesRGBName(const char* path, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillColorAllFramesRGBName(IntPtr path, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillColorAllFramesRGBNameD(const char* path, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillColorAllFramesRGBNameD(IntPtr path, double red, double green, double blue); + /// + /// Set the RGB value for all colors in the specified frame. Animation is referenced + /// by name. + /// EXPORT_API void PluginFillColorName(const char* path, int frameId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillColorName(IntPtr path, int frameId, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillColorNameD(const char* path, double frameId, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillColorNameD(IntPtr path, double frameId, double color); + /// + /// Set the RGB value for all colors in the specified frame. Animation is referenced + /// by id. + /// EXPORT_API void PluginFillColorRGB(int animationId, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillColorRGB(int animationId, int frameId, int red, int green, int blue); + /// + /// Set the RGB value for all colors in the specified frame. Animation is referenced + /// by name. + /// EXPORT_API void PluginFillColorRGBName(const char* path, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillColorRGBName(IntPtr path, int frameId, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillColorRGBNameD(const char* path, double frameId, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillColorRGBNameD(IntPtr path, double frameId, double red, double green, double blue); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors in the specified + /// frame. Animation is referenced by id. + /// EXPORT_API void PluginFillNonZeroColor(int animationId, int frameId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillNonZeroColor(int animationId, int frameId, int color); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors for all frames. + /// Animation is referenced by id. + /// EXPORT_API void PluginFillNonZeroColorAllFrames(int animationId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillNonZeroColorAllFrames(int animationId, int color); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors for all frames. + /// Animation is referenced by name. + /// EXPORT_API void PluginFillNonZeroColorAllFramesName(const char* path, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillNonZeroColorAllFramesName(IntPtr path, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillNonZeroColorAllFramesNameD(const char* path, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillNonZeroColorAllFramesNameD(IntPtr path, double color); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors for all frames. + /// Use the range of 0 to 255 for red, green, and blue parameters. Animation + /// is referenced by id. + /// EXPORT_API void PluginFillNonZeroColorAllFramesRGB(int animationId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillNonZeroColorAllFramesRGB(int animationId, int red, int green, int blue); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors for all frames. + /// Use the range of 0 to 255 for red, green, and blue parameters. Animation + /// is referenced by name. + /// EXPORT_API void PluginFillNonZeroColorAllFramesRGBName(const char* path, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillNonZeroColorAllFramesRGBName(IntPtr path, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillNonZeroColorAllFramesRGBNameD(const char* path, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillNonZeroColorAllFramesRGBNameD(IntPtr path, double red, double green, double blue); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors in the specified + /// frame. Animation is referenced by name. + /// EXPORT_API void PluginFillNonZeroColorName(const char* path, int frameId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillNonZeroColorName(IntPtr path, int frameId, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillNonZeroColorNameD(const char* path, double frameId, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillNonZeroColorNameD(IntPtr path, double frameId, double color); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors in the specified + /// frame. Use the range of 0 to 255 for red, green, and blue parameters. Animation + /// is referenced by id. + /// EXPORT_API void PluginFillNonZeroColorRGB(int animationId, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillNonZeroColorRGB(int animationId, int frameId, int red, int green, int blue); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Set the RGB value for a subset of colors in the specified + /// frame. Use the range of 0 to 255 for red, green, and blue parameters. Animation + /// is referenced by name. + /// EXPORT_API void PluginFillNonZeroColorRGBName(const char* path, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillNonZeroColorRGBName(IntPtr path, int frameId, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillNonZeroColorRGBNameD(const char* path, double frameId, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillNonZeroColorRGBNameD(IntPtr path, double frameId, double red, double green, double blue); + /// + /// Fill the frame with random RGB values for the given frame. Animation is + /// referenced by id. + /// EXPORT_API void PluginFillRandomColors(int animationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillRandomColors(int animationId, int frameId); + /// + /// Fill the frame with random RGB values for all frames. Animation is referenced + /// by id. + /// EXPORT_API void PluginFillRandomColorsAllFrames(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillRandomColorsAllFrames(int animationId); + /// + /// Fill the frame with random RGB values for all frames. Animation is referenced + /// by name. + /// EXPORT_API void PluginFillRandomColorsAllFramesName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillRandomColorsAllFramesName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillRandomColorsAllFramesNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillRandomColorsAllFramesNameD(IntPtr path); + /// + /// Fill the frame with random black and white values for the specified frame. + /// Animation is referenced by id. + /// EXPORT_API void PluginFillRandomColorsBlackAndWhite(int animationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillRandomColorsBlackAndWhite(int animationId, int frameId); + /// + /// Fill the frame with random black and white values for all frames. Animation + /// is referenced by id. + /// EXPORT_API void PluginFillRandomColorsBlackAndWhiteAllFrames(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillRandomColorsBlackAndWhiteAllFrames(int animationId); + /// + /// Fill the frame with random black and white values for all frames. Animation + /// is referenced by name. + /// EXPORT_API void PluginFillRandomColorsBlackAndWhiteAllFramesName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillRandomColorsBlackAndWhiteAllFramesName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillRandomColorsBlackAndWhiteAllFramesNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillRandomColorsBlackAndWhiteAllFramesNameD(IntPtr path); + /// + /// Fill the frame with random black and white values for the specified frame. + /// Animation is referenced by name. + /// EXPORT_API void PluginFillRandomColorsBlackAndWhiteName(const char* path, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillRandomColorsBlackAndWhiteName(IntPtr path, int frameId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillRandomColorsBlackAndWhiteNameD(const char* path, double frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillRandomColorsBlackAndWhiteNameD(IntPtr path, double frameId); + /// + /// Fill the frame with random RGB values for the given frame. Animation is + /// referenced by name. + /// EXPORT_API void PluginFillRandomColorsName(const char* path, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillRandomColorsName(IntPtr path, int frameId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillRandomColorsNameD(const char* path, double frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillRandomColorsNameD(IntPtr path, double frameId); + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by id. + /// EXPORT_API void PluginFillThresholdColors(int animationId, int frameId, int threshold, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColors(int animationId, int frameId, int threshold, int color); + /// + /// Fill all frames with RGB color where the animation color is less than the + /// RGB threshold. Animation is referenced by id. + /// EXPORT_API void PluginFillThresholdColorsAllFrames(int animationId, int threshold, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsAllFrames(int animationId, int threshold, int color); + /// + /// Fill all frames with RGB color where the animation color is less than the + /// RGB threshold. Animation is referenced by name. + /// EXPORT_API void PluginFillThresholdColorsAllFramesName(const char* path, int threshold, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsAllFramesName(IntPtr path, int threshold, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillThresholdColorsAllFramesNameD(const char* path, double threshold, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillThresholdColorsAllFramesNameD(IntPtr path, double threshold, double color); + /// + /// Fill all frames with RGB color where the animation color is less than the + /// threshold. Animation is referenced by id. + /// EXPORT_API void PluginFillThresholdColorsAllFramesRGB(int animationId, int threshold, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsAllFramesRGB(int animationId, int threshold, int red, int green, int blue); + /// + /// Fill all frames with RGB color where the animation color is less than the + /// threshold. Animation is referenced by name. + /// EXPORT_API void PluginFillThresholdColorsAllFramesRGBName(const char* path, int threshold, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsAllFramesRGBName(IntPtr path, int threshold, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillThresholdColorsAllFramesRGBNameD(const char* path, double threshold, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillThresholdColorsAllFramesRGBNameD(IntPtr path, double threshold, double red, double green, double blue); + /// + /// Fill all frames with the min RGB color where the animation color is less + /// than the min threshold AND with the max RGB color where the animation is + /// more than the max threshold. Animation is referenced by id. + /// EXPORT_API void PluginFillThresholdColorsMinMaxAllFramesRGB(int animationId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsMinMaxAllFramesRGB(int animationId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + /// Fill all frames with the min RGB color where the animation color is less + /// than the min threshold AND with the max RGB color where the animation is + /// more than the max threshold. Animation is referenced by name. + /// EXPORT_API void PluginFillThresholdColorsMinMaxAllFramesRGBName(const char* path, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsMinMaxAllFramesRGBName(IntPtr path, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillThresholdColorsMinMaxAllFramesRGBNameD(const char* path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillThresholdColorsMinMaxAllFramesRGBNameD(IntPtr path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); + /// + /// Fill the specified frame with the min RGB color where the animation color + /// is less than the min threshold AND with the max RGB color where the animation + /// is more than the max threshold. Animation is referenced by id. + /// EXPORT_API void PluginFillThresholdColorsMinMaxRGB(int animationId, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsMinMaxRGB(int animationId, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + /// Fill the specified frame with the min RGB color where the animation color + /// is less than the min threshold AND with the max RGB color where the animation + /// is more than the max threshold. Animation is referenced by name. + /// EXPORT_API void PluginFillThresholdColorsMinMaxRGBName(const char* path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsMinMaxRGBName(IntPtr path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillThresholdColorsMinMaxRGBNameD(const char* path, double frameId, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillThresholdColorsMinMaxRGBNameD(IntPtr path, double frameId, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by name. + /// EXPORT_API void PluginFillThresholdColorsName(const char* path, int frameId, int threshold, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsName(IntPtr path, int frameId, int threshold, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillThresholdColorsNameD(const char* path, double frameId, double threshold, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillThresholdColorsNameD(IntPtr path, double frameId, double threshold, double color); + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by id. + /// EXPORT_API void PluginFillThresholdColorsRGB(int animationId, int frameId, int threshold, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsRGB(int animationId, int frameId, int threshold, int red, int green, int blue); + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by name. + /// EXPORT_API void PluginFillThresholdColorsRGBName(const char* path, int frameId, int threshold, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdColorsRGBName(IntPtr path, int frameId, int threshold, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillThresholdColorsRGBNameD(const char* path, double frameId, double threshold, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillThresholdColorsRGBNameD(IntPtr path, double frameId, double threshold, double red, double green, double blue); + /// + /// Fill all frames with RGB color where the animation color is less than the + /// RGB threshold. Animation is referenced by id. + /// EXPORT_API void PluginFillThresholdRGBColorsAllFramesRGB(int animationId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdRGBColorsAllFramesRGB(int animationId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); + /// + /// Fill all frames with RGB color where the animation color is less than the + /// RGB threshold. Animation is referenced by name. + /// EXPORT_API void PluginFillThresholdRGBColorsAllFramesRGBName(const char* path, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdRGBColorsAllFramesRGBName(IntPtr path, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillThresholdRGBColorsAllFramesRGBNameD(const char* path, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillThresholdRGBColorsAllFramesRGBNameD(IntPtr path, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue); + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by id. + /// EXPORT_API void PluginFillThresholdRGBColorsRGB(int animationId, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdRGBColorsRGB(int animationId, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); + /// + /// Fill the specified frame with RGB color where the animation color is less + /// than the RGB threshold. Animation is referenced by name. + /// EXPORT_API void PluginFillThresholdRGBColorsRGBName(const char* path, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillThresholdRGBColorsRGBName(IntPtr path, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillThresholdRGBColorsRGBNameD(const char* path, double frameId, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillThresholdRGBColorsRGBNameD(IntPtr path, double frameId, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue); + /// + /// Fill the specified frame with RGB color where the animation color is zero. + /// Animation is referenced by id. + /// EXPORT_API void PluginFillZeroColor(int animationId, int frameId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillZeroColor(int animationId, int frameId, int color); + /// + /// Fill all frames with RGB color where the animation color is zero. Animation + /// is referenced by id. + /// EXPORT_API void PluginFillZeroColorAllFrames(int animationId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillZeroColorAllFrames(int animationId, int color); + /// + /// Fill all frames with RGB color where the animation color is zero. Animation + /// is referenced by name. + /// EXPORT_API void PluginFillZeroColorAllFramesName(const char* path, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillZeroColorAllFramesName(IntPtr path, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillZeroColorAllFramesNameD(const char* path, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillZeroColorAllFramesNameD(IntPtr path, double color); + /// + /// Fill all frames with RGB color where the animation color is zero. Animation + /// is referenced by id. + /// EXPORT_API void PluginFillZeroColorAllFramesRGB(int animationId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillZeroColorAllFramesRGB(int animationId, int red, int green, int blue); + /// + /// Fill all frames with RGB color where the animation color is zero. Animation + /// is referenced by name. + /// EXPORT_API void PluginFillZeroColorAllFramesRGBName(const char* path, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillZeroColorAllFramesRGBName(IntPtr path, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillZeroColorAllFramesRGBNameD(const char* path, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillZeroColorAllFramesRGBNameD(IntPtr path, double red, double green, double blue); + /// + /// Fill the specified frame with RGB color where the animation color is zero. + /// Animation is referenced by name. + /// EXPORT_API void PluginFillZeroColorName(const char* path, int frameId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillZeroColorName(IntPtr path, int frameId, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillZeroColorNameD(const char* path, double frameId, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillZeroColorNameD(IntPtr path, double frameId, double color); + /// + /// Fill the specified frame with RGB color where the animation color is zero. + /// Animation is referenced by id. + /// EXPORT_API void PluginFillZeroColorRGB(int animationId, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillZeroColorRGB(int animationId, int frameId, int red, int green, int blue); + /// + /// Fill the specified frame with RGB color where the animation color is zero. + /// Animation is referenced by name. + /// EXPORT_API void PluginFillZeroColorRGBName(const char* path, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginFillZeroColorRGBName(IntPtr path, int frameId, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginFillZeroColorRGBNameD(const char* path, double frameId, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginFillZeroColorRGBNameD(IntPtr path, double frameId, double red, double green, double blue); + /// + /// Get the animation color for a frame given the `1D` `led`. The `led` should + /// be greater than or equal to 0 and less than the `MaxLeds`. Animation is + /// referenced by id. + /// EXPORT_API int PluginGet1DColor(int animationId, int frameId, int led); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGet1DColor(int animationId, int frameId, int led); + /// + /// Get the animation color for a frame given the `1D` `led`. The `led` should + /// be greater than or equal to 0 and less than the `MaxLeds`. Animation is + /// referenced by name. + /// EXPORT_API int PluginGet1DColorName(const char* path, int frameId, int led); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGet1DColorName(IntPtr path, int frameId, int led); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGet1DColorNameD(const char* path, double frameId, double led); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGet1DColorNameD(IntPtr path, double frameId, double led); + /// + /// Get the animation color for a frame given the `2D` `row` and `column`. The + /// `row` should be greater than or equal to 0 and less than the `MaxRow`. + /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. + /// Animation is referenced by id. + /// EXPORT_API int PluginGet2DColor(int animationId, int frameId, int row, int column); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGet2DColor(int animationId, int frameId, int row, int column); + /// + /// Get the animation color for a frame given the `2D` `row` and `column`. The + /// `row` should be greater than or equal to 0 and less than the `MaxRow`. + /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. + /// Animation is referenced by name. + /// EXPORT_API int PluginGet2DColorName(const char* path, int frameId, int row, int column); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGet2DColorName(IntPtr path, int frameId, int row, int column); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGet2DColorNameD(const char* path, double frameId, double row, double column); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGet2DColorNameD(IntPtr path, double frameId, double row, double column); + /// + /// Get the animation id for the named animation. + /// EXPORT_API int PluginGetAnimation(const char* name); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetAnimation(IntPtr name); + /// + /// `PluginGetAnimationCount` will return the number of loaded animations. + /// EXPORT_API int PluginGetAnimationCount(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetAnimationCount(); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetAnimationD(const char* name); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetAnimationD(IntPtr name); + /// + /// `PluginGetAnimationId` will return the `animationId` given the `index` of + /// the loaded animation. The `index` is zero-based and less than the number + /// returned by `PluginGetAnimationCount`. Use `PluginGetAnimationName` to + /// get the name of the animation. + /// EXPORT_API int PluginGetAnimationId(int index); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetAnimationId(int index); + /// + /// `PluginGetAnimationName` takes an `animationId` and returns the name of + /// the animation of the `.chroma` animation file. If a name is not available + /// then an empty string will be returned. + /// EXPORT_API const char* PluginGetAnimationName(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern IntPtr PluginGetAnimationName(int animationId); + /// + /// Get the current frame of the animation referenced by id. + /// EXPORT_API int PluginGetCurrentFrame(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetCurrentFrame(int animationId); + /// + /// Get the current frame of the animation referenced by name. + /// EXPORT_API int PluginGetCurrentFrameName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetCurrentFrameName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetCurrentFrameNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetCurrentFrameNameD(IntPtr path); + /// + /// Returns the `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` of a `Chroma` + /// animation respective to the `deviceType`, as an integer upon success. Returns + /// negative one upon failure. + /// EXPORT_API int PluginGetDevice(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetDevice(int animationId); + /// + /// Returns the `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` of a `Chroma` + /// animation respective to the `deviceType`, as an integer upon success. Returns + /// negative one upon failure. + /// EXPORT_API int PluginGetDeviceName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetDeviceName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetDeviceNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetDeviceNameD(IntPtr path); + /// + /// Returns the `EChromaSDKDeviceTypeEnum` of a `Chroma` animation as an integer + /// upon success. Returns negative one upon failure. + /// EXPORT_API int PluginGetDeviceType(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetDeviceType(int animationId); + /// + /// Returns the `EChromaSDKDeviceTypeEnum` of a `Chroma` animation as an integer + /// upon success. Returns negative one upon failure. + /// EXPORT_API int PluginGetDeviceTypeName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetDeviceTypeName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetDeviceTypeNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetDeviceTypeNameD(IntPtr path); + /// + /// Get the frame colors and duration (in seconds) for a `Chroma` animation + /// referenced by id. The `color` is expected to be an array of the expected + /// dimensions for the `deviceType/device`. The `length` parameter is the size + /// of the `color` array. For `EChromaSDKDevice1DEnum` the array size should + /// be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should be `MAX + /// ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard + /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the + /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. + /// Returns the animation id upon success. Returns negative one upon failure. + /// + /// EXPORT_API int PluginGetFrame(int animationId, int frameIndex, float* duration, int* colors, int length, int* keys, int keysLength); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetFrame(int animationId, int frameIndex, out float duration, int[] colors, int length, int[] keys, int keysLength); + /// + /// Returns the frame count of a `Chroma` animation upon success. Returns negative + /// one upon failure. + /// EXPORT_API int PluginGetFrameCount(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetFrameCount(int animationId); + /// + /// Returns the frame count of a `Chroma` animation upon success. Returns negative + /// one upon failure. + /// EXPORT_API int PluginGetFrameCountName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetFrameCountName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetFrameCountNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetFrameCountNameD(IntPtr path); + /// + /// Get the frame colors and duration (in seconds) for a `Chroma` animation + /// referenced by name. The `color` is expected to be an array of the expected + /// dimensions for the `deviceType/device`. The `length` parameter is the size + /// of the `color` array. For `EChromaSDKDevice1DEnum` the array size should + /// be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should be `MAX + /// ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard + /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the + /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. + /// Returns the animation id upon success. Returns negative one upon failure. + /// + /// EXPORT_API int PluginGetFrameName(const char* path, int frameIndex, float* duration, int* colors, int length, int* keys, int keysLength); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetFrameName(IntPtr path, int frameIndex, out float duration, int[] colors, int length, int[] keys, int keysLength); + /// + /// Get the color of an animation key for the given frame referenced by id. + /// + /// EXPORT_API int PluginGetKeyColor(int animationId, int frameId, int rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetKeyColor(int animationId, int frameId, int rzkey); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetKeyColorD(const char* path, double frameId, double rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetKeyColorD(IntPtr path, double frameId, double rzkey); + /// + /// Get the color of an animation key for the given frame referenced by name. + /// + /// EXPORT_API int PluginGetKeyColorName(const char* path, int frameId, int rzkey); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetKeyColorName(IntPtr path, int frameId, int rzkey); + /// + /// Returns `RZRESULT_SUCCESS` if the plugin has been initialized successfully. + /// Returns `RZRESULT_DLL_NOT_FOUND` if core Chroma library is not found. Returns + /// `RZRESULT_DLL_INVALID_SIGNATURE` if core Chroma library has an invalid + /// signature. + /// EXPORT_API RZRESULT PluginGetLibraryLoadedState(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetLibraryLoadedState(); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetLibraryLoadedStateD(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetLibraryLoadedStateD(); + /// + /// Returns the `MAX COLUMN` given the `EChromaSDKDevice2DEnum` device as an + /// integer upon success. Returns negative one upon failure. + /// EXPORT_API int PluginGetMaxColumn(int device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetMaxColumn(int device); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetMaxColumnD(double device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetMaxColumnD(double device); + /// + /// Returns the MAX LEDS given the `EChromaSDKDevice1DEnum` device as an integer + /// upon success. Returns negative one upon failure. + /// EXPORT_API int PluginGetMaxLeds(int device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetMaxLeds(int device); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetMaxLedsD(double device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetMaxLedsD(double device); + /// + /// Returns the `MAX ROW` given the `EChromaSDKDevice2DEnum` device as an integer + /// upon success. Returns negative one upon failure. + /// EXPORT_API int PluginGetMaxRow(int device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetMaxRow(int device); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetMaxRowD(double device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetMaxRowD(double device); + /// + /// `PluginGetPlayingAnimationCount` will return the number of playing animations. + /// + /// EXPORT_API int PluginGetPlayingAnimationCount(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetPlayingAnimationCount(); + /// + /// `PluginGetPlayingAnimationId` will return the `animationId` given the `index` + /// of the playing animation. The `index` is zero-based and less than the number + /// returned by `PluginGetPlayingAnimationCount`. Use `PluginGetAnimationName` + /// to get the name of the animation. + /// EXPORT_API int PluginGetPlayingAnimationId(int index); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetPlayingAnimationId(int index); + /// + /// Get the RGB color given red, green, and blue. + /// EXPORT_API int PluginGetRGB(int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginGetRGB(int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginGetRGBD(double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginGetRGBD(double red, double green, double blue); + /// + /// Check if the animation has loop enabled referenced by id. + /// EXPORT_API bool PluginHasAnimationLoop(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginHasAnimationLoop(int animationId); + /// + /// Check if the animation has loop enabled referenced by name. + /// EXPORT_API bool PluginHasAnimationLoopName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginHasAnimationLoopName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginHasAnimationLoopNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginHasAnimationLoopNameD(IntPtr path); + /// + /// Initialize the ChromaSDK. Zero indicates success, otherwise failure. Many + /// API methods auto initialize the ChromaSDK if not already initialized. + /// EXPORT_API RZRESULT PluginInit(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginInit(); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginInitD(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginInitD(); + /// + /// Initialize the ChromaSDK. AppInfo populates the details in Synapse. Zero + /// indicates success, otherwise failure. Many API methods auto initialize + /// the ChromaSDK if not already initialized. + /// EXPORT_API RZRESULT PluginInitSDK(ChromaSDK::APPINFOTYPE* AppInfo); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginInitSDK(ref ChromaSDK.APPINFOTYPE appInfo); + /// + /// Insert an animation delay by duplicating the frame by the delay number of + /// times. Animation is referenced by id. + /// EXPORT_API void PluginInsertDelay(int animationId, int frameId, int delay); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginInsertDelay(int animationId, int frameId, int delay); + /// + /// Insert an animation delay by duplicating the frame by the delay number of + /// times. Animation is referenced by name. + /// EXPORT_API void PluginInsertDelayName(const char* path, int frameId, int delay); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginInsertDelayName(IntPtr path, int frameId, int delay); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginInsertDelayNameD(const char* path, double frameId, double delay); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginInsertDelayNameD(IntPtr path, double frameId, double delay); + /// + /// Duplicate the source frame index at the target frame index. Animation is + /// referenced by id. + /// EXPORT_API void PluginInsertFrame(int animationId, int sourceFrame, int targetFrame); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginInsertFrame(int animationId, int sourceFrame, int targetFrame); + /// + /// Duplicate the source frame index at the target frame index. Animation is + /// referenced by name. + /// EXPORT_API void PluginInsertFrameName(const char* path, int sourceFrame, int targetFrame); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginInsertFrameName(IntPtr path, int sourceFrame, int targetFrame); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginInsertFrameNameD(const char* path, double sourceFrame, double targetFrame); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginInsertFrameNameD(IntPtr path, double sourceFrame, double targetFrame); + /// + /// Invert all the colors at the specified frame. Animation is referenced by + /// id. + /// EXPORT_API void PluginInvertColors(int animationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginInvertColors(int animationId, int frameId); + /// + /// Invert all the colors for all frames. Animation is referenced by id. + /// EXPORT_API void PluginInvertColorsAllFrames(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginInvertColorsAllFrames(int animationId); + /// + /// Invert all the colors for all frames. Animation is referenced by name. + /// EXPORT_API void PluginInvertColorsAllFramesName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginInvertColorsAllFramesName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginInvertColorsAllFramesNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginInvertColorsAllFramesNameD(IntPtr path); + /// + /// Invert all the colors at the specified frame. Animation is referenced by + /// name. + /// EXPORT_API void PluginInvertColorsName(const char* path, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginInvertColorsName(IntPtr path, int frameId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginInvertColorsNameD(const char* path, double frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginInvertColorsNameD(IntPtr path, double frameId); + /// + /// Check if the animation is paused referenced by id. + /// EXPORT_API bool PluginIsAnimationPaused(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginIsAnimationPaused(int animationId); + /// + /// Check if the animation is paused referenced by name. + /// EXPORT_API bool PluginIsAnimationPausedName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginIsAnimationPausedName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginIsAnimationPausedNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginIsAnimationPausedNameD(IntPtr path); + /// + /// The editor dialog is a non-blocking modal window, this method returns true + /// if the modal window is open, otherwise false. + /// EXPORT_API bool PluginIsDialogOpen(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginIsDialogOpen(); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginIsDialogOpenD(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginIsDialogOpenD(); + /// + /// Returns true if the plugin has been initialized. Returns false if the plugin + /// is uninitialized. + /// EXPORT_API bool PluginIsInitialized(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginIsInitialized(); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginIsInitializedD(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginIsInitializedD(); + /// + /// If the method can be invoked the method returns true. + /// EXPORT_API bool PluginIsPlatformSupported(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginIsPlatformSupported(); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginIsPlatformSupportedD(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginIsPlatformSupportedD(); + /// + /// `PluginIsPlayingName` automatically handles initializing the `ChromaSDK`. + /// The named `.chroma` animation file will be automatically opened. The method + /// will return whether the animation is playing or not. Animation is referenced + /// by id. + /// EXPORT_API bool PluginIsPlaying(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginIsPlaying(int animationId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginIsPlayingD(double animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginIsPlayingD(double animationId); + /// + /// `PluginIsPlayingName` automatically handles initializing the `ChromaSDK`. + /// The named `.chroma` animation file will be automatically opened. The method + /// will return whether the animation is playing or not. Animation is referenced + /// by name. + /// EXPORT_API bool PluginIsPlayingName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginIsPlayingName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginIsPlayingNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginIsPlayingNameD(IntPtr path); + /// + /// `PluginIsPlayingType` automatically handles initializing the `ChromaSDK`. + /// If any animation is playing for the `deviceType` and `device` combination, + /// the method will return true, otherwise false. + /// EXPORT_API bool PluginIsPlayingType(int deviceType, int device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + private static extern bool PluginIsPlayingType(int deviceType, int device); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginIsPlayingTypeD(double deviceType, double device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginIsPlayingTypeD(double deviceType, double device); + /// + /// Do a lerp math operation on a float. + /// EXPORT_API float PluginLerp(float start, float end, float amt); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern float PluginLerp(float start, float end, float amt); + /// + /// Lerp from one color to another given t in the range 0.0 to 1.0. + /// EXPORT_API int PluginLerpColor(int from, int to, float t); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginLerpColor(int from, int to, float t); + /// + /// Loads `Chroma` effects so that the animation can be played immediately. + /// Returns the animation id upon success. Returns negative one upon failure. + /// + /// EXPORT_API int PluginLoadAnimation(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginLoadAnimation(int animationId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginLoadAnimationD(double animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginLoadAnimationD(double animationId); + /// + /// Load the named animation. + /// EXPORT_API void PluginLoadAnimationName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginLoadAnimationName(IntPtr path); + /// + /// Load a composite set of animations. + /// EXPORT_API void PluginLoadComposite(const char* name); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginLoadComposite(IntPtr name); + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color defaults to color. Animation + /// is referenced by id. + /// EXPORT_API void PluginMakeBlankFrames(int animationId, int frameCount, float duration, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMakeBlankFrames(int animationId, int frameCount, float duration, int color); + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color defaults to color. Animation + /// is referenced by name. + /// EXPORT_API void PluginMakeBlankFramesName(const char* path, int frameCount, float duration, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMakeBlankFramesName(IntPtr path, int frameCount, float duration, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMakeBlankFramesNameD(const char* path, double frameCount, double duration, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMakeBlankFramesNameD(IntPtr path, double frameCount, double duration, double color); + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color is random. Animation is referenced + /// by id. + /// EXPORT_API void PluginMakeBlankFramesRandom(int animationId, int frameCount, float duration); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMakeBlankFramesRandom(int animationId, int frameCount, float duration); + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color is random black and white. Animation + /// is referenced by id. + /// EXPORT_API void PluginMakeBlankFramesRandomBlackAndWhite(int animationId, int frameCount, float duration); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMakeBlankFramesRandomBlackAndWhite(int animationId, int frameCount, float duration); + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color is random black and white. Animation + /// is referenced by name. + /// EXPORT_API void PluginMakeBlankFramesRandomBlackAndWhiteName(const char* path, int frameCount, float duration); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMakeBlankFramesRandomBlackAndWhiteName(IntPtr path, int frameCount, float duration); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMakeBlankFramesRandomBlackAndWhiteNameD(const char* path, double frameCount, double duration); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMakeBlankFramesRandomBlackAndWhiteNameD(IntPtr path, double frameCount, double duration); + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color is random. Animation is referenced + /// by name. + /// EXPORT_API void PluginMakeBlankFramesRandomName(const char* path, int frameCount, float duration); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMakeBlankFramesRandomName(IntPtr path, int frameCount, float duration); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMakeBlankFramesRandomNameD(const char* path, double frameCount, double duration); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMakeBlankFramesRandomNameD(IntPtr path, double frameCount, double duration); + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color defaults to color. Animation + /// is referenced by id. + /// EXPORT_API void PluginMakeBlankFramesRGB(int animationId, int frameCount, float duration, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMakeBlankFramesRGB(int animationId, int frameCount, float duration, int red, int green, int blue); + /// + /// Make a blank animation for the length of the frame count. Frame duration + /// defaults to the duration. The frame color defaults to color. Animation + /// is referenced by name. + /// EXPORT_API void PluginMakeBlankFramesRGBName(const char* path, int frameCount, float duration, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMakeBlankFramesRGBName(IntPtr path, int frameCount, float duration, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMakeBlankFramesRGBNameD(const char* path, double frameCount, double duration, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMakeBlankFramesRGBNameD(IntPtr path, double frameCount, double duration, double red, double green, double blue); + /// + /// Flips the color grid horizontally for all `Chroma` animation frames. Returns + /// the animation id upon success. Returns negative one upon failure. + /// EXPORT_API int PluginMirrorHorizontally(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginMirrorHorizontally(int animationId); + /// + /// Flips the color grid vertically for all `Chroma` animation frames. This + /// method has no effect for `EChromaSDKDevice1DEnum` devices. Returns the + /// animation id upon success. Returns negative one upon failure. + /// EXPORT_API int PluginMirrorVertically(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginMirrorVertically(int animationId); + /// + /// Multiply the color intensity with the lerp result from color 1 to color + /// 2 using the frame index divided by the frame count for the `t` parameter. + /// Animation is referenced in id. + /// EXPORT_API void PluginMultiplyColorLerpAllFrames(int animationId, int color1, int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyColorLerpAllFrames(int animationId, int color1, int color2); + /// + /// Multiply the color intensity with the lerp result from color 1 to color + /// 2 using the frame index divided by the frame count for the `t` parameter. + /// Animation is referenced in name. + /// EXPORT_API void PluginMultiplyColorLerpAllFramesName(const char* path, int color1, int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyColorLerpAllFramesName(IntPtr path, int color1, int color2); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyColorLerpAllFramesNameD(const char* path, double color1, double color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyColorLerpAllFramesNameD(IntPtr path, double color1, double color2); + /// + /// Multiply all the colors in the frame by the intensity value. The valid the + /// intensity range is from 0.0 to 255.0. RGB components are multiplied equally. + /// An intensity of 0.5 would half the color value. Black colors in the frame + /// will not be affected by this method. + /// EXPORT_API void PluginMultiplyIntensity(int animationId, int frameId, float intensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensity(int animationId, int frameId, float intensity); + /// + /// Multiply all the colors for all frames by the intensity value. The valid + /// the intensity range is from 0.0 to 255.0. RGB components are multiplied + /// equally. An intensity of 0.5 would half the color value. Black colors in + /// the frame will not be affected by this method. + /// EXPORT_API void PluginMultiplyIntensityAllFrames(int animationId, float intensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityAllFrames(int animationId, float intensity); + /// + /// Multiply all the colors for all frames by the intensity value. The valid + /// the intensity range is from 0.0 to 255.0. RGB components are multiplied + /// equally. An intensity of 0.5 would half the color value. Black colors in + /// the frame will not be affected by this method. + /// EXPORT_API void PluginMultiplyIntensityAllFramesName(const char* path, float intensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityAllFramesName(IntPtr path, float intensity); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyIntensityAllFramesNameD(const char* path, double intensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyIntensityAllFramesNameD(IntPtr path, double intensity); + /// + /// Multiply all frames by the RBG color intensity. Animation is referenced + /// by id. + /// EXPORT_API void PluginMultiplyIntensityAllFramesRGB(int animationId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityAllFramesRGB(int animationId, int red, int green, int blue); + /// + /// Multiply all frames by the RBG color intensity. Animation is referenced + /// by name. + /// EXPORT_API void PluginMultiplyIntensityAllFramesRGBName(const char* path, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityAllFramesRGBName(IntPtr path, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyIntensityAllFramesRGBNameD(const char* path, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyIntensityAllFramesRGBNameD(IntPtr path, double red, double green, double blue); + /// + /// Multiply the specific frame by the RBG color intensity. Animation is referenced + /// by id. + /// EXPORT_API void PluginMultiplyIntensityColor(int animationId, int frameId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityColor(int animationId, int frameId, int color); + /// + /// Multiply all frames by the RBG color intensity. Animation is referenced + /// by id. + /// EXPORT_API void PluginMultiplyIntensityColorAllFrames(int animationId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityColorAllFrames(int animationId, int color); + /// + /// Multiply all frames by the RBG color intensity. Animation is referenced + /// by name. + /// EXPORT_API void PluginMultiplyIntensityColorAllFramesName(const char* path, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityColorAllFramesName(IntPtr path, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyIntensityColorAllFramesNameD(const char* path, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyIntensityColorAllFramesNameD(IntPtr path, double color); + /// + /// Multiply the specific frame by the RBG color intensity. Animation is referenced + /// by name. + /// EXPORT_API void PluginMultiplyIntensityColorName(const char* path, int frameId, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityColorName(IntPtr path, int frameId, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyIntensityColorNameD(const char* path, double frameId, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyIntensityColorNameD(IntPtr path, double frameId, double color); + /// + /// Multiply all the colors in the frame by the intensity value. The valid the + /// intensity range is from 0.0 to 255.0. RGB components are multiplied equally. + /// An intensity of 0.5 would half the color value. Black colors in the frame + /// will not be affected by this method. + /// EXPORT_API void PluginMultiplyIntensityName(const char* path, int frameId, float intensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityName(IntPtr path, int frameId, float intensity); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyIntensityNameD(const char* path, double frameId, double intensity); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyIntensityNameD(IntPtr path, double frameId, double intensity); + /// + /// Multiply the specific frame by the RBG color intensity. Animation is referenced + /// by id. + /// EXPORT_API void PluginMultiplyIntensityRGB(int animationId, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityRGB(int animationId, int frameId, int red, int green, int blue); + /// + /// Multiply the specific frame by the RBG color intensity. Animation is referenced + /// by name. + /// EXPORT_API void PluginMultiplyIntensityRGBName(const char* path, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyIntensityRGBName(IntPtr path, int frameId, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyIntensityRGBNameD(const char* path, double frameId, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyIntensityRGBNameD(IntPtr path, double frameId, double red, double green, double blue); + /// + /// Multiply the specific frame by the color lerp result between color 1 and + /// 2 using the frame color value as the `t` value. Animation is referenced + /// by id. + /// EXPORT_API void PluginMultiplyNonZeroTargetColorLerp(int animationId, int frameId, int color1, int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyNonZeroTargetColorLerp(int animationId, int frameId, int color1, int color2); + /// + /// Multiply all frames by the color lerp result between color 1 and 2 using + /// the frame color value as the `t` value. Animation is referenced by id. + /// + /// EXPORT_API void PluginMultiplyNonZeroTargetColorLerpAllFrames(int animationId, int color1, int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyNonZeroTargetColorLerpAllFrames(int animationId, int color1, int color2); + /// + /// Multiply all frames by the color lerp result between color 1 and 2 using + /// the frame color value as the `t` value. Animation is referenced by name. + /// + /// EXPORT_API void PluginMultiplyNonZeroTargetColorLerpAllFramesName(const char* path, int color1, int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyNonZeroTargetColorLerpAllFramesName(IntPtr path, int color1, int color2); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyNonZeroTargetColorLerpAllFramesNameD(const char* path, double color1, double color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyNonZeroTargetColorLerpAllFramesNameD(IntPtr path, double color1, double color2); + /// + /// Multiply the specific frame by the color lerp result between RGB 1 and 2 + /// using the frame color value as the `t` value. Animation is referenced by + /// id. + /// EXPORT_API void PluginMultiplyNonZeroTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyNonZeroTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2); + /// + /// Multiply the specific frame by the color lerp result between RGB 1 and 2 + /// using the frame color value as the `t` value. Animation is referenced by + /// name. + /// EXPORT_API void PluginMultiplyNonZeroTargetColorLerpAllFramesRGBName(const char* path, int red1, int green1, int blue1, int red2, int green2, int blue2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyNonZeroTargetColorLerpAllFramesRGBName(IntPtr path, int red1, int green1, int blue1, int red2, int green2, int blue2); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyNonZeroTargetColorLerpAllFramesRGBNameD(const char* path, double red1, double green1, double blue1, double red2, double green2, double blue2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyNonZeroTargetColorLerpAllFramesRGBNameD(IntPtr path, double red1, double green1, double blue1, double red2, double green2, double blue2); + /// + /// Multiply the specific frame by the color lerp result between color 1 and + /// 2 using the frame color value as the `t` value. Animation is referenced + /// by id. + /// EXPORT_API void PluginMultiplyTargetColorLerp(int animationId, int frameId, int color1, int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyTargetColorLerp(int animationId, int frameId, int color1, int color2); + /// + /// Multiply all frames by the color lerp result between color 1 and 2 using + /// the frame color value as the `t` value. Animation is referenced by id. + /// + /// EXPORT_API void PluginMultiplyTargetColorLerpAllFrames(int animationId, int color1, int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyTargetColorLerpAllFrames(int animationId, int color1, int color2); + /// + /// Multiply all frames by the color lerp result between color 1 and 2 using + /// the frame color value as the `t` value. Animation is referenced by name. + /// + /// EXPORT_API void PluginMultiplyTargetColorLerpAllFramesName(const char* path, int color1, int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyTargetColorLerpAllFramesName(IntPtr path, int color1, int color2); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyTargetColorLerpAllFramesNameD(const char* path, double color1, double color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyTargetColorLerpAllFramesNameD(IntPtr path, double color1, double color2); + /// + /// Multiply all frames by the color lerp result between RGB 1 and 2 using the + /// frame color value as the `t` value. Animation is referenced by id. + /// EXPORT_API void PluginMultiplyTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2); + /// + /// Multiply all frames by the color lerp result between RGB 1 and 2 using the + /// frame color value as the `t` value. Animation is referenced by name. + /// EXPORT_API void PluginMultiplyTargetColorLerpAllFramesRGBName(const char* path, int red1, int green1, int blue1, int red2, int green2, int blue2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyTargetColorLerpAllFramesRGBName(IntPtr path, int red1, int green1, int blue1, int red2, int green2, int blue2); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginMultiplyTargetColorLerpAllFramesRGBNameD(const char* path, double red1, double green1, double blue1, double red2, double green2, double blue2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginMultiplyTargetColorLerpAllFramesRGBNameD(IntPtr path, double red1, double green1, double blue1, double red2, double green2, double blue2); + /// + /// Multiply the specific frame by the color lerp result between color 1 and + /// 2 using the frame color value as the `t` value. Animation is referenced + /// by name. + /// EXPORT_API void PluginMultiplyTargetColorLerpName(const char* path, int frameId, int color1, int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginMultiplyTargetColorLerpName(IntPtr path, int frameId, int color1, int color2); + /// + /// Offset all colors in the frame using the RGB offset. Use the range of -255 + /// to 255 for red, green, and blue parameters. Negative values remove color. + /// Positive values add color. + /// EXPORT_API void PluginOffsetColors(int animationId, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginOffsetColors(int animationId, int frameId, int red, int green, int blue); + /// + /// Offset all colors for all frames using the RGB offset. Use the range of + /// -255 to 255 for red, green, and blue parameters. Negative values remove + /// color. Positive values add color. + /// EXPORT_API void PluginOffsetColorsAllFrames(int animationId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginOffsetColorsAllFrames(int animationId, int red, int green, int blue); + /// + /// Offset all colors for all frames using the RGB offset. Use the range of + /// -255 to 255 for red, green, and blue parameters. Negative values remove + /// color. Positive values add color. + /// EXPORT_API void PluginOffsetColorsAllFramesName(const char* path, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginOffsetColorsAllFramesName(IntPtr path, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginOffsetColorsAllFramesNameD(const char* path, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginOffsetColorsAllFramesNameD(IntPtr path, double red, double green, double blue); + /// + /// Offset all colors in the frame using the RGB offset. Use the range of -255 + /// to 255 for red, green, and blue parameters. Negative values remove color. + /// Positive values add color. + /// EXPORT_API void PluginOffsetColorsName(const char* path, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginOffsetColorsName(IntPtr path, int frameId, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginOffsetColorsNameD(const char* path, double frameId, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginOffsetColorsNameD(IntPtr path, double frameId, double red, double green, double blue); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Offset a subset of colors in the frame using the RGB offset. + /// Use the range of -255 to 255 for red, green, and blue parameters. Negative + /// values remove color. Positive values add color. + /// EXPORT_API void PluginOffsetNonZeroColors(int animationId, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginOffsetNonZeroColors(int animationId, int frameId, int red, int green, int blue); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Offset a subset of colors for all frames using the RGB offset. + /// Use the range of -255 to 255 for red, green, and blue parameters. Negative + /// values remove color. Positive values add color. + /// EXPORT_API void PluginOffsetNonZeroColorsAllFrames(int animationId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginOffsetNonZeroColorsAllFrames(int animationId, int red, int green, int blue); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Offset a subset of colors for all frames using the RGB offset. + /// Use the range of -255 to 255 for red, green, and blue parameters. Negative + /// values remove color. Positive values add color. + /// EXPORT_API void PluginOffsetNonZeroColorsAllFramesName(const char* path, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginOffsetNonZeroColorsAllFramesName(IntPtr path, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginOffsetNonZeroColorsAllFramesNameD(const char* path, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginOffsetNonZeroColorsAllFramesNameD(IntPtr path, double red, double green, double blue); + /// + /// This method will only update colors in the animation that are not already + /// set to black. Offset a subset of colors in the frame using the RGB offset. + /// Use the range of -255 to 255 for red, green, and blue parameters. Negative + /// values remove color. Positive values add color. + /// EXPORT_API void PluginOffsetNonZeroColorsName(const char* path, int frameId, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginOffsetNonZeroColorsName(IntPtr path, int frameId, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginOffsetNonZeroColorsNameD(const char* path, double frameId, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginOffsetNonZeroColorsNameD(IntPtr path, double frameId, double red, double green, double blue); + /// + /// Opens a `Chroma` animation file so that it can be played. Returns an animation + /// id >= 0 upon success. Returns negative one if there was a failure. The + /// animation id is used in most of the API methods. + /// EXPORT_API int PluginOpenAnimation(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginOpenAnimation(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginOpenAnimationD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginOpenAnimationD(IntPtr path); + /// + /// Opens a `Chroma` animation data from memory so that it can be played. `Data` + /// is a pointer to BYTE array of the loaded animation in memory. `Name` will + /// be assigned to the animation when loaded. Returns an animation id >= 0 + /// upon success. Returns negative one if there was a failure. The animation + /// id is used in most of the API methods. + /// EXPORT_API int PluginOpenAnimationFromMemory(const BYTE* data, const char* name); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginOpenAnimationFromMemory(byte[] data, IntPtr name); + /// + /// Opens a `Chroma` animation file with the `.chroma` extension. Returns zero + /// upon success. Returns negative one if there was a failure. + /// EXPORT_API int PluginOpenEditorDialog(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginOpenEditorDialog(IntPtr path); + /// + /// Open the named animation in the editor dialog and play the animation at + /// start. + /// EXPORT_API int PluginOpenEditorDialogAndPlay(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginOpenEditorDialogAndPlay(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginOpenEditorDialogAndPlayD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginOpenEditorDialogAndPlayD(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginOpenEditorDialogD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginOpenEditorDialogD(IntPtr path); + /// + /// Sets the `duration` for all grames in the `Chroma` animation to the `duration` + /// parameter. Returns the animation id upon success. Returns negative one + /// upon failure. + /// EXPORT_API int PluginOverrideFrameDuration(int animationId, float duration); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginOverrideFrameDuration(int animationId, float duration); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginOverrideFrameDurationD(double animationId, double duration); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginOverrideFrameDurationD(double animationId, double duration); + /// + /// Override the duration of all frames with the `duration` value. Animation + /// is referenced by name. + /// EXPORT_API void PluginOverrideFrameDurationName(const char* path, float duration); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginOverrideFrameDurationName(IntPtr path, float duration); + /// + /// Pause the current animation referenced by id. + /// EXPORT_API void PluginPauseAnimation(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginPauseAnimation(int animationId); + /// + /// Pause the current animation referenced by name. + /// EXPORT_API void PluginPauseAnimationName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginPauseAnimationName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginPauseAnimationNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginPauseAnimationNameD(IntPtr path); + /// + /// Plays the `Chroma` animation. This will load the animation, if not loaded + /// previously. Returns the animation id upon success. Returns negative one + /// upon failure. + /// EXPORT_API int PluginPlayAnimation(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginPlayAnimation(int animationId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginPlayAnimationD(double animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginPlayAnimationD(double animationId); + /// + /// `PluginPlayAnimationFrame` automatically handles initializing the `ChromaSDK`. + /// The method will play the animation given the `animationId` with looping + /// `on` or `off` starting at the `frameId`. + /// EXPORT_API void PluginPlayAnimationFrame(int animationId, int frameId, bool loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginPlayAnimationFrame(int animationId, int frameId, bool loop); + /// + /// `PluginPlayAnimationFrameName` automatically handles initializing the `ChromaSDK`. + /// The named `.chroma` animation file will be automatically opened. The animation + /// will play with looping `on` or `off` starting at the `frameId`. + /// EXPORT_API void PluginPlayAnimationFrameName(const char* path, int frameId, bool loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginPlayAnimationFrameName(IntPtr path, int frameId, bool loop); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginPlayAnimationFrameNameD(const char* path, double frameId, double loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginPlayAnimationFrameNameD(IntPtr path, double frameId, double loop); + /// + /// `PluginPlayAnimationLoop` automatically handles initializing the `ChromaSDK`. + /// The method will play the animation given the `animationId` with looping + /// `on` or `off`. + /// EXPORT_API void PluginPlayAnimationLoop(int animationId, bool loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginPlayAnimationLoop(int animationId, bool loop); + /// + /// `PluginPlayAnimationName` automatically handles initializing the `ChromaSDK`. + /// The named `.chroma` animation file will be automatically opened. The animation + /// will play with looping `on` or `off`. + /// EXPORT_API void PluginPlayAnimationName(const char* path, bool loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginPlayAnimationName(IntPtr path, bool loop); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginPlayAnimationNameD(const char* path, double loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginPlayAnimationNameD(IntPtr path, double loop); + /// + /// `PluginPlayComposite` automatically handles initializing the `ChromaSDK`. + /// The named animation files for the `.chroma` set will be automatically opened. + /// The set of animations will play with looping `on` or `off`. + /// EXPORT_API void PluginPlayComposite(const char* name, bool loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginPlayComposite(IntPtr name, bool loop); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginPlayCompositeD(const char* name, double loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginPlayCompositeD(IntPtr name, double loop); + /// + /// Displays the `Chroma` animation frame on `Chroma` hardware given the `frameIndex`. + /// Returns the animation id upon success. Returns negative one upon failure. + /// + /// EXPORT_API int PluginPreviewFrame(int animationId, int frameIndex); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginPreviewFrame(int animationId, int frameIndex); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginPreviewFrameD(double animationId, double frameIndex); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginPreviewFrameD(double animationId, double frameIndex); + /// + /// Displays the `Chroma` animation frame on `Chroma` hardware given the `frameIndex`. + /// Animaton is referenced by name. + /// EXPORT_API void PluginPreviewFrameName(const char* path, int frameIndex); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginPreviewFrameName(IntPtr path, int frameIndex); + /// + /// Reduce the frames of the animation by removing every nth element. Animation + /// is referenced by id. + /// EXPORT_API void PluginReduceFrames(int animationId, int n); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginReduceFrames(int animationId, int n); + /// + /// Reduce the frames of the animation by removing every nth element. Animation + /// is referenced by name. + /// EXPORT_API void PluginReduceFramesName(const char* path, int n); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginReduceFramesName(IntPtr path, int n); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginReduceFramesNameD(const char* path, double n); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginReduceFramesNameD(IntPtr path, double n); + /// + /// Resets the `Chroma` animation to 1 blank frame. Returns the animation id + /// upon success. Returns negative one upon failure. + /// EXPORT_API int PluginResetAnimation(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginResetAnimation(int animationId); + /// + /// Resume the animation with loop `ON` or `OFF` referenced by id. + /// EXPORT_API void PluginResumeAnimation(int animationId, bool loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginResumeAnimation(int animationId, bool loop); + /// + /// Resume the animation with loop `ON` or `OFF` referenced by name. + /// EXPORT_API void PluginResumeAnimationName(const char* path, bool loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginResumeAnimationName(IntPtr path, bool loop); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginResumeAnimationNameD(const char* path, double loop); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginResumeAnimationNameD(IntPtr path, double loop); + /// + /// Reverse the animation frame order of the `Chroma` animation. Returns the + /// animation id upon success. Returns negative one upon failure. Animation + /// is referenced by id. + /// EXPORT_API int PluginReverse(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginReverse(int animationId); + /// + /// Reverse the animation frame order of the `Chroma` animation. Animation is + /// referenced by id. + /// EXPORT_API void PluginReverseAllFrames(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginReverseAllFrames(int animationId); + /// + /// Reverse the animation frame order of the `Chroma` animation. Animation is + /// referenced by name. + /// EXPORT_API void PluginReverseAllFramesName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginReverseAllFramesName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginReverseAllFramesNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginReverseAllFramesNameD(IntPtr path); + /// + /// Save the animation referenced by id to the path specified. + /// EXPORT_API int PluginSaveAnimation(int animationId, const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginSaveAnimation(int animationId, IntPtr path); + /// + /// Save the named animation to the target path specified. + /// EXPORT_API int PluginSaveAnimationName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginSaveAnimationName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Set the animation color for a frame given the `1D` `led`. The `led` should + /// be greater than or equal to 0 and less than the `MaxLeds`. The animation + /// is referenced by id. + /// EXPORT_API void PluginSet1DColor(int animationId, int frameId, int led, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSet1DColor(int animationId, int frameId, int led, int color); + /// + /// Set the animation color for a frame given the `1D` `led`. The `led` should + /// be greater than or equal to 0 and less than the `MaxLeds`. The animation + /// is referenced by name. + /// EXPORT_API void PluginSet1DColorName(const char* path, int frameId, int led, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSet1DColorName(IntPtr path, int frameId, int led, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSet1DColorNameD(const char* path, double frameId, double led, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSet1DColorNameD(IntPtr path, double frameId, double led, double color); + /// + /// Set the animation color for a frame given the `2D` `row` and `column`. The + /// `row` should be greater than or equal to 0 and less than the `MaxRow`. + /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. + /// The animation is referenced by id. + /// EXPORT_API void PluginSet2DColor(int animationId, int frameId, int row, int column, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSet2DColor(int animationId, int frameId, int row, int column, int color); + /// + /// Set the animation color for a frame given the `2D` `row` and `column`. The + /// `row` should be greater than or equal to 0 and less than the `MaxRow`. + /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. + /// The animation is referenced by name. + /// EXPORT_API void PluginSet2DColorName(const char* path, int frameId, int row, int column, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSet2DColorName(IntPtr path, int frameId, int row, int column, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSet2DColorNameD(const char* path, double frameId, double rowColumnIndex, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSet2DColorNameD(IntPtr path, double frameId, double rowColumnIndex, double color); + /// + /// When custom color is set, the custom key mode will be used. The animation + /// is referenced by id. + /// EXPORT_API void PluginSetChromaCustomColorAllFrames(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetChromaCustomColorAllFrames(int animationId); + /// + /// When custom color is set, the custom key mode will be used. The animation + /// is referenced by name. + /// EXPORT_API void PluginSetChromaCustomColorAllFramesName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetChromaCustomColorAllFramesName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetChromaCustomColorAllFramesNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetChromaCustomColorAllFramesNameD(IntPtr path); + /// + /// Set the Chroma custom key color flag on all frames. `True` changes the layout + /// from grid to key. `True` changes the layout from key to grid. Animation + /// is referenced by id. + /// EXPORT_API void PluginSetChromaCustomFlag(int animationId, bool flag); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetChromaCustomFlag(int animationId, bool flag); + /// + /// Set the Chroma custom key color flag on all frames. `True` changes the layout + /// from grid to key. `True` changes the layout from key to grid. Animation + /// is referenced by name. + /// EXPORT_API void PluginSetChromaCustomFlagName(const char* path, bool flag); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetChromaCustomFlagName(IntPtr path, bool flag); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetChromaCustomFlagNameD(const char* path, double flag); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetChromaCustomFlagNameD(IntPtr path, double flag); + /// + /// Set the current frame of the animation referenced by id. + /// EXPORT_API void PluginSetCurrentFrame(int animationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetCurrentFrame(int animationId, int frameId); + /// + /// Set the current frame of the animation referenced by name. + /// EXPORT_API void PluginSetCurrentFrameName(const char* path, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetCurrentFrameName(IntPtr path, int frameId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetCurrentFrameNameD(const char* path, double frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetCurrentFrameNameD(IntPtr path, double frameId); + /// + /// Set the custom alpha flag on the color array + /// EXPORT_API RZRESULT PluginSetCustomColorFlag2D(int device, int* colors); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginSetCustomColorFlag2D(int device, int[] colors); + /// + /// Changes the `deviceType` and `device` of a `Chroma` animation. If the device + /// is changed, the `Chroma` animation will be reset with 1 blank frame. Returns + /// the animation id upon success. Returns negative one upon failure. + /// EXPORT_API int PluginSetDevice(int animationId, int deviceType, int device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginSetDevice(int animationId, int deviceType, int device); + /// + /// SetEffect will display the referenced effect id. + /// EXPORT_API RZRESULT PluginSetEffect(const ChromaSDK::FChromaSDKGuid& effectId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginSetEffect(Guid effectId); + /// + /// SetEffectCustom1D will display the referenced colors immediately + /// EXPORT_API RZRESULT PluginSetEffectCustom1D(const int device, const int* colors); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginSetEffectCustom1D(int device, int[] colors); + /// + /// SetEffectCustom2D will display the referenced colors immediately. + /// EXPORT_API RZRESULT PluginSetEffectCustom2D(const int device, const int* colors); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginSetEffectCustom2D(int device, int[] colors); + /// + /// SetEffectKeyboardCustom2D will display the referenced custom keyboard colors + /// immediately. Colors represent a visual grid layout. Keys represent the + /// hotkeys for any layout. + /// EXPORT_API RZRESULT PluginSetEffectKeyboardCustom2D(const int device, const int* colors, const int* keys); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginSetEffectKeyboardCustom2D(int device, int[] colors, int[] keys); + /// + /// When the idle animation is used, the named animation will play when no other + /// animations are playing. Reference the animation by id. + /// EXPORT_API void PluginSetIdleAnimation(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetIdleAnimation(int animationId); + /// + /// When the idle animation is used, the named animation will play when no other + /// animations are playing. Reference the animation by name. + /// EXPORT_API void PluginSetIdleAnimationName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetIdleAnimationName(IntPtr path); + /// + /// Set animation key to a static color for the given frame. + /// EXPORT_API void PluginSetKeyColor(int animationId, int frameId, int rzkey, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyColor(int animationId, int frameId, int rzkey, int color); + /// + /// Set the key to the specified key color for all frames. Animation is referenced + /// by id. + /// EXPORT_API void PluginSetKeyColorAllFrames(int animationId, int rzkey, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyColorAllFrames(int animationId, int rzkey, int color); + /// + /// Set the key to the specified key color for all frames. Animation is referenced + /// by name. + /// EXPORT_API void PluginSetKeyColorAllFramesName(const char* path, int rzkey, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyColorAllFramesName(IntPtr path, int rzkey, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetKeyColorAllFramesNameD(const char* path, double rzkey, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetKeyColorAllFramesNameD(IntPtr path, double rzkey, double color); + /// + /// Set the key to the specified key color for all frames. Animation is referenced + /// by id. + /// EXPORT_API void PluginSetKeyColorAllFramesRGB(int animationId, int rzkey, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyColorAllFramesRGB(int animationId, int rzkey, int red, int green, int blue); + /// + /// Set the key to the specified key color for all frames. Animation is referenced + /// by name. + /// EXPORT_API void PluginSetKeyColorAllFramesRGBName(const char* path, int rzkey, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyColorAllFramesRGBName(IntPtr path, int rzkey, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetKeyColorAllFramesRGBNameD(const char* path, double rzkey, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetKeyColorAllFramesRGBNameD(IntPtr path, double rzkey, double red, double green, double blue); + /// + /// Set animation key to a static color for the given frame. + /// EXPORT_API void PluginSetKeyColorName(const char* path, int frameId, int rzkey, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyColorName(IntPtr path, int frameId, int rzkey, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetKeyColorNameD(const char* path, double frameId, double rzkey, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetKeyColorNameD(IntPtr path, double frameId, double rzkey, double color); + /// + /// Set the key to the specified key color for the specified frame. Animation + /// is referenced by id. + /// EXPORT_API void PluginSetKeyColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); + /// + /// Set the key to the specified key color for the specified frame. Animation + /// is referenced by name. + /// EXPORT_API void PluginSetKeyColorRGBName(const char* path, int frameId, int rzkey, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyColorRGBName(IntPtr path, int frameId, int rzkey, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetKeyColorRGBNameD(const char* path, double frameId, double rzkey, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetKeyColorRGBNameD(IntPtr path, double frameId, double rzkey, double red, double green, double blue); + /// + /// Set animation key to a static color for the given frame if the existing + /// color is not already black. + /// EXPORT_API void PluginSetKeyNonZeroColor(int animationId, int frameId, int rzkey, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyNonZeroColor(int animationId, int frameId, int rzkey, int color); + /// + /// Set animation key to a static color for the given frame if the existing + /// color is not already black. + /// EXPORT_API void PluginSetKeyNonZeroColorName(const char* path, int frameId, int rzkey, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyNonZeroColorName(IntPtr path, int frameId, int rzkey, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetKeyNonZeroColorNameD(const char* path, double frameId, double rzkey, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetKeyNonZeroColorNameD(IntPtr path, double frameId, double rzkey, double color); + /// + /// Set the key to the specified key color for the specified frame where color + /// is not black. Animation is referenced by id. + /// EXPORT_API void PluginSetKeyNonZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyNonZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); + /// + /// Set the key to the specified key color for the specified frame where color + /// is not black. Animation is referenced by name. + /// EXPORT_API void PluginSetKeyNonZeroColorRGBName(const char* path, int frameId, int rzkey, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyNonZeroColorRGBName(IntPtr path, int frameId, int rzkey, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetKeyNonZeroColorRGBNameD(const char* path, double frameId, double rzkey, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetKeyNonZeroColorRGBNameD(IntPtr path, double frameId, double rzkey, double red, double green, double blue); + /// + /// Set animation key by row and column to a static color for the given frame. + /// + /// EXPORT_API void PluginSetKeyRowColumnColorName(const char* path, int frameId, int row, int column, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyRowColumnColorName(IntPtr path, int frameId, int row, int column, int color); + /// + /// Set an array of animation keys to a static color for the given frame. Animation + /// is referenced by id. + /// EXPORT_API void PluginSetKeysColor(int animationId, int frameId, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for all frames. Animation + /// is referenced by id. + /// EXPORT_API void PluginSetKeysColorAllFrames(int animationId, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for all frames. Animation + /// is referenced by name. + /// EXPORT_API void PluginSetKeysColorAllFramesName(const char* path, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysColorAllFramesName(IntPtr path, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for all frames. Animation + /// is referenced by id. + /// EXPORT_API void PluginSetKeysColorAllFramesRGB(int animationId, const int* rzkeys, int keyCount, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysColorAllFramesRGB(int animationId, int[] rzkeys, int keyCount, int red, int green, int blue); + /// + /// Set an array of animation keys to a static color for all frames. Animation + /// is referenced by name. + /// EXPORT_API void PluginSetKeysColorAllFramesRGBName(const char* path, const int* rzkeys, int keyCount, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysColorAllFramesRGBName(IntPtr path, int[] rzkeys, int keyCount, int red, int green, int blue); + /// + /// Set an array of animation keys to a static color for the given frame. + /// EXPORT_API void PluginSetKeysColorName(const char* path, int frameId, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysColorName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for the given frame. Animation + /// is referenced by id. + /// EXPORT_API void PluginSetKeysColorRGB(int animationId, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); + /// + /// Set an array of animation keys to a static color for the given frame. Animation + /// is referenced by name. + /// EXPORT_API void PluginSetKeysColorRGBName(const char* path, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysColorRGBName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); + /// + /// Set an array of animation keys to a static color for the given frame if + /// the existing color is not already black. + /// EXPORT_API void PluginSetKeysNonZeroColor(int animationId, int frameId, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysNonZeroColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is not black. Animation is referenced by id. + /// EXPORT_API void PluginSetKeysNonZeroColorAllFrames(int animationId, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysNonZeroColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for all frames if the existing + /// color is not already black. Reference animation by name. + /// EXPORT_API void PluginSetKeysNonZeroColorAllFramesName(const char* path, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysNonZeroColorAllFramesName(IntPtr path, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for the given frame if + /// the existing color is not already black. Reference animation by name. + /// EXPORT_API void PluginSetKeysNonZeroColorName(const char* path, int frameId, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysNonZeroColorName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is not black. Animation is referenced by id. + /// EXPORT_API void PluginSetKeysNonZeroColorRGB(int animationId, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysNonZeroColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is not black. Animation is referenced by name. + /// EXPORT_API void PluginSetKeysNonZeroColorRGBName(const char* path, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysNonZeroColorRGBName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is black. Animation is referenced by id. + /// EXPORT_API void PluginSetKeysZeroColor(int animationId, int frameId, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysZeroColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for all frames where the + /// color is black. Animation is referenced by id. + /// EXPORT_API void PluginSetKeysZeroColorAllFrames(int animationId, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysZeroColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for all frames where the + /// color is black. Animation is referenced by name. + /// EXPORT_API void PluginSetKeysZeroColorAllFramesName(const char* path, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysZeroColorAllFramesName(IntPtr path, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for all frames where the + /// color is black. Animation is referenced by id. + /// EXPORT_API void PluginSetKeysZeroColorAllFramesRGB(int animationId, const int* rzkeys, int keyCount, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysZeroColorAllFramesRGB(int animationId, int[] rzkeys, int keyCount, int red, int green, int blue); + /// + /// Set an array of animation keys to a static color for all frames where the + /// color is black. Animation is referenced by name. + /// EXPORT_API void PluginSetKeysZeroColorAllFramesRGBName(const char* path, const int* rzkeys, int keyCount, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysZeroColorAllFramesRGBName(IntPtr path, int[] rzkeys, int keyCount, int red, int green, int blue); + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is black. Animation is referenced by name. + /// EXPORT_API void PluginSetKeysZeroColorName(const char* path, int frameId, const int* rzkeys, int keyCount, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysZeroColorName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int color); + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is black. Animation is referenced by id. + /// EXPORT_API void PluginSetKeysZeroColorRGB(int animationId, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysZeroColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); + /// + /// Set an array of animation keys to a static color for the given frame where + /// the color is black. Animation is referenced by name. + /// EXPORT_API void PluginSetKeysZeroColorRGBName(const char* path, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeysZeroColorRGBName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); + /// + /// Set animation key to a static color for the given frame where the color + /// is black. Animation is referenced by id. + /// EXPORT_API void PluginSetKeyZeroColor(int animationId, int frameId, int rzkey, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyZeroColor(int animationId, int frameId, int rzkey, int color); + /// + /// Set animation key to a static color for the given frame where the color + /// is black. Animation is referenced by name. + /// EXPORT_API void PluginSetKeyZeroColorName(const char* path, int frameId, int rzkey, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyZeroColorName(IntPtr path, int frameId, int rzkey, int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetKeyZeroColorNameD(const char* path, double frameId, double rzkey, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetKeyZeroColorNameD(IntPtr path, double frameId, double rzkey, double color); + /// + /// Set animation key to a static color for the given frame where the color + /// is black. Animation is referenced by id. + /// EXPORT_API void PluginSetKeyZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); + /// + /// Set animation key to a static color for the given frame where the color + /// is black. Animation is referenced by name. + /// EXPORT_API void PluginSetKeyZeroColorRGBName(const char* path, int frameId, int rzkey, int red, int green, int blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetKeyZeroColorRGBName(IntPtr path, int frameId, int rzkey, int red, int green, int blue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSetKeyZeroColorRGBNameD(const char* path, double frameId, double rzkey, double red, double green, double blue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSetKeyZeroColorRGBNameD(IntPtr path, double frameId, double rzkey, double red, double green, double blue); + /// + /// Invokes the setup for a debug logging callback so that `stdout` is redirected + /// to the callback. This is used by `Unity` so that debug messages can appear + /// in the console window. + /// EXPORT_API void PluginSetLogDelegate(DebugLogPtr fp); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetLogDelegate(IntPtr fp); + /// + /// Sets the target device to the static color. + /// EXPORT_API void PluginSetStaticColor(int deviceType, int device, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetStaticColor(int deviceType, int device, int color); + /// + /// Sets all devices to the static color. + /// EXPORT_API void PluginSetStaticColorAll(int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSetStaticColorAll(int color); + /// + /// Sets the target device to the static color. + /// EXPORT_API void PluginStaticColor(int deviceType, int device, int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginStaticColor(int deviceType, int device, int color); + /// + /// Sets all devices to the static color. + /// EXPORT_API void PluginStaticColorAll(int color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginStaticColorAll(int color); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginStaticColorD(double deviceType, double device, double color); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginStaticColorD(double deviceType, double device, double color); + /// + /// `PluginStopAll` will automatically stop all animations that are playing. + /// + /// EXPORT_API void PluginStopAll(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginStopAll(); + /// + /// Stops animation playback if in progress. Returns the animation id upon success. + /// Returns negative one upon failure. + /// EXPORT_API int PluginStopAnimation(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginStopAnimation(int animationId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginStopAnimationD(double animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginStopAnimationD(double animationId); + /// + /// `PluginStopAnimationName` automatically handles initializing the `ChromaSDK`. + /// The named `.chroma` animation file will be automatically opened. The animation + /// will stop if playing. + /// EXPORT_API void PluginStopAnimationName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginStopAnimationName(IntPtr path); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginStopAnimationNameD(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginStopAnimationNameD(IntPtr path); + /// + /// `PluginStopAnimationType` automatically handles initializing the `ChromaSDK`. + /// If any animation is playing for the `deviceType` and `device` combination, + /// it will be stopped. + /// EXPORT_API void PluginStopAnimationType(int deviceType, int device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginStopAnimationType(int deviceType, int device); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginStopAnimationTypeD(double deviceType, double device); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginStopAnimationTypeD(double deviceType, double device); + /// + /// `PluginStopComposite` automatically handles initializing the `ChromaSDK`. + /// The named animation files for the `.chroma` set will be automatically opened. + /// The set of animations will be stopped if playing. + /// EXPORT_API void PluginStopComposite(const char* name); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginStopComposite(IntPtr name); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginStopCompositeD(const char* name); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginStopCompositeD(IntPtr name); + /// + /// Return color1 - color2 + /// EXPORT_API int PluginSubtractColor(const int color1, const int color2); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginSubtractColor(int color1, int color2); + /// + /// Subtract the source color from the target color for the frame where the + /// target color is not black. Source and target are referenced by id. + /// EXPORT_API void PluginSubtractNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); + /// + /// Subtract the source color from the target color for all frames where the + /// target color is not black. Source and target are referenced by id. + /// EXPORT_API void PluginSubtractNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + /// Subtract the source color from the target color for all frames where the + /// target color is not black. Source and target are referenced by name. + /// EXPORT_API void PluginSubtractNonZeroAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSubtractNonZeroAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSubtractNonZeroAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Subtract the source color from the target color for all frames where the + /// target color is not black starting at offset for the length of the source. + /// Source and target are referenced by id. + /// EXPORT_API void PluginSubtractNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + /// Subtract the source color from the target color for all frames where the + /// target color is not black starting at offset for the length of the source. + /// Source and target are referenced by name. + /// EXPORT_API void PluginSubtractNonZeroAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSubtractNonZeroAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSubtractNonZeroAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); + /// + /// Subtract the source color from the target color for the frame where the + /// target color is not black. Source and target are referenced by name. + /// EXPORT_API void PluginSubtractNonZeroAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); + /// + /// Subtract the source color from the target where color is not black for the + /// source frame and target offset frame, reference source and target by id. + /// + /// EXPORT_API void PluginSubtractNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + /// Subtract the source color from the target where color is not black for the + /// source frame and target offset frame, reference source and target by name. + /// + /// EXPORT_API void PluginSubtractNonZeroAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSubtractNonZeroAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSubtractNonZeroAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); + /// + /// Subtract the source color from the target color where the target color is + /// not black for all frames. Reference source and target by id. + /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); + /// + /// Subtract the source color from the target color where the target color is + /// not black for all frames. Reference source and target by name. + /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroTargetAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSubtractNonZeroTargetAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSubtractNonZeroTargetAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); + /// + /// Subtract the source color from the target color where the target color is + /// not black for all frames starting at the target offset for the length of + /// the source. Reference source and target by id. + /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); + /// + /// Subtract the source color from the target color where the target color is + /// not black for all frames starting at the target offset for the length of + /// the source. Reference source and target by name. + /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroTargetAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSubtractNonZeroTargetAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSubtractNonZeroTargetAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); + /// + /// Subtract the source color from the target color where the target color is + /// not black from the source frame to the target offset frame. Reference source + /// and target by id. + /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); + /// + /// Subtract the source color from the target color where the target color is + /// not black from the source frame to the target offset frame. Reference source + /// and target by name. + /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractNonZeroTargetAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSubtractNonZeroTargetAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSubtractNonZeroTargetAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); + /// + /// Subtract all frames with the min RGB color where the animation color is + /// less than the min threshold AND with the max RGB color where the animation + /// is more than the max threshold. Animation is referenced by id. + /// EXPORT_API void PluginSubtractThresholdColorsMinMaxAllFramesRGB(const int animationId, const int minThreshold, const int minRed, const int minGreen, const int minBlue, const int maxThreshold, const int maxRed, const int maxGreen, const int maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractThresholdColorsMinMaxAllFramesRGB(int animationId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + /// Subtract all frames with the min RGB color where the animation color is + /// less than the min threshold AND with the max RGB color where the animation + /// is more than the max threshold. Animation is referenced by name. + /// EXPORT_API void PluginSubtractThresholdColorsMinMaxAllFramesRGBName(const char* path, const int minThreshold, const int minRed, const int minGreen, const int minBlue, const int maxThreshold, const int maxRed, const int maxGreen, const int maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractThresholdColorsMinMaxAllFramesRGBName(IntPtr path, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSubtractThresholdColorsMinMaxAllFramesRGBNameD(const char* path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSubtractThresholdColorsMinMaxAllFramesRGBNameD(IntPtr path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); + /// + /// Subtract the specified frame with the min RGB color where the animation + /// color is less than the min threshold AND with the max RGB color where the + /// animation is more than the max threshold. Animation is referenced by id. + /// + /// EXPORT_API void PluginSubtractThresholdColorsMinMaxRGB(const int animationId, const int frameId, const int minThreshold, const int minRed, const int minGreen, const int minBlue, const int maxThreshold, const int maxRed, const int maxGreen, const int maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractThresholdColorsMinMaxRGB(int animationId, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + /// Subtract the specified frame with the min RGB color where the animation + /// color is less than the min threshold AND with the max RGB color where the + /// animation is more than the max threshold. Animation is referenced by name. + /// + /// EXPORT_API void PluginSubtractThresholdColorsMinMaxRGBName(const char* path, const int frameId, const int minThreshold, const int minRed, const int minGreen, const int minBlue, const int maxThreshold, const int maxRed, const int maxGreen, const int maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginSubtractThresholdColorsMinMaxRGBName(IntPtr path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginSubtractThresholdColorsMinMaxRGBNameD(const char* path, const int frameId, const int minThreshold, const int minRed, const int minGreen, const int minBlue, const int maxThreshold, const int maxRed, const int maxGreen, const int maxBlue); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginSubtractThresholdColorsMinMaxRGBNameD(IntPtr path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); + /// + /// Trim the end of the animation. The length of the animation will be the lastFrameId + /// plus one. Reference the animation by id. + /// EXPORT_API void PluginTrimEndFrames(int animationId, int lastFrameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginTrimEndFrames(int animationId, int lastFrameId); + /// + /// Trim the end of the animation. The length of the animation will be the lastFrameId + /// plus one. Reference the animation by name. + /// EXPORT_API void PluginTrimEndFramesName(const char* path, int lastFrameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginTrimEndFramesName(IntPtr path, int lastFrameId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginTrimEndFramesNameD(const char* path, double lastFrameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginTrimEndFramesNameD(IntPtr path, double lastFrameId); + /// + /// Remove the frame from the animation. Reference animation by id. + /// EXPORT_API void PluginTrimFrame(int animationId, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginTrimFrame(int animationId, int frameId); + /// + /// Remove the frame from the animation. Reference animation by name. + /// EXPORT_API void PluginTrimFrameName(const char* path, int frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginTrimFrameName(IntPtr path, int frameId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginTrimFrameNameD(const char* path, double frameId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginTrimFrameNameD(IntPtr path, double frameId); + /// + /// Trim the start of the animation starting at frame 0 for the number of frames. + /// Reference the animation by id. + /// EXPORT_API void PluginTrimStartFrames(int animationId, int numberOfFrames); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginTrimStartFrames(int animationId, int numberOfFrames); + /// + /// Trim the start of the animation starting at frame 0 for the number of frames. + /// Reference the animation by name. + /// EXPORT_API void PluginTrimStartFramesName(const char* path, int numberOfFrames); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginTrimStartFramesName(IntPtr path, int numberOfFrames); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginTrimStartFramesNameD(const char* path, double numberOfFrames); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginTrimStartFramesNameD(IntPtr path, double numberOfFrames); + /// + /// Uninitializes the `ChromaSDK`. Returns 0 upon success. Returns negative + /// one upon failure. + /// EXPORT_API RZRESULT PluginUninit(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginUninit(); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginUninitD(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginUninitD(); + /// + /// Unloads `Chroma` effects to free up resources. Returns the animation id + /// upon success. Returns negative one upon failure. Reference the animation + /// by id. + /// EXPORT_API int PluginUnloadAnimation(int animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginUnloadAnimation(int animationId); + /// + /// D suffix for limited data types. + /// EXPORT_API double PluginUnloadAnimationD(double animationId); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern double PluginUnloadAnimationD(double animationId); + /// + /// Unload the animation effects. Reference the animation by name. + /// EXPORT_API void PluginUnloadAnimationName(const char* path); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginUnloadAnimationName(IntPtr path); + /// + /// Unload the the composite set of animation effects. Reference the animation + /// by name. + /// EXPORT_API void PluginUnloadComposite(const char* name); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginUnloadComposite(IntPtr name); + /// + /// Unload the Razer Chroma SDK Library before exiting the application. + /// EXPORT_API void PluginUnloadLibrarySDK(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginUnloadLibrarySDK(); + /// + /// Unload the Razer Chroma Streaming Plugin Library before exiting the application. + /// + /// EXPORT_API void PluginUnloadLibraryStreamingPlugin(); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginUnloadLibraryStreamingPlugin(); + /// + /// Updates the `frameIndex` of the `Chroma` animation referenced by id and + /// sets the `duration` (in seconds). The `color` is expected to be an array + /// of the dimensions for the `deviceType/device`. The `length` parameter is + /// the size of the `color` array. For `EChromaSDKDevice1DEnum` the array size + /// should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should + /// be `MAX ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard + /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the + /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. + /// + /// EXPORT_API int PluginUpdateFrame(int animationId, int frameIndex, float duration, int* colors, int length, int* keys, int keysLength); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginUpdateFrame(int animationId, int frameIndex, float duration, int[] colors, int length, int[] keys, int keysLength); + /// + /// Update the `frameIndex` of the `Chroma` animation referenced by name and + /// sets the `duration` (in seconds). The `color` is expected to be an array + /// of the dimensions for the `deviceType/device`. The `length` parameter is + /// the size of the `color` array. For `EChromaSDKDevice1DEnum` the array size + /// should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should + /// be `MAX ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard + /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the + /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. + /// Returns the animation id upon success. Returns negative one upon failure. + /// + /// EXPORT_API int PluginUpdateFrameName(const char* path, int frameIndex, float duration, int* colors, int length, int* keys, int keysLength); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern int PluginUpdateFrameName(IntPtr path, int frameIndex, float duration, int[] colors, int length, int[] keys, int keysLength); + /// + /// When the idle animation flag is true, when no other animations are playing, + /// the idle animation will be used. The idle animation will not be affected + /// by the API calls to PluginIsPlaying, PluginStopAnimationType, PluginGetPlayingAnimationId, + /// and PluginGetPlayingAnimationCount. Then the idle animation flag is false, + /// the idle animation is disabled. `Device` uses `EChromaSDKDeviceEnum` enums. + /// + /// EXPORT_API void PluginUseIdleAnimation(int device, bool flag); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginUseIdleAnimation(int device, bool flag); + /// + /// Set idle animation flag for all devices. + /// EXPORT_API void PluginUseIdleAnimations(bool flag); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginUseIdleAnimations(bool flag); + /// + /// Set preloading animation flag, which is set to true by default. Reference + /// animation by id. + /// EXPORT_API void PluginUsePreloading(int animationId, bool flag); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginUsePreloading(int animationId, bool flag); + /// + /// Set preloading animation flag, which is set to true by default. Reference + /// animation by name. + /// EXPORT_API void PluginUsePreloadingName(const char* path, bool flag); + /// + [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] + private static extern void PluginUsePreloadingName(IntPtr path, bool flag); + #endregion + } +} diff --git a/ChromaSDK/ChromaSDK.csproj b/ChromaSDK/ChromaSDK.csproj new file mode 100644 index 0000000..99c21c0 --- /dev/null +++ b/ChromaSDK/ChromaSDK.csproj @@ -0,0 +1,16 @@ + + + + net7.0 + x64;ARM64 + enable + embedded + + + + + Always + + + + diff --git a/ChromaSDK/RazerErrors.cs b/ChromaSDK/RazerErrors.cs new file mode 100644 index 0000000..ad7756a --- /dev/null +++ b/ChromaSDK/RazerErrors.cs @@ -0,0 +1,90 @@ +namespace ChromaSDK +{ + class RazerErrors + { + // Error codes + //! Invalid + public const int RZRESULT_INVALID = -1; + //! Success + public const int RZRESULT_SUCCESS = 0; + //! Access denied + public const int RZRESULT_ACCESS_DENIED = 5; + //! Invalid handle + public const int RZRESULT_INVALID_HANDLE = 6; + //! Not supported + public const int RZRESULT_NOT_SUPPORTED = 50; + //! Invalid parameter. + public const int RZRESULT_INVALID_PARAMETER = 87; + //! The service has not been started + public const int RZRESULT_SERVICE_NOT_ACTIVE = 1062; + //! Cannot start more than one instance of the specified program. + public const int RZRESULT_SINGLE_INSTANCE_APP = 1152; + //! Device not connected + public const int RZRESULT_DEVICE_NOT_CONNECTED = 1167; + //! Element not found. + public const int RZRESULT_NOT_FOUND = 1168; + //! Request aborted. + public const int RZRESULT_REQUEST_ABORTED = 1235; + //! An attempt was made to perform an initialization operation when initialization has already been completed. + public const int RZRESULT_ALREADY_INITIALIZED = 1247; + //! Resource not available or disabled + public const int RZRESULT_RESOURCE_DISABLED = 4309; + //! Device not available or supported + public const int RZRESULT_DEVICE_NOT_AVAILABLE = 4319; + //! The group or resource is not in the correct state to perform the requested operation. + public const int RZRESULT_NOT_VALID_STATE = 5023; + //! No more items + public const int RZRESULT_NO_MORE_ITEMS = 259; + //! DLL not found + public const int RZRESULT_DLL_NOT_FOUND = 6023; + //! Invalid signature + public const int RZRESULT_DLL_INVALID_SIGNATURE = 6033; + //! General failure. + public const int RZRESULT_FAILED = unchecked((int)2147500037); + public static string GetResultString(int result) + { + switch (result) + { + case RZRESULT_INVALID: + return "RZRESULT_INVALID"; + case RZRESULT_SUCCESS: + return "RZRESULT_SUCCESS"; + case RZRESULT_ACCESS_DENIED: + return "RZRESULT_ACCESS_DENIED"; + case RZRESULT_INVALID_HANDLE: + return "RZRESULT_INVALID_HANDLE"; + case RZRESULT_NOT_SUPPORTED: + return "RZRESULT_NOT_SUPPORTED"; + case RZRESULT_INVALID_PARAMETER: + return "RZRESULT_INVALID_PARAMETER"; + case RZRESULT_SERVICE_NOT_ACTIVE: + return "RZRESULT_SERVICE_NOT_ACTIVE"; + case RZRESULT_SINGLE_INSTANCE_APP: + return "RZRESULT_SINGLE_INSTANCE_APP"; + case RZRESULT_DEVICE_NOT_CONNECTED: + return "RZRESULT_DEVICE_NOT_CONNECTED"; + case RZRESULT_NOT_FOUND: + return "RZRESULT_NOT_FOUND"; + case RZRESULT_REQUEST_ABORTED: + return "RZRESULT_REQUEST_ABORTED"; + case RZRESULT_ALREADY_INITIALIZED: + return "RZRESULT_ALREADY_INITIALIZED"; + case RZRESULT_RESOURCE_DISABLED: + return "RZRESULT_RESOURCE_DISABLED"; + case RZRESULT_DEVICE_NOT_AVAILABLE: + return "RZRESULT_DEVICE_NOT_AVAILABLE"; + case RZRESULT_NOT_VALID_STATE: + return "RZRESULT_NOT_VALID_STATE"; + case RZRESULT_NO_MORE_ITEMS: + return "RZRESULT_NO_MORE_ITEMS"; + case RZRESULT_DLL_NOT_FOUND: + return "RZRESULT_DLL_NOT_FOUND"; + case RZRESULT_DLL_INVALID_SIGNATURE: + return "RZRESULT_DLL_INVALID_SIGNATURE"; + case RZRESULT_FAILED: + return "RZRESULT_FAILED"; + } + return result.ToString(); + } + } +} diff --git a/FMODAPI/Assets/x64/fmod.dll b/FMODAPI/Assets/x64/fmod.dll new file mode 100644 index 0000000..5425dd6 --- /dev/null +++ b/FMODAPI/Assets/x64/fmod.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba377c62ad807fe17e4177b46259237035e544a5893367e296fbae07b11b1bcb +size 1852928 diff --git a/FMODAPI/FMODAPI.csproj b/FMODAPI/FMODAPI.csproj new file mode 100644 index 0000000..b9ebb9c --- /dev/null +++ b/FMODAPI/FMODAPI.csproj @@ -0,0 +1,15 @@ + + + + net7.0 + x64;ARM64 + enable + embedded + + + + + Always + + + diff --git a/FMODAPI/fmod.cs b/FMODAPI/fmod.cs new file mode 100644 index 0000000..ecb0274 --- /dev/null +++ b/FMODAPI/fmod.cs @@ -0,0 +1,4083 @@ +/* ======================================================================================== */ +/* FMOD Core API - C# wrapper. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2023. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/docs/2.02/api/core-api.html */ +/* ======================================================================================== */ + +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Collections.Generic; + +namespace FMOD +{ + /* + FMOD version number. Check this against FMOD::System::getVersion / System_GetVersion + 0xaaaabbcc -> aaaa = major version number. bb = minor version number. cc = development version number. + */ + public partial class VERSION + { + public const int number = 0x00020219; +#if !UNITY_2019_4_OR_NEWER + public const string dll = "fmod"; +#endif + } + + public class CONSTANTS + { + public const int MAX_CHANNEL_WIDTH = 32; + public const int MAX_LISTENERS = 8; + public const int REVERB_MAXINSTANCES = 4; + public const int MAX_SYSTEMS = 8; + } + + /* + FMOD core types + */ + public enum RESULT : int + { + OK, + ERR_BADCOMMAND, + ERR_CHANNEL_ALLOC, + ERR_CHANNEL_STOLEN, + ERR_DMA, + ERR_DSP_CONNECTION, + ERR_DSP_DONTPROCESS, + ERR_DSP_FORMAT, + ERR_DSP_INUSE, + ERR_DSP_NOTFOUND, + ERR_DSP_RESERVED, + ERR_DSP_SILENCE, + ERR_DSP_TYPE, + ERR_FILE_BAD, + ERR_FILE_COULDNOTSEEK, + ERR_FILE_DISKEJECTED, + ERR_FILE_EOF, + ERR_FILE_ENDOFDATA, + ERR_FILE_NOTFOUND, + ERR_FORMAT, + ERR_HEADER_MISMATCH, + ERR_HTTP, + ERR_HTTP_ACCESS, + ERR_HTTP_PROXY_AUTH, + ERR_HTTP_SERVER_ERROR, + ERR_HTTP_TIMEOUT, + ERR_INITIALIZATION, + ERR_INITIALIZED, + ERR_INTERNAL, + ERR_INVALID_FLOAT, + ERR_INVALID_HANDLE, + ERR_INVALID_PARAM, + ERR_INVALID_POSITION, + ERR_INVALID_SPEAKER, + ERR_INVALID_SYNCPOINT, + ERR_INVALID_THREAD, + ERR_INVALID_VECTOR, + ERR_MAXAUDIBLE, + ERR_MEMORY, + ERR_MEMORY_CANTPOINT, + ERR_NEEDS3D, + ERR_NEEDSHARDWARE, + ERR_NET_CONNECT, + ERR_NET_SOCKET_ERROR, + ERR_NET_URL, + ERR_NET_WOULD_BLOCK, + ERR_NOTREADY, + ERR_OUTPUT_ALLOCATED, + ERR_OUTPUT_CREATEBUFFER, + ERR_OUTPUT_DRIVERCALL, + ERR_OUTPUT_FORMAT, + ERR_OUTPUT_INIT, + ERR_OUTPUT_NODRIVERS, + ERR_PLUGIN, + ERR_PLUGIN_MISSING, + ERR_PLUGIN_RESOURCE, + ERR_PLUGIN_VERSION, + ERR_RECORD, + ERR_REVERB_CHANNELGROUP, + ERR_REVERB_INSTANCE, + ERR_SUBSOUNDS, + ERR_SUBSOUND_ALLOCATED, + ERR_SUBSOUND_CANTMOVE, + ERR_TAGNOTFOUND, + ERR_TOOMANYCHANNELS, + ERR_TRUNCATED, + ERR_UNIMPLEMENTED, + ERR_UNINITIALIZED, + ERR_UNSUPPORTED, + ERR_VERSION, + ERR_EVENT_ALREADY_LOADED, + ERR_EVENT_LIVEUPDATE_BUSY, + ERR_EVENT_LIVEUPDATE_MISMATCH, + ERR_EVENT_LIVEUPDATE_TIMEOUT, + ERR_EVENT_NOTFOUND, + ERR_STUDIO_UNINITIALIZED, + ERR_STUDIO_NOT_LOADED, + ERR_INVALID_STRING, + ERR_ALREADY_LOCKED, + ERR_NOT_LOCKED, + ERR_RECORD_DISCONNECTED, + ERR_TOOMANYSAMPLES, + } + + public enum CHANNELCONTROL_TYPE : int + { + CHANNEL, + CHANNELGROUP, + MAX + } + + [StructLayout(LayoutKind.Sequential)] + public struct VECTOR + { + public float x; + public float y; + public float z; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ATTRIBUTES_3D + { + public VECTOR position; + public VECTOR velocity; + public VECTOR forward; + public VECTOR up; + } + + [StructLayout(LayoutKind.Sequential)] + public partial struct GUID + { + public int Data1; + public int Data2; + public int Data3; + public int Data4; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ASYNCREADINFO + { + public IntPtr handle; + public uint offset; + public uint sizebytes; + public int priority; + + public IntPtr userdata; + public IntPtr buffer; + public uint bytesread; + public FILE_ASYNCDONE_FUNC done; + } + + public enum OUTPUTTYPE : int + { + AUTODETECT, + + UNKNOWN, + NOSOUND, + WAVWRITER, + NOSOUND_NRT, + WAVWRITER_NRT, + + WASAPI, + ASIO, + PULSEAUDIO, + ALSA, + COREAUDIO, + AUDIOTRACK, + OPENSL, + AUDIOOUT, + AUDIO3D, + WEBAUDIO, + NNAUDIO, + WINSONIC, + AAUDIO, + AUDIOWORKLET, + PHASE, + OHAUDIO, + + MAX, + } + + public enum PORT_TYPE : int + { + MUSIC, + COPYRIGHT_MUSIC, + VOICE, + CONTROLLER, + PERSONAL, + VIBRATION, + AUX, + + MAX + } + + public enum DEBUG_MODE : int + { + TTY, + FILE, + CALLBACK, + } + + [Flags] + public enum DEBUG_FLAGS : uint + { + NONE = 0x00000000, + ERROR = 0x00000001, + WARNING = 0x00000002, + LOG = 0x00000004, + + TYPE_MEMORY = 0x00000100, + TYPE_FILE = 0x00000200, + TYPE_CODEC = 0x00000400, + TYPE_TRACE = 0x00000800, + + DISPLAY_TIMESTAMPS = 0x00010000, + DISPLAY_LINENUMBERS = 0x00020000, + DISPLAY_THREAD = 0x00040000, + } + + [Flags] + public enum MEMORY_TYPE : uint + { + NORMAL = 0x00000000, + STREAM_FILE = 0x00000001, + STREAM_DECODE = 0x00000002, + SAMPLEDATA = 0x00000004, + DSP_BUFFER = 0x00000008, + PLUGIN = 0x00000010, + PERSISTENT = 0x00200000, + ALL = 0xFFFFFFFF + } + + public enum SPEAKERMODE : int + { + DEFAULT, + RAW, + MONO, + STEREO, + QUAD, + SURROUND, + _5POINT1, + _7POINT1, + _7POINT1POINT4, + + MAX, + } + + public enum SPEAKER : int + { + NONE = -1, + FRONT_LEFT, + FRONT_RIGHT, + FRONT_CENTER, + LOW_FREQUENCY, + SURROUND_LEFT, + SURROUND_RIGHT, + BACK_LEFT, + BACK_RIGHT, + TOP_FRONT_LEFT, + TOP_FRONT_RIGHT, + TOP_BACK_LEFT, + TOP_BACK_RIGHT, + + MAX, + } + + [Flags] + public enum CHANNELMASK : uint + { + FRONT_LEFT = 0x00000001, + FRONT_RIGHT = 0x00000002, + FRONT_CENTER = 0x00000004, + LOW_FREQUENCY = 0x00000008, + SURROUND_LEFT = 0x00000010, + SURROUND_RIGHT = 0x00000020, + BACK_LEFT = 0x00000040, + BACK_RIGHT = 0x00000080, + BACK_CENTER = 0x00000100, + + MONO = (FRONT_LEFT), + STEREO = (FRONT_LEFT | FRONT_RIGHT), + LRC = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER), + QUAD = (FRONT_LEFT | FRONT_RIGHT | SURROUND_LEFT | SURROUND_RIGHT), + SURROUND = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT), + _5POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT), + _5POINT1_REARS = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT), + _7POINT0 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT), + _7POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT) + } + + public enum CHANNELORDER : int + { + DEFAULT, + WAVEFORMAT, + PROTOOLS, + ALLMONO, + ALLSTEREO, + ALSA, + + MAX, + } + + public enum PLUGINTYPE : int + { + OUTPUT, + CODEC, + DSP, + + MAX, + } + + [StructLayout(LayoutKind.Sequential)] + public struct PLUGINLIST + { + PLUGINTYPE type; + IntPtr description; + } + + [Flags] + public enum INITFLAGS : uint + { + NORMAL = 0x00000000, + STREAM_FROM_UPDATE = 0x00000001, + MIX_FROM_UPDATE = 0x00000002, + _3D_RIGHTHANDED = 0x00000004, + CLIP_OUTPUT = 0x00000008, + CHANNEL_LOWPASS = 0x00000100, + CHANNEL_DISTANCEFILTER = 0x00000200, + PROFILE_ENABLE = 0x00010000, + VOL0_BECOMES_VIRTUAL = 0x00020000, + GEOMETRY_USECLOSEST = 0x00040000, + PREFER_DOLBY_DOWNMIX = 0x00080000, + THREAD_UNSAFE = 0x00100000, + PROFILE_METER_ALL = 0x00200000, + MEMORY_TRACKING = 0x00400000, + } + + public enum SOUND_TYPE : int + { + UNKNOWN, + AIFF, + ASF, + DLS, + FLAC, + FSB, + IT, + MIDI, + MOD, + MPEG, + OGGVORBIS, + PLAYLIST, + RAW, + S3M, + USER, + WAV, + XM, + XMA, + AUDIOQUEUE, + AT9, + VORBIS, + MEDIA_FOUNDATION, + MEDIACODEC, + FADPCM, + OPUS, + + MAX, + } + + public enum SOUND_FORMAT : int + { + NONE, + PCM8, + PCM16, + PCM24, + PCM32, + PCMFLOAT, + BITSTREAM, + + MAX + } + + [Flags] + public enum MODE : uint + { + DEFAULT = 0x00000000, + LOOP_OFF = 0x00000001, + LOOP_NORMAL = 0x00000002, + LOOP_BIDI = 0x00000004, + _2D = 0x00000008, + _3D = 0x00000010, + CREATESTREAM = 0x00000080, + CREATESAMPLE = 0x00000100, + CREATECOMPRESSEDSAMPLE = 0x00000200, + OPENUSER = 0x00000400, + OPENMEMORY = 0x00000800, + OPENMEMORY_POINT = 0x10000000, + OPENRAW = 0x00001000, + OPENONLY = 0x00002000, + ACCURATETIME = 0x00004000, + MPEGSEARCH = 0x00008000, + NONBLOCKING = 0x00010000, + UNIQUE = 0x00020000, + _3D_HEADRELATIVE = 0x00040000, + _3D_WORLDRELATIVE = 0x00080000, + _3D_INVERSEROLLOFF = 0x00100000, + _3D_LINEARROLLOFF = 0x00200000, + _3D_LINEARSQUAREROLLOFF = 0x00400000, + _3D_INVERSETAPEREDROLLOFF = 0x00800000, + _3D_CUSTOMROLLOFF = 0x04000000, + _3D_IGNOREGEOMETRY = 0x40000000, + IGNORETAGS = 0x02000000, + LOWMEM = 0x08000000, + VIRTUAL_PLAYFROMSTART = 0x80000000 + } + + public enum OPENSTATE : int + { + READY = 0, + LOADING, + ERROR, + CONNECTING, + BUFFERING, + SEEKING, + PLAYING, + SETPOSITION, + + MAX, + } + + public enum SOUNDGROUP_BEHAVIOR : int + { + BEHAVIOR_FAIL, + BEHAVIOR_MUTE, + BEHAVIOR_STEALLOWEST, + + MAX, + } + + public enum CHANNELCONTROL_CALLBACK_TYPE : int + { + END, + VIRTUALVOICE, + SYNCPOINT, + OCCLUSION, + + MAX, + } + + public struct CHANNELCONTROL_DSP_INDEX + { + public const int HEAD = -1; + public const int FADER = -2; + public const int TAIL = -3; + } + + public enum ERRORCALLBACK_INSTANCETYPE : int + { + NONE, + SYSTEM, + CHANNEL, + CHANNELGROUP, + CHANNELCONTROL, + SOUND, + SOUNDGROUP, + DSP, + DSPCONNECTION, + GEOMETRY, + REVERB3D, + STUDIO_SYSTEM, + STUDIO_EVENTDESCRIPTION, + STUDIO_EVENTINSTANCE, + STUDIO_PARAMETERINSTANCE, + STUDIO_BUS, + STUDIO_VCA, + STUDIO_BANK, + STUDIO_COMMANDREPLAY + } + + [StructLayout(LayoutKind.Sequential)] + public struct ERRORCALLBACK_INFO + { + public RESULT result; + public ERRORCALLBACK_INSTANCETYPE instancetype; + public IntPtr instance; + public StringWrapper functionname; + public StringWrapper functionparams; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CPU_USAGE + { + public float dsp; /* DSP mixing CPU usage. */ + public float stream; /* Streaming engine CPU usage. */ + public float geometry; /* Geometry engine CPU usage. */ + public float update; /* System::update CPU usage. */ + public float convolution1; /* Convolution reverb processing thread #1 CPU usage */ + public float convolution2; /* Convolution reverb processing thread #2 CPU usage */ + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_DATA_PARAMETER_INFO + { + public IntPtr data; + public uint length; + public int index; + } + + [Flags] + public enum SYSTEM_CALLBACK_TYPE : uint + { + DEVICELISTCHANGED = 0x00000001, + DEVICELOST = 0x00000002, + MEMORYALLOCATIONFAILED = 0x00000004, + THREADCREATED = 0x00000008, + BADDSPCONNECTION = 0x00000010, + PREMIX = 0x00000020, + POSTMIX = 0x00000040, + ERROR = 0x00000080, + MIDMIX = 0x00000100, + THREADDESTROYED = 0x00000200, + PREUPDATE = 0x00000400, + POSTUPDATE = 0x00000800, + RECORDLISTCHANGED = 0x00001000, + BUFFEREDNOMIX = 0x00002000, + DEVICEREINITIALIZE = 0x00004000, + OUTPUTUNDERRUN = 0x00008000, + RECORDPOSITIONCHANGED = 0x00010000, + ALL = 0xFFFFFFFF, + } + + /* + FMOD Callbacks + */ + public delegate RESULT DEBUG_CALLBACK (DEBUG_FLAGS flags, IntPtr file, int line, IntPtr func, IntPtr message); + public delegate RESULT SYSTEM_CALLBACK (IntPtr system, SYSTEM_CALLBACK_TYPE type, IntPtr commanddata1, IntPtr commanddata2, IntPtr userdata); + public delegate RESULT CHANNELCONTROL_CALLBACK (IntPtr channelcontrol, CHANNELCONTROL_TYPE controltype, CHANNELCONTROL_CALLBACK_TYPE callbacktype, IntPtr commanddata1, IntPtr commanddata2); + public delegate RESULT DSP_CALLBACK (IntPtr dsp, DSP_CALLBACK_TYPE type, IntPtr data); + public delegate RESULT SOUND_NONBLOCK_CALLBACK (IntPtr sound, RESULT result); + public delegate RESULT SOUND_PCMREAD_CALLBACK (IntPtr sound, IntPtr data, uint datalen); + public delegate RESULT SOUND_PCMSETPOS_CALLBACK (IntPtr sound, int subsound, uint position, TIMEUNIT postype); + public delegate RESULT FILE_OPEN_CALLBACK (IntPtr name, ref uint filesize, ref IntPtr handle, IntPtr userdata); + public delegate RESULT FILE_CLOSE_CALLBACK (IntPtr handle, IntPtr userdata); + public delegate RESULT FILE_READ_CALLBACK (IntPtr handle, IntPtr buffer, uint sizebytes, ref uint bytesread, IntPtr userdata); + public delegate RESULT FILE_SEEK_CALLBACK (IntPtr handle, uint pos, IntPtr userdata); + public delegate RESULT FILE_ASYNCREAD_CALLBACK (IntPtr info, IntPtr userdata); + public delegate RESULT FILE_ASYNCCANCEL_CALLBACK(IntPtr info, IntPtr userdata); + public delegate void FILE_ASYNCDONE_FUNC (IntPtr info, RESULT result); + public delegate IntPtr MEMORY_ALLOC_CALLBACK (uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate IntPtr MEMORY_REALLOC_CALLBACK (IntPtr ptr, uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate void MEMORY_FREE_CALLBACK (IntPtr ptr, MEMORY_TYPE type, IntPtr sourcestr); + public delegate float CB_3D_ROLLOFF_CALLBACK (IntPtr channelcontrol, float distance); + + public enum DSP_RESAMPLER : int + { + DEFAULT, + NOINTERP, + LINEAR, + CUBIC, + SPLINE, + + MAX, + } + + public enum DSP_CALLBACK_TYPE : int + { + DATAPARAMETERRELEASE, + + MAX, + } + + public enum DSPCONNECTION_TYPE : int + { + STANDARD, + SIDECHAIN, + SEND, + SEND_SIDECHAIN, + + MAX, + } + + public enum TAGTYPE : int + { + UNKNOWN = 0, + ID3V1, + ID3V2, + VORBISCOMMENT, + SHOUTCAST, + ICECAST, + ASF, + MIDI, + PLAYLIST, + FMOD, + USER, + + MAX + } + + public enum TAGDATATYPE : int + { + BINARY = 0, + INT, + FLOAT, + STRING, + STRING_UTF16, + STRING_UTF16BE, + STRING_UTF8, + + MAX + } + + [StructLayout(LayoutKind.Sequential)] + public struct TAG + { + public TAGTYPE type; + public TAGDATATYPE datatype; + public StringWrapper name; + public IntPtr data; + public uint datalen; + public bool updated; + } + + [Flags] + public enum TIMEUNIT : uint + { + MS = 0x00000001, + PCM = 0x00000002, + PCMBYTES = 0x00000004, + RAWBYTES = 0x00000008, + PCMFRACTION = 0x00000010, + MODORDER = 0x00000100, + MODROW = 0x00000200, + MODPATTERN = 0x00000400, + } + + public struct PORT_INDEX + { + public const ulong NONE = 0xFFFFFFFFFFFFFFFF; + public const ulong FLAG_VR_CONTROLLER = 0x1000000000000000; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CREATESOUNDEXINFO + { + public int cbsize; + public uint length; + public uint fileoffset; + public int numchannels; + public int defaultfrequency; + public SOUND_FORMAT format; + public uint decodebuffersize; + public int initialsubsound; + public int numsubsounds; + public IntPtr inclusionlist; + public int inclusionlistnum; + public IntPtr pcmreadcallback_internal; + public IntPtr pcmsetposcallback_internal; + public IntPtr nonblockcallback_internal; + public IntPtr dlsname; + public IntPtr encryptionkey; + public int maxpolyphony; + public IntPtr userdata; + public SOUND_TYPE suggestedsoundtype; + public IntPtr fileuseropen_internal; + public IntPtr fileuserclose_internal; + public IntPtr fileuserread_internal; + public IntPtr fileuserseek_internal; + public IntPtr fileuserasyncread_internal; + public IntPtr fileuserasynccancel_internal; + public IntPtr fileuserdata; + public int filebuffersize; + public CHANNELORDER channelorder; + public IntPtr initialsoundgroup; + public uint initialseekposition; + public TIMEUNIT initialseekpostype; + public int ignoresetfilesystem; + public uint audioqueuepolicy; + public uint minmidigranularity; + public int nonblockthreadid; + public IntPtr fsbguid; + + public SOUND_PCMREAD_CALLBACK pcmreadcallback + { + set { pcmreadcallback_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return pcmreadcallback_internal == IntPtr.Zero ? null : (SOUND_PCMREAD_CALLBACK)Marshal.GetDelegateForFunctionPointer(pcmreadcallback_internal, typeof(SOUND_PCMREAD_CALLBACK)); } + } + public SOUND_PCMSETPOS_CALLBACK pcmsetposcallback + { + set { pcmsetposcallback_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return pcmsetposcallback_internal == IntPtr.Zero ? null : (SOUND_PCMSETPOS_CALLBACK)Marshal.GetDelegateForFunctionPointer(pcmsetposcallback_internal, typeof(SOUND_PCMSETPOS_CALLBACK)); } + } + public SOUND_NONBLOCK_CALLBACK nonblockcallback + { + set { nonblockcallback_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return nonblockcallback_internal == IntPtr.Zero ? null : (SOUND_NONBLOCK_CALLBACK)Marshal.GetDelegateForFunctionPointer(nonblockcallback_internal, typeof(SOUND_NONBLOCK_CALLBACK)); } + } + public FILE_OPEN_CALLBACK fileuseropen + { + set { fileuseropen_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuseropen_internal == IntPtr.Zero ? null : (FILE_OPEN_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuseropen_internal, typeof(FILE_OPEN_CALLBACK)); } + } + public FILE_CLOSE_CALLBACK fileuserclose + { + set { fileuserclose_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuserclose_internal == IntPtr.Zero ? null : (FILE_CLOSE_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuserclose_internal, typeof(FILE_CLOSE_CALLBACK)); } + } + public FILE_READ_CALLBACK fileuserread + { + set { fileuserread_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuserread_internal == IntPtr.Zero ? null : (FILE_READ_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuserread_internal, typeof(FILE_READ_CALLBACK)); } + } + public FILE_SEEK_CALLBACK fileuserseek + { + set { fileuserseek_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuserseek_internal == IntPtr.Zero ? null : (FILE_SEEK_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuserseek_internal, typeof(FILE_SEEK_CALLBACK)); } + } + public FILE_ASYNCREAD_CALLBACK fileuserasyncread + { + set { fileuserasyncread_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuserasyncread_internal == IntPtr.Zero ? null : (FILE_ASYNCREAD_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuserasyncread_internal, typeof(FILE_ASYNCREAD_CALLBACK)); } + } + public FILE_ASYNCCANCEL_CALLBACK fileuserasynccancel + { + set { fileuserasynccancel_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuserasynccancel_internal == IntPtr.Zero ? null : (FILE_ASYNCCANCEL_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuserasynccancel_internal, typeof(FILE_ASYNCCANCEL_CALLBACK)); } + } + + } + +#pragma warning disable 414 + [StructLayout(LayoutKind.Sequential)] + public struct REVERB_PROPERTIES + { + public float DecayTime; + public float EarlyDelay; + public float LateDelay; + public float HFReference; + public float HFDecayRatio; + public float Diffusion; + public float Density; + public float LowShelfFrequency; + public float LowShelfGain; + public float HighCut; + public float EarlyLateMix; + public float WetLevel; + + #region wrapperinternal + public REVERB_PROPERTIES(float decayTime, float earlyDelay, float lateDelay, float hfReference, + float hfDecayRatio, float diffusion, float density, float lowShelfFrequency, float lowShelfGain, + float highCut, float earlyLateMix, float wetLevel) + { + DecayTime = decayTime; + EarlyDelay = earlyDelay; + LateDelay = lateDelay; + HFReference = hfReference; + HFDecayRatio = hfDecayRatio; + Diffusion = diffusion; + Density = density; + LowShelfFrequency = lowShelfFrequency; + LowShelfGain = lowShelfGain; + HighCut = highCut; + EarlyLateMix = earlyLateMix; + WetLevel = wetLevel; + } + #endregion + } +#pragma warning restore 414 + + public class PRESET + { + public static REVERB_PROPERTIES OFF() { return new REVERB_PROPERTIES( 1000, 7, 11, 5000, 100, 100, 100, 250, 0, 20, 96, -80.0f );} + public static REVERB_PROPERTIES GENERIC() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 83, 100, 100, 250, 0, 14500, 96, -8.0f );} + public static REVERB_PROPERTIES PADDEDCELL() { return new REVERB_PROPERTIES( 170, 1, 2, 5000, 10, 100, 100, 250, 0, 160, 84, -7.8f );} + public static REVERB_PROPERTIES ROOM() { return new REVERB_PROPERTIES( 400, 2, 3, 5000, 83, 100, 100, 250, 0, 6050, 88, -9.4f );} + public static REVERB_PROPERTIES BATHROOM() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 54, 100, 60, 250, 0, 2900, 83, 0.5f );} + public static REVERB_PROPERTIES LIVINGROOM() { return new REVERB_PROPERTIES( 500, 3, 4, 5000, 10, 100, 100, 250, 0, 160, 58, -19.0f );} + public static REVERB_PROPERTIES STONEROOM() { return new REVERB_PROPERTIES( 2300, 12, 17, 5000, 64, 100, 100, 250, 0, 7800, 71, -8.5f );} + public static REVERB_PROPERTIES AUDITORIUM() { return new REVERB_PROPERTIES( 4300, 20, 30, 5000, 59, 100, 100, 250, 0, 5850, 64, -11.7f );} + public static REVERB_PROPERTIES CONCERTHALL() { return new REVERB_PROPERTIES( 3900, 20, 29, 5000, 70, 100, 100, 250, 0, 5650, 80, -9.8f );} + public static REVERB_PROPERTIES CAVE() { return new REVERB_PROPERTIES( 2900, 15, 22, 5000, 100, 100, 100, 250, 0, 20000, 59, -11.3f );} + public static REVERB_PROPERTIES ARENA() { return new REVERB_PROPERTIES( 7200, 20, 30, 5000, 33, 100, 100, 250, 0, 4500, 80, -9.6f );} + public static REVERB_PROPERTIES HANGAR() { return new REVERB_PROPERTIES( 10000, 20, 30, 5000, 23, 100, 100, 250, 0, 3400, 72, -7.4f );} + public static REVERB_PROPERTIES CARPETTEDHALLWAY() { return new REVERB_PROPERTIES( 300, 2, 30, 5000, 10, 100, 100, 250, 0, 500, 56, -24.0f );} + public static REVERB_PROPERTIES HALLWAY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 59, 100, 100, 250, 0, 7800, 87, -5.5f );} + public static REVERB_PROPERTIES STONECORRIDOR() { return new REVERB_PROPERTIES( 270, 13, 20, 5000, 79, 100, 100, 250, 0, 9000, 86, -6.0f );} + public static REVERB_PROPERTIES ALLEY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 86, 100, 100, 250, 0, 8300, 80, -9.8f );} + public static REVERB_PROPERTIES FOREST() { return new REVERB_PROPERTIES( 1500, 162, 88, 5000, 54, 79, 100, 250, 0, 760, 94, -12.3f );} + public static REVERB_PROPERTIES CITY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 67, 50, 100, 250, 0, 4050, 66, -26.0f );} + public static REVERB_PROPERTIES MOUNTAINS() { return new REVERB_PROPERTIES( 1500, 300, 100, 5000, 21, 27, 100, 250, 0, 1220, 82, -24.0f );} + public static REVERB_PROPERTIES QUARRY() { return new REVERB_PROPERTIES( 1500, 61, 25, 5000, 83, 100, 100, 250, 0, 3400, 100, -5.0f );} + public static REVERB_PROPERTIES PLAIN() { return new REVERB_PROPERTIES( 1500, 179, 100, 5000, 50, 21, 100, 250, 0, 1670, 65, -28.0f );} + public static REVERB_PROPERTIES PARKINGLOT() { return new REVERB_PROPERTIES( 1700, 8, 12, 5000, 100, 100, 100, 250, 0, 20000, 56, -19.5f );} + public static REVERB_PROPERTIES SEWERPIPE() { return new REVERB_PROPERTIES( 2800, 14, 21, 5000, 14, 80, 60, 250, 0, 3400, 66, 1.2f );} + public static REVERB_PROPERTIES UNDERWATER() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 10, 100, 100, 250, 0, 500, 92, 7.0f );} + } + + [StructLayout(LayoutKind.Sequential)] + public struct ADVANCEDSETTINGS + { + public int cbSize; + public int maxMPEGCodecs; + public int maxADPCMCodecs; + public int maxXMACodecs; + public int maxVorbisCodecs; + public int maxAT9Codecs; + public int maxFADPCMCodecs; + public int maxPCMCodecs; + public int ASIONumChannels; + public IntPtr ASIOChannelList; + public IntPtr ASIOSpeakerList; + public float vol0virtualvol; + public uint defaultDecodeBufferSize; + public ushort profilePort; + public uint geometryMaxFadeTime; + public float distanceFilterCenterFreq; + public int reverb3Dinstance; + public int DSPBufferPoolSize; + public DSP_RESAMPLER resamplerMethod; + public uint randomSeed; + public int maxConvolutionThreads; + public int maxOpusCodecs; + } + + [Flags] + public enum DRIVER_STATE : uint + { + CONNECTED = 0x00000001, + DEFAULT = 0x00000002, + } + + public enum THREAD_PRIORITY : int + { + /* Platform specific priority range */ + PLATFORM_MIN = -32 * 1024, + PLATFORM_MAX = 32 * 1024, + + /* Platform agnostic priorities, maps internally to platform specific value */ + DEFAULT = PLATFORM_MIN - 1, + LOW = PLATFORM_MIN - 2, + MEDIUM = PLATFORM_MIN - 3, + HIGH = PLATFORM_MIN - 4, + VERY_HIGH = PLATFORM_MIN - 5, + EXTREME = PLATFORM_MIN - 6, + CRITICAL = PLATFORM_MIN - 7, + + /* Thread defaults */ + MIXER = EXTREME, + FEEDER = CRITICAL, + STREAM = VERY_HIGH, + FILE = HIGH, + NONBLOCKING = HIGH, + RECORD = HIGH, + GEOMETRY = LOW, + PROFILER = MEDIUM, + STUDIO_UPDATE = MEDIUM, + STUDIO_LOAD_BANK = MEDIUM, + STUDIO_LOAD_SAMPLE = MEDIUM, + CONVOLUTION1 = VERY_HIGH, + CONVOLUTION2 = VERY_HIGH + + } + + public enum THREAD_STACK_SIZE : uint + { + DEFAULT = 0, + MIXER = 80 * 1024, + FEEDER = 16 * 1024, + STREAM = 96 * 1024, + FILE = 64 * 1024, + NONBLOCKING = 112 * 1024, + RECORD = 16 * 1024, + GEOMETRY = 48 * 1024, + PROFILER = 128 * 1024, + STUDIO_UPDATE = 96 * 1024, + STUDIO_LOAD_BANK = 96 * 1024, + STUDIO_LOAD_SAMPLE = 96 * 1024, + CONVOLUTION1 = 16 * 1024, + CONVOLUTION2 = 16 * 1024 + } + + [Flags] + public enum THREAD_AFFINITY : long + { + /* Platform agnostic thread groupings */ + GROUP_DEFAULT = 0x4000000000000000, + GROUP_A = 0x4000000000000001, + GROUP_B = 0x4000000000000002, + GROUP_C = 0x4000000000000003, + + /* Thread defaults */ + MIXER = GROUP_A, + FEEDER = GROUP_C, + STREAM = GROUP_C, + FILE = GROUP_C, + NONBLOCKING = GROUP_C, + RECORD = GROUP_C, + GEOMETRY = GROUP_C, + PROFILER = GROUP_C, + STUDIO_UPDATE = GROUP_B, + STUDIO_LOAD_BANK = GROUP_C, + STUDIO_LOAD_SAMPLE = GROUP_C, + CONVOLUTION1 = GROUP_C, + CONVOLUTION2 = GROUP_C, + + /* Core mask, valid up to 1 << 61 */ + CORE_ALL = 0, + CORE_0 = 1 << 0, + CORE_1 = 1 << 1, + CORE_2 = 1 << 2, + CORE_3 = 1 << 3, + CORE_4 = 1 << 4, + CORE_5 = 1 << 5, + CORE_6 = 1 << 6, + CORE_7 = 1 << 7, + CORE_8 = 1 << 8, + CORE_9 = 1 << 9, + CORE_10 = 1 << 10, + CORE_11 = 1 << 11, + CORE_12 = 1 << 12, + CORE_13 = 1 << 13, + CORE_14 = 1 << 14, + CORE_15 = 1 << 15 + } + + public enum THREAD_TYPE : int + { + MIXER, + FEEDER, + STREAM, + FILE, + NONBLOCKING, + RECORD, + GEOMETRY, + PROFILER, + STUDIO_UPDATE, + STUDIO_LOAD_BANK, + STUDIO_LOAD_SAMPLE, + CONVOLUTION1, + CONVOLUTION2, + + MAX + } + + /* + FMOD System factory functions. Use this to create an FMOD System Instance. below you will see System init/close to get started. + */ + public struct Factory + { + public static RESULT System_Create(out System system) + { + return FMOD5_System_Create(out system.handle, VERSION.number); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Create(out IntPtr system, uint headerversion); + + #endregion + } + + /* + FMOD global system functions (optional). + */ + public struct Memory + { + public static RESULT Initialize(IntPtr poolmem, int poollen, MEMORY_ALLOC_CALLBACK useralloc, MEMORY_REALLOC_CALLBACK userrealloc, MEMORY_FREE_CALLBACK userfree, MEMORY_TYPE memtypeflags = MEMORY_TYPE.ALL) + { + return FMOD5_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); + } + + public static RESULT GetStats(out int currentalloced, out int maxalloced, bool blocking = true) + { + return FMOD5_Memory_GetStats(out currentalloced, out maxalloced, blocking); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Memory_Initialize(IntPtr poolmem, int poollen, MEMORY_ALLOC_CALLBACK useralloc, MEMORY_REALLOC_CALLBACK userrealloc, MEMORY_FREE_CALLBACK userfree, MEMORY_TYPE memtypeflags); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Memory_GetStats (out int currentalloced, out int maxalloced, bool blocking); + + #endregion + } + + public struct Debug + { + public static RESULT Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode = DEBUG_MODE.TTY, DEBUG_CALLBACK callback = null, string filename = null) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Debug_Initialize(flags, mode, callback, encoder.byteFromStringUTF8(filename)); + } + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Debug_Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode, DEBUG_CALLBACK callback, byte[] filename); + + #endregion + } + + public struct Thread + { + public static RESULT SetAttributes(THREAD_TYPE type, THREAD_AFFINITY affinity = THREAD_AFFINITY.GROUP_DEFAULT, THREAD_PRIORITY priority = THREAD_PRIORITY.DEFAULT, THREAD_STACK_SIZE stacksize = THREAD_STACK_SIZE.DEFAULT) + { + return FMOD5_Thread_SetAttributes(type, affinity, priority, stacksize); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Thread_SetAttributes(THREAD_TYPE type, THREAD_AFFINITY affinity, THREAD_PRIORITY priority, THREAD_STACK_SIZE stacksize); + #endregion + } + + /* + 'System' API. + */ + public struct System + { + public RESULT release() + { + return FMOD5_System_Release(this.handle); + } + + // Setup functions. + public RESULT setOutput(OUTPUTTYPE output) + { + return FMOD5_System_SetOutput(this.handle, output); + } + public RESULT getOutput(out OUTPUTTYPE output) + { + return FMOD5_System_GetOutput(this.handle, out output); + } + public RESULT getNumDrivers(out int numdrivers) + { + return FMOD5_System_GetNumDrivers(this.handle, out numdrivers); + } + public RESULT getDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels); + using (StringHelper.ThreadSafeEncoding encoding = StringHelper.GetFreeHelper()) + { + name = encoding.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) + { + return FMOD5_System_GetDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels); + } + public RESULT setDriver(int driver) + { + return FMOD5_System_SetDriver(this.handle, driver); + } + public RESULT getDriver(out int driver) + { + return FMOD5_System_GetDriver(this.handle, out driver); + } + public RESULT setSoftwareChannels(int numsoftwarechannels) + { + return FMOD5_System_SetSoftwareChannels(this.handle, numsoftwarechannels); + } + public RESULT getSoftwareChannels(out int numsoftwarechannels) + { + return FMOD5_System_GetSoftwareChannels(this.handle, out numsoftwarechannels); + } + public RESULT setSoftwareFormat(int samplerate, SPEAKERMODE speakermode, int numrawspeakers) + { + return FMOD5_System_SetSoftwareFormat(this.handle, samplerate, speakermode, numrawspeakers); + } + public RESULT getSoftwareFormat(out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers) + { + return FMOD5_System_GetSoftwareFormat(this.handle, out samplerate, out speakermode, out numrawspeakers); + } + public RESULT setDSPBufferSize(uint bufferlength, int numbuffers) + { + return FMOD5_System_SetDSPBufferSize(this.handle, bufferlength, numbuffers); + } + public RESULT getDSPBufferSize(out uint bufferlength, out int numbuffers) + { + return FMOD5_System_GetDSPBufferSize(this.handle, out bufferlength, out numbuffers); + } + public RESULT setFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek, FILE_ASYNCREAD_CALLBACK userasyncread, FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign) + { + return FMOD5_System_SetFileSystem(this.handle, useropen, userclose, userread, userseek, userasyncread, userasynccancel, blockalign); + } + public RESULT attachFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek) + { + return FMOD5_System_AttachFileSystem(this.handle, useropen, userclose, userread, userseek); + } + public RESULT setAdvancedSettings(ref ADVANCEDSETTINGS settings) + { + settings.cbSize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); + return FMOD5_System_SetAdvancedSettings(this.handle, ref settings); + } + public RESULT getAdvancedSettings(ref ADVANCEDSETTINGS settings) + { + settings.cbSize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); + return FMOD5_System_GetAdvancedSettings(this.handle, ref settings); + } + public RESULT setCallback(SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL) + { + return FMOD5_System_SetCallback(this.handle, callback, callbackmask); + } + + // Plug-in support. + public RESULT setPluginPath(string path) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_SetPluginPath(this.handle, encoder.byteFromStringUTF8(path)); + } + } + public RESULT loadPlugin(string filename, out uint handle, uint priority = 0) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_LoadPlugin(this.handle, encoder.byteFromStringUTF8(filename), out handle, priority); + } + } + public RESULT unloadPlugin(uint handle) + { + return FMOD5_System_UnloadPlugin(this.handle, handle); + } + public RESULT getNumNestedPlugins(uint handle, out int count) + { + return FMOD5_System_GetNumNestedPlugins(this.handle, handle, out count); + } + public RESULT getNestedPlugin(uint handle, int index, out uint nestedhandle) + { + return FMOD5_System_GetNestedPlugin(this.handle, handle, index, out nestedhandle); + } + public RESULT getNumPlugins(PLUGINTYPE plugintype, out int numplugins) + { + return FMOD5_System_GetNumPlugins(this.handle, plugintype, out numplugins); + } + public RESULT getPluginHandle(PLUGINTYPE plugintype, int index, out uint handle) + { + return FMOD5_System_GetPluginHandle(this.handle, plugintype, index, out handle); + } + public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out string name, int namelen, out uint version) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, stringMem, namelen, out version); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out uint version) + { + return FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, IntPtr.Zero, 0, out version); + } + public RESULT setOutputByPlugin(uint handle) + { + return FMOD5_System_SetOutputByPlugin(this.handle, handle); + } + public RESULT getOutputByPlugin(out uint handle) + { + return FMOD5_System_GetOutputByPlugin(this.handle, out handle); + } + public RESULT createDSPByPlugin(uint handle, out DSP dsp) + { + return FMOD5_System_CreateDSPByPlugin(this.handle, handle, out dsp.handle); + } + public RESULT getDSPInfoByPlugin(uint handle, out IntPtr description) + { + return FMOD5_System_GetDSPInfoByPlugin(this.handle, handle, out description); + } + public RESULT registerDSP(ref DSP_DESCRIPTION description, out uint handle) + { + return FMOD5_System_RegisterDSP(this.handle, ref description, out handle); + } + + // Init/Close. + public RESULT init(int maxchannels, INITFLAGS flags, IntPtr extradriverdata) + { + return FMOD5_System_Init(this.handle, maxchannels, flags, extradriverdata); + } + public RESULT close() + { + return FMOD5_System_Close(this.handle); + } + + // General post-init system functions. + public RESULT update() + { + return FMOD5_System_Update(this.handle); + } + public RESULT setSpeakerPosition(SPEAKER speaker, float x, float y, bool active) + { + return FMOD5_System_SetSpeakerPosition(this.handle, speaker, x, y, active); + } + public RESULT getSpeakerPosition(SPEAKER speaker, out float x, out float y, out bool active) + { + return FMOD5_System_GetSpeakerPosition(this.handle, speaker, out x, out y, out active); + } + public RESULT setStreamBufferSize(uint filebuffersize, TIMEUNIT filebuffersizetype) + { + return FMOD5_System_SetStreamBufferSize(this.handle, filebuffersize, filebuffersizetype); + } + public RESULT getStreamBufferSize(out uint filebuffersize, out TIMEUNIT filebuffersizetype) + { + return FMOD5_System_GetStreamBufferSize(this.handle, out filebuffersize, out filebuffersizetype); + } + public RESULT set3DSettings(float dopplerscale, float distancefactor, float rolloffscale) + { + return FMOD5_System_Set3DSettings(this.handle, dopplerscale, distancefactor, rolloffscale); + } + public RESULT get3DSettings(out float dopplerscale, out float distancefactor, out float rolloffscale) + { + return FMOD5_System_Get3DSettings(this.handle, out dopplerscale, out distancefactor, out rolloffscale); + } + public RESULT set3DNumListeners(int numlisteners) + { + return FMOD5_System_Set3DNumListeners(this.handle, numlisteners); + } + public RESULT get3DNumListeners(out int numlisteners) + { + return FMOD5_System_Get3DNumListeners(this.handle, out numlisteners); + } + public RESULT set3DListenerAttributes(int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up) + { + return FMOD5_System_Set3DListenerAttributes(this.handle, listener, ref pos, ref vel, ref forward, ref up); + } + public RESULT get3DListenerAttributes(int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up) + { + return FMOD5_System_Get3DListenerAttributes(this.handle, listener, out pos, out vel, out forward, out up); + } + public RESULT set3DRolloffCallback(CB_3D_ROLLOFF_CALLBACK callback) + { + return FMOD5_System_Set3DRolloffCallback(this.handle, callback); + } + public RESULT mixerSuspend() + { + return FMOD5_System_MixerSuspend(this.handle); + } + public RESULT mixerResume() + { + return FMOD5_System_MixerResume(this.handle); + } + public RESULT getDefaultMixMatrix(SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop) + { + return FMOD5_System_GetDefaultMixMatrix(this.handle, sourcespeakermode, targetspeakermode, matrix, matrixhop); + } + public RESULT getSpeakerModeChannels(SPEAKERMODE mode, out int channels) + { + return FMOD5_System_GetSpeakerModeChannels(this.handle, mode, out channels); + } + + // System information functions. + public RESULT getVersion(out uint version) + { + return FMOD5_System_GetVersion(this.handle, out version); + } + public RESULT getOutputHandle(out IntPtr handle) + { + return FMOD5_System_GetOutputHandle(this.handle, out handle); + } + public RESULT getChannelsPlaying(out int channels) + { + return FMOD5_System_GetChannelsPlaying(this.handle, out channels, IntPtr.Zero); + } + public RESULT getChannelsPlaying(out int channels, out int realchannels) + { + return FMOD5_System_GetChannelsPlaying(this.handle, out channels, out realchannels); + } + public RESULT getCPUUsage(out CPU_USAGE usage) + { + return FMOD5_System_GetCPUUsage(this.handle, out usage); + } + public RESULT getFileUsage(out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead) + { + return FMOD5_System_GetFileUsage(this.handle, out sampleBytesRead, out streamBytesRead, out otherBytesRead); + } + + // Sound/DSP/Channel/FX creation and retrieval. + public RESULT createSound(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateSound(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); + } + } + public RESULT createSound(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateSound(this.handle, data, mode, ref exinfo, out sound.handle); + } + public RESULT createSound(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateSound(this.handle, name_or_data, mode, ref exinfo, out sound.handle); + } + public RESULT createSound(string name, MODE mode, out Sound sound) + { + CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); + exinfo.cbsize = MarshalHelper.SizeOf(typeof(CREATESOUNDEXINFO)); + + return createSound(name, mode, ref exinfo, out sound); + } + public RESULT createStream(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateStream(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); + } + } + public RESULT createStream(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateStream(this.handle, data, mode, ref exinfo, out sound.handle); + } + public RESULT createStream(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateStream(this.handle, name_or_data, mode, ref exinfo, out sound.handle); + } + public RESULT createStream(string name, MODE mode, out Sound sound) + { + CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); + exinfo.cbsize = MarshalHelper.SizeOf(typeof(CREATESOUNDEXINFO)); + + return createStream(name, mode, ref exinfo, out sound); + } + public RESULT createDSP(ref DSP_DESCRIPTION description, out DSP dsp) + { + return FMOD5_System_CreateDSP(this.handle, ref description, out dsp.handle); + } + public RESULT createDSPByType(DSP_TYPE type, out DSP dsp) + { + return FMOD5_System_CreateDSPByType(this.handle, type, out dsp.handle); + } + public RESULT createChannelGroup(string name, out ChannelGroup channelgroup) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateChannelGroup(this.handle, encoder.byteFromStringUTF8(name), out channelgroup.handle); + } + } + public RESULT createSoundGroup(string name, out SoundGroup soundgroup) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateSoundGroup(this.handle, encoder.byteFromStringUTF8(name), out soundgroup.handle); + } + } + public RESULT createReverb3D(out Reverb3D reverb) + { + return FMOD5_System_CreateReverb3D(this.handle, out reverb.handle); + } + public RESULT playSound(Sound sound, ChannelGroup channelgroup, bool paused, out Channel channel) + { + return FMOD5_System_PlaySound(this.handle, sound.handle, channelgroup.handle, paused, out channel.handle); + } + public RESULT playDSP(DSP dsp, ChannelGroup channelgroup, bool paused, out Channel channel) + { + return FMOD5_System_PlayDSP(this.handle, dsp.handle, channelgroup.handle, paused, out channel.handle); + } + public RESULT getChannel(int channelid, out Channel channel) + { + return FMOD5_System_GetChannel(this.handle, channelid, out channel.handle); + } + public RESULT getDSPInfoByType(DSP_TYPE type, out IntPtr description) + { + return FMOD5_System_GetDSPInfoByType(this.handle, type, out description); + } + public RESULT getMasterChannelGroup(out ChannelGroup channelgroup) + { + return FMOD5_System_GetMasterChannelGroup(this.handle, out channelgroup.handle); + } + public RESULT getMasterSoundGroup(out SoundGroup soundgroup) + { + return FMOD5_System_GetMasterSoundGroup(this.handle, out soundgroup.handle); + } + + // Routing to ports. + public RESULT attachChannelGroupToPort(PORT_TYPE portType, ulong portIndex, ChannelGroup channelgroup, bool passThru = false) + { + return FMOD5_System_AttachChannelGroupToPort(this.handle, portType, portIndex, channelgroup.handle, passThru); + } + public RESULT detachChannelGroupFromPort(ChannelGroup channelgroup) + { + return FMOD5_System_DetachChannelGroupFromPort(this.handle, channelgroup.handle); + } + + // Reverb api. + public RESULT setReverbProperties(int instance, ref REVERB_PROPERTIES prop) + { + return FMOD5_System_SetReverbProperties(this.handle, instance, ref prop); + } + public RESULT getReverbProperties(int instance, out REVERB_PROPERTIES prop) + { + return FMOD5_System_GetReverbProperties(this.handle, instance, out prop); + } + + // System level DSP functionality. + public RESULT lockDSP() + { + return FMOD5_System_LockDSP(this.handle); + } + public RESULT unlockDSP() + { + return FMOD5_System_UnlockDSP(this.handle); + } + + // Recording api + public RESULT getRecordNumDrivers(out int numdrivers, out int numconnected) + { + return FMOD5_System_GetRecordNumDrivers(this.handle, out numdrivers, out numconnected); + } + public RESULT getRecordDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetRecordDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels, out state); + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getRecordDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) + { + return FMOD5_System_GetRecordDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels, out state); + } + public RESULT getRecordPosition(int id, out uint position) + { + return FMOD5_System_GetRecordPosition(this.handle, id, out position); + } + public RESULT recordStart(int id, Sound sound, bool loop) + { + return FMOD5_System_RecordStart(this.handle, id, sound.handle, loop); + } + public RESULT recordStop(int id) + { + return FMOD5_System_RecordStop(this.handle, id); + } + public RESULT isRecording(int id, out bool recording) + { + return FMOD5_System_IsRecording(this.handle, id, out recording); + } + + // Geometry api + public RESULT createGeometry(int maxpolygons, int maxvertices, out Geometry geometry) + { + return FMOD5_System_CreateGeometry(this.handle, maxpolygons, maxvertices, out geometry.handle); + } + public RESULT setGeometrySettings(float maxworldsize) + { + return FMOD5_System_SetGeometrySettings(this.handle, maxworldsize); + } + public RESULT getGeometrySettings(out float maxworldsize) + { + return FMOD5_System_GetGeometrySettings(this.handle, out maxworldsize); + } + public RESULT loadGeometry(IntPtr data, int datasize, out Geometry geometry) + { + return FMOD5_System_LoadGeometry(this.handle, data, datasize, out geometry.handle); + } + public RESULT getGeometryOcclusion(ref VECTOR listener, ref VECTOR source, out float direct, out float reverb) + { + return FMOD5_System_GetGeometryOcclusion(this.handle, ref listener, ref source, out direct, out reverb); + } + + // Network functions + public RESULT setNetworkProxy(string proxy) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_SetNetworkProxy(this.handle, encoder.byteFromStringUTF8(proxy)); + } + } + public RESULT getNetworkProxy(out string proxy, int proxylen) + { + IntPtr stringMem = Marshal.AllocHGlobal(proxylen); + + RESULT result = FMOD5_System_GetNetworkProxy(this.handle, stringMem, proxylen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + proxy = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT setNetworkTimeout(int timeout) + { + return FMOD5_System_SetNetworkTimeout(this.handle, timeout); + } + public RESULT getNetworkTimeout(out int timeout) + { + return FMOD5_System_GetNetworkTimeout(this.handle, out timeout); + } + + // Userdata set/get + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_System_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_System_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Release (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetOutput (IntPtr system, OUTPUTTYPE output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutput (IntPtr system, out OUTPUTTYPE output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumDrivers (IntPtr system, out int numdrivers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetDriver (IntPtr system, int driver); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDriver (IntPtr system, out int driver); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSoftwareChannels (IntPtr system, int numsoftwarechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSoftwareChannels (IntPtr system, out int numsoftwarechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSoftwareFormat (IntPtr system, int samplerate, SPEAKERMODE speakermode, int numrawspeakers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSoftwareFormat (IntPtr system, out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetDSPBufferSize (IntPtr system, uint bufferlength, int numbuffers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPBufferSize (IntPtr system, out uint bufferlength, out int numbuffers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetFileSystem (IntPtr system, FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek, FILE_ASYNCREAD_CALLBACK userasyncread, FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_AttachFileSystem (IntPtr system, FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetCallback (IntPtr system, SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetPluginPath (IntPtr system, byte[] path); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LoadPlugin (IntPtr system, byte[] filename, out uint handle, uint priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_UnloadPlugin (IntPtr system, uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumNestedPlugins (IntPtr system, uint handle, out int count); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNestedPlugin (IntPtr system, uint handle, int index, out uint nestedhandle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumPlugins (IntPtr system, PLUGINTYPE plugintype, out int numplugins); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetPluginHandle (IntPtr system, PLUGINTYPE plugintype, int index, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetPluginInfo (IntPtr system, uint handle, out PLUGINTYPE plugintype, IntPtr name, int namelen, out uint version); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetOutputByPlugin (IntPtr system, uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutputByPlugin (IntPtr system, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSPByPlugin (IntPtr system, uint handle, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPInfoByPlugin (IntPtr system, uint handle, out IntPtr description); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RegisterDSP (IntPtr system, ref DSP_DESCRIPTION description, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Init (IntPtr system, int maxchannels, INITFLAGS flags, IntPtr extradriverdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Close (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Update (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSpeakerPosition (IntPtr system, SPEAKER speaker, float x, float y, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSpeakerPosition (IntPtr system, SPEAKER speaker, out float x, out float y, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetStreamBufferSize (IntPtr system, uint filebuffersize, TIMEUNIT filebuffersizetype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetStreamBufferSize (IntPtr system, out uint filebuffersize, out TIMEUNIT filebuffersizetype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DSettings (IntPtr system, float dopplerscale, float distancefactor, float rolloffscale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DSettings (IntPtr system, out float dopplerscale, out float distancefactor, out float rolloffscale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DNumListeners (IntPtr system, int numlisteners); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DNumListeners (IntPtr system, out int numlisteners); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DListenerAttributes (IntPtr system, int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DListenerAttributes (IntPtr system, int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DRolloffCallback (IntPtr system, CB_3D_ROLLOFF_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_MixerSuspend (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_MixerResume (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDefaultMixMatrix (IntPtr system, SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSpeakerModeChannels (IntPtr system, SPEAKERMODE mode, out int channels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetVersion (IntPtr system, out uint version); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutputHandle (IntPtr system, out IntPtr handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, out int realchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetCPUUsage (IntPtr system, out CPU_USAGE usage); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetFileUsage (IntPtr system, out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSound (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSound (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateStream (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateStream (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSP (IntPtr system, ref DSP_DESCRIPTION description, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSPByType (IntPtr system, DSP_TYPE type, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateChannelGroup (IntPtr system, byte[] name, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSoundGroup (IntPtr system, byte[] name, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateReverb3D (IntPtr system, out IntPtr reverb); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_PlaySound (IntPtr system, IntPtr sound, IntPtr channelgroup, bool paused, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_PlayDSP (IntPtr system, IntPtr dsp, IntPtr channelgroup, bool paused, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannel (IntPtr system, int channelid, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPInfoByType (IntPtr system, DSP_TYPE type, out IntPtr description); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetMasterChannelGroup (IntPtr system, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetMasterSoundGroup (IntPtr system, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_AttachChannelGroupToPort (IntPtr system, PORT_TYPE portType, ulong portIndex, IntPtr channelgroup, bool passThru); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_DetachChannelGroupFromPort(IntPtr system, IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetReverbProperties (IntPtr system, int instance, ref REVERB_PROPERTIES prop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetReverbProperties (IntPtr system, int instance, out REVERB_PROPERTIES prop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LockDSP (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_UnlockDSP (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordNumDrivers (IntPtr system, out int numdrivers, out int numconnected); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordPosition (IntPtr system, int id, out uint position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RecordStart (IntPtr system, int id, IntPtr sound, bool loop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RecordStop (IntPtr system, int id); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_IsRecording (IntPtr system, int id, out bool recording); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateGeometry (IntPtr system, int maxpolygons, int maxvertices, out IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetGeometrySettings (IntPtr system, float maxworldsize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetGeometrySettings (IntPtr system, out float maxworldsize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LoadGeometry (IntPtr system, IntPtr data, int datasize, out IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetGeometryOcclusion (IntPtr system, ref VECTOR listener, ref VECTOR source, out float direct, out float reverb); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetNetworkProxy (IntPtr system, byte[] proxy); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNetworkProxy (IntPtr system, IntPtr proxy, int proxylen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetNetworkTimeout (IntPtr system, int timeout); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNetworkTimeout (IntPtr system, out int timeout); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetUserData (IntPtr system, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetUserData (IntPtr system, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public System(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + + /* + 'Sound' API. + */ + public struct Sound + { + public RESULT release() + { + return FMOD5_Sound_Release(this.handle); + } + public RESULT getSystemObject(out System system) + { + return FMOD5_Sound_GetSystemObject(this.handle, out system.handle); + } + + // Standard sound manipulation functions. + public RESULT @lock(uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2) + { + return FMOD5_Sound_Lock(this.handle, offset, length, out ptr1, out ptr2, out len1, out len2); + } + public RESULT unlock(IntPtr ptr1, IntPtr ptr2, uint len1, uint len2) + { + return FMOD5_Sound_Unlock(this.handle, ptr1, ptr2, len1, len2); + } + public RESULT setDefaults(float frequency, int priority) + { + return FMOD5_Sound_SetDefaults(this.handle, frequency, priority); + } + public RESULT getDefaults(out float frequency, out int priority) + { + return FMOD5_Sound_GetDefaults(this.handle, out frequency, out priority); + } + public RESULT set3DMinMaxDistance(float min, float max) + { + return FMOD5_Sound_Set3DMinMaxDistance(this.handle, min, max); + } + public RESULT get3DMinMaxDistance(out float min, out float max) + { + return FMOD5_Sound_Get3DMinMaxDistance(this.handle, out min, out max); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_Sound_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_Sound_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_Sound_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_Sound_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + + public RESULT getSubSound(int index, out Sound subsound) + { + return FMOD5_Sound_GetSubSound(this.handle, index, out subsound.handle); + } + public RESULT getSubSoundParent(out Sound parentsound) + { + return FMOD5_Sound_GetSubSoundParent(this.handle, out parentsound.handle); + } + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_Sound_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getLength(out uint length, TIMEUNIT lengthtype) + { + return FMOD5_Sound_GetLength(this.handle, out length, lengthtype); + } + public RESULT getFormat(out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits) + { + return FMOD5_Sound_GetFormat(this.handle, out type, out format, out channels, out bits); + } + public RESULT getNumSubSounds(out int numsubsounds) + { + return FMOD5_Sound_GetNumSubSounds(this.handle, out numsubsounds); + } + public RESULT getNumTags(out int numtags, out int numtagsupdated) + { + return FMOD5_Sound_GetNumTags(this.handle, out numtags, out numtagsupdated); + } + public RESULT getTag(string name, int index, out TAG tag) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Sound_GetTag(this.handle, encoder.byteFromStringUTF8(name), index, out tag); + } + } + public RESULT getOpenState(out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy) + { + return FMOD5_Sound_GetOpenState(this.handle, out openstate, out percentbuffered, out starving, out diskbusy); + } + public RESULT readData(byte[] buffer) + { + return FMOD5_Sound_ReadData(this.handle, buffer, (uint)buffer.Length, IntPtr.Zero); + } + public RESULT readData(byte[] buffer, out uint read) + { + return FMOD5_Sound_ReadData(this.handle, buffer, (uint)buffer.Length, out read); + } + [Obsolete("Use Sound.readData(byte[], out uint) or Sound.readData(byte[]) instead.")] + public RESULT readData(IntPtr buffer, uint length, out uint read) + { + return FMOD5_Sound_ReadData(this.handle, buffer, length, out read); + } + public RESULT seekData(uint pcm) + { + return FMOD5_Sound_SeekData(this.handle, pcm); + } + public RESULT setSoundGroup(SoundGroup soundgroup) + { + return FMOD5_Sound_SetSoundGroup(this.handle, soundgroup.handle); + } + public RESULT getSoundGroup(out SoundGroup soundgroup) + { + return FMOD5_Sound_GetSoundGroup(this.handle, out soundgroup.handle); + } + + // Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks. + public RESULT getNumSyncPoints(out int numsyncpoints) + { + return FMOD5_Sound_GetNumSyncPoints(this.handle, out numsyncpoints); + } + public RESULT getSyncPoint(int index, out IntPtr point) + { + return FMOD5_Sound_GetSyncPoint(this.handle, index, out point); + } + public RESULT getSyncPointInfo(IntPtr point, out string name, int namelen, out uint offset, TIMEUNIT offsettype) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_Sound_GetSyncPointInfo(this.handle, point, stringMem, namelen, out offset, offsettype); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getSyncPointInfo(IntPtr point, out uint offset, TIMEUNIT offsettype) + { + return FMOD5_Sound_GetSyncPointInfo(this.handle, point, IntPtr.Zero, 0, out offset, offsettype); + } + public RESULT addSyncPoint(uint offset, TIMEUNIT offsettype, string name, out IntPtr point) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Sound_AddSyncPoint(this.handle, offset, offsettype, encoder.byteFromStringUTF8(name), out point); + } + } + public RESULT deleteSyncPoint(IntPtr point) + { + return FMOD5_Sound_DeleteSyncPoint(this.handle, point); + } + + // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time. + public RESULT setMode(MODE mode) + { + return FMOD5_Sound_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_Sound_GetMode(this.handle, out mode); + } + public RESULT setLoopCount(int loopcount) + { + return FMOD5_Sound_SetLoopCount(this.handle, loopcount); + } + public RESULT getLoopCount(out int loopcount) + { + return FMOD5_Sound_GetLoopCount(this.handle, out loopcount); + } + public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Sound_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); + } + public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Sound_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); + } + + // For MOD/S3M/XM/IT/MID sequenced formats only. + public RESULT getMusicNumChannels(out int numchannels) + { + return FMOD5_Sound_GetMusicNumChannels(this.handle, out numchannels); + } + public RESULT setMusicChannelVolume(int channel, float volume) + { + return FMOD5_Sound_SetMusicChannelVolume(this.handle, channel, volume); + } + public RESULT getMusicChannelVolume(int channel, out float volume) + { + return FMOD5_Sound_GetMusicChannelVolume(this.handle, channel, out volume); + } + public RESULT setMusicSpeed(float speed) + { + return FMOD5_Sound_SetMusicSpeed(this.handle, speed); + } + public RESULT getMusicSpeed(out float speed) + { + return FMOD5_Sound_GetMusicSpeed(this.handle, out speed); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Sound_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Sound_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Release (IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSystemObject (IntPtr sound, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Lock (IntPtr sound, uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Unlock (IntPtr sound, IntPtr ptr1, IntPtr ptr2, uint len1, uint len2); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetDefaults (IntPtr sound, float frequency, int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetDefaults (IntPtr sound, out float frequency, out int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DMinMaxDistance (IntPtr sound, float min, float max); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DMinMaxDistance (IntPtr sound, out float min, out float max); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DConeSettings (IntPtr sound, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DConeSettings (IntPtr sound, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DCustomRolloff (IntPtr sound, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DCustomRolloff (IntPtr sound, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSubSound (IntPtr sound, int index, out IntPtr subsound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSubSoundParent (IntPtr sound, out IntPtr parentsound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetName (IntPtr sound, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLength (IntPtr sound, out uint length, TIMEUNIT lengthtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetFormat (IntPtr sound, out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumSubSounds (IntPtr sound, out int numsubsounds); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumTags (IntPtr sound, out int numtags, out int numtagsupdated); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetTag (IntPtr sound, byte[] name, int index, out TAG tag); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetOpenState (IntPtr sound, out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, byte[] buffer, uint length, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, byte[] buffer, uint length, out uint read); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, IntPtr buffer, uint length, out uint read); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SeekData (IntPtr sound, uint pcm); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetSoundGroup (IntPtr sound, IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSoundGroup (IntPtr sound, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumSyncPoints (IntPtr sound, out int numsyncpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSyncPoint (IntPtr sound, int index, out IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSyncPointInfo (IntPtr sound, IntPtr point, IntPtr name, int namelen, out uint offset, TIMEUNIT offsettype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_AddSyncPoint (IntPtr sound, uint offset, TIMEUNIT offsettype, byte[] name, out IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_DeleteSyncPoint (IntPtr sound, IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMode (IntPtr sound, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMode (IntPtr sound, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetLoopCount (IntPtr sound, int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLoopCount (IntPtr sound, out int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetLoopPoints (IntPtr sound, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLoopPoints (IntPtr sound, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicNumChannels (IntPtr sound, out int numchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMusicChannelVolume (IntPtr sound, int channel, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicChannelVolume (IntPtr sound, int channel, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMusicSpeed (IntPtr sound, float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicSpeed (IntPtr sound, out float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetUserData (IntPtr sound, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetUserData (IntPtr sound, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Sound(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'ChannelControl' API + */ + interface IChannelControl + { + RESULT getSystemObject (out System system); + + // General control functionality for Channels and ChannelGroups. + RESULT stop (); + RESULT setPaused (bool paused); + RESULT getPaused (out bool paused); + RESULT setVolume (float volume); + RESULT getVolume (out float volume); + RESULT setVolumeRamp (bool ramp); + RESULT getVolumeRamp (out bool ramp); + RESULT getAudibility (out float audibility); + RESULT setPitch (float pitch); + RESULT getPitch (out float pitch); + RESULT setMute (bool mute); + RESULT getMute (out bool mute); + RESULT setReverbProperties (int instance, float wet); + RESULT getReverbProperties (int instance, out float wet); + RESULT setLowPassGain (float gain); + RESULT getLowPassGain (out float gain); + RESULT setMode (MODE mode); + RESULT getMode (out MODE mode); + RESULT setCallback (CHANNELCONTROL_CALLBACK callback); + RESULT isPlaying (out bool isplaying); + + // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. + RESULT setPan (float pan); + RESULT setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + RESULT setMixLevelsInput (float[] levels, int numlevels); + RESULT setMixMatrix (float[] matrix, int outchannels, int inchannels, int inchannel_hop); + RESULT getMixMatrix (float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + + // Clock based functionality. + RESULT getDSPClock (out ulong dspclock, out ulong parentclock); + RESULT setDelay (ulong dspclock_start, ulong dspclock_end, bool stopchannels); + RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end); + RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + RESULT addFadePoint (ulong dspclock, float volume); + RESULT setFadePointRamp (ulong dspclock, float volume); + RESULT removeFadePoints (ulong dspclock_start, ulong dspclock_end); + RESULT getFadePoints (ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + + // DSP effects. + RESULT getDSP (int index, out DSP dsp); + RESULT addDSP (int index, DSP dsp); + RESULT removeDSP (DSP dsp); + RESULT getNumDSPs (out int numdsps); + RESULT setDSPIndex (DSP dsp, int index); + RESULT getDSPIndex (DSP dsp, out int index); + + // 3D functionality. + RESULT set3DAttributes (ref VECTOR pos, ref VECTOR vel); + RESULT get3DAttributes (out VECTOR pos, out VECTOR vel); + RESULT set3DMinMaxDistance (float mindistance, float maxdistance); + RESULT get3DMinMaxDistance (out float mindistance, out float maxdistance); + RESULT set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume); + RESULT get3DConeSettings (out float insideconeangle, out float outsideconeangle, out float outsidevolume); + RESULT set3DConeOrientation (ref VECTOR orientation); + RESULT get3DConeOrientation (out VECTOR orientation); + RESULT set3DCustomRolloff (ref VECTOR points, int numpoints); + RESULT get3DCustomRolloff (out IntPtr points, out int numpoints); + RESULT set3DOcclusion (float directocclusion, float reverbocclusion); + RESULT get3DOcclusion (out float directocclusion, out float reverbocclusion); + RESULT set3DSpread (float angle); + RESULT get3DSpread (out float angle); + RESULT set3DLevel (float level); + RESULT get3DLevel (out float level); + RESULT set3DDopplerLevel (float level); + RESULT get3DDopplerLevel (out float level); + RESULT set3DDistanceFilter (bool custom, float customLevel, float centerFreq); + RESULT get3DDistanceFilter (out bool custom, out float customLevel, out float centerFreq); + + // Userdata set/get. + RESULT setUserData (IntPtr userdata); + RESULT getUserData (out IntPtr userdata); + } + + /* + 'Channel' API + */ + public struct Channel : IChannelControl + { + // Channel specific control functionality. + public RESULT setFrequency(float frequency) + { + return FMOD5_Channel_SetFrequency(this.handle, frequency); + } + public RESULT getFrequency(out float frequency) + { + return FMOD5_Channel_GetFrequency(this.handle, out frequency); + } + public RESULT setPriority(int priority) + { + return FMOD5_Channel_SetPriority(this.handle, priority); + } + public RESULT getPriority(out int priority) + { + return FMOD5_Channel_GetPriority(this.handle, out priority); + } + public RESULT setPosition(uint position, TIMEUNIT postype) + { + return FMOD5_Channel_SetPosition(this.handle, position, postype); + } + public RESULT getPosition(out uint position, TIMEUNIT postype) + { + return FMOD5_Channel_GetPosition(this.handle, out position, postype); + } + public RESULT setChannelGroup(ChannelGroup channelgroup) + { + return FMOD5_Channel_SetChannelGroup(this.handle, channelgroup.handle); + } + public RESULT getChannelGroup(out ChannelGroup channelgroup) + { + return FMOD5_Channel_GetChannelGroup(this.handle, out channelgroup.handle); + } + public RESULT setLoopCount(int loopcount) + { + return FMOD5_Channel_SetLoopCount(this.handle, loopcount); + } + public RESULT getLoopCount(out int loopcount) + { + return FMOD5_Channel_GetLoopCount(this.handle, out loopcount); + } + public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Channel_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); + } + public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Channel_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); + } + + // Information only functions. + public RESULT isVirtual(out bool isvirtual) + { + return FMOD5_Channel_IsVirtual(this.handle, out isvirtual); + } + public RESULT getCurrentSound(out Sound sound) + { + return FMOD5_Channel_GetCurrentSound(this.handle, out sound.handle); + } + public RESULT getIndex(out int index) + { + return FMOD5_Channel_GetIndex(this.handle, out index); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_Channel_GetSystemObject(this.handle, out system.handle); + } + + // General control functionality for Channels and ChannelGroups. + public RESULT stop() + { + return FMOD5_Channel_Stop(this.handle); + } + public RESULT setPaused(bool paused) + { + return FMOD5_Channel_SetPaused(this.handle, paused); + } + public RESULT getPaused(out bool paused) + { + return FMOD5_Channel_GetPaused(this.handle, out paused); + } + public RESULT setVolume(float volume) + { + return FMOD5_Channel_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_Channel_GetVolume(this.handle, out volume); + } + public RESULT setVolumeRamp(bool ramp) + { + return FMOD5_Channel_SetVolumeRamp(this.handle, ramp); + } + public RESULT getVolumeRamp(out bool ramp) + { + return FMOD5_Channel_GetVolumeRamp(this.handle, out ramp); + } + public RESULT getAudibility(out float audibility) + { + return FMOD5_Channel_GetAudibility(this.handle, out audibility); + } + public RESULT setPitch(float pitch) + { + return FMOD5_Channel_SetPitch(this.handle, pitch); + } + public RESULT getPitch(out float pitch) + { + return FMOD5_Channel_GetPitch(this.handle, out pitch); + } + public RESULT setMute(bool mute) + { + return FMOD5_Channel_SetMute(this.handle, mute); + } + public RESULT getMute(out bool mute) + { + return FMOD5_Channel_GetMute(this.handle, out mute); + } + public RESULT setReverbProperties(int instance, float wet) + { + return FMOD5_Channel_SetReverbProperties(this.handle, instance, wet); + } + public RESULT getReverbProperties(int instance, out float wet) + { + return FMOD5_Channel_GetReverbProperties(this.handle, instance, out wet); + } + public RESULT setLowPassGain(float gain) + { + return FMOD5_Channel_SetLowPassGain(this.handle, gain); + } + public RESULT getLowPassGain(out float gain) + { + return FMOD5_Channel_GetLowPassGain(this.handle, out gain); + } + public RESULT setMode(MODE mode) + { + return FMOD5_Channel_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_Channel_GetMode(this.handle, out mode); + } + public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) + { + return FMOD5_Channel_SetCallback(this.handle, callback); + } + public RESULT isPlaying(out bool isplaying) + { + return FMOD5_Channel_IsPlaying(this.handle, out isplaying); + } + + // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. + public RESULT setPan(float pan) + { + return FMOD5_Channel_SetPan(this.handle, pan); + } + public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) + { + return FMOD5_Channel_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); + } + public RESULT setMixLevelsInput(float[] levels, int numlevels) + { + return FMOD5_Channel_SetMixLevelsInput(this.handle, levels, numlevels); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) + { + return FMOD5_Channel_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) + { + return FMOD5_Channel_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + + // Clock based functionality. + public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) + { + return FMOD5_Channel_GetDSPClock(this.handle, out dspclock, out parentclock); + } + public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels = true) + { + return FMOD5_Channel_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) + { + return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) + { + return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); + } + public RESULT addFadePoint(ulong dspclock, float volume) + { + return FMOD5_Channel_AddFadePoint(this.handle, dspclock, volume); + } + public RESULT setFadePointRamp(ulong dspclock, float volume) + { + return FMOD5_Channel_SetFadePointRamp(this.handle, dspclock, volume); + } + public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) + { + return FMOD5_Channel_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); + } + public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) + { + return FMOD5_Channel_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); + } + + // DSP effects. + public RESULT getDSP(int index, out DSP dsp) + { + return FMOD5_Channel_GetDSP(this.handle, index, out dsp.handle); + } + public RESULT addDSP(int index, DSP dsp) + { + return FMOD5_Channel_AddDSP(this.handle, index, dsp.handle); + } + public RESULT removeDSP(DSP dsp) + { + return FMOD5_Channel_RemoveDSP(this.handle, dsp.handle); + } + public RESULT getNumDSPs(out int numdsps) + { + return FMOD5_Channel_GetNumDSPs(this.handle, out numdsps); + } + public RESULT setDSPIndex(DSP dsp, int index) + { + return FMOD5_Channel_SetDSPIndex(this.handle, dsp.handle, index); + } + public RESULT getDSPIndex(DSP dsp, out int index) + { + return FMOD5_Channel_GetDSPIndex(this.handle, dsp.handle, out index); + } + + // 3D functionality. + public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) + { + return FMOD5_Channel_Set3DAttributes(this.handle, ref pos, ref vel); + } + public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) + { + return FMOD5_Channel_Get3DAttributes(this.handle, out pos, out vel); + } + public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) + { + return FMOD5_Channel_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); + } + public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) + { + return FMOD5_Channel_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_Channel_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_Channel_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DConeOrientation(ref VECTOR orientation) + { + return FMOD5_Channel_Set3DConeOrientation(this.handle, ref orientation); + } + public RESULT get3DConeOrientation(out VECTOR orientation) + { + return FMOD5_Channel_Get3DConeOrientation(this.handle, out orientation); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_Channel_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_Channel_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) + { + return FMOD5_Channel_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); + } + public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) + { + return FMOD5_Channel_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); + } + public RESULT set3DSpread(float angle) + { + return FMOD5_Channel_Set3DSpread(this.handle, angle); + } + public RESULT get3DSpread(out float angle) + { + return FMOD5_Channel_Get3DSpread(this.handle, out angle); + } + public RESULT set3DLevel(float level) + { + return FMOD5_Channel_Set3DLevel(this.handle, level); + } + public RESULT get3DLevel(out float level) + { + return FMOD5_Channel_Get3DLevel(this.handle, out level); + } + public RESULT set3DDopplerLevel(float level) + { + return FMOD5_Channel_Set3DDopplerLevel(this.handle, level); + } + public RESULT get3DDopplerLevel(out float level) + { + return FMOD5_Channel_Get3DDopplerLevel(this.handle, out level); + } + public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) + { + return FMOD5_Channel_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); + } + public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) + { + return FMOD5_Channel_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Channel_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Channel_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetFrequency (IntPtr channel, float frequency); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetFrequency (IntPtr channel, out float frequency); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPriority (IntPtr channel, int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPriority (IntPtr channel, out int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPosition (IntPtr channel, uint position, TIMEUNIT postype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPosition (IntPtr channel, out uint position, TIMEUNIT postype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetChannelGroup (IntPtr channel, IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetChannelGroup (IntPtr channel, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLoopCount (IntPtr channel, int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLoopCount (IntPtr channel, out int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLoopPoints (IntPtr channel, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLoopPoints (IntPtr channel, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_IsVirtual (IntPtr channel, out bool isvirtual); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetCurrentSound (IntPtr channel, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetIndex (IntPtr channel, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetSystemObject (IntPtr channel, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Stop (IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPaused (IntPtr channel, bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPaused (IntPtr channel, out bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetVolume (IntPtr channel, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetVolume (IntPtr channel, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetVolumeRamp (IntPtr channel, bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetVolumeRamp (IntPtr channel, out bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetAudibility (IntPtr channel, out float audibility); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPitch (IntPtr channel, float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPitch (IntPtr channel, out float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMute (IntPtr channel, bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMute (IntPtr channel, out bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetReverbProperties (IntPtr channel, int instance, float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetReverbProperties (IntPtr channel, int instance, out float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLowPassGain (IntPtr channel, float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLowPassGain (IntPtr channel, out float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMode (IntPtr channel, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMode (IntPtr channel, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetCallback (IntPtr channel, CHANNELCONTROL_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_IsPlaying (IntPtr channel, out bool isplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPan (IntPtr channel, float pan); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixLevelsOutput (IntPtr channel, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixLevelsInput (IntPtr channel, float[] levels, int numlevels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixMatrix (IntPtr channel, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMixMatrix (IntPtr channel, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSPClock (IntPtr channel, out ulong dspclock, out ulong parentclock); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetDelay (IntPtr channel, ulong dspclock_start, ulong dspclock_end, bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_AddFadePoint (IntPtr channel, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetFadePointRamp (IntPtr channel, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_RemoveFadePoints (IntPtr channel, ulong dspclock_start, ulong dspclock_end); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetFadePoints (IntPtr channel, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSP (IntPtr channel, int index, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_AddDSP (IntPtr channel, int index, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_RemoveDSP (IntPtr channel, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetNumDSPs (IntPtr channel, out int numdsps); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetDSPIndex (IntPtr channel, IntPtr dsp, int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSPIndex (IntPtr channel, IntPtr dsp, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DAttributes (IntPtr channel, ref VECTOR pos, ref VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DAttributes (IntPtr channel, out VECTOR pos, out VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DMinMaxDistance (IntPtr channel, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DMinMaxDistance (IntPtr channel, out float mindistance, out float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DConeSettings (IntPtr channel, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DConeSettings (IntPtr channel, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DConeOrientation (IntPtr channel, ref VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DConeOrientation (IntPtr channel, out VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DCustomRolloff (IntPtr channel, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DCustomRolloff (IntPtr channel, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DOcclusion (IntPtr channel, float directocclusion, float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DOcclusion (IntPtr channel, out float directocclusion, out float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DSpread (IntPtr channel, float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DSpread (IntPtr channel, out float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DLevel (IntPtr channel, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DLevel (IntPtr channel, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DDopplerLevel (IntPtr channel, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DDopplerLevel (IntPtr channel, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DDistanceFilter (IntPtr channel, bool custom, float customLevel, float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DDistanceFilter (IntPtr channel, out bool custom, out float customLevel, out float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetUserData (IntPtr channel, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetUserData (IntPtr channel, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Channel(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'ChannelGroup' API + */ + public struct ChannelGroup : IChannelControl + { + public RESULT release() + { + return FMOD5_ChannelGroup_Release(this.handle); + } + + // Nested channel groups. + public RESULT addGroup(ChannelGroup group, bool propagatedspclock = true) + { + return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, IntPtr.Zero); + } + public RESULT addGroup(ChannelGroup group, bool propagatedspclock, out DSPConnection connection) + { + return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, out connection.handle); + } + public RESULT getNumGroups(out int numgroups) + { + return FMOD5_ChannelGroup_GetNumGroups(this.handle, out numgroups); + } + public RESULT getGroup(int index, out ChannelGroup group) + { + return FMOD5_ChannelGroup_GetGroup(this.handle, index, out group.handle); + } + public RESULT getParentGroup(out ChannelGroup group) + { + return FMOD5_ChannelGroup_GetParentGroup(this.handle, out group.handle); + } + + // Information only functions. + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_ChannelGroup_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getNumChannels(out int numchannels) + { + return FMOD5_ChannelGroup_GetNumChannels(this.handle, out numchannels); + } + public RESULT getChannel(int index, out Channel channel) + { + return FMOD5_ChannelGroup_GetChannel(this.handle, index, out channel.handle); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_ChannelGroup_GetSystemObject(this.handle, out system.handle); + } + + // General control functionality for Channels and ChannelGroups. + public RESULT stop() + { + return FMOD5_ChannelGroup_Stop(this.handle); + } + public RESULT setPaused(bool paused) + { + return FMOD5_ChannelGroup_SetPaused(this.handle, paused); + } + public RESULT getPaused(out bool paused) + { + return FMOD5_ChannelGroup_GetPaused(this.handle, out paused); + } + public RESULT setVolume(float volume) + { + return FMOD5_ChannelGroup_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_ChannelGroup_GetVolume(this.handle, out volume); + } + public RESULT setVolumeRamp(bool ramp) + { + return FMOD5_ChannelGroup_SetVolumeRamp(this.handle, ramp); + } + public RESULT getVolumeRamp(out bool ramp) + { + return FMOD5_ChannelGroup_GetVolumeRamp(this.handle, out ramp); + } + public RESULT getAudibility(out float audibility) + { + return FMOD5_ChannelGroup_GetAudibility(this.handle, out audibility); + } + public RESULT setPitch(float pitch) + { + return FMOD5_ChannelGroup_SetPitch(this.handle, pitch); + } + public RESULT getPitch(out float pitch) + { + return FMOD5_ChannelGroup_GetPitch(this.handle, out pitch); + } + public RESULT setMute(bool mute) + { + return FMOD5_ChannelGroup_SetMute(this.handle, mute); + } + public RESULT getMute(out bool mute) + { + return FMOD5_ChannelGroup_GetMute(this.handle, out mute); + } + public RESULT setReverbProperties(int instance, float wet) + { + return FMOD5_ChannelGroup_SetReverbProperties(this.handle, instance, wet); + } + public RESULT getReverbProperties(int instance, out float wet) + { + return FMOD5_ChannelGroup_GetReverbProperties(this.handle, instance, out wet); + } + public RESULT setLowPassGain(float gain) + { + return FMOD5_ChannelGroup_SetLowPassGain(this.handle, gain); + } + public RESULT getLowPassGain(out float gain) + { + return FMOD5_ChannelGroup_GetLowPassGain(this.handle, out gain); + } + public RESULT setMode(MODE mode) + { + return FMOD5_ChannelGroup_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_ChannelGroup_GetMode(this.handle, out mode); + } + public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) + { + return FMOD5_ChannelGroup_SetCallback(this.handle, callback); + } + public RESULT isPlaying(out bool isplaying) + { + return FMOD5_ChannelGroup_IsPlaying(this.handle, out isplaying); + } + + // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. + public RESULT setPan(float pan) + { + return FMOD5_ChannelGroup_SetPan(this.handle, pan); + } + public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) + { + return FMOD5_ChannelGroup_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); + } + public RESULT setMixLevelsInput(float[] levels, int numlevels) + { + return FMOD5_ChannelGroup_SetMixLevelsInput(this.handle, levels, numlevels); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop) + { + return FMOD5_ChannelGroup_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop) + { + return FMOD5_ChannelGroup_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + + // Clock based functionality. + public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) + { + return FMOD5_ChannelGroup_GetDSPClock(this.handle, out dspclock, out parentclock); + } + public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels) + { + return FMOD5_ChannelGroup_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) + { + return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) + { + return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); + } + public RESULT addFadePoint(ulong dspclock, float volume) + { + return FMOD5_ChannelGroup_AddFadePoint(this.handle, dspclock, volume); + } + public RESULT setFadePointRamp(ulong dspclock, float volume) + { + return FMOD5_ChannelGroup_SetFadePointRamp(this.handle, dspclock, volume); + } + public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) + { + return FMOD5_ChannelGroup_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); + } + public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) + { + return FMOD5_ChannelGroup_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); + } + + // DSP effects. + public RESULT getDSP(int index, out DSP dsp) + { + return FMOD5_ChannelGroup_GetDSP(this.handle, index, out dsp.handle); + } + public RESULT addDSP(int index, DSP dsp) + { + return FMOD5_ChannelGroup_AddDSP(this.handle, index, dsp.handle); + } + public RESULT removeDSP(DSP dsp) + { + return FMOD5_ChannelGroup_RemoveDSP(this.handle, dsp.handle); + } + public RESULT getNumDSPs(out int numdsps) + { + return FMOD5_ChannelGroup_GetNumDSPs(this.handle, out numdsps); + } + public RESULT setDSPIndex(DSP dsp, int index) + { + return FMOD5_ChannelGroup_SetDSPIndex(this.handle, dsp.handle, index); + } + public RESULT getDSPIndex(DSP dsp, out int index) + { + return FMOD5_ChannelGroup_GetDSPIndex(this.handle, dsp.handle, out index); + } + + // 3D functionality. + public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) + { + return FMOD5_ChannelGroup_Set3DAttributes(this.handle, ref pos, ref vel); + } + public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) + { + return FMOD5_ChannelGroup_Get3DAttributes(this.handle, out pos, out vel); + } + public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) + { + return FMOD5_ChannelGroup_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); + } + public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) + { + return FMOD5_ChannelGroup_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_ChannelGroup_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_ChannelGroup_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DConeOrientation(ref VECTOR orientation) + { + return FMOD5_ChannelGroup_Set3DConeOrientation(this.handle, ref orientation); + } + public RESULT get3DConeOrientation(out VECTOR orientation) + { + return FMOD5_ChannelGroup_Get3DConeOrientation(this.handle, out orientation); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_ChannelGroup_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_ChannelGroup_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) + { + return FMOD5_ChannelGroup_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); + } + public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) + { + return FMOD5_ChannelGroup_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); + } + public RESULT set3DSpread(float angle) + { + return FMOD5_ChannelGroup_Set3DSpread(this.handle, angle); + } + public RESULT get3DSpread(out float angle) + { + return FMOD5_ChannelGroup_Get3DSpread(this.handle, out angle); + } + public RESULT set3DLevel(float level) + { + return FMOD5_ChannelGroup_Set3DLevel(this.handle, level); + } + public RESULT get3DLevel(out float level) + { + return FMOD5_ChannelGroup_Get3DLevel(this.handle, out level); + } + public RESULT set3DDopplerLevel(float level) + { + return FMOD5_ChannelGroup_Set3DDopplerLevel(this.handle, level); + } + public RESULT get3DDopplerLevel(out float level) + { + return FMOD5_ChannelGroup_Get3DDopplerLevel(this.handle, out level); + } + public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) + { + return FMOD5_ChannelGroup_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); + } + public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) + { + return FMOD5_ChannelGroup_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_ChannelGroup_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_ChannelGroup_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Release (IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, out IntPtr connection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumGroups (IntPtr channelgroup, out int numgroups); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetGroup (IntPtr channelgroup, int index, out IntPtr group); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetParentGroup (IntPtr channelgroup, out IntPtr group); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetName (IntPtr channelgroup, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumChannels (IntPtr channelgroup, out int numchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetChannel (IntPtr channelgroup, int index, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetSystemObject (IntPtr channelgroup, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Stop (IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPaused (IntPtr channelgroup, bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetPaused (IntPtr channelgroup, out bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetVolume (IntPtr channelgroup, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetVolume (IntPtr channelgroup, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetVolumeRamp (IntPtr channelgroup, bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetVolumeRamp (IntPtr channelgroup, out bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetAudibility (IntPtr channelgroup, out float audibility); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPitch (IntPtr channelgroup, float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetPitch (IntPtr channelgroup, out float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMute (IntPtr channelgroup, bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMute (IntPtr channelgroup, out bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetReverbProperties (IntPtr channelgroup, int instance, float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetReverbProperties (IntPtr channelgroup, int instance, out float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetLowPassGain (IntPtr channelgroup, float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetLowPassGain (IntPtr channelgroup, out float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMode (IntPtr channelgroup, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMode (IntPtr channelgroup, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetCallback (IntPtr channelgroup, CHANNELCONTROL_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_IsPlaying (IntPtr channelgroup, out bool isplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPan (IntPtr channelgroup, float pan); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsOutput (IntPtr channelgroup, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsInput (IntPtr channelgroup, float[] levels, int numlevels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixMatrix (IntPtr channelgroup, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMixMatrix (IntPtr channelgroup, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSPClock (IntPtr channelgroup, out ulong dspclock, out ulong parentclock); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetDelay (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end, bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddFadePoint (IntPtr channelgroup, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetFadePointRamp (IntPtr channelgroup, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_RemoveFadePoints (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetFadePoints (IntPtr channelgroup, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSP (IntPtr channelgroup, int index, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddDSP (IntPtr channelgroup, int index, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_RemoveDSP (IntPtr channelgroup, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumDSPs (IntPtr channelgroup, out int numdsps); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetDSPIndex (IntPtr channelgroup, IntPtr dsp, int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSPIndex (IntPtr channelgroup, IntPtr dsp, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DAttributes (IntPtr channelgroup, ref VECTOR pos, ref VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DAttributes (IntPtr channelgroup, out VECTOR pos, out VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DMinMaxDistance (IntPtr channelgroup, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DMinMaxDistance (IntPtr channelgroup, out float mindistance, out float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DConeSettings (IntPtr channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DConeSettings (IntPtr channelgroup, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DConeOrientation(IntPtr channelgroup, ref VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DConeOrientation(IntPtr channelgroup, out VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DCustomRolloff (IntPtr channelgroup, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DCustomRolloff (IntPtr channelgroup, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DOcclusion (IntPtr channelgroup, float directocclusion, float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DOcclusion (IntPtr channelgroup, out float directocclusion, out float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DSpread (IntPtr channelgroup, float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DSpread (IntPtr channelgroup, out float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DLevel (IntPtr channelgroup, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DLevel (IntPtr channelgroup, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DDopplerLevel (IntPtr channelgroup, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DDopplerLevel (IntPtr channelgroup, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DDistanceFilter (IntPtr channelgroup, bool custom, float customLevel, float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DDistanceFilter (IntPtr channelgroup, out bool custom, out float customLevel, out float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetUserData (IntPtr channelgroup, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetUserData (IntPtr channelgroup, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public ChannelGroup(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'SoundGroup' API + */ + public struct SoundGroup + { + public RESULT release() + { + return FMOD5_SoundGroup_Release(this.handle); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_SoundGroup_GetSystemObject(this.handle, out system.handle); + } + + // SoundGroup control functions. + public RESULT setMaxAudible(int maxaudible) + { + return FMOD5_SoundGroup_SetMaxAudible(this.handle, maxaudible); + } + public RESULT getMaxAudible(out int maxaudible) + { + return FMOD5_SoundGroup_GetMaxAudible(this.handle, out maxaudible); + } + public RESULT setMaxAudibleBehavior(SOUNDGROUP_BEHAVIOR behavior) + { + return FMOD5_SoundGroup_SetMaxAudibleBehavior(this.handle, behavior); + } + public RESULT getMaxAudibleBehavior(out SOUNDGROUP_BEHAVIOR behavior) + { + return FMOD5_SoundGroup_GetMaxAudibleBehavior(this.handle, out behavior); + } + public RESULT setMuteFadeSpeed(float speed) + { + return FMOD5_SoundGroup_SetMuteFadeSpeed(this.handle, speed); + } + public RESULT getMuteFadeSpeed(out float speed) + { + return FMOD5_SoundGroup_GetMuteFadeSpeed(this.handle, out speed); + } + public RESULT setVolume(float volume) + { + return FMOD5_SoundGroup_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_SoundGroup_GetVolume(this.handle, out volume); + } + public RESULT stop() + { + return FMOD5_SoundGroup_Stop(this.handle); + } + + // Information only functions. + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_SoundGroup_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getNumSounds(out int numsounds) + { + return FMOD5_SoundGroup_GetNumSounds(this.handle, out numsounds); + } + public RESULT getSound(int index, out Sound sound) + { + return FMOD5_SoundGroup_GetSound(this.handle, index, out sound.handle); + } + public RESULT getNumPlaying(out int numplaying) + { + return FMOD5_SoundGroup_GetNumPlaying(this.handle, out numplaying); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_SoundGroup_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_SoundGroup_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_Release (IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetSystemObject (IntPtr soundgroup, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMaxAudible (IntPtr soundgroup, int maxaudible); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMaxAudible (IntPtr soundgroup, out int maxaudible); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMaxAudibleBehavior (IntPtr soundgroup, SOUNDGROUP_BEHAVIOR behavior); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMaxAudibleBehavior (IntPtr soundgroup, out SOUNDGROUP_BEHAVIOR behavior); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMuteFadeSpeed (IntPtr soundgroup, float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMuteFadeSpeed (IntPtr soundgroup, out float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetVolume (IntPtr soundgroup, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetVolume (IntPtr soundgroup, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_Stop (IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetName (IntPtr soundgroup, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetNumSounds (IntPtr soundgroup, out int numsounds); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetSound (IntPtr soundgroup, int index, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetNumPlaying (IntPtr soundgroup, out int numplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetUserData (IntPtr soundgroup, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetUserData (IntPtr soundgroup, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public SoundGroup(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'DSP' API + */ + public struct DSP + { + public RESULT release() + { + return FMOD5_DSP_Release(this.handle); + } + public RESULT getSystemObject(out System system) + { + return FMOD5_DSP_GetSystemObject(this.handle, out system.handle); + } + + // Connection / disconnection / input and output enumeration. + public RESULT addInput(DSP input) + { + return FMOD5_DSP_AddInput(this.handle, input.handle, IntPtr.Zero, DSPCONNECTION_TYPE.STANDARD); + } + public RESULT addInput(DSP input, out DSPConnection connection, DSPCONNECTION_TYPE type = DSPCONNECTION_TYPE.STANDARD) + { + return FMOD5_DSP_AddInput(this.handle, input.handle, out connection.handle, type); + } + public RESULT disconnectFrom(DSP target, DSPConnection connection) + { + return FMOD5_DSP_DisconnectFrom(this.handle, target.handle, connection.handle); + } + public RESULT disconnectAll(bool inputs, bool outputs) + { + return FMOD5_DSP_DisconnectAll(this.handle, inputs, outputs); + } + public RESULT getNumInputs(out int numinputs) + { + return FMOD5_DSP_GetNumInputs(this.handle, out numinputs); + } + public RESULT getNumOutputs(out int numoutputs) + { + return FMOD5_DSP_GetNumOutputs(this.handle, out numoutputs); + } + public RESULT getInput(int index, out DSP input, out DSPConnection inputconnection) + { + return FMOD5_DSP_GetInput(this.handle, index, out input.handle, out inputconnection.handle); + } + public RESULT getOutput(int index, out DSP output, out DSPConnection outputconnection) + { + return FMOD5_DSP_GetOutput(this.handle, index, out output.handle, out outputconnection.handle); + } + + // DSP unit control. + public RESULT setActive(bool active) + { + return FMOD5_DSP_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_DSP_GetActive(this.handle, out active); + } + public RESULT setBypass(bool bypass) + { + return FMOD5_DSP_SetBypass(this.handle, bypass); + } + public RESULT getBypass(out bool bypass) + { + return FMOD5_DSP_GetBypass(this.handle, out bypass); + } + public RESULT setWetDryMix(float prewet, float postwet, float dry) + { + return FMOD5_DSP_SetWetDryMix(this.handle, prewet, postwet, dry); + } + public RESULT getWetDryMix(out float prewet, out float postwet, out float dry) + { + return FMOD5_DSP_GetWetDryMix(this.handle, out prewet, out postwet, out dry); + } + public RESULT setChannelFormat(CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode) + { + return FMOD5_DSP_SetChannelFormat(this.handle, channelmask, numchannels, source_speakermode); + } + public RESULT getChannelFormat(out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode) + { + return FMOD5_DSP_GetChannelFormat(this.handle, out channelmask, out numchannels, out source_speakermode); + } + public RESULT getOutputChannelFormat(CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode) + { + return FMOD5_DSP_GetOutputChannelFormat(this.handle, inmask, inchannels, inspeakermode, out outmask, out outchannels, out outspeakermode); + } + public RESULT reset() + { + return FMOD5_DSP_Reset(this.handle); + } + public RESULT setCallback(DSP_CALLBACK callback) + { + return FMOD5_DSP_SetCallback(this.handle, callback); + } + + // DSP parameter control. + public RESULT setParameterFloat(int index, float value) + { + return FMOD5_DSP_SetParameterFloat(this.handle, index, value); + } + public RESULT setParameterInt(int index, int value) + { + return FMOD5_DSP_SetParameterInt(this.handle, index, value); + } + public RESULT setParameterBool(int index, bool value) + { + return FMOD5_DSP_SetParameterBool(this.handle, index, value); + } + public RESULT setParameterData(int index, byte[] data) + { + return FMOD5_DSP_SetParameterData(this.handle, index, Marshal.UnsafeAddrOfPinnedArrayElement(data, 0), (uint)data.Length); + } + public RESULT getParameterFloat(int index, out float value) + { + return FMOD5_DSP_GetParameterFloat(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterInt(int index, out int value) + { + return FMOD5_DSP_GetParameterInt(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterBool(int index, out bool value) + { + return FMOD5_DSP_GetParameterBool(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterData(int index, out IntPtr data, out uint length) + { + return FMOD5_DSP_GetParameterData(this.handle, index, out data, out length, IntPtr.Zero, 0); + } + public RESULT getNumParameters(out int numparams) + { + return FMOD5_DSP_GetNumParameters(this.handle, out numparams); + } + public RESULT getParameterInfo(int index, out DSP_PARAMETER_DESC desc) + { + IntPtr descPtr; + RESULT result = FMOD5_DSP_GetParameterInfo(this.handle, index, out descPtr); + desc = (DSP_PARAMETER_DESC)MarshalHelper.PtrToStructure(descPtr, typeof(DSP_PARAMETER_DESC)); + return result; + } + public RESULT getDataParameterIndex(int datatype, out int index) + { + return FMOD5_DSP_GetDataParameterIndex(this.handle, datatype, out index); + } + public RESULT showConfigDialog(IntPtr hwnd, bool show) + { + return FMOD5_DSP_ShowConfigDialog(this.handle, hwnd, show); + } + + // DSP attributes. + public RESULT getInfo(out string name, out uint version, out int channels, out int configwidth, out int configheight) + { + IntPtr nameMem = Marshal.AllocHGlobal(32); + + RESULT result = FMOD5_DSP_GetInfo(this.handle, nameMem, out version, out channels, out configwidth, out configheight); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(nameMem); + } + Marshal.FreeHGlobal(nameMem); + return result; + } + public RESULT getInfo(out uint version, out int channels, out int configwidth, out int configheight) + { + return FMOD5_DSP_GetInfo(this.handle, IntPtr.Zero, out version, out channels, out configwidth, out configheight); ; + } + public RESULT getType(out DSP_TYPE type) + { + return FMOD5_DSP_GetType(this.handle, out type); + } + public RESULT getIdle(out bool idle) + { + return FMOD5_DSP_GetIdle(this.handle, out idle); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_DSP_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_DSP_GetUserData(this.handle, out userdata); + } + + // Metering. + public RESULT setMeteringEnabled(bool inputEnabled, bool outputEnabled) + { + return FMOD5_DSP_SetMeteringEnabled(this.handle, inputEnabled, outputEnabled); + } + public RESULT getMeteringEnabled(out bool inputEnabled, out bool outputEnabled) + { + return FMOD5_DSP_GetMeteringEnabled(this.handle, out inputEnabled, out outputEnabled); + } + + public RESULT getMeteringInfo(IntPtr zero, out DSP_METERING_INFO outputInfo) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, zero, out outputInfo); + } + public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, IntPtr zero) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, zero); + } + public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, out outputInfo); + } + + public RESULT getCPUUsage(out uint exclusive, out uint inclusive) + { + return FMOD5_DSP_GetCPUUsage(this.handle, out exclusive, out inclusive); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_Release (IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetSystemObject (IntPtr dsp, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, IntPtr zero, DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, out IntPtr connection, DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_DisconnectFrom (IntPtr dsp, IntPtr target, IntPtr connection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_DisconnectAll (IntPtr dsp, bool inputs, bool outputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumInputs (IntPtr dsp, out int numinputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumOutputs (IntPtr dsp, out int numoutputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetInput (IntPtr dsp, int index, out IntPtr input, out IntPtr inputconnection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetOutput (IntPtr dsp, int index, out IntPtr output, out IntPtr outputconnection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetActive (IntPtr dsp, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetActive (IntPtr dsp, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetBypass (IntPtr dsp, bool bypass); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetBypass (IntPtr dsp, out bool bypass); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetWetDryMix (IntPtr dsp, float prewet, float postwet, float dry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetWetDryMix (IntPtr dsp, out float prewet, out float postwet, out float dry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetChannelFormat (IntPtr dsp, CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetChannelFormat (IntPtr dsp, out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetOutputChannelFormat (IntPtr dsp, CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_Reset (IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetCallback (IntPtr dsp, DSP_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterFloat (IntPtr dsp, int index, float value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterInt (IntPtr dsp, int index, int value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterBool (IntPtr dsp, int index, bool value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterData (IntPtr dsp, int index, IntPtr data, uint length); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterFloat (IntPtr dsp, int index, out float value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterInt (IntPtr dsp, int index, out int value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterBool (IntPtr dsp, int index, out bool value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterData (IntPtr dsp, int index, out IntPtr data, out uint length, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumParameters (IntPtr dsp, out int numparams); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterInfo (IntPtr dsp, int index, out IntPtr desc); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetDataParameterIndex (IntPtr dsp, int datatype, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_ShowConfigDialog (IntPtr dsp, IntPtr hwnd, bool show); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetInfo (IntPtr dsp, IntPtr name, out uint version, out int channels, out int configwidth, out int configheight); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetType (IntPtr dsp, out DSP_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetIdle (IntPtr dsp, out bool idle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetUserData (IntPtr dsp, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetUserData (IntPtr dsp, out IntPtr userdata); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_SetMeteringEnabled (IntPtr dsp, bool inputEnabled, bool outputEnabled); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringEnabled (IntPtr dsp, out bool inputEnabled, out bool outputEnabled); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, IntPtr zero, out DSP_METERING_INFO outputInfo); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, IntPtr zero); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetCPUUsage (IntPtr dsp, out uint exclusive, out uint inclusive); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public DSP(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'DSPConnection' API + */ + public struct DSPConnection + { + public RESULT getInput(out DSP input) + { + return FMOD5_DSPConnection_GetInput(this.handle, out input.handle); + } + public RESULT getOutput(out DSP output) + { + return FMOD5_DSPConnection_GetOutput(this.handle, out output.handle); + } + public RESULT setMix(float volume) + { + return FMOD5_DSPConnection_SetMix(this.handle, volume); + } + public RESULT getMix(out float volume) + { + return FMOD5_DSPConnection_GetMix(this.handle, out volume); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) + { + return FMOD5_DSPConnection_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) + { + return FMOD5_DSPConnection_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + public RESULT getType(out DSPCONNECTION_TYPE type) + { + return FMOD5_DSPConnection_GetType(this.handle, out type); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_DSPConnection_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_DSPConnection_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetInput (IntPtr dspconnection, out IntPtr input); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetOutput (IntPtr dspconnection, out IntPtr output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetMix (IntPtr dspconnection, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetMix (IntPtr dspconnection, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetMixMatrix (IntPtr dspconnection, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetMixMatrix (IntPtr dspconnection, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetType (IntPtr dspconnection, out DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetUserData (IntPtr dspconnection, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetUserData (IntPtr dspconnection, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public DSPConnection(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'Geometry' API + */ + public struct Geometry + { + public RESULT release() + { + return FMOD5_Geometry_Release(this.handle); + } + + // Polygon manipulation. + public RESULT addPolygon(float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex) + { + return FMOD5_Geometry_AddPolygon(this.handle, directocclusion, reverbocclusion, doublesided, numvertices, vertices, out polygonindex); + } + public RESULT getNumPolygons(out int numpolygons) + { + return FMOD5_Geometry_GetNumPolygons(this.handle, out numpolygons); + } + public RESULT getMaxPolygons(out int maxpolygons, out int maxvertices) + { + return FMOD5_Geometry_GetMaxPolygons(this.handle, out maxpolygons, out maxvertices); + } + public RESULT getPolygonNumVertices(int index, out int numvertices) + { + return FMOD5_Geometry_GetPolygonNumVertices(this.handle, index, out numvertices); + } + public RESULT setPolygonVertex(int index, int vertexindex, ref VECTOR vertex) + { + return FMOD5_Geometry_SetPolygonVertex(this.handle, index, vertexindex, ref vertex); + } + public RESULT getPolygonVertex(int index, int vertexindex, out VECTOR vertex) + { + return FMOD5_Geometry_GetPolygonVertex(this.handle, index, vertexindex, out vertex); + } + public RESULT setPolygonAttributes(int index, float directocclusion, float reverbocclusion, bool doublesided) + { + return FMOD5_Geometry_SetPolygonAttributes(this.handle, index, directocclusion, reverbocclusion, doublesided); + } + public RESULT getPolygonAttributes(int index, out float directocclusion, out float reverbocclusion, out bool doublesided) + { + return FMOD5_Geometry_GetPolygonAttributes(this.handle, index, out directocclusion, out reverbocclusion, out doublesided); + } + + // Object manipulation. + public RESULT setActive(bool active) + { + return FMOD5_Geometry_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_Geometry_GetActive(this.handle, out active); + } + public RESULT setRotation(ref VECTOR forward, ref VECTOR up) + { + return FMOD5_Geometry_SetRotation(this.handle, ref forward, ref up); + } + public RESULT getRotation(out VECTOR forward, out VECTOR up) + { + return FMOD5_Geometry_GetRotation(this.handle, out forward, out up); + } + public RESULT setPosition(ref VECTOR position) + { + return FMOD5_Geometry_SetPosition(this.handle, ref position); + } + public RESULT getPosition(out VECTOR position) + { + return FMOD5_Geometry_GetPosition(this.handle, out position); + } + public RESULT setScale(ref VECTOR scale) + { + return FMOD5_Geometry_SetScale(this.handle, ref scale); + } + public RESULT getScale(out VECTOR scale) + { + return FMOD5_Geometry_GetScale(this.handle, out scale); + } + public RESULT save(IntPtr data, out int datasize) + { + return FMOD5_Geometry_Save(this.handle, data, out datasize); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Geometry_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Geometry_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_Release (IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_AddPolygon (IntPtr geometry, float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetNumPolygons (IntPtr geometry, out int numpolygons); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetMaxPolygons (IntPtr geometry, out int maxpolygons, out int maxvertices); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonNumVertices(IntPtr geometry, int index, out int numvertices); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPolygonVertex (IntPtr geometry, int index, int vertexindex, ref VECTOR vertex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonVertex (IntPtr geometry, int index, int vertexindex, out VECTOR vertex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPolygonAttributes (IntPtr geometry, int index, float directocclusion, float reverbocclusion, bool doublesided); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonAttributes (IntPtr geometry, int index, out float directocclusion, out float reverbocclusion, out bool doublesided); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetActive (IntPtr geometry, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetActive (IntPtr geometry, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetRotation (IntPtr geometry, ref VECTOR forward, ref VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetRotation (IntPtr geometry, out VECTOR forward, out VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPosition (IntPtr geometry, ref VECTOR position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPosition (IntPtr geometry, out VECTOR position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetScale (IntPtr geometry, ref VECTOR scale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetScale (IntPtr geometry, out VECTOR scale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_Save (IntPtr geometry, IntPtr data, out int datasize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetUserData (IntPtr geometry, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetUserData (IntPtr geometry, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Geometry(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'Reverb3D' API + */ + public struct Reverb3D + { + public RESULT release() + { + return FMOD5_Reverb3D_Release(this.handle); + } + + // Reverb manipulation. + public RESULT set3DAttributes(ref VECTOR position, float mindistance, float maxdistance) + { + return FMOD5_Reverb3D_Set3DAttributes(this.handle, ref position, mindistance, maxdistance); + } + public RESULT get3DAttributes(ref VECTOR position, ref float mindistance, ref float maxdistance) + { + return FMOD5_Reverb3D_Get3DAttributes(this.handle, ref position, ref mindistance, ref maxdistance); + } + public RESULT setProperties(ref REVERB_PROPERTIES properties) + { + return FMOD5_Reverb3D_SetProperties(this.handle, ref properties); + } + public RESULT getProperties(ref REVERB_PROPERTIES properties) + { + return FMOD5_Reverb3D_GetProperties(this.handle, ref properties); + } + public RESULT setActive(bool active) + { + return FMOD5_Reverb3D_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_Reverb3D_GetActive(this.handle, out active); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Reverb3D_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Reverb3D_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Release (IntPtr reverb3d); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Set3DAttributes (IntPtr reverb3d, ref VECTOR position, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Get3DAttributes (IntPtr reverb3d, ref VECTOR position, ref float mindistance, ref float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetActive (IntPtr reverb3d, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetActive (IntPtr reverb3d, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetUserData (IntPtr reverb3d, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetUserData (IntPtr reverb3d, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Reverb3D(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + #region Helper Functions + [StructLayout(LayoutKind.Sequential)] + public struct StringWrapper + { + IntPtr nativeUtf8Ptr; + + public StringWrapper(IntPtr ptr) + { + nativeUtf8Ptr = ptr; + } + + public static implicit operator string(StringWrapper fstring) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return encoder.stringFromNative(fstring.nativeUtf8Ptr); + } + } + + public bool StartsWith(byte[] prefix) + { + if (nativeUtf8Ptr == IntPtr.Zero) + { + return false; + } + + for (int i = 0; i < prefix.Length; i++) + { + if (Marshal.ReadByte(nativeUtf8Ptr, i) != prefix[i]) + { + return false; + } + } + + return true; + } + + public bool Equals(byte[] comparison) + { + if (nativeUtf8Ptr == IntPtr.Zero) + { + return false; + } + + for (int i = 0; i < comparison.Length; i++) + { + if (Marshal.ReadByte(nativeUtf8Ptr, i) != comparison[i]) + { + return false; + } + } + + if (Marshal.ReadByte(nativeUtf8Ptr, comparison.Length) != 0) + { + return false; + } + + return true; + } + } + + static class StringHelper + { + public class ThreadSafeEncoding : IDisposable + { + UTF8Encoding encoding = new UTF8Encoding(); + byte[] encodedBuffer = new byte[128]; + char[] decodedBuffer = new char[128]; + bool inUse; + GCHandle gcHandle; + + public bool InUse() { return inUse; } + public void SetInUse() { inUse = true; } + + private int roundUpPowerTwo(int number) + { + int newNumber = 1; + while (newNumber <= number) + { + newNumber *= 2; + } + + return newNumber; + } + + public byte[] byteFromStringUTF8(string s) + { + if (s == null) + { + return null; + } + + int maximumLength = encoding.GetMaxByteCount(s.Length) + 1; // +1 for null terminator + if (maximumLength > encodedBuffer.Length) + { + int encodedLength = encoding.GetByteCount(s) + 1; // +1 for null terminator + if (encodedLength > encodedBuffer.Length) + { + encodedBuffer = new byte[roundUpPowerTwo(encodedLength)]; + } + } + + int byteCount = encoding.GetBytes(s, 0, s.Length, encodedBuffer, 0); + encodedBuffer[byteCount] = 0; // Apply null terminator + + return encodedBuffer; + } + + public IntPtr intptrFromStringUTF8(string s) + { + if (s == null) + { + return IntPtr.Zero; + } + + gcHandle = GCHandle.Alloc(byteFromStringUTF8(s), GCHandleType.Pinned); + return gcHandle.AddrOfPinnedObject(); + } + + public string stringFromNative(IntPtr nativePtr) + { + if (nativePtr == IntPtr.Zero) + { + return ""; + } + + int nativeLen = 0; + while (Marshal.ReadByte(nativePtr, nativeLen) != 0) + { + nativeLen++; + } + + if (nativeLen == 0) + { + return ""; + } + + if (nativeLen > encodedBuffer.Length) + { + encodedBuffer = new byte[roundUpPowerTwo(nativeLen)]; + } + + Marshal.Copy(nativePtr, encodedBuffer, 0, nativeLen); + + int maximumLength = encoding.GetMaxCharCount(nativeLen); + if (maximumLength > decodedBuffer.Length) + { + int decodedLength = encoding.GetCharCount(encodedBuffer, 0, nativeLen); + if (decodedLength > decodedBuffer.Length) + { + decodedBuffer = new char[roundUpPowerTwo(decodedLength)]; + } + } + + int charCount = encoding.GetChars(encodedBuffer, 0, nativeLen, decodedBuffer, 0); + + return new String(decodedBuffer, 0, charCount); + } + + public void Dispose() + { + if (gcHandle.IsAllocated) + { + gcHandle.Free(); + } + lock (encoders) + { + inUse = false; + } + } + } + + static List encoders = new List(1); + + public static ThreadSafeEncoding GetFreeHelper() + { + lock (encoders) + { + ThreadSafeEncoding helper = null; + // Search for not in use helper + for (int i = 0; i < encoders.Count; i++) + { + if (!encoders[i].InUse()) + { + helper = encoders[i]; + break; + } + } + // Otherwise create another helper + if (helper == null) + { + helper = new ThreadSafeEncoding(); + encoders.Add(helper); + } + helper.SetInUse(); + return helper; + } + } + } + + // Some of the Marshal functions were marked as deprecated / obsolete, however that decision was reversed: https://github.com/dotnet/corefx/pull/10541 + // Use the old syntax (non-generic) to ensure maximum compatibility (especially with Unity) ignoring the warnings + public static class MarshalHelper + { +#pragma warning disable 618 + public static int SizeOf(Type t) + { + return Marshal.SizeOf(t); // Always use Type version, never Object version as it boxes causes GC allocations + } + + public static object PtrToStructure(IntPtr ptr, Type structureType) + { + return Marshal.PtrToStructure(ptr, structureType); + } +#pragma warning restore 618 + } + + #endregion +} diff --git a/FMODAPI/fmod_dsp.cs b/FMODAPI/fmod_dsp.cs new file mode 100644 index 0000000..537fe5c --- /dev/null +++ b/FMODAPI/fmod_dsp.cs @@ -0,0 +1,897 @@ +/* ======================================================================================== */ +/* FMOD Core API - DSP header file. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2023. */ +/* */ +/* Use this header if you are wanting to develop your own DSP plugin to use with FMODs */ +/* dsp system. With this header you can make your own DSP plugin that FMOD can */ +/* register and use. See the documentation and examples on how to make a working plugin. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/docs/2.02/api/plugin-api-dsp.html */ +/* =========================================================================================*/ + +using System; +using System.Text; +using System.Runtime.InteropServices; + +namespace FMOD +{ + [StructLayout(LayoutKind.Sequential)] + public struct DSP_BUFFER_ARRAY + { + public int numbuffers; + public int[] buffernumchannels; + public CHANNELMASK[] bufferchannelmask; + public IntPtr[] buffers; + public SPEAKERMODE speakermode; + } + + public enum DSP_PROCESS_OPERATION + { + PROCESS_PERFORM = 0, + PROCESS_QUERY + } + + [StructLayout(LayoutKind.Sequential)] + public struct COMPLEX + { + public float real; + public float imag; + } + + public enum DSP_PAN_SURROUND_FLAGS + { + DEFAULT = 0, + ROTATION_NOT_BIASED = 1, + } + + + /* + DSP callbacks + */ + public delegate RESULT DSP_CREATE_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_RELEASE_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_RESET_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_SETPOSITION_CALLBACK (ref DSP_STATE dsp_state, uint pos); + public delegate RESULT DSP_READ_CALLBACK (ref DSP_STATE dsp_state, IntPtr inbuffer, IntPtr outbuffer, uint length, int inchannels, ref int outchannels); + public delegate RESULT DSP_SHOULDIPROCESS_CALLBACK (ref DSP_STATE dsp_state, bool inputsidle, uint length, CHANNELMASK inmask, int inchannels, SPEAKERMODE speakermode); + public delegate RESULT DSP_PROCESS_CALLBACK (ref DSP_STATE dsp_state, uint length, ref DSP_BUFFER_ARRAY inbufferarray, ref DSP_BUFFER_ARRAY outbufferarray, bool inputsidle, DSP_PROCESS_OPERATION op); + public delegate RESULT DSP_SETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, float value); + public delegate RESULT DSP_SETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, int value); + public delegate RESULT DSP_SETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, bool value); + public delegate RESULT DSP_SETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, IntPtr data, uint length); + public delegate RESULT DSP_GETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, ref float value, IntPtr valuestr); + public delegate RESULT DSP_GETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, ref int value, IntPtr valuestr); + public delegate RESULT DSP_GETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, ref bool value, IntPtr valuestr); + public delegate RESULT DSP_GETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, ref IntPtr data, ref uint length, IntPtr valuestr); + public delegate RESULT DSP_SYSTEM_REGISTER_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_SYSTEM_DEREGISTER_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_SYSTEM_MIX_CALLBACK (ref DSP_STATE dsp_state, int stage); + + + /* + DSP functions + */ + public delegate IntPtr DSP_ALLOC_FUNC (uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate IntPtr DSP_REALLOC_FUNC (IntPtr ptr, uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate void DSP_FREE_FUNC (IntPtr ptr, MEMORY_TYPE type, IntPtr sourcestr); + public delegate void DSP_LOG_FUNC (DEBUG_FLAGS level, IntPtr file, int line, IntPtr function, IntPtr str); + public delegate RESULT DSP_GETSAMPLERATE_FUNC (ref DSP_STATE dsp_state, ref int rate); + public delegate RESULT DSP_GETBLOCKSIZE_FUNC (ref DSP_STATE dsp_state, ref uint blocksize); + public delegate RESULT DSP_GETSPEAKERMODE_FUNC (ref DSP_STATE dsp_state, ref int speakermode_mixer, ref int speakermode_output); + public delegate RESULT DSP_GETCLOCK_FUNC (ref DSP_STATE dsp_state, out ulong clock, out uint offset, out uint length); + public delegate RESULT DSP_GETLISTENERATTRIBUTES_FUNC (ref DSP_STATE dsp_state, ref int numlisteners, IntPtr attributes); + public delegate RESULT DSP_GETUSERDATA_FUNC (ref DSP_STATE dsp_state, out IntPtr userdata); + public delegate RESULT DSP_DFT_FFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr signal, IntPtr dft, IntPtr window, int signalhop); + public delegate RESULT DSP_DFT_IFFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr dft, IntPtr signal, IntPtr window, int signalhop); + public delegate RESULT DSP_PAN_SUMMONOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float lowFrequencyGain, float overallGain, IntPtr matrix); + public delegate RESULT DSP_PAN_SUMSTEREOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float pan, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); + public delegate RESULT DSP_PAN_SUMSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix, DSP_PAN_SURROUND_FLAGS flags); + public delegate RESULT DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int targetSpeakerMode, float direction, float extent, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); + public delegate RESULT DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); + public delegate RESULT DSP_PAN_GETROLLOFFGAIN_FUNC (ref DSP_STATE dsp_state, DSP_PAN_3D_ROLLOFF_TYPE rolloff, float distance, float mindistance, float maxdistance, out float gain); + + + public enum DSP_TYPE : int + { + UNKNOWN, + MIXER, + OSCILLATOR, + LOWPASS, + ITLOWPASS, + HIGHPASS, + ECHO, + FADER, + FLANGE, + DISTORTION, + NORMALIZE, + LIMITER, + PARAMEQ, + PITCHSHIFT, + CHORUS, + VSTPLUGIN, + WINAMPPLUGIN, + ITECHO, + COMPRESSOR, + SFXREVERB, + LOWPASS_SIMPLE, + DELAY, + TREMOLO, + LADSPAPLUGIN, + SEND, + RETURN, + HIGHPASS_SIMPLE, + PAN, + THREE_EQ, + FFT, + LOUDNESS_METER, + ENVELOPEFOLLOWER, + CONVOLUTIONREVERB, + CHANNELMIX, + TRANSCEIVER, + OBJECTPAN, + MULTIBAND_EQ, + MAX + } + + public enum DSP_PARAMETER_TYPE + { + FLOAT = 0, + INT, + BOOL, + DATA, + MAX + } + + public enum DSP_PARAMETER_FLOAT_MAPPING_TYPE + { + DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR = 0, + DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO, + DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR, + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR + { + public int numpoints; + public IntPtr pointparamvalues; + public IntPtr pointpositions; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_FLOAT_MAPPING + { + public DSP_PARAMETER_FLOAT_MAPPING_TYPE type; + public DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping; + } + + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_FLOAT + { + public float min; + public float max; + public float defaultval; + public DSP_PARAMETER_FLOAT_MAPPING mapping; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_INT + { + public int min; + public int max; + public int defaultval; + public bool goestoinf; + public IntPtr valuenames; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_BOOL + { + public bool defaultval; + public IntPtr valuenames; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_DATA + { + public int datatype; + } + + [StructLayout(LayoutKind.Explicit)] + public struct DSP_PARAMETER_DESC_UNION + { + [FieldOffset(0)] + public DSP_PARAMETER_DESC_FLOAT floatdesc; + [FieldOffset(0)] + public DSP_PARAMETER_DESC_INT intdesc; + [FieldOffset(0)] + public DSP_PARAMETER_DESC_BOOL booldesc; + [FieldOffset(0)] + public DSP_PARAMETER_DESC_DATA datadesc; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC + { + public DSP_PARAMETER_TYPE type; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] name; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] label; + public string description; + + public DSP_PARAMETER_DESC_UNION desc; + } + + public enum DSP_PARAMETER_DATA_TYPE + { + DSP_PARAMETER_DATA_TYPE_USER = 0, + DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1, + DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2, + DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3, + DSP_PARAMETER_DATA_TYPE_FFT = -4, + DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5, + DSP_PARAMETER_DATA_TYPE_ATTENUATION_RANGE = -6 + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_OVERALLGAIN + { + public float linear_gain; + public float linear_gain_additive; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_3DATTRIBUTES + { + public ATTRIBUTES_3D relative; + public ATTRIBUTES_3D absolute; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_3DATTRIBUTES_MULTI + { + public int numlisteners; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public ATTRIBUTES_3D[] relative; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public float[] weight; + public ATTRIBUTES_3D absolute; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_SIDECHAIN + { + public int sidechainenable; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_FFT + { + public int length; + public int numchannels; + + [MarshalAs(UnmanagedType.ByValArray,SizeConst=32)] + private IntPtr[] spectrum_internal; + + public float[][] spectrum + { + get + { + var buffer = new float[numchannels][]; + + for (int i = 0; i < numchannels; ++i) + { + buffer[i] = new float[length]; + Marshal.Copy(spectrum_internal[i], buffer[i], 0, length); + } + + return buffer; + } + } + + public void getSpectrum(ref float[][] buffer) + { + int bufferLength = Math.Min(buffer.Length, numchannels); + for (int i = 0; i < bufferLength; ++i) + { + getSpectrum(i, ref buffer[i]); + } + } + + public void getSpectrum(int channel, ref float[] buffer) + { + int bufferLength = Math.Min(buffer.Length, length); + Marshal.Copy(spectrum_internal[channel], buffer, 0, bufferLength); + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_LOUDNESS_METER_INFO_TYPE + { + public float momentaryloudness; + public float shorttermloudness; + public float integratedloudness; + public float loudness10thpercentile; + public float loudness95thpercentile; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 66)] + public float[] loudnesshistogram; + public float maxtruepeak; + public float maxmomentaryloudness; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_LOUDNESS_METER_WEIGHTING_TYPE + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public float[] channelweight; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_ATTENUATION_RANGE + { + public float min; + public float max; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_DESCRIPTION + { + public uint pluginsdkversion; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public byte[] name; + public uint version; + public int numinputbuffers; + public int numoutputbuffers; + public DSP_CREATE_CALLBACK create; + public DSP_RELEASE_CALLBACK release; + public DSP_RESET_CALLBACK reset; + public DSP_READ_CALLBACK read; + public DSP_PROCESS_CALLBACK process; + public DSP_SETPOSITION_CALLBACK setposition; + + public int numparameters; + public IntPtr paramdesc; + public DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat; + public DSP_SETPARAM_INT_CALLBACK setparameterint; + public DSP_SETPARAM_BOOL_CALLBACK setparameterbool; + public DSP_SETPARAM_DATA_CALLBACK setparameterdata; + public DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat; + public DSP_GETPARAM_INT_CALLBACK getparameterint; + public DSP_GETPARAM_BOOL_CALLBACK getparameterbool; + public DSP_GETPARAM_DATA_CALLBACK getparameterdata; + public DSP_SHOULDIPROCESS_CALLBACK shouldiprocess; + public IntPtr userdata; + + public DSP_SYSTEM_REGISTER_CALLBACK sys_register; + public DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister; + public DSP_SYSTEM_MIX_CALLBACK sys_mix; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE_DFT_FUNCTIONS + { + public DSP_DFT_FFTREAL_FUNC fftreal; + public DSP_DFT_IFFTREAL_FUNC inversefftreal; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE_PAN_FUNCTIONS + { + public DSP_PAN_SUMMONOMATRIX_FUNC summonomatrix; + public DSP_PAN_SUMSTEREOMATRIX_FUNC sumstereomatrix; + public DSP_PAN_SUMSURROUNDMATRIX_FUNC sumsurroundmatrix; + public DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC summonotosurroundmatrix; + public DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC sumstereotosurroundmatrix; + public DSP_PAN_GETROLLOFFGAIN_FUNC getrolloffgain; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE_FUNCTIONS + { + public DSP_ALLOC_FUNC alloc; + public DSP_REALLOC_FUNC realloc; + public DSP_FREE_FUNC free; + public DSP_GETSAMPLERATE_FUNC getsamplerate; + public DSP_GETBLOCKSIZE_FUNC getblocksize; + public IntPtr dft; + public IntPtr pan; + public DSP_GETSPEAKERMODE_FUNC getspeakermode; + public DSP_GETCLOCK_FUNC getclock; + public DSP_GETLISTENERATTRIBUTES_FUNC getlistenerattributes; + public DSP_LOG_FUNC log; + public DSP_GETUSERDATA_FUNC getuserdata; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE + { + public IntPtr instance; + public IntPtr plugindata; + public uint channelmask; + public int source_speakermode; + public IntPtr sidechaindata; + public int sidechainchannels; + public IntPtr functions; + public int systemobject; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_METERING_INFO + { + public int numsamples; + [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] + public float[] peaklevel; + [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] + public float[] rmslevel; + public short numchannels; + } + + /* + ============================================================================================================== + + FMOD built in effect parameters. + Use DSP::setParameter with these enums for the 'index' parameter. + + ============================================================================================================== + */ + + public enum DSP_OSCILLATOR : int + { + TYPE, + RATE + } + + public enum DSP_LOWPASS : int + { + CUTOFF, + RESONANCE + } + + public enum DSP_ITLOWPASS : int + { + CUTOFF, + RESONANCE + } + + public enum DSP_HIGHPASS : int + { + CUTOFF, + RESONANCE + } + + public enum DSP_ECHO : int + { + DELAY, + FEEDBACK, + DRYLEVEL, + WETLEVEL + } + + public enum DSP_FADER : int + { + GAIN, + OVERALL_GAIN, + } + + public enum DSP_DELAY : int + { + CH0, + CH1, + CH2, + CH3, + CH4, + CH5, + CH6, + CH7, + CH8, + CH9, + CH10, + CH11, + CH12, + CH13, + CH14, + CH15, + MAXDELAY, + } + + public enum DSP_FLANGE : int + { + MIX, + DEPTH, + RATE + } + + public enum DSP_TREMOLO : int + { + FREQUENCY, + DEPTH, + SHAPE, + SKEW, + DUTY, + SQUARE, + PHASE, + SPREAD + } + + public enum DSP_DISTORTION : int + { + LEVEL + } + + public enum DSP_NORMALIZE : int + { + FADETIME, + THRESHOLD, + MAXAMP + } + + public enum DSP_LIMITER : int + { + RELEASETIME, + CEILING, + MAXIMIZERGAIN, + MODE, + } + + public enum DSP_PARAMEQ : int + { + CENTER, + BANDWIDTH, + GAIN + } + + public enum DSP_MULTIBAND_EQ : int + { + A_FILTER, + A_FREQUENCY, + A_Q, + A_GAIN, + B_FILTER, + B_FREQUENCY, + B_Q, + B_GAIN, + C_FILTER, + C_FREQUENCY, + C_Q, + C_GAIN, + D_FILTER, + D_FREQUENCY, + D_Q, + D_GAIN, + E_FILTER, + E_FREQUENCY, + E_Q, + E_GAIN, + } + + public enum DSP_MULTIBAND_EQ_FILTER_TYPE : int + { + DISABLED, + LOWPASS_12DB, + LOWPASS_24DB, + LOWPASS_48DB, + HIGHPASS_12DB, + HIGHPASS_24DB, + HIGHPASS_48DB, + LOWSHELF, + HIGHSHELF, + PEAKING, + BANDPASS, + NOTCH, + ALLPASS, + } + + public enum DSP_PITCHSHIFT : int + { + PITCH, + FFTSIZE, + OVERLAP, + MAXCHANNELS + } + + public enum DSP_CHORUS : int + { + MIX, + RATE, + DEPTH, + } + + public enum DSP_ITECHO : int + { + WETDRYMIX, + FEEDBACK, + LEFTDELAY, + RIGHTDELAY, + PANDELAY + } + + public enum DSP_COMPRESSOR : int + { + THRESHOLD, + RATIO, + ATTACK, + RELEASE, + GAINMAKEUP, + USESIDECHAIN, + LINKED + } + + public enum DSP_SFXREVERB : int + { + DECAYTIME, + EARLYDELAY, + LATEDELAY, + HFREFERENCE, + HFDECAYRATIO, + DIFFUSION, + DENSITY, + LOWSHELFFREQUENCY, + LOWSHELFGAIN, + HIGHCUT, + EARLYLATEMIX, + WETLEVEL, + DRYLEVEL + } + + public enum DSP_LOWPASS_SIMPLE : int + { + CUTOFF + } + + public enum DSP_SEND : int + { + RETURNID, + LEVEL, + } + + public enum DSP_RETURN : int + { + ID, + INPUT_SPEAKER_MODE + } + + public enum DSP_HIGHPASS_SIMPLE : int + { + CUTOFF + } + + public enum DSP_PAN_2D_STEREO_MODE_TYPE : int + { + DISTRIBUTED, + DISCRETE + } + + public enum DSP_PAN_MODE_TYPE : int + { + MONO, + STEREO, + SURROUND + } + + public enum DSP_PAN_3D_ROLLOFF_TYPE : int + { + LINEARSQUARED, + LINEAR, + INVERSE, + INVERSETAPERED, + CUSTOM + } + + public enum DSP_PAN_3D_EXTENT_MODE_TYPE : int + { + AUTO, + USER, + OFF + } + + public enum DSP_PAN : int + { + MODE, + _2D_STEREO_POSITION, + _2D_DIRECTION, + _2D_EXTENT, + _2D_ROTATION, + _2D_LFE_LEVEL, + _2D_STEREO_MODE, + _2D_STEREO_SEPARATION, + _2D_STEREO_AXIS, + ENABLED_SPEAKERS, + _3D_POSITION, + _3D_ROLLOFF, + _3D_MIN_DISTANCE, + _3D_MAX_DISTANCE, + _3D_EXTENT_MODE, + _3D_SOUND_SIZE, + _3D_MIN_EXTENT, + _3D_PAN_BLEND, + LFE_UPMIX_ENABLED, + OVERALL_GAIN, + SURROUND_SPEAKER_MODE, + _2D_HEIGHT_BLEND, + ATTENUATION_RANGE, + OVERRIDE_RANGE + } + + public enum DSP_THREE_EQ_CROSSOVERSLOPE_TYPE : int + { + _12DB, + _24DB, + _48DB + } + + public enum DSP_THREE_EQ : int + { + LOWGAIN, + MIDGAIN, + HIGHGAIN, + LOWCROSSOVER, + HIGHCROSSOVER, + CROSSOVERSLOPE + } + + public enum DSP_FFT_WINDOW : int + { + RECT, + TRIANGLE, + HAMMING, + HANNING, + BLACKMAN, + BLACKMANHARRIS + } + + public enum DSP_FFT : int + { + WINDOWSIZE, + WINDOWTYPE, + SPECTRUMDATA, + DOMINANT_FREQ + } + + + public enum DSP_LOUDNESS_METER : int + { + STATE, + WEIGHTING, + INFO + } + + + public enum DSP_LOUDNESS_METER_STATE_TYPE : int + { + RESET_INTEGRATED = -3, + RESET_MAXPEAK = -2, + RESET_ALL = -1, + PAUSED = 0, + ANALYZING = 1 + } + + public enum DSP_ENVELOPEFOLLOWER : int + { + ATTACK, + RELEASE, + ENVELOPE, + USESIDECHAIN + } + + public enum DSP_CONVOLUTION_REVERB : int + { + IR, + WET, + DRY, + LINKED + } + + public enum DSP_CHANNELMIX_OUTPUT : int + { + DEFAULT, + ALLMONO, + ALLSTEREO, + ALLQUAD, + ALL5POINT1, + ALL7POINT1, + ALLLFE, + ALL7POINT1POINT4 + } + + public enum DSP_CHANNELMIX : int + { + OUTPUTGROUPING, + GAIN_CH0, + GAIN_CH1, + GAIN_CH2, + GAIN_CH3, + GAIN_CH4, + GAIN_CH5, + GAIN_CH6, + GAIN_CH7, + GAIN_CH8, + GAIN_CH9, + GAIN_CH10, + GAIN_CH11, + GAIN_CH12, + GAIN_CH13, + GAIN_CH14, + GAIN_CH15, + GAIN_CH16, + GAIN_CH17, + GAIN_CH18, + GAIN_CH19, + GAIN_CH20, + GAIN_CH21, + GAIN_CH22, + GAIN_CH23, + GAIN_CH24, + GAIN_CH25, + GAIN_CH26, + GAIN_CH27, + GAIN_CH28, + GAIN_CH29, + GAIN_CH30, + GAIN_CH31, + OUTPUT_CH0, + OUTPUT_CH1, + OUTPUT_CH2, + OUTPUT_CH3, + OUTPUT_CH4, + OUTPUT_CH5, + OUTPUT_CH6, + OUTPUT_CH7, + OUTPUT_CH8, + OUTPUT_CH9, + OUTPUT_CH10, + OUTPUT_CH11, + OUTPUT_CH12, + OUTPUT_CH13, + OUTPUT_CH14, + OUTPUT_CH15, + OUTPUT_CH16, + OUTPUT_CH17, + OUTPUT_CH18, + OUTPUT_CH19, + OUTPUT_CH20, + OUTPUT_CH21, + OUTPUT_CH22, + OUTPUT_CH23, + OUTPUT_CH24, + OUTPUT_CH25, + OUTPUT_CH26, + OUTPUT_CH27, + OUTPUT_CH28, + OUTPUT_CH29, + OUTPUT_CH30, + OUTPUT_CH31, + } + + public enum DSP_TRANSCEIVER_SPEAKERMODE : int + { + AUTO = -1, + MONO = 0, + STEREO, + SURROUND, + } + + public enum DSP_TRANSCEIVER : int + { + TRANSMIT, + GAIN, + CHANNEL, + TRANSMITSPEAKERMODE + } + + public enum DSP_OBJECTPAN : int + { + _3D_POSITION, + _3D_ROLLOFF, + _3D_MIN_DISTANCE, + _3D_MAX_DISTANCE, + _3D_EXTENT_MODE, + _3D_SOUND_SIZE, + _3D_MIN_EXTENT, + OVERALL_GAIN, + OUTPUTGAIN, + ATTENUATION_RANGE, + OVERRIDE_RANGE + } +} diff --git a/FMODAPI/fmod_errors.cs b/FMODAPI/fmod_errors.cs new file mode 100644 index 0000000..63f3140 --- /dev/null +++ b/FMODAPI/fmod_errors.cs @@ -0,0 +1,106 @@ +/* ============================================================================================== */ +/* FMOD Core / Studio API - Error string header file. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2023. */ +/* */ +/* Use this header if you want to store or display a string version / english explanation */ +/* of the FMOD error codes. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/docs/2.02/api/core-api-common.html#fmod_result */ +/* =============================================================================================== */ + +namespace FMOD +{ + public class Error + { + public static string String(FMOD.RESULT errcode) + { + switch (errcode) + { + case FMOD.RESULT.OK: return "No errors."; + case FMOD.RESULT.ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound)."; + case FMOD.RESULT.ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel."; + case FMOD.RESULT.ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound."; + case FMOD.RESULT.ERR_DMA: return "DMA Failure. See debug output for more information."; + case FMOD.RESULT.ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts."; + case FMOD.RESULT.ERR_DSP_DONTPROCESS: return "DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph."; + case FMOD.RESULT.ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map."; + case FMOD.RESULT.ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released."; + case FMOD.RESULT.ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified."; + case FMOD.RESULT.ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system."; + case FMOD.RESULT.ERR_DSP_SILENCE: return "DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph."; + case FMOD.RESULT.ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type."; + case FMOD.RESULT.ERR_FILE_BAD: return "Error loading file."; + case FMOD.RESULT.ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format."; + case FMOD.RESULT.ERR_FILE_DISKEJECTED: return "Media was ejected while reading."; + case FMOD.RESULT.ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?)."; + case FMOD.RESULT.ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data."; + case FMOD.RESULT.ERR_FILE_NOTFOUND: return "File not found."; + case FMOD.RESULT.ERR_FORMAT: return "Unsupported file or audio format."; + case FMOD.RESULT.ERR_HEADER_MISMATCH: return "There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library."; + case FMOD.RESULT.ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere."; + case FMOD.RESULT.ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden."; + case FMOD.RESULT.ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource."; + case FMOD.RESULT.ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred."; + case FMOD.RESULT.ERR_HTTP_TIMEOUT: return "The HTTP request timed out."; + case FMOD.RESULT.ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function."; + case FMOD.RESULT.ERR_INITIALIZED: return "Cannot call this command after System::init."; + case FMOD.RESULT.ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support."; + case FMOD.RESULT.ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float."; + case FMOD.RESULT.ERR_INVALID_HANDLE: return "An invalid object handle was used."; + case FMOD.RESULT.ERR_INVALID_PARAM: return "An invalid parameter was passed to this function."; + case FMOD.RESULT.ERR_INVALID_POSITION: return "An invalid seek position was passed to this function."; + case FMOD.RESULT.ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode."; + case FMOD.RESULT.ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle."; + case FMOD.RESULT.ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported."; + case FMOD.RESULT.ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular."; + case FMOD.RESULT.ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup."; + case FMOD.RESULT.ERR_MEMORY: return "Not enough memory or resources."; + case FMOD.RESULT.ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used."; + case FMOD.RESULT.ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound."; + case FMOD.RESULT.ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support."; + case FMOD.RESULT.ERR_NET_CONNECT: return "Couldn't connect to the specified host."; + case FMOD.RESULT.ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere."; + case FMOD.RESULT.ERR_NET_URL: return "The specified URL couldn't be resolved."; + case FMOD.RESULT.ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately."; + case FMOD.RESULT.ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready."; + case FMOD.RESULT.ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused."; + case FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer."; + case FMOD.RESULT.ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted."; + case FMOD.RESULT.ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format."; + case FMOD.RESULT.ERR_OUTPUT_INIT: return "Error initializing output device."; + case FMOD.RESULT.ERR_OUTPUT_NODRIVERS: return "The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails."; + case FMOD.RESULT.ERR_PLUGIN: return "An unspecified error has been returned from a plugin."; + case FMOD.RESULT.ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available."; + case FMOD.RESULT.ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be allocated or found. (ie the DLS file for MIDI playback)"; + case FMOD.RESULT.ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version."; + case FMOD.RESULT.ERR_RECORD: return "An error occurred trying to initialize the recording device."; + case FMOD.RESULT.ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection."; + case FMOD.RESULT.ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist."; + case FMOD.RESULT.ERR_SUBSOUNDS: return "The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound."; + case FMOD.RESULT.ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first."; + case FMOD.RESULT.ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file."; + case FMOD.RESULT.ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags."; + case FMOD.RESULT.ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat."; + case FMOD.RESULT.ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated."; + case FMOD.RESULT.ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!"; + case FMOD.RESULT.ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called."; + case FMOD.RESULT.ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified."; + case FMOD.RESULT.ERR_VERSION: return "The version number of this file format is not supported."; + case FMOD.RESULT.ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded."; + case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected."; + case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool."; + case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out."; + case FMOD.RESULT.ERR_EVENT_NOTFOUND: return "The requested event, bus or vca could not be found."; + case FMOD.RESULT.ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized."; + case FMOD.RESULT.ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded."; + case FMOD.RESULT.ERR_INVALID_STRING: return "An invalid string was passed to this function."; + case FMOD.RESULT.ERR_ALREADY_LOCKED: return "The specified resource is already locked."; + case FMOD.RESULT.ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked."; + case FMOD.RESULT.ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected."; + case FMOD.RESULT.ERR_TOOMANYSAMPLES: return "The length provided exceed the allowable limit."; + default: return "Unknown error."; + } + } + } +} diff --git a/LedCSharp/Assets/x64/LogitechLedEnginesWrapper.dll b/LedCSharp/Assets/x64/LogitechLedEnginesWrapper.dll new file mode 100644 index 0000000..815b40c --- /dev/null +++ b/LedCSharp/Assets/x64/LogitechLedEnginesWrapper.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46a0773e5ae6ef5b24557f3051e18a62527c7b2c133360dfb21522cbfe9cbdd1 +size 20104 diff --git a/LedCSharp/LedCSharp.csproj b/LedCSharp/LedCSharp.csproj new file mode 100644 index 0000000..9f5f7c5 --- /dev/null +++ b/LedCSharp/LedCSharp.csproj @@ -0,0 +1,10 @@ + + + + net7.0 + x64;ARM64 + enable + embedded + + + diff --git a/LedCSharp/LogitechGSDK.cs b/LedCSharp/LogitechGSDK.cs new file mode 100644 index 0000000..44576f8 --- /dev/null +++ b/LedCSharp/LogitechGSDK.cs @@ -0,0 +1,238 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; + +namespace LedCSharp +{ + public enum keyboardNames + { + ESC = 0x01, + F1 = 0x3b, + F2 = 0x3c, + F3 = 0x3d, + F4 = 0x3e, + F5 = 0x3f, + F6 = 0x40, + F7 = 0x41, + F8 = 0x42, + F9 = 0x43, + F10 = 0x44, + F11 = 0x57, + F12 = 0x58, + PRINT_SCREEN = 0x137, + SCROLL_LOCK = 0x46, + PAUSE_BREAK = 0x145, + TILDE = 0x29, + ONE = 0x02, + TWO = 0x03, + THREE = 0x04, + FOUR = 0x05, + FIVE = 0x06, + SIX = 0x07, + SEVEN = 0x08, + EIGHT = 0x09, + NINE = 0x0A, + ZERO = 0x0B, + MINUS = 0x0C, + EQUALS = 0x0D, + BACKSPACE = 0x0E, + INSERT = 0x152, + HOME = 0x147, + PAGE_UP = 0x149, + NUM_LOCK = 0x45, + NUM_SLASH = 0x135, + NUM_ASTERISK = 0x37, + NUM_MINUS = 0x4A, + TAB = 0x0F, + Q = 0x10, + W = 0x11, + E = 0x12, + R = 0x13, + T = 0x14, + Y = 0x15, + U = 0x16, + I = 0x17, + O = 0x18, + P = 0x19, + OPEN_BRACKET = 0x1A, + CLOSE_BRACKET = 0x1B, + BACKSLASH = 0x2B, + KEYBOARD_DELETE = 0x153, + END = 0x14F, + PAGE_DOWN = 0x151, + NUM_SEVEN = 0x47, + NUM_EIGHT = 0x48, + NUM_NINE = 0x49, + NUM_PLUS = 0x4E, + CAPS_LOCK = 0x3A, + A = 0x1E, + S = 0x1F, + D = 0x20, + F = 0x21, + G = 0x22, + H = 0x23, + J = 0x24, + K = 0x25, + L = 0x26, + SEMICOLON = 0x27, + APOSTROPHE = 0x28, + ENTER = 0x1C, + NUM_FOUR = 0x4B, + NUM_FIVE = 0x4C, + NUM_SIX = 0x4D, + LEFT_SHIFT = 0x2A, + Z = 0x2C, + X = 0x2D, + C = 0x2E, + V = 0x2F, + B = 0x30, + N = 0x31, + M = 0x32, + COMMA = 0x33, + PERIOD = 0x34, + FORWARD_SLASH = 0x35, + RIGHT_SHIFT = 0x36, + ARROW_UP = 0x148, + NUM_ONE = 0x4F, + NUM_TWO = 0x50, + NUM_THREE = 0x51, + NUM_ENTER = 0x11C, + LEFT_CONTROL = 0x1D, + LEFT_WINDOWS = 0x15B, + LEFT_ALT = 0x38, + SPACE = 0x39, + RIGHT_ALT = 0x138, + RIGHT_WINDOWS = 0x15C, + APPLICATION_SELECT = 0x15D, + RIGHT_CONTROL = 0x11D, + ARROW_LEFT = 0x14B, + ARROW_DOWN = 0x150, + ARROW_RIGHT = 0x14D, + NUM_ZERO = 0x52, + NUM_PERIOD = 0x53, + G_1 = 0xFFF1, + G_2 = 0xFFF2, + G_3 = 0xFFF3, + G_4 = 0xFFF4, + G_5 = 0xFFF5, + G_6 = 0xFFF6, + G_7 = 0xFFF7, + G_8 = 0xFFF8, + G_9 = 0xFFF9, + G_LOGO = 0xFFFF1, + G_BADGE = 0xFFFF2 + }; + + public enum DeviceType + { + Keyboard = 0x0, + Mouse = 0x3, + Mousemat = 0x4, + Headset = 0x8, + Speaker = 0xe + } + + public class LogitechGSDK + { + //LED SDK + private const int LOGI_DEVICETYPE_MONOCHROME_ORD = 0; + private const int LOGI_DEVICETYPE_RGB_ORD = 1; + private const int LOGI_DEVICETYPE_PERKEY_RGB_ORD = 2; + + public const int LOGI_DEVICETYPE_MONOCHROME = (1 << LOGI_DEVICETYPE_MONOCHROME_ORD); + public const int LOGI_DEVICETYPE_RGB = (1 << LOGI_DEVICETYPE_RGB_ORD); + public const int LOGI_DEVICETYPE_PERKEY_RGB = (1 << LOGI_DEVICETYPE_PERKEY_RGB_ORD); + public const int LOGI_DEVICETYPE_ALL = (LOGI_DEVICETYPE_MONOCHROME | LOGI_DEVICETYPE_RGB | LOGI_DEVICETYPE_PERKEY_RGB); + + public const int LOGI_LED_BITMAP_WIDTH = 21; + public const int LOGI_LED_BITMAP_HEIGHT = 6; + public const int LOGI_LED_BITMAP_BYTES_PER_KEY = 4; + + public const int LOGI_LED_BITMAP_SIZE = LOGI_LED_BITMAP_WIDTH * LOGI_LED_BITMAP_HEIGHT * LOGI_LED_BITMAP_BYTES_PER_KEY; + public const int LOGI_LED_DURATION_INFINITE = 0; + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedInit(); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedInitWithName(String name); + + //Config option functions + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedGetConfigOptionNumber([MarshalAs(UnmanagedType.LPWStr)]String configPath, ref double defaultNumber); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedGetConfigOptionBool([MarshalAs(UnmanagedType.LPWStr)]String configPath, ref bool defaultRed); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedGetConfigOptionColor([MarshalAs(UnmanagedType.LPWStr)]String configPath, ref int defaultRed, ref int defaultGreen, ref int defaultBlue); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedGetConfigOptionKeyInput([MarshalAs(UnmanagedType.LPWStr)]String configPath, StringBuilder buffer, int bufsize); + ///////////////////// + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSetTargetDevice(int targetDevice); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedGetSdkVersion(ref int majorNum, ref int minorNum, ref int buildNum); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSaveCurrentLighting(); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercentage); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedRestoreLighting(); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedFlashLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedPulseLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedStopEffects(); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedExcludeKeysFromBitmap(keyboardNames[] keyList, int listCount); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSetLightingFromBitmap(byte[] bitmap); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSetLightingForKeyWithQuartzCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSetLightingForKeyWithKeyName(keyboardNames keyCode, int redPercentage, int greenPercentage, int bluePercentage); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSaveLightingForKey(keyboardNames keyName); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedRestoreLightingForKey(keyboardNames keyName); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedFlashSingleKey(keyboardNames keyName, int redPercentage, int greenPercentage, int bluePercentage, int msDuration, int msInterval); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedPulseSingleKey(keyboardNames keyName, int startRedPercentage, int startGreenPercentage, int startBluePercentage, int finishRedPercentage, int finishGreenPercentage, int finishBluePercentage, int msDuration, bool isInfinite); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedStopEffectsOnKey(keyboardNames keyName); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSetLightingForTargetZone(DeviceType deviceType, int zone, int redPercentage, int greenPercentage, int bluePercentage); + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern void LogiLedShutdown(); + } + +} diff --git a/Qwilight.sln b/Qwilight.sln index 7db7fdd..33138e6 100644 --- a/Qwilight.sln +++ b/Qwilight.sln @@ -24,6 +24,12 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Igniter", "Igniter\Igniter.csproj", "{9E9B7E8A-2617-4CCE-8431-34B97550E75B}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LedCSharp", "LedCSharp\LedCSharp.csproj", "{DB5E7D3B-3BAC-4AD8-B434-B20BDEDDEF6E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChromaSDK", "ChromaSDK\ChromaSDK.csproj", "{BBC3B632-3A18-4A09-B203-C1026F347DAB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FMODAPI", "FMODAPI\FMODAPI.csproj", "{99FA193F-D634-4706-AC10-D22722B45166}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM64 = Debug|ARM64 @@ -96,6 +102,30 @@ {9E9B7E8A-2617-4CCE-8431-34B97550E75B}.Release|ARM64.Build.0 = Release|ARM64 {9E9B7E8A-2617-4CCE-8431-34B97550E75B}.Release|x64.ActiveCfg = Release|x64 {9E9B7E8A-2617-4CCE-8431-34B97550E75B}.Release|x64.Build.0 = Release|x64 + {DB5E7D3B-3BAC-4AD8-B434-B20BDEDDEF6E}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {DB5E7D3B-3BAC-4AD8-B434-B20BDEDDEF6E}.Debug|ARM64.Build.0 = Debug|ARM64 + {DB5E7D3B-3BAC-4AD8-B434-B20BDEDDEF6E}.Debug|x64.ActiveCfg = Debug|x64 + {DB5E7D3B-3BAC-4AD8-B434-B20BDEDDEF6E}.Debug|x64.Build.0 = Debug|x64 + {DB5E7D3B-3BAC-4AD8-B434-B20BDEDDEF6E}.Release|ARM64.ActiveCfg = Release|ARM64 + {DB5E7D3B-3BAC-4AD8-B434-B20BDEDDEF6E}.Release|ARM64.Build.0 = Release|ARM64 + {DB5E7D3B-3BAC-4AD8-B434-B20BDEDDEF6E}.Release|x64.ActiveCfg = Release|x64 + {DB5E7D3B-3BAC-4AD8-B434-B20BDEDDEF6E}.Release|x64.Build.0 = Release|x64 + {BBC3B632-3A18-4A09-B203-C1026F347DAB}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {BBC3B632-3A18-4A09-B203-C1026F347DAB}.Debug|ARM64.Build.0 = Debug|ARM64 + {BBC3B632-3A18-4A09-B203-C1026F347DAB}.Debug|x64.ActiveCfg = Debug|x64 + {BBC3B632-3A18-4A09-B203-C1026F347DAB}.Debug|x64.Build.0 = Debug|x64 + {BBC3B632-3A18-4A09-B203-C1026F347DAB}.Release|ARM64.ActiveCfg = Release|ARM64 + {BBC3B632-3A18-4A09-B203-C1026F347DAB}.Release|ARM64.Build.0 = Release|ARM64 + {BBC3B632-3A18-4A09-B203-C1026F347DAB}.Release|x64.ActiveCfg = Release|x64 + {BBC3B632-3A18-4A09-B203-C1026F347DAB}.Release|x64.Build.0 = Release|x64 + {99FA193F-D634-4706-AC10-D22722B45166}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {99FA193F-D634-4706-AC10-D22722B45166}.Debug|ARM64.Build.0 = Debug|ARM64 + {99FA193F-D634-4706-AC10-D22722B45166}.Debug|x64.ActiveCfg = Debug|x64 + {99FA193F-D634-4706-AC10-D22722B45166}.Debug|x64.Build.0 = Debug|x64 + {99FA193F-D634-4706-AC10-D22722B45166}.Release|ARM64.ActiveCfg = Release|ARM64 + {99FA193F-D634-4706-AC10-D22722B45166}.Release|ARM64.Build.0 = Release|ARM64 + {99FA193F-D634-4706-AC10-D22722B45166}.Release|x64.ActiveCfg = Release|x64 + {99FA193F-D634-4706-AC10-D22722B45166}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Qwilight/Assets/x64/CChromaEditorLibrary64.dll b/Qwilight/Assets/x64/CChromaEditorLibrary64.dll deleted file mode 100644 index 608576a..0000000 --- a/Qwilight/Assets/x64/CChromaEditorLibrary64.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:14e5709b9de7c454ecfb0b9386591ed64f67af6e35be27b8b695bcafc8ac256a -size 436112 diff --git a/Qwilight/Assets/x64/LogitechLedEnginesWrapper.dll b/Qwilight/Assets/x64/LogitechLedEnginesWrapper.dll deleted file mode 100644 index 815b40c..0000000 --- a/Qwilight/Assets/x64/LogitechLedEnginesWrapper.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:46a0773e5ae6ef5b24557f3051e18a62527c7b2c133360dfb21522cbfe9cbdd1 -size 20104 diff --git a/Qwilight/Assets/x64/fmod.dll b/Qwilight/Assets/x64/fmod.dll deleted file mode 100644 index 5425dd6..0000000 --- a/Qwilight/Assets/x64/fmod.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba377c62ad807fe17e4177b46259237035e544a5893367e296fbae07b11b1bcb -size 1852928 diff --git a/Qwilight/ChromaSDK/ChromaAnimationAPI.cs b/Qwilight/ChromaSDK/ChromaAnimationAPI.cs deleted file mode 100644 index 1b2977b..0000000 --- a/Qwilight/ChromaSDK/ChromaAnimationAPI.cs +++ /dev/null @@ -1,10071 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Runtime.InteropServices; -using System.Text; - -namespace ChromaSDK -{ - public class Keyboard - { - //! Definitions of keys. - public enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc (VK_ESCAPE) */ - RZKEY_F1 = 0x0003, /*!< F1 (VK_F1) */ - RZKEY_F2 = 0x0004, /*!< F2 (VK_F2) */ - RZKEY_F3 = 0x0005, /*!< F3 (VK_F3) */ - RZKEY_F4 = 0x0006, /*!< F4 (VK_F4) */ - RZKEY_F5 = 0x0007, /*!< F5 (VK_F5) */ - RZKEY_F6 = 0x0008, /*!< F6 (VK_F6) */ - RZKEY_F7 = 0x0009, /*!< F7 (VK_F7) */ - RZKEY_F8 = 0x000A, /*!< F8 (VK_F8) */ - RZKEY_F9 = 0x000B, /*!< F9 (VK_F9) */ - RZKEY_F10 = 0x000C, /*!< F10 (VK_F10) */ - RZKEY_F11 = 0x000D, /*!< F11 (VK_F11) */ - RZKEY_F12 = 0x000E, /*!< F12 (VK_F12) */ - RZKEY_1 = 0x0102, /*!< 1 (VK_1) */ - RZKEY_2 = 0x0103, /*!< 2 (VK_2) */ - RZKEY_3 = 0x0104, /*!< 3 (VK_3) */ - RZKEY_4 = 0x0105, /*!< 4 (VK_4) */ - RZKEY_5 = 0x0106, /*!< 5 (VK_5) */ - RZKEY_6 = 0x0107, /*!< 6 (VK_6) */ - RZKEY_7 = 0x0108, /*!< 7 (VK_7) */ - RZKEY_8 = 0x0109, /*!< 8 (VK_8) */ - RZKEY_9 = 0x010A, /*!< 9 (VK_9) */ - RZKEY_0 = 0x010B, /*!< 0 (VK_0) */ - RZKEY_A = 0x0302, /*!< A (VK_A) */ - RZKEY_B = 0x0407, /*!< B (VK_B) */ - RZKEY_C = 0x0405, /*!< C (VK_C) */ - RZKEY_D = 0x0304, /*!< D (VK_D) */ - RZKEY_E = 0x0204, /*!< E (VK_E) */ - RZKEY_F = 0x0305, /*!< F (VK_F) */ - RZKEY_G = 0x0306, /*!< G (VK_G) */ - RZKEY_H = 0x0307, /*!< H (VK_H) */ - RZKEY_I = 0x0209, /*!< I (VK_I) */ - RZKEY_J = 0x0308, /*!< J (VK_J) */ - RZKEY_K = 0x0309, /*!< K (VK_K) */ - RZKEY_L = 0x030A, /*!< L (VK_L) */ - RZKEY_M = 0x0409, /*!< M (VK_M) */ - RZKEY_N = 0x0408, /*!< N (VK_N) */ - RZKEY_O = 0x020A, /*!< O (VK_O) */ - RZKEY_P = 0x020B, /*!< P (VK_P) */ - RZKEY_Q = 0x0202, /*!< Q (VK_Q) */ - RZKEY_R = 0x0205, /*!< R (VK_R) */ - RZKEY_S = 0x0303, /*!< S (VK_S) */ - RZKEY_T = 0x0206, /*!< T (VK_T) */ - RZKEY_U = 0x0208, /*!< U (VK_U) */ - RZKEY_V = 0x0406, /*!< V (VK_V) */ - RZKEY_W = 0x0203, /*!< W (VK_W) */ - RZKEY_X = 0x0404, /*!< X (VK_X) */ - RZKEY_Y = 0x0207, /*!< Y (VK_Y) */ - RZKEY_Z = 0x0403, /*!< Z (VK_Z) */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock (VK_NUMLOCK) */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 (VK_NUMPAD0) */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 (VK_NUMPAD1) */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 (VK_NUMPAD2) */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 (VK_NUMPAD3) */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 (VK_NUMPAD4) */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 (VK_NUMPAD5) */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 (VK_NUMPAD6) */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 (VK_NUMPAD7) */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 (VK_NUMPAD8) */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9 (VK_ NUMPAD9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide (VK_DIVIDE) */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply (VK_MULTIPLY) */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract (VK_SUBTRACT) */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add (VK_ADD) */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter (VK_RETURN - Extended) */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal (VK_DECIMAL) */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen (VK_PRINT) */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock (VK_SCROLL) */ - RZKEY_PAUSE = 0x0011, /*!< Pause (VK_PAUSE) */ - RZKEY_INSERT = 0x010F, /*!< Insert (VK_INSERT) */ - RZKEY_HOME = 0x0110, /*!< Home (VK_HOME) */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up (VK_PRIOR) */ - RZKEY_DELETE = 0x020f, /*!< Delete (VK_DELETE) */ - RZKEY_END = 0x0210, /*!< End (VK_END) */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down (VK_NEXT) */ - RZKEY_UP = 0x0410, /*!< Up (VK_UP) */ - RZKEY_LEFT = 0x050F, /*!< Left (VK_LEFT) */ - RZKEY_DOWN = 0x0510, /*!< Down (VK_DOWN) */ - RZKEY_RIGHT = 0x0511, /*!< Right (VK_RIGHT) */ - RZKEY_TAB = 0x0201, /*!< Tab (VK_TAB) */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock(VK_CAPITAL) */ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace (VK_BACK) */ - RZKEY_ENTER = 0x030E, /*!< Enter (VK_RETURN) */ - RZKEY_LCTRL = 0x0501, /*!< Left Control(VK_LCONTROL) */ - RZKEY_LWIN = 0x0502, /*!< Left Window (VK_LWIN) */ - RZKEY_LALT = 0x0503, /*!< Left Alt (VK_LMENU) */ - RZKEY_SPACE = 0x0507, /*!< Spacebar (VK_SPACE) */ - RZKEY_RALT = 0x050B, /*!< Right Alt (VK_RMENU) */ - RZKEY_FN = 0x050C, /*!< Function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu (VK_APPS) */ - RZKEY_RCTRL = 0x050E, /*!< Right Control (VK_RCONTROL) */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift (VK_LSHIFT) */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift (VK_RSHIFT) */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1 */ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2 */ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4 */ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ (tilde/半角/全角) (VK_OEM_3) */ - RZKEY_OEM_2 = 0x010C, /*!< -- (minus) (VK_OEM_MINUS) */ - RZKEY_OEM_3 = 0x010D, /*!< = (equal) (VK_OEM_PLUS) */ - RZKEY_OEM_4 = 0x020C, /*!< [ (left sqaure bracket) (VK_OEM_4) */ - RZKEY_OEM_5 = 0x020D, /*!< ] (right square bracket) (VK_OEM_6) */ - RZKEY_OEM_6 = 0x020E, /*!< \ (backslash) (VK_OEM_5) */ - RZKEY_OEM_7 = 0x030B, /*!< ; (semi-colon) (VK_OEM_1) */ - RZKEY_OEM_8 = 0x030C, /*!< ' (apostrophe) (VK_OEM_7) */ - RZKEY_OEM_9 = 0x040A, /*!< , (comma) (VK_OEM_COMMA) */ - RZKEY_OEM_10 = 0x040B, /*!< . (period) (VK_OEM_PERIOD) */ - RZKEY_OEM_11 = 0x040C, /*!< / (forward slash) (VK_OEM_2) */ - RZKEY_EUR_1 = 0x030D, /*!< "#" (VK_OEM_5) */ - RZKEY_EUR_2 = 0x0402, /*!< \ (VK_OEM_102) */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ (0xFF) */ - RZKEY_JPN_2 = 0x040D, /*!< \ (0xC1) */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 (VK_OEM_PA1) */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 (0xFF) */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ (0xFF) */ - RZKEY_KOR_1 = 0x0015, /*!< | (0xFF) */ - RZKEY_KOR_2 = 0x030D, /*!< (VK_OEM_5) */ - RZKEY_KOR_3 = 0x0402, /*!< (VK_OEM_102) */ - RZKEY_KOR_4 = 0x040D, /*!< (0xC1) */ - RZKEY_KOR_5 = 0x0504, /*!< (VK_OEM_PA1) */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 (0xFF) */ - RZKEY_KOR_7 = 0x050A, /*!< (0xFF) */ - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } - - //! Definition of LEDs. - public enum RZLED - { - RZLED_LOGO = 0x0014 /*!< Razer logo */ - }; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct APPINFOTYPE - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string Title; //TCHAR Title[256]; - - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] - public string Description; //TCHAR Description[1024]; - - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string Author_Name; //TCHAR Name[256]; - - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string Author_Contact; //TCHAR Contact[256]; - - public UInt32 SupportedDevice; //DWORD SupportedDevice; - - public UInt32 Category; //DWORD Category; - } - - [StructLayout(LayoutKind.Sequential)] - public struct FChromaSDKGuid - { - Guid Data; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DEVICE_INFO_TYPE - { - int DeviceType; - uint Connected; - } - - public enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect (This effect type has deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (This effect type has deprecated and should not be used). - CHROMA_BREATHING, //!< Breathing effect (This effect type has deprecated and should not be used). - CHROMA_BLINKING, //!< Blinking effect (This effect type has deprecated and should not be used). - CHROMA_REACTIVE, //!< Reactive effect (This effect type has deprecated and should not be used). - CHROMA_STATIC, //!< Static effect. - CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. - CHROMA_RESERVED, //!< Reserved - CHROMA_INVALID //!< Invalid effect. - } - - namespace Stream - { - public enum StreamStatusType - { - READY = 0, // ready for commands - AUTHORIZING = 1, // the session is being authorized - BROADCASTING = 2, // the session is being broadcast - WATCHING = 3, // A stream is being watched - NOT_AUTHORIZED = 4, // The session is not authorized - BROADCAST_DUPLICATE = 5, // The session has duplicate broadcasters - SERVICE_OFFLINE = 6, // The service is offline - } - - public class Default - { - const uint LENGTH_SHORTCODE = 6; - const uint LENGTH_STREAM_ID = 48; - const uint LENGTH_STREAM_KEY = 48; - const uint LENGTH_STREAM_FOCUS = 48; - - static string GetDefaultString(uint length) - { - string result = string.Empty; - for (uint i = 0; i < length; ++i) - { - result += " "; - } - return result; - } - - public readonly static string Shortcode = GetDefaultString(LENGTH_SHORTCODE); - public readonly static string StreamId = GetDefaultString(LENGTH_STREAM_ID); - public readonly static string StreamKey = GetDefaultString(LENGTH_STREAM_KEY); - public readonly static string StreamFocus = GetDefaultString(LENGTH_STREAM_FOCUS); - } - } - - public class ChromaAnimationAPI - { - -#if X64 - const string DLL_NAME = "CChromaEditorLibrary64"; -#else - const string DLL_NAME = "CChromaEditorLibrary"; -#endif - -#region Data Structures - - public enum DeviceType - { - Invalid = -1, - DE_1D = 0, - DE_2D = 1, - MAX = 2, - } - - public enum Device - { - Invalid = -1, - ChromaLink = 0, - Headset = 1, - Keyboard = 2, - Keypad = 3, - Mouse = 4, - Mousepad = 5, - KeyboardExtended = 6, - MAX = 7, - } - - public enum Device1D - { - Invalid = -1, - ChromaLink = 0, - Headset = 1, - Mousepad = 2, - MAX = 3, - } - - public enum Device2D - { - Invalid = -1, - Keyboard = 0, - Keypad = 1, - Mouse = 2, - KeyboardExtended = 3, - MAX = 4, - } - - public class FChromaSDKDeviceFrameIndex - { - // Index corresponds to EChromaSDKDeviceEnum; - public int[] _mFrameIndex = new int[(int)Device.MAX]; - - public FChromaSDKDeviceFrameIndex() - { - _mFrameIndex[(int)Device.ChromaLink] = 0; - _mFrameIndex[(int)Device.Headset] = 0; - _mFrameIndex[(int)Device.Keyboard] = 0; - _mFrameIndex[(int)Device.Keypad] = 0; - _mFrameIndex[(int)Device.Mouse] = 0; - _mFrameIndex[(int)Device.Mousepad] = 0; - _mFrameIndex[(int)Device.KeyboardExtended] = 0; - } - } - - public enum EChromaSDKSceneBlend - { - SB_None, - SB_Invert, - SB_Threshold, - SB_Lerp, - }; - - public enum EChromaSDKSceneMode - { - SM_Replace, - SM_Max, - SM_Min, - SM_Average, - SM_Multiply, - SM_Add, - SM_Subtract, - }; - - public class FChromaSDKSceneEffect - { - public string _mAnimation = ""; - public bool _mState = false; - public int _mPrimaryColor = 0; - public int _mSecondaryColor = 0; - public int _mSpeed = 1; - public EChromaSDKSceneBlend _mBlend = EChromaSDKSceneBlend.SB_None; - public EChromaSDKSceneMode _mMode = EChromaSDKSceneMode.SM_Replace; - - public FChromaSDKDeviceFrameIndex _mFrameIndex = new FChromaSDKDeviceFrameIndex(); - } - - public class FChromaSDKScene - { - public List _mEffects = new List(); - public bool GetState(int effect) - { - if (effect >= 0 && effect < _mEffects.Count) - { - return _mEffects[effect]._mState; - } - else - { - return false; - } - } - public void ToggleState(int effect) - { - if (effect >= 0 && effect < _mEffects.Count) - { - _mEffects[effect]._mState = !_mEffects[effect]._mState; - } - } - } - - -#endregion - -#region Helpers (handle path conversions) - - /// - /// Helper to convert path string to IntPtr - /// - /// - /// - private static IntPtr GetPathIntPtr(string path) - { - if (string.IsNullOrEmpty(path)) - { - return IntPtr.Zero; - } - FileInfo fi = new FileInfo(path); - byte[] array = ASCIIEncoding.ASCII.GetBytes(fi.FullName + "\0"); - IntPtr lpData = Marshal.AllocHGlobal(array.Length); - Marshal.Copy(array, 0, lpData, array.Length); - return lpData; - } - - /// - /// Helper to Ascii path string to IntPtr - /// - /// - /// - private static IntPtr GetAsciiIntPtr(string str) - { - if (string.IsNullOrEmpty(str)) - { - return IntPtr.Zero; - } - byte[] array = ASCIIEncoding.ASCII.GetBytes(str + "\0"); - IntPtr lpData = Marshal.AllocHGlobal(array.Length); - Marshal.Copy(array, 0, lpData, array.Length); - return lpData; - } - - /// - /// Helper to Unicode path string to IntPtr - /// - /// - /// - private static IntPtr GetUnicodeIntPtr(string str) - { - if (string.IsNullOrEmpty(str)) - { - return IntPtr.Zero; - } - byte[] array = UnicodeEncoding.Unicode.GetBytes(str + "\0"); - IntPtr lpData = Marshal.AllocHGlobal(array.Length); - Marshal.Copy(array, 0, lpData, array.Length); - return lpData; - } - - /// - /// Helper to recycle the IntPtr - /// - /// - private static void FreeIntPtr(IntPtr lpData) - { - if (lpData != IntPtr.Zero) - { - Marshal.FreeHGlobal(lpData); - } - } - - public static int UninitAPI() - { - UnloadLibrarySDK(); - UnloadLibraryStreamingPlugin(); - - return 0; - } - -#endregion - - - #region Public API Methods - /// - /// Return the sum of colors - /// - public static int AddColor(int color1, int color2) - { - int result = PluginAddColor(color1, color2); - return result; - } - /// - /// Adds a frame to the `Chroma` animation and sets the `duration` (in seconds). - /// The `color` is expected to be an array of the dimensions for the `deviceType/device`. - /// The `length` parameter is the size of the `color` array. For `EChromaSDKDevice1DEnum` - /// the array size should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array - /// size should be `MAX ROW` times `MAX COLUMN`. Returns the animation id upon - /// success. Returns negative one upon failure. - /// - public static int AddFrame(int animationId, float duration, int[] colors, int length) - { - int result = PluginAddFrame(animationId, duration, colors, length); - return result; - } - /// - /// Add source color to target where color is not black for frame id, reference - /// source and target by id. - /// - public static void AddNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) - { - PluginAddNonZeroAllKeys(sourceAnimationId, targetAnimationId, frameId); - } - /// - /// Add source color to target where color is not black for all frames, reference - /// source and target by id. - /// - public static void AddNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) - { - PluginAddNonZeroAllKeysAllFrames(sourceAnimationId, targetAnimationId); - } - /// - /// Add source color to target where color is not black for all frames, reference - /// source and target by name. - /// - public static void AddNonZeroAllKeysAllFramesName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginAddNonZeroAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double AddNonZeroAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginAddNonZeroAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Add source color to target where color is not black for all frames starting - /// at offset for the length of the source, reference source and target by - /// id. - /// - public static void AddNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) - { - PluginAddNonZeroAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); - } - /// - /// Add source color to target where color is not black for all frames starting - /// at offset for the length of the source, reference source and target by - /// name. - /// - public static void AddNonZeroAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginAddNonZeroAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double AddNonZeroAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginAddNonZeroAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Add source color to target where color is not black for frame id, reference - /// source and target by name. - /// - public static void AddNonZeroAllKeysName(string sourceAnimation, string targetAnimation, int frameId) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginAddNonZeroAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// Add source color to target where color is not black for the source frame - /// and target offset frame, reference source and target by id. - /// - public static void AddNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) - { - PluginAddNonZeroAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); - } - /// - /// Add source color to target where color is not black for the source frame - /// and target offset frame, reference source and target by name. - /// - public static void AddNonZeroAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginAddNonZeroAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double AddNonZeroAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginAddNonZeroAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Add source color to target where the target color is not black for all frames, - /// reference source and target by id. - /// - public static void AddNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) - { - PluginAddNonZeroTargetAllKeysAllFrames(sourceAnimationId, targetAnimationId); - } - /// - /// Add source color to target where the target color is not black for all frames, - /// reference source and target by name. - /// - public static void AddNonZeroTargetAllKeysAllFramesName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginAddNonZeroTargetAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double AddNonZeroTargetAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginAddNonZeroTargetAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Add source color to target where the target color is not black for all frames - /// starting at offset for the length of the source, reference source and target - /// by id. - /// - public static void AddNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) - { - PluginAddNonZeroTargetAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); - } - /// - /// Add source color to target where the target color is not black for all frames - /// starting at offset for the length of the source, reference source and target - /// by name. - /// - public static void AddNonZeroTargetAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginAddNonZeroTargetAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double AddNonZeroTargetAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginAddNonZeroTargetAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Add source color to target where target color is not blank from the source - /// frame to the target offset frame, reference source and target by id. - /// - public static void AddNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) - { - PluginAddNonZeroTargetAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); - } - /// - /// Add source color to target where target color is not blank from the source - /// frame to the target offset frame, reference source and target by name. - /// - /// - public static void AddNonZeroTargetAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginAddNonZeroTargetAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double AddNonZeroTargetAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginAddNonZeroTargetAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Append all source frames to the target animation, reference source and target - /// by id. - /// - public static void AppendAllFrames(int sourceAnimationId, int targetAnimationId) - { - PluginAppendAllFrames(sourceAnimationId, targetAnimationId); - } - /// - /// Append all source frames to the target animation, reference source and target - /// by name. - /// - public static void AppendAllFramesName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginAppendAllFramesName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double AppendAllFramesNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginAppendAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// `PluginClearAll` will issue a `CLEAR` effect for all devices. - /// - public static void ClearAll() - { - PluginClearAll(); - } - /// - /// `PluginClearAnimationType` will issue a `CLEAR` effect for the given device. - /// - /// - public static void ClearAnimationType(int deviceType, int device) - { - PluginClearAnimationType(deviceType, device); - } - /// - /// `PluginCloseAll` closes all open animations so they can be reloaded from - /// disk. The set of animations will be stopped if playing. - /// - public static void CloseAll() - { - PluginCloseAll(); - } - /// - /// Closes the `Chroma` animation to free up resources referenced by id. Returns - /// the animation id upon success. Returns negative one upon failure. This - /// might be used while authoring effects if there was a change necessitating - /// re-opening the animation. The animation id can no longer be used once closed. - /// - /// - public static int CloseAnimation(int animationId) - { - int result = PluginCloseAnimation(animationId); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double CloseAnimationD(double animationId) - { - double result = PluginCloseAnimationD(animationId); - return result; - } - /// - /// Closes the `Chroma` animation referenced by name so that the animation can - /// be reloaded from disk. - /// - public static void CloseAnimationName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginCloseAnimationName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double CloseAnimationNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginCloseAnimationNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// `PluginCloseComposite` closes a set of animations so they can be reloaded - /// from disk. The set of animations will be stopped if playing. - /// - public static void CloseComposite(string name) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - PluginCloseComposite(lp_Name); - FreeIntPtr(lp_Name); - } - /// - /// D suffix for limited data types. - /// - public static double CloseCompositeD(string name) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - double result = PluginCloseCompositeD(lp_Name); - FreeIntPtr(lp_Name); - return result; - } - /// - /// Copy source animation to target animation for the given frame. Source and - /// target are referenced by id. - /// - public static void CopyAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) - { - PluginCopyAllKeys(sourceAnimationId, targetAnimationId, frameId); - } - /// - /// Copy source animation to target animation for the given frame. Source and - /// target are referenced by id. - /// - public static void CopyAllKeysName(string sourceAnimation, string targetAnimation, int frameId) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// Copy animation to named target animation in memory. If target animation - /// exists, close first. Source is referenced by id. - /// - public static int CopyAnimation(int sourceAnimationId, string targetAnimation) - { - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - int result = PluginCopyAnimation(sourceAnimationId, lp_TargetAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy animation to named target animation in memory. If target animation - /// exists, close first. Source is referenced by name. - /// - public static void CopyAnimationName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyAnimationName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyAnimationNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyAnimationNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy blue channel to other channels for all frames. Intensity range is 0.0 - /// to 1.0. Reference the animation by id. - /// - public static void CopyBlueChannelAllFrames(int animationId, float redIntensity, float greenIntensity) - { - PluginCopyBlueChannelAllFrames(animationId, redIntensity, greenIntensity); - } - /// - /// Copy blue channel to other channels for all frames. Intensity range is 0.0 - /// to 1.0. Reference the animation by name. - /// - public static void CopyBlueChannelAllFramesName(string path, float redIntensity, float greenIntensity) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginCopyBlueChannelAllFramesName(lp_Path, redIntensity, greenIntensity); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double CopyBlueChannelAllFramesNameD(string path, double redIntensity, double greenIntensity) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginCopyBlueChannelAllFramesNameD(lp_Path, redIntensity, greenIntensity); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Copy green channel to other channels for all frames. Intensity range is - /// 0.0 to 1.0. Reference the animation by id. - /// - public static void CopyGreenChannelAllFrames(int animationId, float redIntensity, float blueIntensity) - { - PluginCopyGreenChannelAllFrames(animationId, redIntensity, blueIntensity); - } - /// - /// Copy green channel to other channels for all frames. Intensity range is - /// 0.0 to 1.0. Reference the animation by name. - /// - public static void CopyGreenChannelAllFramesName(string path, float redIntensity, float blueIntensity) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginCopyGreenChannelAllFramesName(lp_Path, redIntensity, blueIntensity); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double CopyGreenChannelAllFramesNameD(string path, double redIntensity, double blueIntensity) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginCopyGreenChannelAllFramesNameD(lp_Path, redIntensity, blueIntensity); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Copy animation key color from the source animation to the target animation - /// for the given frame. Reference the source and target by id. - /// - public static void CopyKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey) - { - PluginCopyKeyColor(sourceAnimationId, targetAnimationId, frameId, rzkey); - } - /// - /// Copy animation key color from the source animation to the target animation - /// for all frames. Reference the source and target by id. - /// - public static void CopyKeyColorAllFrames(int sourceAnimationId, int targetAnimationId, int rzkey) - { - PluginCopyKeyColorAllFrames(sourceAnimationId, targetAnimationId, rzkey); - } - /// - /// Copy animation key color from the source animation to the target animation - /// for all frames. Reference the source and target by name. - /// - public static void CopyKeyColorAllFramesName(string sourceAnimation, string targetAnimation, int rzkey) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyKeyColorAllFramesName(lp_SourceAnimation, lp_TargetAnimation, rzkey); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyKeyColorAllFramesNameD(string sourceAnimation, string targetAnimation, double rzkey) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyKeyColorAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation, rzkey); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy animation key color from the source animation to the target animation - /// for all frames, starting at the offset for the length of the source animation. - /// Source and target are referenced by id. - /// - public static void CopyKeyColorAllFramesOffset(int sourceAnimationId, int targetAnimationId, int rzkey, int offset) - { - PluginCopyKeyColorAllFramesOffset(sourceAnimationId, targetAnimationId, rzkey, offset); - } - /// - /// Copy animation key color from the source animation to the target animation - /// for all frames, starting at the offset for the length of the source animation. - /// Source and target are referenced by name. - /// - public static void CopyKeyColorAllFramesOffsetName(string sourceAnimation, string targetAnimation, int rzkey, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyKeyColorAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, rzkey, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyKeyColorAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double rzkey, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyKeyColorAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, rzkey, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy animation key color from the source animation to the target animation - /// for the given frame. - /// - public static void CopyKeyColorName(string sourceAnimation, string targetAnimation, int frameId, int rzkey) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyKeyColorName(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyKeyColorNameD(string sourceAnimation, string targetAnimation, double frameId, double rzkey) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyKeyColorNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation for the given frame. Reference the source and target by - /// id. - /// - public static void CopyKeysColor(int sourceAnimationId, int targetAnimationId, int frameId, int[] keys, int size) - { - PluginCopyKeysColor(sourceAnimationId, targetAnimationId, frameId, keys, size); - } - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation for all frames. Reference the source and target by id. - /// - /// - public static void CopyKeysColorAllFrames(int sourceAnimationId, int targetAnimationId, int[] keys, int size) - { - PluginCopyKeysColorAllFrames(sourceAnimationId, targetAnimationId, keys, size); - } - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation for all frames. Reference the source and target by name. - /// - /// - public static void CopyKeysColorAllFramesName(string sourceAnimation, string targetAnimation, int[] keys, int size) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyKeysColorAllFramesName(lp_SourceAnimation, lp_TargetAnimation, keys, size); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation for the given frame. Reference the source and target by - /// name. - /// - public static void CopyKeysColorName(string sourceAnimation, string targetAnimation, int frameId, int[] keys, int size) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyKeysColorName(lp_SourceAnimation, lp_TargetAnimation, frameId, keys, size); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation from the source frame to the target frame. Reference the - /// source and target by id. - /// - public static void CopyKeysColorOffset(int sourceAnimationId, int targetAnimationId, int sourceFrameId, int targetFrameId, int[] keys, int size) - { - PluginCopyKeysColorOffset(sourceAnimationId, targetAnimationId, sourceFrameId, targetFrameId, keys, size); - } - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation from the source frame to the target frame. Reference the - /// source and target by name. - /// - public static void CopyKeysColorOffsetName(string sourceAnimation, string targetAnimation, int sourceFrameId, int targetFrameId, int[] keys, int size) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyKeysColorOffsetName(lp_SourceAnimation, lp_TargetAnimation, sourceFrameId, targetFrameId, keys, size); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// Copy source animation to target animation for the given frame. Source and - /// target are referenced by id. - /// - public static void CopyNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) - { - PluginCopyNonZeroAllKeys(sourceAnimationId, targetAnimationId, frameId); - } - /// - /// Copy nonzero colors from a source animation to a target animation for all - /// frames. Reference source and target by id. - /// - public static void CopyNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) - { - PluginCopyNonZeroAllKeysAllFrames(sourceAnimationId, targetAnimationId); - } - /// - /// Copy nonzero colors from a source animation to a target animation for all - /// frames. Reference source and target by name. - /// - public static void CopyNonZeroAllKeysAllFramesName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyNonZeroAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyNonZeroAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyNonZeroAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy nonzero colors from a source animation to a target animation for all - /// frames starting at the offset for the length of the source animation. The - /// source and target are referenced by id. - /// - public static void CopyNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) - { - PluginCopyNonZeroAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); - } - /// - /// Copy nonzero colors from a source animation to a target animation for all - /// frames starting at the offset for the length of the source animation. The - /// source and target are referenced by name. - /// - public static void CopyNonZeroAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyNonZeroAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyNonZeroAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyNonZeroAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy nonzero colors from source animation to target animation for the specified - /// frame. Source and target are referenced by id. - /// - public static void CopyNonZeroAllKeysName(string sourceAnimation, string targetAnimation, int frameId) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyNonZeroAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyNonZeroAllKeysNameD(string sourceAnimation, string targetAnimation, double frameId) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyNonZeroAllKeysNameD(lp_SourceAnimation, lp_TargetAnimation, frameId); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy nonzero colors from the source animation to the target animation from - /// the source frame to the target offset frame. Source and target are referenced - /// by id. - /// - public static void CopyNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) - { - PluginCopyNonZeroAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); - } - /// - /// Copy nonzero colors from the source animation to the target animation from - /// the source frame to the target offset frame. Source and target are referenced - /// by name. - /// - public static void CopyNonZeroAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyNonZeroAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyNonZeroAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyNonZeroAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy animation key color from the source animation to the target animation - /// for the given frame where color is not zero. - /// - public static void CopyNonZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey) - { - PluginCopyNonZeroKeyColor(sourceAnimationId, targetAnimationId, frameId, rzkey); - } - /// - /// Copy animation key color from the source animation to the target animation - /// for the given frame where color is not zero. - /// - public static void CopyNonZeroKeyColorName(string sourceAnimation, string targetAnimation, int frameId, int rzkey) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyNonZeroKeyColorName(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyNonZeroKeyColorNameD(string sourceAnimation, string targetAnimation, double frameId, double rzkey) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyNonZeroKeyColorNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for the specified frame. Source and target - /// are referenced by id. - /// - public static void CopyNonZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) - { - PluginCopyNonZeroTargetAllKeys(sourceAnimationId, targetAnimationId, frameId); - } - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for all frames. Source and target are referenced - /// by id. - /// - public static void CopyNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) - { - PluginCopyNonZeroTargetAllKeysAllFrames(sourceAnimationId, targetAnimationId); - } - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for all frames. Source and target are referenced - /// by name. - /// - public static void CopyNonZeroTargetAllKeysAllFramesName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyNonZeroTargetAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyNonZeroTargetAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyNonZeroTargetAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for all frames. Source and target are referenced - /// by name. - /// - public static void CopyNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) - { - PluginCopyNonZeroTargetAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); - } - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for all frames starting at the target offset - /// for the length of the source animation. Source and target animations are - /// referenced by name. - /// - public static void CopyNonZeroTargetAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyNonZeroTargetAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyNonZeroTargetAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyNonZeroTargetAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for the specified frame. The source and target - /// are referenced by name. - /// - public static void CopyNonZeroTargetAllKeysName(string sourceAnimation, string targetAnimation, int frameId) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyNonZeroTargetAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyNonZeroTargetAllKeysNameD(string sourceAnimation, string targetAnimation, double frameId) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyNonZeroTargetAllKeysNameD(lp_SourceAnimation, lp_TargetAnimation, frameId); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for the specified source frame and target offset - /// frame. The source and target are referenced by id. - /// - public static void CopyNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) - { - PluginCopyNonZeroTargetAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); - } - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for the specified source frame and target offset - /// frame. The source and target are referenced by name. - /// - public static void CopyNonZeroTargetAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyNonZeroTargetAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyNonZeroTargetAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyNonZeroTargetAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is zero for all frames. Source and target are referenced - /// by id. - /// - public static void CopyNonZeroTargetZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) - { - PluginCopyNonZeroTargetZeroAllKeysAllFrames(sourceAnimationId, targetAnimationId); - } - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is zero for all frames. Source and target are referenced - /// by name. - /// - public static void CopyNonZeroTargetZeroAllKeysAllFramesName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyNonZeroTargetZeroAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyNonZeroTargetZeroAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyNonZeroTargetZeroAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy red channel to other channels for all frames. Intensity range is 0.0 - /// to 1.0. Reference the animation by id. - /// - public static void CopyRedChannelAllFrames(int animationId, float greenIntensity, float blueIntensity) - { - PluginCopyRedChannelAllFrames(animationId, greenIntensity, blueIntensity); - } - /// - /// Copy green channel to other channels for all frames. Intensity range is - /// 0.0 to 1.0. Reference the animation by name. - /// - public static void CopyRedChannelAllFramesName(string path, float greenIntensity, float blueIntensity) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginCopyRedChannelAllFramesName(lp_Path, greenIntensity, blueIntensity); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double CopyRedChannelAllFramesNameD(string path, double greenIntensity, double blueIntensity) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginCopyRedChannelAllFramesNameD(lp_Path, greenIntensity, blueIntensity); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Copy zero colors from source animation to target animation for the frame. - /// Source and target are referenced by id. - /// - public static void CopyZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) - { - PluginCopyZeroAllKeys(sourceAnimationId, targetAnimationId, frameId); - } - /// - /// Copy zero colors from source animation to target animation for all frames. - /// Source and target are referenced by id. - /// - public static void CopyZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) - { - PluginCopyZeroAllKeysAllFrames(sourceAnimationId, targetAnimationId); - } - /// - /// Copy zero colors from source animation to target animation for all frames. - /// Source and target are referenced by name. - /// - public static void CopyZeroAllKeysAllFramesName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyZeroAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyZeroAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyZeroAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy zero colors from source animation to target animation for all frames - /// starting at the target offset for the length of the source animation. Source - /// and target are referenced by id. - /// - public static void CopyZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) - { - PluginCopyZeroAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); - } - /// - /// Copy zero colors from source animation to target animation for all frames - /// starting at the target offset for the length of the source animation. Source - /// and target are referenced by name. - /// - public static void CopyZeroAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyZeroAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyZeroAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyZeroAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy zero colors from source animation to target animation for the frame. - /// Source and target are referenced by name. - /// - public static void CopyZeroAllKeysName(string sourceAnimation, string targetAnimation, int frameId) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyZeroAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// Copy zero colors from source animation to target animation for the frame - /// id starting at the target offset for the length of the source animation. - /// Source and target are referenced by id. - /// - public static void CopyZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) - { - PluginCopyZeroAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); - } - /// - /// Copy zero colors from source animation to target animation for the frame - /// id starting at the target offset for the length of the source animation. - /// Source and target are referenced by name. - /// - public static void CopyZeroAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyZeroAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// Copy zero key color from source animation to target animation for the specified - /// frame. Source and target are referenced by id. - /// - public static void CopyZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey) - { - PluginCopyZeroKeyColor(sourceAnimationId, targetAnimationId, frameId, rzkey); - } - /// - /// Copy zero key color from source animation to target animation for the specified - /// frame. Source and target are referenced by name. - /// - public static void CopyZeroKeyColorName(string sourceAnimation, string targetAnimation, int frameId, int rzkey) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyZeroKeyColorName(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyZeroKeyColorNameD(string sourceAnimation, string targetAnimation, double frameId, double rzkey) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyZeroKeyColorNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, rzkey); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy nonzero color from source animation to target animation where target - /// is zero for the frame. Source and target are referenced by id. - /// - public static void CopyZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) - { - PluginCopyZeroTargetAllKeys(sourceAnimationId, targetAnimationId, frameId); - } - /// - /// Copy nonzero color from source animation to target animation where target - /// is zero for all frames. Source and target are referenced by id. - /// - public static void CopyZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) - { - PluginCopyZeroTargetAllKeysAllFrames(sourceAnimationId, targetAnimationId); - } - /// - /// Copy nonzero color from source animation to target animation where target - /// is zero for all frames. Source and target are referenced by name. - /// - public static void CopyZeroTargetAllKeysAllFramesName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyZeroTargetAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double CopyZeroTargetAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginCopyZeroTargetAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Copy nonzero color from source animation to target animation where target - /// is zero for the frame. Source and target are referenced by name. - /// - public static void CopyZeroTargetAllKeysName(string sourceAnimation, string targetAnimation, int frameId) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginCopyZeroTargetAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// Direct access to low level API. - /// - public static int CoreCreateChromaLinkEffect(int effect, IntPtr pParam, out Guid pEffectId) - { - int result = PluginCoreCreateChromaLinkEffect(effect, pParam, out pEffectId); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreCreateEffect(Guid deviceId, EFFECT_TYPE effect, IntPtr pParam, out Guid pEffectId) - { - int result = PluginCoreCreateEffect(deviceId, (int)effect, pParam, out pEffectId); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreCreateHeadsetEffect(int effect, IntPtr pParam, out Guid pEffectId) - { - int result = PluginCoreCreateHeadsetEffect(effect, pParam, out pEffectId); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreCreateKeyboardEffect(int effect, IntPtr pParam, out Guid pEffectId) - { - int result = PluginCoreCreateKeyboardEffect(effect, pParam, out pEffectId); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreCreateKeypadEffect(int effect, IntPtr pParam, out Guid pEffectId) - { - int result = PluginCoreCreateKeypadEffect(effect, pParam, out pEffectId); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreCreateMouseEffect(int effect, IntPtr pParam, out Guid pEffectId) - { - int result = PluginCoreCreateMouseEffect(effect, pParam, out pEffectId); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreCreateMousepadEffect(int effect, IntPtr pParam, out Guid pEffectId) - { - int result = PluginCoreCreateMousepadEffect(effect, pParam, out pEffectId); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreDeleteEffect(Guid effectId) - { - int result = PluginCoreDeleteEffect(effectId); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreInit() - { - int result = PluginCoreInit(); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreInitSDK(ref ChromaSDK.APPINFOTYPE appInfo) - { - int result = PluginCoreInitSDK(ref appInfo); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreQueryDevice(Guid deviceId, out DEVICE_INFO_TYPE deviceInfo) - { - int result = PluginCoreQueryDevice(deviceId, out deviceInfo); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreSetEffect(Guid effectId) - { - int result = PluginCoreSetEffect(effectId); - return result; - } - /// - /// Begin broadcasting Chroma RGB data using the stored stream key as the endpoint. - /// Intended for Cloud Gaming Platforms, restore the streaming key when the - /// game instance is launched to continue streaming. streamId is a null terminated - /// string streamKey is a null terminated string StreamGetStatus() should return - /// the READY status to use this method. - /// - public static bool CoreStreamBroadcast(string streamId, string streamKey) - { - string str_StreamId = streamId; - IntPtr lp_StreamId = GetAsciiIntPtr(str_StreamId); - string str_StreamKey = streamKey; - IntPtr lp_StreamKey = GetAsciiIntPtr(str_StreamKey); - bool result = PluginCoreStreamBroadcast(lp_StreamId, lp_StreamKey); - FreeIntPtr(lp_StreamId); - FreeIntPtr(lp_StreamKey); - return result; - } - /// - /// End broadcasting Chroma RGB data. StreamGetStatus() should return the BROADCASTING - /// status to use this method. - /// - public static bool CoreStreamBroadcastEnd() - { - bool result = PluginCoreStreamBroadcastEnd(); - return result; - } - /// - /// shortcode: Pass the address of a preallocated character buffer to get the - /// streaming auth code. The buffer should have a minimum length of 6. length: - /// Length will return as zero if the streaming auth code could not be obtained. - /// If length is greater than zero, it will be the length of the returned streaming - /// auth code. Once you have the shortcode, it should be shown to the user - /// so they can associate the stream with their Razer ID StreamGetStatus() - /// should return the READY status before invoking this method. platform: is - /// the null terminated string that identifies the source of the stream: { - /// GEFORCE_NOW, LUNA, STADIA, GAME_PASS } title: is the null terminated string - /// that identifies the application or game. - /// - public static void CoreStreamGetAuthShortcode(ref string shortcode, out byte length, string platform, string title) - { - string str_Shortcode = shortcode; - IntPtr lp_Shortcode = GetAsciiIntPtr(str_Shortcode); - string str_Platform = platform; - IntPtr lp_Platform = GetUnicodeIntPtr(str_Platform); - string str_Title = title; - IntPtr lp_Title = GetUnicodeIntPtr(str_Title); - PluginCoreStreamGetAuthShortcode(lp_Shortcode, out length, lp_Platform, lp_Title); - if (lp_Shortcode != IntPtr.Zero) - { - shortcode = Marshal.PtrToStringAnsi(lp_Shortcode); - } - FreeIntPtr(lp_Shortcode); - FreeIntPtr(lp_Platform); - FreeIntPtr(lp_Title); - } - /// - /// focus: Pass the address of a preallocated character buffer to get the stream - /// focus. The buffer should have a length of 48 length: Length will return - /// as zero if the stream focus could not be obtained. If length is greater - /// than zero, it will be the length of the returned stream focus. - /// - public static bool CoreStreamGetFocus(ref string focus, out byte length) - { - string str_Focus = focus; - IntPtr lp_Focus = GetAsciiIntPtr(str_Focus); - bool result = PluginCoreStreamGetFocus(lp_Focus, out length); - if (lp_Focus != IntPtr.Zero) - { - focus = Marshal.PtrToStringAnsi(lp_Focus); - } - FreeIntPtr(lp_Focus); - return result; - } - /// - /// Intended for Cloud Gaming Platforms, store the stream id to persist in user - /// preferences to continue streaming if the game is suspended or closed. shortcode: - /// The shortcode is a null terminated string. Use the shortcode that authorized - /// the stream to obtain the stream id. streamId should be a preallocated buffer - /// to get the stream key. The buffer should have a length of 48. length: Length - /// will return zero if the key could not be obtained. If the length is greater - /// than zero, it will be the length of the returned streaming id. Retrieve - /// the stream id after authorizing the shortcode. The authorization window - /// will expire in 5 minutes. Be sure to save the stream key before the window - /// expires. StreamGetStatus() should return the READY status to use this method. - /// - /// - public static void CoreStreamGetId(string shortcode, ref string streamId, out byte length) - { - string str_Shortcode = shortcode; - IntPtr lp_Shortcode = GetAsciiIntPtr(str_Shortcode); - string str_StreamId = streamId; - IntPtr lp_StreamId = GetAsciiIntPtr(str_StreamId); - PluginCoreStreamGetId(lp_Shortcode, lp_StreamId, out length); - FreeIntPtr(lp_Shortcode); - if (lp_StreamId != IntPtr.Zero) - { - streamId = Marshal.PtrToStringAnsi(lp_StreamId); - } - FreeIntPtr(lp_StreamId); - } - /// - /// Intended for Cloud Gaming Platforms, store the streaming key to persist - /// in user preferences to continue streaming if the game is suspended or closed. - /// shortcode: The shortcode is a null terminated string. Use the shortcode - /// that authorized the stream to obtain the stream key. If the status is in - /// the BROADCASTING or WATCHING state, passing a NULL shortcode will return - /// the active streamId. streamKey should be a preallocated buffer to get the - /// stream key. The buffer should have a length of 48. length: Length will - /// return zero if the key could not be obtained. If the length is greater - /// than zero, it will be the length of the returned streaming key. Retrieve - /// the stream key after authorizing the shortcode. The authorization window - /// will expire in 5 minutes. Be sure to save the stream key before the window - /// expires. StreamGetStatus() should return the READY status to use this method. - /// - /// - public static void CoreStreamGetKey(string shortcode, ref string streamKey, out byte length) - { - string str_Shortcode = shortcode; - IntPtr lp_Shortcode = GetAsciiIntPtr(str_Shortcode); - string str_StreamKey = streamKey; - IntPtr lp_StreamKey = GetAsciiIntPtr(str_StreamKey); - PluginCoreStreamGetKey(lp_Shortcode, lp_StreamKey, out length); - FreeIntPtr(lp_Shortcode); - if (lp_StreamKey != IntPtr.Zero) - { - streamKey = Marshal.PtrToStringAnsi(lp_StreamKey); - } - FreeIntPtr(lp_StreamKey); - } - /// - /// Returns StreamStatus, the current status of the service - /// - public static ChromaSDK.Stream.StreamStatusType CoreStreamGetStatus() - { - ChromaSDK.Stream.StreamStatusType result = PluginCoreStreamGetStatus(); - return result; - } - /// - /// Convert StreamStatusType to a printable string - /// - public static string CoreStreamGetStatusString(ChromaSDK.Stream.StreamStatusType status) - { - string result = Marshal.PtrToStringAnsi(PluginCoreStreamGetStatusString(status)); - return result; - } - /// - /// This prevents the stream id and stream key from being obtained through the - /// shortcode. This closes the auth window. shortcode is a null terminated - /// string. StreamGetStatus() should return the READY status to use this method. - /// returns success when shortcode has been released - /// - public static bool CoreStreamReleaseShortcode(string shortcode) - { - string str_Shortcode = shortcode; - IntPtr lp_Shortcode = GetAsciiIntPtr(str_Shortcode); - bool result = PluginCoreStreamReleaseShortcode(lp_Shortcode); - FreeIntPtr(lp_Shortcode); - return result; - } - /// - /// The focus is a null terminated string. Set the focus identifer for the application - /// designated to automatically change the streaming state. Returns true on - /// success. - /// - public static bool CoreStreamSetFocus(string focus) - { - string str_Focus = focus; - IntPtr lp_Focus = GetAsciiIntPtr(str_Focus); - bool result = PluginCoreStreamSetFocus(lp_Focus); - FreeIntPtr(lp_Focus); - return result; - } - /// - /// Returns true if the Chroma streaming is supported. If false is returned, - /// avoid calling stream methods. - /// - public static bool CoreStreamSupportsStreaming() - { - bool result = PluginCoreStreamSupportsStreaming(); - return result; - } - /// - /// Begin watching the Chroma RGB data using streamID parameter. streamId is - /// a null terminated string. StreamGetStatus() should return the READY status - /// to use this method. - /// - public static bool CoreStreamWatch(string streamId, ulong timestamp) - { - string str_StreamId = streamId; - IntPtr lp_StreamId = GetAsciiIntPtr(str_StreamId); - bool result = PluginCoreStreamWatch(lp_StreamId, timestamp); - FreeIntPtr(lp_StreamId); - return result; - } - /// - /// End watching Chroma RGB data stream. StreamGetStatus() should return the - /// WATCHING status to use this method. - /// - public static bool CoreStreamWatchEnd() - { - bool result = PluginCoreStreamWatchEnd(); - return result; - } - /// - /// Direct access to low level API. - /// - public static int CoreUnInit() - { - int result = PluginCoreUnInit(); - return result; - } - /// - /// Creates a `Chroma` animation at the given path. The `deviceType` parameter - /// uses `EChromaSDKDeviceTypeEnum` as an integer. The `device` parameter uses - /// `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` as an integer, respective - /// to the `deviceType`. Returns the animation id upon success. Returns negative - /// one upon failure. Saves a `Chroma` animation file with the `.chroma` extension - /// at the given path. Returns the animation id upon success. Returns negative - /// one upon failure. - /// - public static int CreateAnimation(string path, int deviceType, int device) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginCreateAnimation(lp_Path, deviceType, device); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Creates a `Chroma` animation in memory without creating a file. The `deviceType` - /// parameter uses `EChromaSDKDeviceTypeEnum` as an integer. The `device` parameter - /// uses `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` as an integer, - /// respective to the `deviceType`. Returns the animation id upon success. - /// Returns negative one upon failure. Returns the animation id upon success. - /// Returns negative one upon failure. - /// - public static int CreateAnimationInMemory(int deviceType, int device) - { - int result = PluginCreateAnimationInMemory(deviceType, device); - return result; - } - /// - /// Create a device specific effect. - /// - public static int CreateEffect(Guid deviceId, EFFECT_TYPE effect, int[] colors, int size, out FChromaSDKGuid effectId) - { - int result = PluginCreateEffect(deviceId, (int)effect, colors, size, out effectId); - return result; - } - /// - /// Delete an effect given the effect id. - /// - public static int DeleteEffect(Guid effectId) - { - int result = PluginDeleteEffect(effectId); - return result; - } - /// - /// Duplicate the first animation frame so that the animation length matches - /// the frame count. Animation is referenced by id. - /// - public static void DuplicateFirstFrame(int animationId, int frameCount) - { - PluginDuplicateFirstFrame(animationId, frameCount); - } - /// - /// Duplicate the first animation frame so that the animation length matches - /// the frame count. Animation is referenced by name. - /// - public static void DuplicateFirstFrameName(string path, int frameCount) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginDuplicateFirstFrameName(lp_Path, frameCount); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double DuplicateFirstFrameNameD(string path, double frameCount) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginDuplicateFirstFrameNameD(lp_Path, frameCount); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Duplicate all the frames of the animation to double the animation length. - /// Frame 1 becomes frame 1 and 2. Frame 2 becomes frame 3 and 4. And so on. - /// The animation is referenced by id. - /// - public static void DuplicateFrames(int animationId) - { - PluginDuplicateFrames(animationId); - } - /// - /// Duplicate all the frames of the animation to double the animation length. - /// Frame 1 becomes frame 1 and 2. Frame 2 becomes frame 3 and 4. And so on. - /// The animation is referenced by name. - /// - public static void DuplicateFramesName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginDuplicateFramesName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double DuplicateFramesNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginDuplicateFramesNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Duplicate all the animation frames in reverse so that the animation plays - /// forwards and backwards. Animation is referenced by id. - /// - public static void DuplicateMirrorFrames(int animationId) - { - PluginDuplicateMirrorFrames(animationId); - } - /// - /// Duplicate all the animation frames in reverse so that the animation plays - /// forwards and backwards. Animation is referenced by name. - /// - public static void DuplicateMirrorFramesName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginDuplicateMirrorFramesName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double DuplicateMirrorFramesNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginDuplicateMirrorFramesNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fade the animation to black starting at the fade frame index to the end - /// of the animation. Animation is referenced by id. - /// - public static void FadeEndFrames(int animationId, int fade) - { - PluginFadeEndFrames(animationId, fade); - } - /// - /// Fade the animation to black starting at the fade frame index to the end - /// of the animation. Animation is referenced by name. - /// - public static void FadeEndFramesName(string path, int fade) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFadeEndFramesName(lp_Path, fade); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FadeEndFramesNameD(string path, double fade) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFadeEndFramesNameD(lp_Path, fade); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fade the animation from black to full color starting at 0 to the fade frame - /// index. Animation is referenced by id. - /// - public static void FadeStartFrames(int animationId, int fade) - { - PluginFadeStartFrames(animationId, fade); - } - /// - /// Fade the animation from black to full color starting at 0 to the fade frame - /// index. Animation is referenced by name. - /// - public static void FadeStartFramesName(string path, int fade) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFadeStartFramesName(lp_Path, fade); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FadeStartFramesNameD(string path, double fade) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFadeStartFramesNameD(lp_Path, fade); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the RGB value for all colors in the specified frame. Animation is referenced - /// by id. - /// - public static void FillColor(int animationId, int frameId, int color) - { - PluginFillColor(animationId, frameId, color); - } - /// - /// Set the RGB value for all colors for all frames. Animation is referenced - /// by id. - /// - public static void FillColorAllFrames(int animationId, int color) - { - PluginFillColorAllFrames(animationId, color); - } - /// - /// Set the RGB value for all colors for all frames. Animation is referenced - /// by name. - /// - public static void FillColorAllFramesName(string path, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillColorAllFramesName(lp_Path, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillColorAllFramesNameD(string path, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillColorAllFramesNameD(lp_Path, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the RGB value for all colors for all frames. Use the range of 0 to 255 - /// for red, green, and blue parameters. Animation is referenced by id. - /// - public static void FillColorAllFramesRGB(int animationId, int red, int green, int blue) - { - PluginFillColorAllFramesRGB(animationId, red, green, blue); - } - /// - /// Set the RGB value for all colors for all frames. Use the range of 0 to 255 - /// for red, green, and blue parameters. Animation is referenced by name. - /// - public static void FillColorAllFramesRGBName(string path, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillColorAllFramesRGBName(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillColorAllFramesRGBNameD(string path, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillColorAllFramesRGBNameD(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the RGB value for all colors in the specified frame. Animation is referenced - /// by name. - /// - public static void FillColorName(string path, int frameId, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillColorName(lp_Path, frameId, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillColorNameD(string path, double frameId, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillColorNameD(lp_Path, frameId, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the RGB value for all colors in the specified frame. Animation is referenced - /// by id. - /// - public static void FillColorRGB(int animationId, int frameId, int red, int green, int blue) - { - PluginFillColorRGB(animationId, frameId, red, green, blue); - } - /// - /// Set the RGB value for all colors in the specified frame. Animation is referenced - /// by name. - /// - public static void FillColorRGBName(string path, int frameId, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillColorRGBName(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillColorRGBNameD(string path, double frameId, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillColorRGBNameD(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors in the specified - /// frame. Animation is referenced by id. - /// - public static void FillNonZeroColor(int animationId, int frameId, int color) - { - PluginFillNonZeroColor(animationId, frameId, color); - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors for all frames. - /// Animation is referenced by id. - /// - public static void FillNonZeroColorAllFrames(int animationId, int color) - { - PluginFillNonZeroColorAllFrames(animationId, color); - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors for all frames. - /// Animation is referenced by name. - /// - public static void FillNonZeroColorAllFramesName(string path, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillNonZeroColorAllFramesName(lp_Path, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillNonZeroColorAllFramesNameD(string path, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillNonZeroColorAllFramesNameD(lp_Path, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors for all frames. - /// Use the range of 0 to 255 for red, green, and blue parameters. Animation - /// is referenced by id. - /// - public static void FillNonZeroColorAllFramesRGB(int animationId, int red, int green, int blue) - { - PluginFillNonZeroColorAllFramesRGB(animationId, red, green, blue); - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors for all frames. - /// Use the range of 0 to 255 for red, green, and blue parameters. Animation - /// is referenced by name. - /// - public static void FillNonZeroColorAllFramesRGBName(string path, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillNonZeroColorAllFramesRGBName(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillNonZeroColorAllFramesRGBNameD(string path, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillNonZeroColorAllFramesRGBNameD(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors in the specified - /// frame. Animation is referenced by name. - /// - public static void FillNonZeroColorName(string path, int frameId, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillNonZeroColorName(lp_Path, frameId, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillNonZeroColorNameD(string path, double frameId, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillNonZeroColorNameD(lp_Path, frameId, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors in the specified - /// frame. Use the range of 0 to 255 for red, green, and blue parameters. Animation - /// is referenced by id. - /// - public static void FillNonZeroColorRGB(int animationId, int frameId, int red, int green, int blue) - { - PluginFillNonZeroColorRGB(animationId, frameId, red, green, blue); - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors in the specified - /// frame. Use the range of 0 to 255 for red, green, and blue parameters. Animation - /// is referenced by name. - /// - public static void FillNonZeroColorRGBName(string path, int frameId, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillNonZeroColorRGBName(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillNonZeroColorRGBNameD(string path, double frameId, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillNonZeroColorRGBNameD(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the frame with random RGB values for the given frame. Animation is - /// referenced by id. - /// - public static void FillRandomColors(int animationId, int frameId) - { - PluginFillRandomColors(animationId, frameId); - } - /// - /// Fill the frame with random RGB values for all frames. Animation is referenced - /// by id. - /// - public static void FillRandomColorsAllFrames(int animationId) - { - PluginFillRandomColorsAllFrames(animationId); - } - /// - /// Fill the frame with random RGB values for all frames. Animation is referenced - /// by name. - /// - public static void FillRandomColorsAllFramesName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillRandomColorsAllFramesName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillRandomColorsAllFramesNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillRandomColorsAllFramesNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the frame with random black and white values for the specified frame. - /// Animation is referenced by id. - /// - public static void FillRandomColorsBlackAndWhite(int animationId, int frameId) - { - PluginFillRandomColorsBlackAndWhite(animationId, frameId); - } - /// - /// Fill the frame with random black and white values for all frames. Animation - /// is referenced by id. - /// - public static void FillRandomColorsBlackAndWhiteAllFrames(int animationId) - { - PluginFillRandomColorsBlackAndWhiteAllFrames(animationId); - } - /// - /// Fill the frame with random black and white values for all frames. Animation - /// is referenced by name. - /// - public static void FillRandomColorsBlackAndWhiteAllFramesName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillRandomColorsBlackAndWhiteAllFramesName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillRandomColorsBlackAndWhiteAllFramesNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillRandomColorsBlackAndWhiteAllFramesNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the frame with random black and white values for the specified frame. - /// Animation is referenced by name. - /// - public static void FillRandomColorsBlackAndWhiteName(string path, int frameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillRandomColorsBlackAndWhiteName(lp_Path, frameId); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillRandomColorsBlackAndWhiteNameD(string path, double frameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillRandomColorsBlackAndWhiteNameD(lp_Path, frameId); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the frame with random RGB values for the given frame. Animation is - /// referenced by name. - /// - public static void FillRandomColorsName(string path, int frameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillRandomColorsName(lp_Path, frameId); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillRandomColorsNameD(string path, double frameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillRandomColorsNameD(lp_Path, frameId); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by id. - /// - public static void FillThresholdColors(int animationId, int frameId, int threshold, int color) - { - PluginFillThresholdColors(animationId, frameId, threshold, color); - } - /// - /// Fill all frames with RGB color where the animation color is less than the - /// RGB threshold. Animation is referenced by id. - /// - public static void FillThresholdColorsAllFrames(int animationId, int threshold, int color) - { - PluginFillThresholdColorsAllFrames(animationId, threshold, color); - } - /// - /// Fill all frames with RGB color where the animation color is less than the - /// RGB threshold. Animation is referenced by name. - /// - public static void FillThresholdColorsAllFramesName(string path, int threshold, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillThresholdColorsAllFramesName(lp_Path, threshold, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillThresholdColorsAllFramesNameD(string path, double threshold, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillThresholdColorsAllFramesNameD(lp_Path, threshold, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill all frames with RGB color where the animation color is less than the - /// threshold. Animation is referenced by id. - /// - public static void FillThresholdColorsAllFramesRGB(int animationId, int threshold, int red, int green, int blue) - { - PluginFillThresholdColorsAllFramesRGB(animationId, threshold, red, green, blue); - } - /// - /// Fill all frames with RGB color where the animation color is less than the - /// threshold. Animation is referenced by name. - /// - public static void FillThresholdColorsAllFramesRGBName(string path, int threshold, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillThresholdColorsAllFramesRGBName(lp_Path, threshold, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillThresholdColorsAllFramesRGBNameD(string path, double threshold, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillThresholdColorsAllFramesRGBNameD(lp_Path, threshold, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill all frames with the min RGB color where the animation color is less - /// than the min threshold AND with the max RGB color where the animation is - /// more than the max threshold. Animation is referenced by id. - /// - public static void FillThresholdColorsMinMaxAllFramesRGB(int animationId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) - { - PluginFillThresholdColorsMinMaxAllFramesRGB(animationId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - } - /// - /// Fill all frames with the min RGB color where the animation color is less - /// than the min threshold AND with the max RGB color where the animation is - /// more than the max threshold. Animation is referenced by name. - /// - public static void FillThresholdColorsMinMaxAllFramesRGBName(string path, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillThresholdColorsMinMaxAllFramesRGBName(lp_Path, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillThresholdColorsMinMaxAllFramesRGBNameD(string path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillThresholdColorsMinMaxAllFramesRGBNameD(lp_Path, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the specified frame with the min RGB color where the animation color - /// is less than the min threshold AND with the max RGB color where the animation - /// is more than the max threshold. Animation is referenced by id. - /// - public static void FillThresholdColorsMinMaxRGB(int animationId, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) - { - PluginFillThresholdColorsMinMaxRGB(animationId, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - } - /// - /// Fill the specified frame with the min RGB color where the animation color - /// is less than the min threshold AND with the max RGB color where the animation - /// is more than the max threshold. Animation is referenced by name. - /// - public static void FillThresholdColorsMinMaxRGBName(string path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillThresholdColorsMinMaxRGBName(lp_Path, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillThresholdColorsMinMaxRGBNameD(string path, double frameId, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillThresholdColorsMinMaxRGBNameD(lp_Path, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by name. - /// - public static void FillThresholdColorsName(string path, int frameId, int threshold, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillThresholdColorsName(lp_Path, frameId, threshold, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillThresholdColorsNameD(string path, double frameId, double threshold, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillThresholdColorsNameD(lp_Path, frameId, threshold, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by id. - /// - public static void FillThresholdColorsRGB(int animationId, int frameId, int threshold, int red, int green, int blue) - { - PluginFillThresholdColorsRGB(animationId, frameId, threshold, red, green, blue); - } - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by name. - /// - public static void FillThresholdColorsRGBName(string path, int frameId, int threshold, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillThresholdColorsRGBName(lp_Path, frameId, threshold, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillThresholdColorsRGBNameD(string path, double frameId, double threshold, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillThresholdColorsRGBNameD(lp_Path, frameId, threshold, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill all frames with RGB color where the animation color is less than the - /// RGB threshold. Animation is referenced by id. - /// - public static void FillThresholdRGBColorsAllFramesRGB(int animationId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue) - { - PluginFillThresholdRGBColorsAllFramesRGB(animationId, redThreshold, greenThreshold, blueThreshold, red, green, blue); - } - /// - /// Fill all frames with RGB color where the animation color is less than the - /// RGB threshold. Animation is referenced by name. - /// - public static void FillThresholdRGBColorsAllFramesRGBName(string path, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillThresholdRGBColorsAllFramesRGBName(lp_Path, redThreshold, greenThreshold, blueThreshold, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillThresholdRGBColorsAllFramesRGBNameD(string path, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillThresholdRGBColorsAllFramesRGBNameD(lp_Path, redThreshold, greenThreshold, blueThreshold, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by id. - /// - public static void FillThresholdRGBColorsRGB(int animationId, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue) - { - PluginFillThresholdRGBColorsRGB(animationId, frameId, redThreshold, greenThreshold, blueThreshold, red, green, blue); - } - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by name. - /// - public static void FillThresholdRGBColorsRGBName(string path, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillThresholdRGBColorsRGBName(lp_Path, frameId, redThreshold, greenThreshold, blueThreshold, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillThresholdRGBColorsRGBNameD(string path, double frameId, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillThresholdRGBColorsRGBNameD(lp_Path, frameId, redThreshold, greenThreshold, blueThreshold, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the specified frame with RGB color where the animation color is zero. - /// Animation is referenced by id. - /// - public static void FillZeroColor(int animationId, int frameId, int color) - { - PluginFillZeroColor(animationId, frameId, color); - } - /// - /// Fill all frames with RGB color where the animation color is zero. Animation - /// is referenced by id. - /// - public static void FillZeroColorAllFrames(int animationId, int color) - { - PluginFillZeroColorAllFrames(animationId, color); - } - /// - /// Fill all frames with RGB color where the animation color is zero. Animation - /// is referenced by name. - /// - public static void FillZeroColorAllFramesName(string path, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillZeroColorAllFramesName(lp_Path, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillZeroColorAllFramesNameD(string path, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillZeroColorAllFramesNameD(lp_Path, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill all frames with RGB color where the animation color is zero. Animation - /// is referenced by id. - /// - public static void FillZeroColorAllFramesRGB(int animationId, int red, int green, int blue) - { - PluginFillZeroColorAllFramesRGB(animationId, red, green, blue); - } - /// - /// Fill all frames with RGB color where the animation color is zero. Animation - /// is referenced by name. - /// - public static void FillZeroColorAllFramesRGBName(string path, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillZeroColorAllFramesRGBName(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillZeroColorAllFramesRGBNameD(string path, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillZeroColorAllFramesRGBNameD(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the specified frame with RGB color where the animation color is zero. - /// Animation is referenced by name. - /// - public static void FillZeroColorName(string path, int frameId, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillZeroColorName(lp_Path, frameId, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillZeroColorNameD(string path, double frameId, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillZeroColorNameD(lp_Path, frameId, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Fill the specified frame with RGB color where the animation color is zero. - /// Animation is referenced by id. - /// - public static void FillZeroColorRGB(int animationId, int frameId, int red, int green, int blue) - { - PluginFillZeroColorRGB(animationId, frameId, red, green, blue); - } - /// - /// Fill the specified frame with RGB color where the animation color is zero. - /// Animation is referenced by name. - /// - public static void FillZeroColorRGBName(string path, int frameId, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginFillZeroColorRGBName(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double FillZeroColorRGBNameD(string path, double frameId, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginFillZeroColorRGBNameD(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Get the animation color for a frame given the `1D` `led`. The `led` should - /// be greater than or equal to 0 and less than the `MaxLeds`. Animation is - /// referenced by id. - /// - public static int Get1DColor(int animationId, int frameId, int led) - { - int result = PluginGet1DColor(animationId, frameId, led); - return result; - } - /// - /// Get the animation color for a frame given the `1D` `led`. The `led` should - /// be greater than or equal to 0 and less than the `MaxLeds`. Animation is - /// referenced by name. - /// - public static int Get1DColorName(string path, int frameId, int led) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginGet1DColorName(lp_Path, frameId, led); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double Get1DColorNameD(string path, double frameId, double led) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginGet1DColorNameD(lp_Path, frameId, led); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Get the animation color for a frame given the `2D` `row` and `column`. The - /// `row` should be greater than or equal to 0 and less than the `MaxRow`. - /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. - /// Animation is referenced by id. - /// - public static int Get2DColor(int animationId, int frameId, int row, int column) - { - int result = PluginGet2DColor(animationId, frameId, row, column); - return result; - } - /// - /// Get the animation color for a frame given the `2D` `row` and `column`. The - /// `row` should be greater than or equal to 0 and less than the `MaxRow`. - /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. - /// Animation is referenced by name. - /// - public static int Get2DColorName(string path, int frameId, int row, int column) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginGet2DColorName(lp_Path, frameId, row, column); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double Get2DColorNameD(string path, double frameId, double row, double column) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginGet2DColorNameD(lp_Path, frameId, row, column); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Get the animation id for the named animation. - /// - public static int GetAnimation(string name) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - int result = PluginGetAnimation(lp_Name); - FreeIntPtr(lp_Name); - return result; - } - /// - /// `PluginGetAnimationCount` will return the number of loaded animations. - /// - public static int GetAnimationCount() - { - int result = PluginGetAnimationCount(); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetAnimationD(string name) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - double result = PluginGetAnimationD(lp_Name); - FreeIntPtr(lp_Name); - return result; - } - /// - /// `PluginGetAnimationId` will return the `animationId` given the `index` of - /// the loaded animation. The `index` is zero-based and less than the number - /// returned by `PluginGetAnimationCount`. Use `PluginGetAnimationName` to - /// get the name of the animation. - /// - public static int GetAnimationId(int index) - { - int result = PluginGetAnimationId(index); - return result; - } - /// - /// `PluginGetAnimationName` takes an `animationId` and returns the name of - /// the animation of the `.chroma` animation file. If a name is not available - /// then an empty string will be returned. - /// - public static string GetAnimationName(int animationId) - { - string result = Marshal.PtrToStringAnsi(PluginGetAnimationName(animationId)); - return result; - } - /// - /// Get the current frame of the animation referenced by id. - /// - public static int GetCurrentFrame(int animationId) - { - int result = PluginGetCurrentFrame(animationId); - return result; - } - /// - /// Get the current frame of the animation referenced by name. - /// - public static int GetCurrentFrameName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginGetCurrentFrameName(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetCurrentFrameNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginGetCurrentFrameNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Returns the `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` of a `Chroma` - /// animation respective to the `deviceType`, as an integer upon success. Returns - /// negative one upon failure. - /// - public static int GetDevice(int animationId) - { - int result = PluginGetDevice(animationId); - return result; - } - /// - /// Returns the `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` of a `Chroma` - /// animation respective to the `deviceType`, as an integer upon success. Returns - /// negative one upon failure. - /// - public static int GetDeviceName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginGetDeviceName(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetDeviceNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginGetDeviceNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Returns the `EChromaSDKDeviceTypeEnum` of a `Chroma` animation as an integer - /// upon success. Returns negative one upon failure. - /// - public static int GetDeviceType(int animationId) - { - int result = PluginGetDeviceType(animationId); - return result; - } - /// - /// Returns the `EChromaSDKDeviceTypeEnum` of a `Chroma` animation as an integer - /// upon success. Returns negative one upon failure. - /// - public static int GetDeviceTypeName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginGetDeviceTypeName(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetDeviceTypeNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginGetDeviceTypeNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Get the frame colors and duration (in seconds) for a `Chroma` animation - /// referenced by id. The `color` is expected to be an array of the expected - /// dimensions for the `deviceType/device`. The `length` parameter is the size - /// of the `color` array. For `EChromaSDKDevice1DEnum` the array size should - /// be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should be `MAX - /// ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard - /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the - /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. - /// Returns the animation id upon success. Returns negative one upon failure. - /// - /// - public static int GetFrame(int animationId, int frameIndex, out float duration, int[] colors, int length, int[] keys, int keysLength) - { - int result = PluginGetFrame(animationId, frameIndex, out duration, colors, length, keys, keysLength); - return result; - } - /// - /// Returns the frame count of a `Chroma` animation upon success. Returns negative - /// one upon failure. - /// - public static int GetFrameCount(int animationId) - { - int result = PluginGetFrameCount(animationId); - return result; - } - /// - /// Returns the frame count of a `Chroma` animation upon success. Returns negative - /// one upon failure. - /// - public static int GetFrameCountName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginGetFrameCountName(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetFrameCountNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginGetFrameCountNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Get the frame colors and duration (in seconds) for a `Chroma` animation - /// referenced by name. The `color` is expected to be an array of the expected - /// dimensions for the `deviceType/device`. The `length` parameter is the size - /// of the `color` array. For `EChromaSDKDevice1DEnum` the array size should - /// be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should be `MAX - /// ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard - /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the - /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. - /// Returns the animation id upon success. Returns negative one upon failure. - /// - /// - public static int GetFrameName(string path, int frameIndex, out float duration, int[] colors, int length, int[] keys, int keysLength) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginGetFrameName(lp_Path, frameIndex, out duration, colors, length, keys, keysLength); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Get the color of an animation key for the given frame referenced by id. - /// - /// - public static int GetKeyColor(int animationId, int frameId, int rzkey) - { - int result = PluginGetKeyColor(animationId, frameId, rzkey); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetKeyColorD(string path, double frameId, double rzkey) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginGetKeyColorD(lp_Path, frameId, rzkey); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Get the color of an animation key for the given frame referenced by name. - /// - /// - public static int GetKeyColorName(string path, int frameId, int rzkey) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginGetKeyColorName(lp_Path, frameId, rzkey); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Returns `RZRESULT_SUCCESS` if the plugin has been initialized successfully. - /// Returns `RZRESULT_DLL_NOT_FOUND` if core Chroma library is not found. Returns - /// `RZRESULT_DLL_INVALID_SIGNATURE` if core Chroma library has an invalid - /// signature. - /// - public static int GetLibraryLoadedState() - { - int result = PluginGetLibraryLoadedState(); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetLibraryLoadedStateD() - { - double result = PluginGetLibraryLoadedStateD(); - return result; - } - /// - /// Returns the `MAX COLUMN` given the `EChromaSDKDevice2DEnum` device as an - /// integer upon success. Returns negative one upon failure. - /// - public static int GetMaxColumn(Device2D device) - { - int result = PluginGetMaxColumn((int)device); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetMaxColumnD(double device) - { - double result = PluginGetMaxColumnD(device); - return result; - } - /// - /// Returns the MAX LEDS given the `EChromaSDKDevice1DEnum` device as an integer - /// upon success. Returns negative one upon failure. - /// - public static int GetMaxLeds(Device1D device) - { - int result = PluginGetMaxLeds((int)device); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetMaxLedsD(double device) - { - double result = PluginGetMaxLedsD(device); - return result; - } - /// - /// Returns the `MAX ROW` given the `EChromaSDKDevice2DEnum` device as an integer - /// upon success. Returns negative one upon failure. - /// - public static int GetMaxRow(Device2D device) - { - int result = PluginGetMaxRow((int)device); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetMaxRowD(double device) - { - double result = PluginGetMaxRowD(device); - return result; - } - /// - /// `PluginGetPlayingAnimationCount` will return the number of playing animations. - /// - /// - public static int GetPlayingAnimationCount() - { - int result = PluginGetPlayingAnimationCount(); - return result; - } - /// - /// `PluginGetPlayingAnimationId` will return the `animationId` given the `index` - /// of the playing animation. The `index` is zero-based and less than the number - /// returned by `PluginGetPlayingAnimationCount`. Use `PluginGetAnimationName` - /// to get the name of the animation. - /// - public static int GetPlayingAnimationId(int index) - { - int result = PluginGetPlayingAnimationId(index); - return result; - } - /// - /// Get the RGB color given red, green, and blue. - /// - public static int GetRGB(int red, int green, int blue) - { - int result = PluginGetRGB(red, green, blue); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double GetRGBD(double red, double green, double blue) - { - double result = PluginGetRGBD(red, green, blue); - return result; - } - /// - /// Check if the animation has loop enabled referenced by id. - /// - public static bool HasAnimationLoop(int animationId) - { - bool result = PluginHasAnimationLoop(animationId); - return result; - } - /// - /// Check if the animation has loop enabled referenced by name. - /// - public static bool HasAnimationLoopName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - bool result = PluginHasAnimationLoopName(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double HasAnimationLoopNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginHasAnimationLoopNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Initialize the ChromaSDK. Zero indicates success, otherwise failure. Many - /// API methods auto initialize the ChromaSDK if not already initialized. - /// - public static int Init() - { - int result = PluginInit(); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double InitD() - { - double result = PluginInitD(); - return result; - } - /// - /// Initialize the ChromaSDK. AppInfo populates the details in Synapse. Zero - /// indicates success, otherwise failure. Many API methods auto initialize - /// the ChromaSDK if not already initialized. - /// - public static int InitSDK(ref ChromaSDK.APPINFOTYPE appInfo) - { - int result = PluginInitSDK(ref appInfo); - return result; - } - /// - /// Insert an animation delay by duplicating the frame by the delay number of - /// times. Animation is referenced by id. - /// - public static void InsertDelay(int animationId, int frameId, int delay) - { - PluginInsertDelay(animationId, frameId, delay); - } - /// - /// Insert an animation delay by duplicating the frame by the delay number of - /// times. Animation is referenced by name. - /// - public static void InsertDelayName(string path, int frameId, int delay) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginInsertDelayName(lp_Path, frameId, delay); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double InsertDelayNameD(string path, double frameId, double delay) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginInsertDelayNameD(lp_Path, frameId, delay); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Duplicate the source frame index at the target frame index. Animation is - /// referenced by id. - /// - public static void InsertFrame(int animationId, int sourceFrame, int targetFrame) - { - PluginInsertFrame(animationId, sourceFrame, targetFrame); - } - /// - /// Duplicate the source frame index at the target frame index. Animation is - /// referenced by name. - /// - public static void InsertFrameName(string path, int sourceFrame, int targetFrame) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginInsertFrameName(lp_Path, sourceFrame, targetFrame); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double InsertFrameNameD(string path, double sourceFrame, double targetFrame) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginInsertFrameNameD(lp_Path, sourceFrame, targetFrame); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Invert all the colors at the specified frame. Animation is referenced by - /// id. - /// - public static void InvertColors(int animationId, int frameId) - { - PluginInvertColors(animationId, frameId); - } - /// - /// Invert all the colors for all frames. Animation is referenced by id. - /// - public static void InvertColorsAllFrames(int animationId) - { - PluginInvertColorsAllFrames(animationId); - } - /// - /// Invert all the colors for all frames. Animation is referenced by name. - /// - public static void InvertColorsAllFramesName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginInvertColorsAllFramesName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double InvertColorsAllFramesNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginInvertColorsAllFramesNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Invert all the colors at the specified frame. Animation is referenced by - /// name. - /// - public static void InvertColorsName(string path, int frameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginInvertColorsName(lp_Path, frameId); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double InvertColorsNameD(string path, double frameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginInvertColorsNameD(lp_Path, frameId); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Check if the animation is paused referenced by id. - /// - public static bool IsAnimationPaused(int animationId) - { - bool result = PluginIsAnimationPaused(animationId); - return result; - } - /// - /// Check if the animation is paused referenced by name. - /// - public static bool IsAnimationPausedName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - bool result = PluginIsAnimationPausedName(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double IsAnimationPausedNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginIsAnimationPausedNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// The editor dialog is a non-blocking modal window, this method returns true - /// if the modal window is open, otherwise false. - /// - public static bool IsDialogOpen() - { - bool result = PluginIsDialogOpen(); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double IsDialogOpenD() - { - double result = PluginIsDialogOpenD(); - return result; - } - /// - /// Returns true if the plugin has been initialized. Returns false if the plugin - /// is uninitialized. - /// - public static bool IsInitialized() - { - bool result = PluginIsInitialized(); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double IsInitializedD() - { - double result = PluginIsInitializedD(); - return result; - } - /// - /// If the method can be invoked the method returns true. - /// - public static bool IsPlatformSupported() - { - bool result = PluginIsPlatformSupported(); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double IsPlatformSupportedD() - { - double result = PluginIsPlatformSupportedD(); - return result; - } - /// - /// `PluginIsPlayingName` automatically handles initializing the `ChromaSDK`. - /// The named `.chroma` animation file will be automatically opened. The method - /// will return whether the animation is playing or not. Animation is referenced - /// by id. - /// - public static bool IsPlaying(int animationId) - { - bool result = PluginIsPlaying(animationId); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double IsPlayingD(double animationId) - { - double result = PluginIsPlayingD(animationId); - return result; - } - /// - /// `PluginIsPlayingName` automatically handles initializing the `ChromaSDK`. - /// The named `.chroma` animation file will be automatically opened. The method - /// will return whether the animation is playing or not. Animation is referenced - /// by name. - /// - public static bool IsPlayingName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - bool result = PluginIsPlayingName(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double IsPlayingNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginIsPlayingNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// `PluginIsPlayingType` automatically handles initializing the `ChromaSDK`. - /// If any animation is playing for the `deviceType` and `device` combination, - /// the method will return true, otherwise false. - /// - public static bool IsPlayingType(int deviceType, int device) - { - bool result = PluginIsPlayingType(deviceType, device); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double IsPlayingTypeD(double deviceType, double device) - { - double result = PluginIsPlayingTypeD(deviceType, device); - return result; - } - /// - /// Do a lerp math operation on a float. - /// - public static float Lerp(float start, float end, float amt) - { - float result = PluginLerp(start, end, amt); - return result; - } - /// - /// Lerp from one color to another given t in the range 0.0 to 1.0. - /// - public static int LerpColor(int from, int to, float t) - { - int result = PluginLerpColor(from, to, t); - return result; - } - /// - /// Loads `Chroma` effects so that the animation can be played immediately. - /// Returns the animation id upon success. Returns negative one upon failure. - /// - /// - public static int LoadAnimation(int animationId) - { - int result = PluginLoadAnimation(animationId); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double LoadAnimationD(double animationId) - { - double result = PluginLoadAnimationD(animationId); - return result; - } - /// - /// Load the named animation. - /// - public static void LoadAnimationName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginLoadAnimationName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// Load a composite set of animations. - /// - public static void LoadComposite(string name) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - PluginLoadComposite(lp_Name); - FreeIntPtr(lp_Name); - } - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color defaults to color. Animation - /// is referenced by id. - /// - public static void MakeBlankFrames(int animationId, int frameCount, float duration, int color) - { - PluginMakeBlankFrames(animationId, frameCount, duration, color); - } - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color defaults to color. Animation - /// is referenced by name. - /// - public static void MakeBlankFramesName(string path, int frameCount, float duration, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMakeBlankFramesName(lp_Path, frameCount, duration, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MakeBlankFramesNameD(string path, double frameCount, double duration, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMakeBlankFramesNameD(lp_Path, frameCount, duration, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color is random. Animation is referenced - /// by id. - /// - public static void MakeBlankFramesRandom(int animationId, int frameCount, float duration) - { - PluginMakeBlankFramesRandom(animationId, frameCount, duration); - } - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color is random black and white. Animation - /// is referenced by id. - /// - public static void MakeBlankFramesRandomBlackAndWhite(int animationId, int frameCount, float duration) - { - PluginMakeBlankFramesRandomBlackAndWhite(animationId, frameCount, duration); - } - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color is random black and white. Animation - /// is referenced by name. - /// - public static void MakeBlankFramesRandomBlackAndWhiteName(string path, int frameCount, float duration) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMakeBlankFramesRandomBlackAndWhiteName(lp_Path, frameCount, duration); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MakeBlankFramesRandomBlackAndWhiteNameD(string path, double frameCount, double duration) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMakeBlankFramesRandomBlackAndWhiteNameD(lp_Path, frameCount, duration); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color is random. Animation is referenced - /// by name. - /// - public static void MakeBlankFramesRandomName(string path, int frameCount, float duration) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMakeBlankFramesRandomName(lp_Path, frameCount, duration); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MakeBlankFramesRandomNameD(string path, double frameCount, double duration) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMakeBlankFramesRandomNameD(lp_Path, frameCount, duration); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color defaults to color. Animation - /// is referenced by id. - /// - public static void MakeBlankFramesRGB(int animationId, int frameCount, float duration, int red, int green, int blue) - { - PluginMakeBlankFramesRGB(animationId, frameCount, duration, red, green, blue); - } - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color defaults to color. Animation - /// is referenced by name. - /// - public static void MakeBlankFramesRGBName(string path, int frameCount, float duration, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMakeBlankFramesRGBName(lp_Path, frameCount, duration, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MakeBlankFramesRGBNameD(string path, double frameCount, double duration, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMakeBlankFramesRGBNameD(lp_Path, frameCount, duration, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Flips the color grid horizontally for all `Chroma` animation frames. Returns - /// the animation id upon success. Returns negative one upon failure. - /// - public static int MirrorHorizontally(int animationId) - { - int result = PluginMirrorHorizontally(animationId); - return result; - } - /// - /// Flips the color grid vertically for all `Chroma` animation frames. This - /// method has no effect for `EChromaSDKDevice1DEnum` devices. Returns the - /// animation id upon success. Returns negative one upon failure. - /// - public static int MirrorVertically(int animationId) - { - int result = PluginMirrorVertically(animationId); - return result; - } - /// - /// Multiply the color intensity with the lerp result from color 1 to color - /// 2 using the frame index divided by the frame count for the `t` parameter. - /// Animation is referenced in id. - /// - public static void MultiplyColorLerpAllFrames(int animationId, int color1, int color2) - { - PluginMultiplyColorLerpAllFrames(animationId, color1, color2); - } - /// - /// Multiply the color intensity with the lerp result from color 1 to color - /// 2 using the frame index divided by the frame count for the `t` parameter. - /// Animation is referenced in name. - /// - public static void MultiplyColorLerpAllFramesName(string path, int color1, int color2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyColorLerpAllFramesName(lp_Path, color1, color2); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyColorLerpAllFramesNameD(string path, double color1, double color2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyColorLerpAllFramesNameD(lp_Path, color1, color2); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply all the colors in the frame by the intensity value. The valid the - /// intensity range is from 0.0 to 255.0. RGB components are multiplied equally. - /// An intensity of 0.5 would half the color value. Black colors in the frame - /// will not be affected by this method. - /// - public static void MultiplyIntensity(int animationId, int frameId, float intensity) - { - PluginMultiplyIntensity(animationId, frameId, intensity); - } - /// - /// Multiply all the colors for all frames by the intensity value. The valid - /// the intensity range is from 0.0 to 255.0. RGB components are multiplied - /// equally. An intensity of 0.5 would half the color value. Black colors in - /// the frame will not be affected by this method. - /// - public static void MultiplyIntensityAllFrames(int animationId, float intensity) - { - PluginMultiplyIntensityAllFrames(animationId, intensity); - } - /// - /// Multiply all the colors for all frames by the intensity value. The valid - /// the intensity range is from 0.0 to 255.0. RGB components are multiplied - /// equally. An intensity of 0.5 would half the color value. Black colors in - /// the frame will not be affected by this method. - /// - public static void MultiplyIntensityAllFramesName(string path, float intensity) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyIntensityAllFramesName(lp_Path, intensity); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyIntensityAllFramesNameD(string path, double intensity) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyIntensityAllFramesNameD(lp_Path, intensity); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply all frames by the RBG color intensity. Animation is referenced - /// by id. - /// - public static void MultiplyIntensityAllFramesRGB(int animationId, int red, int green, int blue) - { - PluginMultiplyIntensityAllFramesRGB(animationId, red, green, blue); - } - /// - /// Multiply all frames by the RBG color intensity. Animation is referenced - /// by name. - /// - public static void MultiplyIntensityAllFramesRGBName(string path, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyIntensityAllFramesRGBName(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyIntensityAllFramesRGBNameD(string path, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyIntensityAllFramesRGBNameD(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply the specific frame by the RBG color intensity. Animation is referenced - /// by id. - /// - public static void MultiplyIntensityColor(int animationId, int frameId, int color) - { - PluginMultiplyIntensityColor(animationId, frameId, color); - } - /// - /// Multiply all frames by the RBG color intensity. Animation is referenced - /// by id. - /// - public static void MultiplyIntensityColorAllFrames(int animationId, int color) - { - PluginMultiplyIntensityColorAllFrames(animationId, color); - } - /// - /// Multiply all frames by the RBG color intensity. Animation is referenced - /// by name. - /// - public static void MultiplyIntensityColorAllFramesName(string path, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyIntensityColorAllFramesName(lp_Path, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyIntensityColorAllFramesNameD(string path, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyIntensityColorAllFramesNameD(lp_Path, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply the specific frame by the RBG color intensity. Animation is referenced - /// by name. - /// - public static void MultiplyIntensityColorName(string path, int frameId, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyIntensityColorName(lp_Path, frameId, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyIntensityColorNameD(string path, double frameId, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyIntensityColorNameD(lp_Path, frameId, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply all the colors in the frame by the intensity value. The valid the - /// intensity range is from 0.0 to 255.0. RGB components are multiplied equally. - /// An intensity of 0.5 would half the color value. Black colors in the frame - /// will not be affected by this method. - /// - public static void MultiplyIntensityName(string path, int frameId, float intensity) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyIntensityName(lp_Path, frameId, intensity); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyIntensityNameD(string path, double frameId, double intensity) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyIntensityNameD(lp_Path, frameId, intensity); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply the specific frame by the RBG color intensity. Animation is referenced - /// by id. - /// - public static void MultiplyIntensityRGB(int animationId, int frameId, int red, int green, int blue) - { - PluginMultiplyIntensityRGB(animationId, frameId, red, green, blue); - } - /// - /// Multiply the specific frame by the RBG color intensity. Animation is referenced - /// by name. - /// - public static void MultiplyIntensityRGBName(string path, int frameId, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyIntensityRGBName(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyIntensityRGBNameD(string path, double frameId, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyIntensityRGBNameD(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply the specific frame by the color lerp result between color 1 and - /// 2 using the frame color value as the `t` value. Animation is referenced - /// by id. - /// - public static void MultiplyNonZeroTargetColorLerp(int animationId, int frameId, int color1, int color2) - { - PluginMultiplyNonZeroTargetColorLerp(animationId, frameId, color1, color2); - } - /// - /// Multiply all frames by the color lerp result between color 1 and 2 using - /// the frame color value as the `t` value. Animation is referenced by id. - /// - /// - public static void MultiplyNonZeroTargetColorLerpAllFrames(int animationId, int color1, int color2) - { - PluginMultiplyNonZeroTargetColorLerpAllFrames(animationId, color1, color2); - } - /// - /// Multiply all frames by the color lerp result between color 1 and 2 using - /// the frame color value as the `t` value. Animation is referenced by name. - /// - /// - public static void MultiplyNonZeroTargetColorLerpAllFramesName(string path, int color1, int color2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyNonZeroTargetColorLerpAllFramesName(lp_Path, color1, color2); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyNonZeroTargetColorLerpAllFramesNameD(string path, double color1, double color2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyNonZeroTargetColorLerpAllFramesNameD(lp_Path, color1, color2); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply the specific frame by the color lerp result between RGB 1 and 2 - /// using the frame color value as the `t` value. Animation is referenced by - /// id. - /// - public static void MultiplyNonZeroTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2) - { - PluginMultiplyNonZeroTargetColorLerpAllFramesRGB(animationId, red1, green1, blue1, red2, green2, blue2); - } - /// - /// Multiply the specific frame by the color lerp result between RGB 1 and 2 - /// using the frame color value as the `t` value. Animation is referenced by - /// name. - /// - public static void MultiplyNonZeroTargetColorLerpAllFramesRGBName(string path, int red1, int green1, int blue1, int red2, int green2, int blue2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyNonZeroTargetColorLerpAllFramesRGBName(lp_Path, red1, green1, blue1, red2, green2, blue2); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyNonZeroTargetColorLerpAllFramesRGBNameD(string path, double red1, double green1, double blue1, double red2, double green2, double blue2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyNonZeroTargetColorLerpAllFramesRGBNameD(lp_Path, red1, green1, blue1, red2, green2, blue2); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply the specific frame by the color lerp result between color 1 and - /// 2 using the frame color value as the `t` value. Animation is referenced - /// by id. - /// - public static void MultiplyTargetColorLerp(int animationId, int frameId, int color1, int color2) - { - PluginMultiplyTargetColorLerp(animationId, frameId, color1, color2); - } - /// - /// Multiply all frames by the color lerp result between color 1 and 2 using - /// the frame color value as the `t` value. Animation is referenced by id. - /// - /// - public static void MultiplyTargetColorLerpAllFrames(int animationId, int color1, int color2) - { - PluginMultiplyTargetColorLerpAllFrames(animationId, color1, color2); - } - /// - /// Multiply all frames by the color lerp result between color 1 and 2 using - /// the frame color value as the `t` value. Animation is referenced by name. - /// - /// - public static void MultiplyTargetColorLerpAllFramesName(string path, int color1, int color2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyTargetColorLerpAllFramesName(lp_Path, color1, color2); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyTargetColorLerpAllFramesNameD(string path, double color1, double color2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyTargetColorLerpAllFramesNameD(lp_Path, color1, color2); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply all frames by the color lerp result between RGB 1 and 2 using the - /// frame color value as the `t` value. Animation is referenced by id. - /// - public static void MultiplyTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2) - { - PluginMultiplyTargetColorLerpAllFramesRGB(animationId, red1, green1, blue1, red2, green2, blue2); - } - /// - /// Multiply all frames by the color lerp result between RGB 1 and 2 using the - /// frame color value as the `t` value. Animation is referenced by name. - /// - public static void MultiplyTargetColorLerpAllFramesRGBName(string path, int red1, int green1, int blue1, int red2, int green2, int blue2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyTargetColorLerpAllFramesRGBName(lp_Path, red1, green1, blue1, red2, green2, blue2); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double MultiplyTargetColorLerpAllFramesRGBNameD(string path, double red1, double green1, double blue1, double red2, double green2, double blue2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginMultiplyTargetColorLerpAllFramesRGBNameD(lp_Path, red1, green1, blue1, red2, green2, blue2); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Multiply the specific frame by the color lerp result between color 1 and - /// 2 using the frame color value as the `t` value. Animation is referenced - /// by name. - /// - public static void MultiplyTargetColorLerpName(string path, int frameId, int color1, int color2) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginMultiplyTargetColorLerpName(lp_Path, frameId, color1, color2); - FreeIntPtr(lp_Path); - } - /// - /// Offset all colors in the frame using the RGB offset. Use the range of -255 - /// to 255 for red, green, and blue parameters. Negative values remove color. - /// Positive values add color. - /// - public static void OffsetColors(int animationId, int frameId, int red, int green, int blue) - { - PluginOffsetColors(animationId, frameId, red, green, blue); - } - /// - /// Offset all colors for all frames using the RGB offset. Use the range of - /// -255 to 255 for red, green, and blue parameters. Negative values remove - /// color. Positive values add color. - /// - public static void OffsetColorsAllFrames(int animationId, int red, int green, int blue) - { - PluginOffsetColorsAllFrames(animationId, red, green, blue); - } - /// - /// Offset all colors for all frames using the RGB offset. Use the range of - /// -255 to 255 for red, green, and blue parameters. Negative values remove - /// color. Positive values add color. - /// - public static void OffsetColorsAllFramesName(string path, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginOffsetColorsAllFramesName(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double OffsetColorsAllFramesNameD(string path, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginOffsetColorsAllFramesNameD(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Offset all colors in the frame using the RGB offset. Use the range of -255 - /// to 255 for red, green, and blue parameters. Negative values remove color. - /// Positive values add color. - /// - public static void OffsetColorsName(string path, int frameId, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginOffsetColorsName(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double OffsetColorsNameD(string path, double frameId, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginOffsetColorsNameD(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Offset a subset of colors in the frame using the RGB offset. - /// Use the range of -255 to 255 for red, green, and blue parameters. Negative - /// values remove color. Positive values add color. - /// - public static void OffsetNonZeroColors(int animationId, int frameId, int red, int green, int blue) - { - PluginOffsetNonZeroColors(animationId, frameId, red, green, blue); - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Offset a subset of colors for all frames using the RGB offset. - /// Use the range of -255 to 255 for red, green, and blue parameters. Negative - /// values remove color. Positive values add color. - /// - public static void OffsetNonZeroColorsAllFrames(int animationId, int red, int green, int blue) - { - PluginOffsetNonZeroColorsAllFrames(animationId, red, green, blue); - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Offset a subset of colors for all frames using the RGB offset. - /// Use the range of -255 to 255 for red, green, and blue parameters. Negative - /// values remove color. Positive values add color. - /// - public static void OffsetNonZeroColorsAllFramesName(string path, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginOffsetNonZeroColorsAllFramesName(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double OffsetNonZeroColorsAllFramesNameD(string path, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginOffsetNonZeroColorsAllFramesNameD(lp_Path, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// This method will only update colors in the animation that are not already - /// set to black. Offset a subset of colors in the frame using the RGB offset. - /// Use the range of -255 to 255 for red, green, and blue parameters. Negative - /// values remove color. Positive values add color. - /// - public static void OffsetNonZeroColorsName(string path, int frameId, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginOffsetNonZeroColorsName(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double OffsetNonZeroColorsNameD(string path, double frameId, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginOffsetNonZeroColorsNameD(lp_Path, frameId, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Opens a `Chroma` animation file so that it can be played. Returns an animation - /// id >= 0 upon success. Returns negative one if there was a failure. The - /// animation id is used in most of the API methods. - /// - public static int OpenAnimation(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginOpenAnimation(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double OpenAnimationD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginOpenAnimationD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Opens a `Chroma` animation data from memory so that it can be played. `Data` - /// is a pointer to BYTE array of the loaded animation in memory. `Name` will - /// be assigned to the animation when loaded. Returns an animation id >= 0 - /// upon success. Returns negative one if there was a failure. The animation - /// id is used in most of the API methods. - /// - public static int OpenAnimationFromMemory(byte[] data, string name) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - int result = PluginOpenAnimationFromMemory(data, lp_Name); - FreeIntPtr(lp_Name); - return result; - } - /// - /// Opens a `Chroma` animation file with the `.chroma` extension. Returns zero - /// upon success. Returns negative one if there was a failure. - /// - public static int OpenEditorDialog(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginOpenEditorDialog(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Open the named animation in the editor dialog and play the animation at - /// start. - /// - public static int OpenEditorDialogAndPlay(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginOpenEditorDialogAndPlay(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double OpenEditorDialogAndPlayD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginOpenEditorDialogAndPlayD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double OpenEditorDialogD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginOpenEditorDialogD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Sets the `duration` for all grames in the `Chroma` animation to the `duration` - /// parameter. Returns the animation id upon success. Returns negative one - /// upon failure. - /// - public static int OverrideFrameDuration(int animationId, float duration) - { - int result = PluginOverrideFrameDuration(animationId, duration); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double OverrideFrameDurationD(double animationId, double duration) - { - double result = PluginOverrideFrameDurationD(animationId, duration); - return result; - } - /// - /// Override the duration of all frames with the `duration` value. Animation - /// is referenced by name. - /// - public static void OverrideFrameDurationName(string path, float duration) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginOverrideFrameDurationName(lp_Path, duration); - FreeIntPtr(lp_Path); - } - /// - /// Pause the current animation referenced by id. - /// - public static void PauseAnimation(int animationId) - { - PluginPauseAnimation(animationId); - } - /// - /// Pause the current animation referenced by name. - /// - public static void PauseAnimationName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginPauseAnimationName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double PauseAnimationNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginPauseAnimationNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Plays the `Chroma` animation. This will load the animation, if not loaded - /// previously. Returns the animation id upon success. Returns negative one - /// upon failure. - /// - public static int PlayAnimation(int animationId) - { - int result = PluginPlayAnimation(animationId); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double PlayAnimationD(double animationId) - { - double result = PluginPlayAnimationD(animationId); - return result; - } - /// - /// `PluginPlayAnimationFrame` automatically handles initializing the `ChromaSDK`. - /// The method will play the animation given the `animationId` with looping - /// `on` or `off` starting at the `frameId`. - /// - public static void PlayAnimationFrame(int animationId, int frameId, bool loop) - { - PluginPlayAnimationFrame(animationId, frameId, loop); - } - /// - /// `PluginPlayAnimationFrameName` automatically handles initializing the `ChromaSDK`. - /// The named `.chroma` animation file will be automatically opened. The animation - /// will play with looping `on` or `off` starting at the `frameId`. - /// - public static void PlayAnimationFrameName(string path, int frameId, bool loop) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginPlayAnimationFrameName(lp_Path, frameId, loop); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double PlayAnimationFrameNameD(string path, double frameId, double loop) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginPlayAnimationFrameNameD(lp_Path, frameId, loop); - FreeIntPtr(lp_Path); - return result; - } - /// - /// `PluginPlayAnimationLoop` automatically handles initializing the `ChromaSDK`. - /// The method will play the animation given the `animationId` with looping - /// `on` or `off`. - /// - public static void PlayAnimationLoop(int animationId, bool loop) - { - PluginPlayAnimationLoop(animationId, loop); - } - /// - /// `PluginPlayAnimationName` automatically handles initializing the `ChromaSDK`. - /// The named `.chroma` animation file will be automatically opened. The animation - /// will play with looping `on` or `off`. - /// - public static void PlayAnimationName(string path, bool loop) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginPlayAnimationName(lp_Path, loop); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double PlayAnimationNameD(string path, double loop) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginPlayAnimationNameD(lp_Path, loop); - FreeIntPtr(lp_Path); - return result; - } - /// - /// `PluginPlayComposite` automatically handles initializing the `ChromaSDK`. - /// The named animation files for the `.chroma` set will be automatically opened. - /// The set of animations will play with looping `on` or `off`. - /// - public static void PlayComposite(string name, bool loop) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - PluginPlayComposite(lp_Name, loop); - FreeIntPtr(lp_Name); - } - /// - /// D suffix for limited data types. - /// - public static double PlayCompositeD(string name, double loop) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - double result = PluginPlayCompositeD(lp_Name, loop); - FreeIntPtr(lp_Name); - return result; - } - /// - /// Displays the `Chroma` animation frame on `Chroma` hardware given the `frameIndex`. - /// Returns the animation id upon success. Returns negative one upon failure. - /// - /// - public static int PreviewFrame(int animationId, int frameIndex) - { - int result = PluginPreviewFrame(animationId, frameIndex); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double PreviewFrameD(double animationId, double frameIndex) - { - double result = PluginPreviewFrameD(animationId, frameIndex); - return result; - } - /// - /// Displays the `Chroma` animation frame on `Chroma` hardware given the `frameIndex`. - /// Animaton is referenced by name. - /// - public static void PreviewFrameName(string path, int frameIndex) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginPreviewFrameName(lp_Path, frameIndex); - FreeIntPtr(lp_Path); - } - /// - /// Reduce the frames of the animation by removing every nth element. Animation - /// is referenced by id. - /// - public static void ReduceFrames(int animationId, int n) - { - PluginReduceFrames(animationId, n); - } - /// - /// Reduce the frames of the animation by removing every nth element. Animation - /// is referenced by name. - /// - public static void ReduceFramesName(string path, int n) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginReduceFramesName(lp_Path, n); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double ReduceFramesNameD(string path, double n) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginReduceFramesNameD(lp_Path, n); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Resets the `Chroma` animation to 1 blank frame. Returns the animation id - /// upon success. Returns negative one upon failure. - /// - public static int ResetAnimation(int animationId) - { - int result = PluginResetAnimation(animationId); - return result; - } - /// - /// Resume the animation with loop `ON` or `OFF` referenced by id. - /// - public static void ResumeAnimation(int animationId, bool loop) - { - PluginResumeAnimation(animationId, loop); - } - /// - /// Resume the animation with loop `ON` or `OFF` referenced by name. - /// - public static void ResumeAnimationName(string path, bool loop) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginResumeAnimationName(lp_Path, loop); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double ResumeAnimationNameD(string path, double loop) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginResumeAnimationNameD(lp_Path, loop); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Reverse the animation frame order of the `Chroma` animation. Returns the - /// animation id upon success. Returns negative one upon failure. Animation - /// is referenced by id. - /// - public static int Reverse(int animationId) - { - int result = PluginReverse(animationId); - return result; - } - /// - /// Reverse the animation frame order of the `Chroma` animation. Animation is - /// referenced by id. - /// - public static void ReverseAllFrames(int animationId) - { - PluginReverseAllFrames(animationId); - } - /// - /// Reverse the animation frame order of the `Chroma` animation. Animation is - /// referenced by name. - /// - public static void ReverseAllFramesName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginReverseAllFramesName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double ReverseAllFramesNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginReverseAllFramesNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Save the animation referenced by id to the path specified. - /// - public static int SaveAnimation(int animationId, string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginSaveAnimation(animationId, lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Save the named animation to the target path specified. - /// - public static int SaveAnimationName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - int result = PluginSaveAnimationName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Set the animation color for a frame given the `1D` `led`. The `led` should - /// be greater than or equal to 0 and less than the `MaxLeds`. The animation - /// is referenced by id. - /// - public static void Set1DColor(int animationId, int frameId, int led, int color) - { - PluginSet1DColor(animationId, frameId, led, color); - } - /// - /// Set the animation color for a frame given the `1D` `led`. The `led` should - /// be greater than or equal to 0 and less than the `MaxLeds`. The animation - /// is referenced by name. - /// - public static void Set1DColorName(string path, int frameId, int led, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSet1DColorName(lp_Path, frameId, led, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double Set1DColorNameD(string path, double frameId, double led, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSet1DColorNameD(lp_Path, frameId, led, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the animation color for a frame given the `2D` `row` and `column`. The - /// `row` should be greater than or equal to 0 and less than the `MaxRow`. - /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. - /// The animation is referenced by id. - /// - public static void Set2DColor(int animationId, int frameId, int row, int column, int color) - { - PluginSet2DColor(animationId, frameId, row, column, color); - } - /// - /// Set the animation color for a frame given the `2D` `row` and `column`. The - /// `row` should be greater than or equal to 0 and less than the `MaxRow`. - /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. - /// The animation is referenced by name. - /// - public static void Set2DColorName(string path, int frameId, int row, int column, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSet2DColorName(lp_Path, frameId, row, column, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double Set2DColorNameD(string path, double frameId, double rowColumnIndex, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSet2DColorNameD(lp_Path, frameId, rowColumnIndex, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// When custom color is set, the custom key mode will be used. The animation - /// is referenced by id. - /// - public static void SetChromaCustomColorAllFrames(int animationId) - { - PluginSetChromaCustomColorAllFrames(animationId); - } - /// - /// When custom color is set, the custom key mode will be used. The animation - /// is referenced by name. - /// - public static void SetChromaCustomColorAllFramesName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetChromaCustomColorAllFramesName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetChromaCustomColorAllFramesNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetChromaCustomColorAllFramesNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the Chroma custom key color flag on all frames. `True` changes the layout - /// from grid to key. `True` changes the layout from key to grid. Animation - /// is referenced by id. - /// - public static void SetChromaCustomFlag(int animationId, bool flag) - { - PluginSetChromaCustomFlag(animationId, flag); - } - /// - /// Set the Chroma custom key color flag on all frames. `True` changes the layout - /// from grid to key. `True` changes the layout from key to grid. Animation - /// is referenced by name. - /// - public static void SetChromaCustomFlagName(string path, bool flag) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetChromaCustomFlagName(lp_Path, flag); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetChromaCustomFlagNameD(string path, double flag) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetChromaCustomFlagNameD(lp_Path, flag); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the current frame of the animation referenced by id. - /// - public static void SetCurrentFrame(int animationId, int frameId) - { - PluginSetCurrentFrame(animationId, frameId); - } - /// - /// Set the current frame of the animation referenced by name. - /// - public static void SetCurrentFrameName(string path, int frameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetCurrentFrameName(lp_Path, frameId); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetCurrentFrameNameD(string path, double frameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetCurrentFrameNameD(lp_Path, frameId); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the custom alpha flag on the color array - /// - public static int SetCustomColorFlag2D(int device, int[] colors) - { - int result = PluginSetCustomColorFlag2D(device, colors); - return result; - } - /// - /// Changes the `deviceType` and `device` of a `Chroma` animation. If the device - /// is changed, the `Chroma` animation will be reset with 1 blank frame. Returns - /// the animation id upon success. Returns negative one upon failure. - /// - public static int SetDevice(int animationId, int deviceType, int device) - { - int result = PluginSetDevice(animationId, deviceType, device); - return result; - } - /// - /// SetEffect will display the referenced effect id. - /// - public static int SetEffect(Guid effectId) - { - int result = PluginSetEffect(effectId); - return result; - } - /// - /// SetEffectCustom1D will display the referenced colors immediately - /// - public static int SetEffectCustom1D(int device, int[] colors) - { - int result = PluginSetEffectCustom1D(device, colors); - return result; - } - /// - /// SetEffectCustom2D will display the referenced colors immediately. - /// - public static int SetEffectCustom2D(int device, int[] colors) - { - int result = PluginSetEffectCustom2D(device, colors); - return result; - } - /// - /// SetEffectKeyboardCustom2D will display the referenced custom keyboard colors - /// immediately. Colors represent a visual grid layout. Keys represent the - /// hotkeys for any layout. - /// - public static int SetEffectKeyboardCustom2D(int device, int[] colors, int[] keys) - { - int result = PluginSetEffectKeyboardCustom2D(device, colors, keys); - return result; - } - /// - /// When the idle animation is used, the named animation will play when no other - /// animations are playing. Reference the animation by id. - /// - public static void SetIdleAnimation(int animationId) - { - PluginSetIdleAnimation(animationId); - } - /// - /// When the idle animation is used, the named animation will play when no other - /// animations are playing. Reference the animation by name. - /// - public static void SetIdleAnimationName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetIdleAnimationName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// Set animation key to a static color for the given frame. - /// - public static void SetKeyColor(int animationId, int frameId, int rzkey, int color) - { - PluginSetKeyColor(animationId, frameId, rzkey, color); - } - /// - /// Set the key to the specified key color for all frames. Animation is referenced - /// by id. - /// - public static void SetKeyColorAllFrames(int animationId, int rzkey, int color) - { - PluginSetKeyColorAllFrames(animationId, rzkey, color); - } - /// - /// Set the key to the specified key color for all frames. Animation is referenced - /// by name. - /// - public static void SetKeyColorAllFramesName(string path, int rzkey, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeyColorAllFramesName(lp_Path, rzkey, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetKeyColorAllFramesNameD(string path, double rzkey, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetKeyColorAllFramesNameD(lp_Path, rzkey, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the key to the specified key color for all frames. Animation is referenced - /// by id. - /// - public static void SetKeyColorAllFramesRGB(int animationId, int rzkey, int red, int green, int blue) - { - PluginSetKeyColorAllFramesRGB(animationId, rzkey, red, green, blue); - } - /// - /// Set the key to the specified key color for all frames. Animation is referenced - /// by name. - /// - public static void SetKeyColorAllFramesRGBName(string path, int rzkey, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeyColorAllFramesRGBName(lp_Path, rzkey, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetKeyColorAllFramesRGBNameD(string path, double rzkey, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetKeyColorAllFramesRGBNameD(lp_Path, rzkey, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set animation key to a static color for the given frame. - /// - public static void SetKeyColorName(string path, int frameId, int rzkey, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeyColorName(lp_Path, frameId, rzkey, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetKeyColorNameD(string path, double frameId, double rzkey, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetKeyColorNameD(lp_Path, frameId, rzkey, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the key to the specified key color for the specified frame. Animation - /// is referenced by id. - /// - public static void SetKeyColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue) - { - PluginSetKeyColorRGB(animationId, frameId, rzkey, red, green, blue); - } - /// - /// Set the key to the specified key color for the specified frame. Animation - /// is referenced by name. - /// - public static void SetKeyColorRGBName(string path, int frameId, int rzkey, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeyColorRGBName(lp_Path, frameId, rzkey, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetKeyColorRGBNameD(string path, double frameId, double rzkey, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetKeyColorRGBNameD(lp_Path, frameId, rzkey, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set animation key to a static color for the given frame if the existing - /// color is not already black. - /// - public static void SetKeyNonZeroColor(int animationId, int frameId, int rzkey, int color) - { - PluginSetKeyNonZeroColor(animationId, frameId, rzkey, color); - } - /// - /// Set animation key to a static color for the given frame if the existing - /// color is not already black. - /// - public static void SetKeyNonZeroColorName(string path, int frameId, int rzkey, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeyNonZeroColorName(lp_Path, frameId, rzkey, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetKeyNonZeroColorNameD(string path, double frameId, double rzkey, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetKeyNonZeroColorNameD(lp_Path, frameId, rzkey, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set the key to the specified key color for the specified frame where color - /// is not black. Animation is referenced by id. - /// - public static void SetKeyNonZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue) - { - PluginSetKeyNonZeroColorRGB(animationId, frameId, rzkey, red, green, blue); - } - /// - /// Set the key to the specified key color for the specified frame where color - /// is not black. Animation is referenced by name. - /// - public static void SetKeyNonZeroColorRGBName(string path, int frameId, int rzkey, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeyNonZeroColorRGBName(lp_Path, frameId, rzkey, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetKeyNonZeroColorRGBNameD(string path, double frameId, double rzkey, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetKeyNonZeroColorRGBNameD(lp_Path, frameId, rzkey, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set animation key by row and column to a static color for the given frame. - /// - /// - public static void SetKeyRowColumnColorName(string path, int frameId, int row, int column, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeyRowColumnColorName(lp_Path, frameId, row, column, color); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for the given frame. Animation - /// is referenced by id. - /// - public static void SetKeysColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color) - { - PluginSetKeysColor(animationId, frameId, rzkeys, keyCount, color); - } - /// - /// Set an array of animation keys to a static color for all frames. Animation - /// is referenced by id. - /// - public static void SetKeysColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color) - { - PluginSetKeysColorAllFrames(animationId, rzkeys, keyCount, color); - } - /// - /// Set an array of animation keys to a static color for all frames. Animation - /// is referenced by name. - /// - public static void SetKeysColorAllFramesName(string path, int[] rzkeys, int keyCount, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysColorAllFramesName(lp_Path, rzkeys, keyCount, color); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for all frames. Animation - /// is referenced by id. - /// - public static void SetKeysColorAllFramesRGB(int animationId, int[] rzkeys, int keyCount, int red, int green, int blue) - { - PluginSetKeysColorAllFramesRGB(animationId, rzkeys, keyCount, red, green, blue); - } - /// - /// Set an array of animation keys to a static color for all frames. Animation - /// is referenced by name. - /// - public static void SetKeysColorAllFramesRGBName(string path, int[] rzkeys, int keyCount, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysColorAllFramesRGBName(lp_Path, rzkeys, keyCount, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for the given frame. - /// - public static void SetKeysColorName(string path, int frameId, int[] rzkeys, int keyCount, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysColorName(lp_Path, frameId, rzkeys, keyCount, color); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for the given frame. Animation - /// is referenced by id. - /// - public static void SetKeysColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) - { - PluginSetKeysColorRGB(animationId, frameId, rzkeys, keyCount, red, green, blue); - } - /// - /// Set an array of animation keys to a static color for the given frame. Animation - /// is referenced by name. - /// - public static void SetKeysColorRGBName(string path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysColorRGBName(lp_Path, frameId, rzkeys, keyCount, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for the given frame if - /// the existing color is not already black. - /// - public static void SetKeysNonZeroColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color) - { - PluginSetKeysNonZeroColor(animationId, frameId, rzkeys, keyCount, color); - } - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is not black. Animation is referenced by id. - /// - public static void SetKeysNonZeroColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color) - { - PluginSetKeysNonZeroColorAllFrames(animationId, rzkeys, keyCount, color); - } - /// - /// Set an array of animation keys to a static color for all frames if the existing - /// color is not already black. Reference animation by name. - /// - public static void SetKeysNonZeroColorAllFramesName(string path, int[] rzkeys, int keyCount, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysNonZeroColorAllFramesName(lp_Path, rzkeys, keyCount, color); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for the given frame if - /// the existing color is not already black. Reference animation by name. - /// - public static void SetKeysNonZeroColorName(string path, int frameId, int[] rzkeys, int keyCount, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysNonZeroColorName(lp_Path, frameId, rzkeys, keyCount, color); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is not black. Animation is referenced by id. - /// - public static void SetKeysNonZeroColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) - { - PluginSetKeysNonZeroColorRGB(animationId, frameId, rzkeys, keyCount, red, green, blue); - } - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is not black. Animation is referenced by name. - /// - public static void SetKeysNonZeroColorRGBName(string path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysNonZeroColorRGBName(lp_Path, frameId, rzkeys, keyCount, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is black. Animation is referenced by id. - /// - public static void SetKeysZeroColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color) - { - PluginSetKeysZeroColor(animationId, frameId, rzkeys, keyCount, color); - } - /// - /// Set an array of animation keys to a static color for all frames where the - /// color is black. Animation is referenced by id. - /// - public static void SetKeysZeroColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color) - { - PluginSetKeysZeroColorAllFrames(animationId, rzkeys, keyCount, color); - } - /// - /// Set an array of animation keys to a static color for all frames where the - /// color is black. Animation is referenced by name. - /// - public static void SetKeysZeroColorAllFramesName(string path, int[] rzkeys, int keyCount, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysZeroColorAllFramesName(lp_Path, rzkeys, keyCount, color); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for all frames where the - /// color is black. Animation is referenced by id. - /// - public static void SetKeysZeroColorAllFramesRGB(int animationId, int[] rzkeys, int keyCount, int red, int green, int blue) - { - PluginSetKeysZeroColorAllFramesRGB(animationId, rzkeys, keyCount, red, green, blue); - } - /// - /// Set an array of animation keys to a static color for all frames where the - /// color is black. Animation is referenced by name. - /// - public static void SetKeysZeroColorAllFramesRGBName(string path, int[] rzkeys, int keyCount, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysZeroColorAllFramesRGBName(lp_Path, rzkeys, keyCount, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is black. Animation is referenced by name. - /// - public static void SetKeysZeroColorName(string path, int frameId, int[] rzkeys, int keyCount, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysZeroColorName(lp_Path, frameId, rzkeys, keyCount, color); - FreeIntPtr(lp_Path); - } - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is black. Animation is referenced by id. - /// - public static void SetKeysZeroColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) - { - PluginSetKeysZeroColorRGB(animationId, frameId, rzkeys, keyCount, red, green, blue); - } - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is black. Animation is referenced by name. - /// - public static void SetKeysZeroColorRGBName(string path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeysZeroColorRGBName(lp_Path, frameId, rzkeys, keyCount, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// Set animation key to a static color for the given frame where the color - /// is black. Animation is referenced by id. - /// - public static void SetKeyZeroColor(int animationId, int frameId, int rzkey, int color) - { - PluginSetKeyZeroColor(animationId, frameId, rzkey, color); - } - /// - /// Set animation key to a static color for the given frame where the color - /// is black. Animation is referenced by name. - /// - public static void SetKeyZeroColorName(string path, int frameId, int rzkey, int color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeyZeroColorName(lp_Path, frameId, rzkey, color); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetKeyZeroColorNameD(string path, double frameId, double rzkey, double color) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetKeyZeroColorNameD(lp_Path, frameId, rzkey, color); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Set animation key to a static color for the given frame where the color - /// is black. Animation is referenced by id. - /// - public static void SetKeyZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue) - { - PluginSetKeyZeroColorRGB(animationId, frameId, rzkey, red, green, blue); - } - /// - /// Set animation key to a static color for the given frame where the color - /// is black. Animation is referenced by name. - /// - public static void SetKeyZeroColorRGBName(string path, int frameId, int rzkey, int red, int green, int blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSetKeyZeroColorRGBName(lp_Path, frameId, rzkey, red, green, blue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SetKeyZeroColorRGBNameD(string path, double frameId, double rzkey, double red, double green, double blue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSetKeyZeroColorRGBNameD(lp_Path, frameId, rzkey, red, green, blue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Invokes the setup for a debug logging callback so that `stdout` is redirected - /// to the callback. This is used by `Unity` so that debug messages can appear - /// in the console window. - /// - public static void SetLogDelegate(IntPtr fp) - { - PluginSetLogDelegate(fp); - } - /// - /// Sets the target device to the static color. - /// - public static void SetStaticColor(int deviceType, int device, int color) - { - PluginSetStaticColor(deviceType, device, color); - } - /// - /// Sets all devices to the static color. - /// - public static void SetStaticColorAll(int color) - { - PluginSetStaticColorAll(color); - } - /// - /// Sets the target device to the static color. - /// - public static void StaticColor(int deviceType, int device, int color) - { - PluginStaticColor(deviceType, device, color); - } - /// - /// Sets all devices to the static color. - /// - public static void StaticColorAll(int color) - { - PluginStaticColorAll(color); - } - /// - /// D suffix for limited data types. - /// - public static double StaticColorD(double deviceType, double device, double color) - { - double result = PluginStaticColorD(deviceType, device, color); - return result; - } - /// - /// `PluginStopAll` will automatically stop all animations that are playing. - /// - /// - public static void StopAll() - { - PluginStopAll(); - } - /// - /// Stops animation playback if in progress. Returns the animation id upon success. - /// Returns negative one upon failure. - /// - public static int StopAnimation(int animationId) - { - int result = PluginStopAnimation(animationId); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double StopAnimationD(double animationId) - { - double result = PluginStopAnimationD(animationId); - return result; - } - /// - /// `PluginStopAnimationName` automatically handles initializing the `ChromaSDK`. - /// The named `.chroma` animation file will be automatically opened. The animation - /// will stop if playing. - /// - public static void StopAnimationName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginStopAnimationName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double StopAnimationNameD(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginStopAnimationNameD(lp_Path); - FreeIntPtr(lp_Path); - return result; - } - /// - /// `PluginStopAnimationType` automatically handles initializing the `ChromaSDK`. - /// If any animation is playing for the `deviceType` and `device` combination, - /// it will be stopped. - /// - public static void StopAnimationType(int deviceType, int device) - { - PluginStopAnimationType(deviceType, device); - } - /// - /// D suffix for limited data types. - /// - public static double StopAnimationTypeD(double deviceType, double device) - { - double result = PluginStopAnimationTypeD(deviceType, device); - return result; - } - /// - /// `PluginStopComposite` automatically handles initializing the `ChromaSDK`. - /// The named animation files for the `.chroma` set will be automatically opened. - /// The set of animations will be stopped if playing. - /// - public static void StopComposite(string name) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - PluginStopComposite(lp_Name); - FreeIntPtr(lp_Name); - } - /// - /// D suffix for limited data types. - /// - public static double StopCompositeD(string name) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - double result = PluginStopCompositeD(lp_Name); - FreeIntPtr(lp_Name); - return result; - } - /// - /// Return color1 - color2 - /// - public static int SubtractColor(int color1, int color2) - { - int result = PluginSubtractColor(color1, color2); - return result; - } - /// - /// Subtract the source color from the target color for the frame where the - /// target color is not black. Source and target are referenced by id. - /// - public static void SubtractNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId) - { - PluginSubtractNonZeroAllKeys(sourceAnimationId, targetAnimationId, frameId); - } - /// - /// Subtract the source color from the target color for all frames where the - /// target color is not black. Source and target are referenced by id. - /// - public static void SubtractNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) - { - PluginSubtractNonZeroAllKeysAllFrames(sourceAnimationId, targetAnimationId); - } - /// - /// Subtract the source color from the target color for all frames where the - /// target color is not black. Source and target are referenced by name. - /// - public static void SubtractNonZeroAllKeysAllFramesName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginSubtractNonZeroAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double SubtractNonZeroAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginSubtractNonZeroAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Subtract the source color from the target color for all frames where the - /// target color is not black starting at offset for the length of the source. - /// Source and target are referenced by id. - /// - public static void SubtractNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) - { - PluginSubtractNonZeroAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); - } - /// - /// Subtract the source color from the target color for all frames where the - /// target color is not black starting at offset for the length of the source. - /// Source and target are referenced by name. - /// - public static void SubtractNonZeroAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginSubtractNonZeroAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double SubtractNonZeroAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginSubtractNonZeroAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Subtract the source color from the target color for the frame where the - /// target color is not black. Source and target are referenced by name. - /// - public static void SubtractNonZeroAllKeysName(string sourceAnimation, string targetAnimation, int frameId) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginSubtractNonZeroAllKeysName(lp_SourceAnimation, lp_TargetAnimation, frameId); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// Subtract the source color from the target where color is not black for the - /// source frame and target offset frame, reference source and target by id. - /// - /// - public static void SubtractNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) - { - PluginSubtractNonZeroAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); - } - /// - /// Subtract the source color from the target where color is not black for the - /// source frame and target offset frame, reference source and target by name. - /// - /// - public static void SubtractNonZeroAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginSubtractNonZeroAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double SubtractNonZeroAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginSubtractNonZeroAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Subtract the source color from the target color where the target color is - /// not black for all frames. Reference source and target by id. - /// - public static void SubtractNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId) - { - PluginSubtractNonZeroTargetAllKeysAllFrames(sourceAnimationId, targetAnimationId); - } - /// - /// Subtract the source color from the target color where the target color is - /// not black for all frames. Reference source and target by name. - /// - public static void SubtractNonZeroTargetAllKeysAllFramesName(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginSubtractNonZeroTargetAllKeysAllFramesName(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double SubtractNonZeroTargetAllKeysAllFramesNameD(string sourceAnimation, string targetAnimation) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginSubtractNonZeroTargetAllKeysAllFramesNameD(lp_SourceAnimation, lp_TargetAnimation); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Subtract the source color from the target color where the target color is - /// not black for all frames starting at the target offset for the length of - /// the source. Reference source and target by id. - /// - public static void SubtractNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset) - { - PluginSubtractNonZeroTargetAllKeysAllFramesOffset(sourceAnimationId, targetAnimationId, offset); - } - /// - /// Subtract the source color from the target color where the target color is - /// not black for all frames starting at the target offset for the length of - /// the source. Reference source and target by name. - /// - public static void SubtractNonZeroTargetAllKeysAllFramesOffsetName(string sourceAnimation, string targetAnimation, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginSubtractNonZeroTargetAllKeysAllFramesOffsetName(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double SubtractNonZeroTargetAllKeysAllFramesOffsetNameD(string sourceAnimation, string targetAnimation, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginSubtractNonZeroTargetAllKeysAllFramesOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Subtract the source color from the target color where the target color is - /// not black from the source frame to the target offset frame. Reference source - /// and target by id. - /// - public static void SubtractNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset) - { - PluginSubtractNonZeroTargetAllKeysOffset(sourceAnimationId, targetAnimationId, frameId, offset); - } - /// - /// Subtract the source color from the target color where the target color is - /// not black from the source frame to the target offset frame. Reference source - /// and target by name. - /// - public static void SubtractNonZeroTargetAllKeysOffsetName(string sourceAnimation, string targetAnimation, int frameId, int offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - PluginSubtractNonZeroTargetAllKeysOffsetName(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - } - /// - /// D suffix for limited data types. - /// - public static double SubtractNonZeroTargetAllKeysOffsetNameD(string sourceAnimation, string targetAnimation, double frameId, double offset) - { - string str_SourceAnimation = sourceAnimation; - IntPtr lp_SourceAnimation = GetPathIntPtr(str_SourceAnimation); - string str_TargetAnimation = targetAnimation; - IntPtr lp_TargetAnimation = GetPathIntPtr(str_TargetAnimation); - double result = PluginSubtractNonZeroTargetAllKeysOffsetNameD(lp_SourceAnimation, lp_TargetAnimation, frameId, offset); - FreeIntPtr(lp_SourceAnimation); - FreeIntPtr(lp_TargetAnimation); - return result; - } - /// - /// Subtract all frames with the min RGB color where the animation color is - /// less than the min threshold AND with the max RGB color where the animation - /// is more than the max threshold. Animation is referenced by id. - /// - public static void SubtractThresholdColorsMinMaxAllFramesRGB(int animationId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) - { - PluginSubtractThresholdColorsMinMaxAllFramesRGB(animationId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - } - /// - /// Subtract all frames with the min RGB color where the animation color is - /// less than the min threshold AND with the max RGB color where the animation - /// is more than the max threshold. Animation is referenced by name. - /// - public static void SubtractThresholdColorsMinMaxAllFramesRGBName(string path, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSubtractThresholdColorsMinMaxAllFramesRGBName(lp_Path, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SubtractThresholdColorsMinMaxAllFramesRGBNameD(string path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSubtractThresholdColorsMinMaxAllFramesRGBNameD(lp_Path, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Subtract the specified frame with the min RGB color where the animation - /// color is less than the min threshold AND with the max RGB color where the - /// animation is more than the max threshold. Animation is referenced by id. - /// - /// - public static void SubtractThresholdColorsMinMaxRGB(int animationId, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) - { - PluginSubtractThresholdColorsMinMaxRGB(animationId, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - } - /// - /// Subtract the specified frame with the min RGB color where the animation - /// color is less than the min threshold AND with the max RGB color where the - /// animation is more than the max threshold. Animation is referenced by name. - /// - /// - public static void SubtractThresholdColorsMinMaxRGBName(string path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginSubtractThresholdColorsMinMaxRGBName(lp_Path, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double SubtractThresholdColorsMinMaxRGBNameD(string path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginSubtractThresholdColorsMinMaxRGBNameD(lp_Path, frameId, minThreshold, minRed, minGreen, minBlue, maxThreshold, maxRed, maxGreen, maxBlue); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Trim the end of the animation. The length of the animation will be the lastFrameId - /// plus one. Reference the animation by id. - /// - public static void TrimEndFrames(int animationId, int lastFrameId) - { - PluginTrimEndFrames(animationId, lastFrameId); - } - /// - /// Trim the end of the animation. The length of the animation will be the lastFrameId - /// plus one. Reference the animation by name. - /// - public static void TrimEndFramesName(string path, int lastFrameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginTrimEndFramesName(lp_Path, lastFrameId); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double TrimEndFramesNameD(string path, double lastFrameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginTrimEndFramesNameD(lp_Path, lastFrameId); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Remove the frame from the animation. Reference animation by id. - /// - public static void TrimFrame(int animationId, int frameId) - { - PluginTrimFrame(animationId, frameId); - } - /// - /// Remove the frame from the animation. Reference animation by name. - /// - public static void TrimFrameName(string path, int frameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginTrimFrameName(lp_Path, frameId); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double TrimFrameNameD(string path, double frameId) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginTrimFrameNameD(lp_Path, frameId); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Trim the start of the animation starting at frame 0 for the number of frames. - /// Reference the animation by id. - /// - public static void TrimStartFrames(int animationId, int numberOfFrames) - { - PluginTrimStartFrames(animationId, numberOfFrames); - } - /// - /// Trim the start of the animation starting at frame 0 for the number of frames. - /// Reference the animation by name. - /// - public static void TrimStartFramesName(string path, int numberOfFrames) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginTrimStartFramesName(lp_Path, numberOfFrames); - FreeIntPtr(lp_Path); - } - /// - /// D suffix for limited data types. - /// - public static double TrimStartFramesNameD(string path, double numberOfFrames) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - double result = PluginTrimStartFramesNameD(lp_Path, numberOfFrames); - FreeIntPtr(lp_Path); - return result; - } - /// - /// Uninitializes the `ChromaSDK`. Returns 0 upon success. Returns negative - /// one upon failure. - /// - public static int Uninit() - { - int result = PluginUninit(); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double UninitD() - { - double result = PluginUninitD(); - return result; - } - /// - /// Unloads `Chroma` effects to free up resources. Returns the animation id - /// upon success. Returns negative one upon failure. Reference the animation - /// by id. - /// - public static int UnloadAnimation(int animationId) - { - int result = PluginUnloadAnimation(animationId); - return result; - } - /// - /// D suffix for limited data types. - /// - public static double UnloadAnimationD(double animationId) - { - double result = PluginUnloadAnimationD(animationId); - return result; - } - /// - /// Unload the animation effects. Reference the animation by name. - /// - public static void UnloadAnimationName(string path) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginUnloadAnimationName(lp_Path); - FreeIntPtr(lp_Path); - } - /// - /// Unload the the composite set of animation effects. Reference the animation - /// by name. - /// - public static void UnloadComposite(string name) - { - string str_Name = name; - IntPtr lp_Name = GetPathIntPtr(str_Name); - PluginUnloadComposite(lp_Name); - FreeIntPtr(lp_Name); - } - /// - /// Unload the Razer Chroma SDK Library before exiting the application. - /// - public static void UnloadLibrarySDK() - { - PluginUnloadLibrarySDK(); - } - /// - /// Unload the Razer Chroma Streaming Plugin Library before exiting the application. - /// - /// - public static void UnloadLibraryStreamingPlugin() - { - PluginUnloadLibraryStreamingPlugin(); - } - /// - /// Updates the `frameIndex` of the `Chroma` animation referenced by id and - /// sets the `duration` (in seconds). The `color` is expected to be an array - /// of the dimensions for the `deviceType/device`. The `length` parameter is - /// the size of the `color` array. For `EChromaSDKDevice1DEnum` the array size - /// should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should - /// be `MAX ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard - /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the - /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. - /// - /// - public static int UpdateFrame(int animationId, int frameIndex, float duration, int[] colors, int length, int[] keys, int keysLength) - { - int result = PluginUpdateFrame(animationId, frameIndex, duration, colors, length, keys, keysLength); - return result; - } - /// - /// Update the `frameIndex` of the `Chroma` animation referenced by name and - /// sets the `duration` (in seconds). The `color` is expected to be an array - /// of the dimensions for the `deviceType/device`. The `length` parameter is - /// the size of the `color` array. For `EChromaSDKDevice1DEnum` the array size - /// should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should - /// be `MAX ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard - /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the - /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. - /// Returns the animation id upon success. Returns negative one upon failure. - /// - /// - public static int UpdateFrameName(string path, int frameIndex, float duration, int[] colors, int length, int[] keys, int keysLength) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - int result = PluginUpdateFrameName(lp_Path, frameIndex, duration, colors, length, keys, keysLength); - FreeIntPtr(lp_Path); - return result; - } - /// - /// When the idle animation flag is true, when no other animations are playing, - /// the idle animation will be used. The idle animation will not be affected - /// by the API calls to PluginIsPlaying, PluginStopAnimationType, PluginGetPlayingAnimationId, - /// and PluginGetPlayingAnimationCount. Then the idle animation flag is false, - /// the idle animation is disabled. `Device` uses `EChromaSDKDeviceEnum` enums. - /// - /// - public static void UseIdleAnimation(int device, bool flag) - { - PluginUseIdleAnimation(device, flag); - } - /// - /// Set idle animation flag for all devices. - /// - public static void UseIdleAnimations(bool flag) - { - PluginUseIdleAnimations(flag); - } - /// - /// Set preloading animation flag, which is set to true by default. Reference - /// animation by id. - /// - public static void UsePreloading(int animationId, bool flag) - { - PluginUsePreloading(animationId, flag); - } - /// - /// Set preloading animation flag, which is set to true by default. Reference - /// animation by name. - /// - public static void UsePreloadingName(string path, bool flag) - { - string str_Path = path; - IntPtr lp_Path = GetPathIntPtr(str_Path); - PluginUsePreloadingName(lp_Path, flag); - FreeIntPtr(lp_Path); - } - #endregion - - #region Private DLL Hooks - /// - /// Return the sum of colors - /// EXPORT_API int PluginAddColor(const int color1, const int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginAddColor(int color1, int color2); - /// - /// Adds a frame to the `Chroma` animation and sets the `duration` (in seconds). - /// The `color` is expected to be an array of the dimensions for the `deviceType/device`. - /// The `length` parameter is the size of the `color` array. For `EChromaSDKDevice1DEnum` - /// the array size should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array - /// size should be `MAX ROW` times `MAX COLUMN`. Returns the animation id upon - /// success. Returns negative one upon failure. - /// EXPORT_API int PluginAddFrame(int animationId, float duration, int* colors, int length); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginAddFrame(int animationId, float duration, int[] colors, int length); - /// - /// Add source color to target where color is not black for frame id, reference - /// source and target by id. - /// EXPORT_API void PluginAddNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - /// Add source color to target where color is not black for all frames, reference - /// source and target by id. - /// EXPORT_API void PluginAddNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - /// Add source color to target where color is not black for all frames, reference - /// source and target by name. - /// EXPORT_API void PluginAddNonZeroAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginAddNonZeroAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginAddNonZeroAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Add source color to target where color is not black for all frames starting - /// at offset for the length of the source, reference source and target by - /// id. - /// EXPORT_API void PluginAddNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - /// Add source color to target where color is not black for all frames starting - /// at offset for the length of the source, reference source and target by - /// name. - /// EXPORT_API void PluginAddNonZeroAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginAddNonZeroAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginAddNonZeroAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); - /// - /// Add source color to target where color is not black for frame id, reference - /// source and target by name. - /// EXPORT_API void PluginAddNonZeroAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); - /// - /// Add source color to target where color is not black for the source frame - /// and target offset frame, reference source and target by id. - /// EXPORT_API void PluginAddNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - /// Add source color to target where color is not black for the source frame - /// and target offset frame, reference source and target by name. - /// EXPORT_API void PluginAddNonZeroAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginAddNonZeroAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginAddNonZeroAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); - /// - /// Add source color to target where the target color is not black for all frames, - /// reference source and target by id. - /// EXPORT_API void PluginAddNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - /// Add source color to target where the target color is not black for all frames, - /// reference source and target by name. - /// EXPORT_API void PluginAddNonZeroTargetAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroTargetAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginAddNonZeroTargetAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginAddNonZeroTargetAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Add source color to target where the target color is not black for all frames - /// starting at offset for the length of the source, reference source and target - /// by id. - /// EXPORT_API void PluginAddNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - /// Add source color to target where the target color is not black for all frames - /// starting at offset for the length of the source, reference source and target - /// by name. - /// EXPORT_API void PluginAddNonZeroTargetAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroTargetAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginAddNonZeroTargetAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginAddNonZeroTargetAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); - /// - /// Add source color to target where target color is not blank from the source - /// frame to the target offset frame, reference source and target by id. - /// EXPORT_API void PluginAddNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - /// Add source color to target where target color is not blank from the source - /// frame to the target offset frame, reference source and target by name. - /// - /// EXPORT_API void PluginAddNonZeroTargetAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAddNonZeroTargetAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginAddNonZeroTargetAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginAddNonZeroTargetAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); - /// - /// Append all source frames to the target animation, reference source and target - /// by id. - /// EXPORT_API void PluginAppendAllFrames(int sourceAnimationId, int targetAnimationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAppendAllFrames(int sourceAnimationId, int targetAnimationId); - /// - /// Append all source frames to the target animation, reference source and target - /// by name. - /// EXPORT_API void PluginAppendAllFramesName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginAppendAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginAppendAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginAppendAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// `PluginClearAll` will issue a `CLEAR` effect for all devices. - /// EXPORT_API void PluginClearAll(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginClearAll(); - /// - /// `PluginClearAnimationType` will issue a `CLEAR` effect for the given device. - /// - /// EXPORT_API void PluginClearAnimationType(int deviceType, int device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginClearAnimationType(int deviceType, int device); - /// - /// `PluginCloseAll` closes all open animations so they can be reloaded from - /// disk. The set of animations will be stopped if playing. - /// EXPORT_API void PluginCloseAll(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCloseAll(); - /// - /// Closes the `Chroma` animation to free up resources referenced by id. Returns - /// the animation id upon success. Returns negative one upon failure. This - /// might be used while authoring effects if there was a change necessitating - /// re-opening the animation. The animation id can no longer be used once closed. - /// - /// EXPORT_API int PluginCloseAnimation(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCloseAnimation(int animationId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCloseAnimationD(double animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCloseAnimationD(double animationId); - /// - /// Closes the `Chroma` animation referenced by name so that the animation can - /// be reloaded from disk. - /// EXPORT_API void PluginCloseAnimationName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCloseAnimationName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCloseAnimationNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCloseAnimationNameD(IntPtr path); - /// - /// `PluginCloseComposite` closes a set of animations so they can be reloaded - /// from disk. The set of animations will be stopped if playing. - /// EXPORT_API void PluginCloseComposite(const char* name); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCloseComposite(IntPtr name); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCloseCompositeD(const char* name); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCloseCompositeD(IntPtr name); - /// - /// Copy source animation to target animation for the given frame. Source and - /// target are referenced by id. - /// EXPORT_API void PluginCopyAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - /// Copy source animation to target animation for the given frame. Source and - /// target are referenced by id. - /// EXPORT_API void PluginCopyAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); - /// - /// Copy animation to named target animation in memory. If target animation - /// exists, close first. Source is referenced by id. - /// EXPORT_API int PluginCopyAnimation(int sourceAnimationId, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCopyAnimation(int sourceAnimationId, IntPtr targetAnimation); - /// - /// Copy animation to named target animation in memory. If target animation - /// exists, close first. Source is referenced by name. - /// EXPORT_API void PluginCopyAnimationName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyAnimationName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyAnimationNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyAnimationNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Copy blue channel to other channels for all frames. Intensity range is 0.0 - /// to 1.0. Reference the animation by id. - /// EXPORT_API void PluginCopyBlueChannelAllFrames(int animationId, float redIntensity, float greenIntensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyBlueChannelAllFrames(int animationId, float redIntensity, float greenIntensity); - /// - /// Copy blue channel to other channels for all frames. Intensity range is 0.0 - /// to 1.0. Reference the animation by name. - /// EXPORT_API void PluginCopyBlueChannelAllFramesName(const char* path, float redIntensity, float greenIntensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyBlueChannelAllFramesName(IntPtr path, float redIntensity, float greenIntensity); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyBlueChannelAllFramesNameD(const char* path, double redIntensity, double greenIntensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyBlueChannelAllFramesNameD(IntPtr path, double redIntensity, double greenIntensity); - /// - /// Copy green channel to other channels for all frames. Intensity range is - /// 0.0 to 1.0. Reference the animation by id. - /// EXPORT_API void PluginCopyGreenChannelAllFrames(int animationId, float redIntensity, float blueIntensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyGreenChannelAllFrames(int animationId, float redIntensity, float blueIntensity); - /// - /// Copy green channel to other channels for all frames. Intensity range is - /// 0.0 to 1.0. Reference the animation by name. - /// EXPORT_API void PluginCopyGreenChannelAllFramesName(const char* path, float redIntensity, float blueIntensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyGreenChannelAllFramesName(IntPtr path, float redIntensity, float blueIntensity); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyGreenChannelAllFramesNameD(const char* path, double redIntensity, double blueIntensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyGreenChannelAllFramesNameD(IntPtr path, double redIntensity, double blueIntensity); - /// - /// Copy animation key color from the source animation to the target animation - /// for the given frame. Reference the source and target by id. - /// EXPORT_API void PluginCopyKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); - /// - /// Copy animation key color from the source animation to the target animation - /// for all frames. Reference the source and target by id. - /// EXPORT_API void PluginCopyKeyColorAllFrames(int sourceAnimationId, int targetAnimationId, int rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeyColorAllFrames(int sourceAnimationId, int targetAnimationId, int rzkey); - /// - /// Copy animation key color from the source animation to the target animation - /// for all frames. Reference the source and target by name. - /// EXPORT_API void PluginCopyKeyColorAllFramesName(const char* sourceAnimation, const char* targetAnimation, int rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeyColorAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation, int rzkey); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyKeyColorAllFramesNameD(const char* sourceAnimation, const char* targetAnimation, double rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyKeyColorAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double rzkey); - /// - /// Copy animation key color from the source animation to the target animation - /// for all frames, starting at the offset for the length of the source animation. - /// Source and target are referenced by id. - /// EXPORT_API void PluginCopyKeyColorAllFramesOffset(int sourceAnimationId, int targetAnimationId, int rzkey, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeyColorAllFramesOffset(int sourceAnimationId, int targetAnimationId, int rzkey, int offset); - /// - /// Copy animation key color from the source animation to the target animation - /// for all frames, starting at the offset for the length of the source animation. - /// Source and target are referenced by name. - /// EXPORT_API void PluginCopyKeyColorAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int rzkey, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeyColorAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int rzkey, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyKeyColorAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double rzkey, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyKeyColorAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double rzkey, double offset); - /// - /// Copy animation key color from the source animation to the target animation - /// for the given frame. - /// EXPORT_API void PluginCopyKeyColorName(const char* sourceAnimation, const char* targetAnimation, int frameId, int rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeyColorName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int rzkey); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyKeyColorNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyKeyColorNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double rzkey); - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation for the given frame. Reference the source and target by - /// id. - /// EXPORT_API void PluginCopyKeysColor(int sourceAnimationId, int targetAnimationId, int frameId, const int* keys, int size); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeysColor(int sourceAnimationId, int targetAnimationId, int frameId, int[] keys, int size); - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation for all frames. Reference the source and target by id. - /// - /// EXPORT_API void PluginCopyKeysColorAllFrames(int sourceAnimationId, int targetAnimationId, const int* keys, int size); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeysColorAllFrames(int sourceAnimationId, int targetAnimationId, int[] keys, int size); - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation for all frames. Reference the source and target by name. - /// - /// EXPORT_API void PluginCopyKeysColorAllFramesName(const char* sourceAnimation, const char* targetAnimation, const int* keys, int size); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeysColorAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation, int[] keys, int size); - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation for the given frame. Reference the source and target by - /// name. - /// EXPORT_API void PluginCopyKeysColorName(const char* sourceAnimation, const char* targetAnimation, int frameId, const int* keys, int size); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeysColorName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int[] keys, int size); - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation from the source frame to the target frame. Reference the - /// source and target by id. - /// EXPORT_API void PluginCopyKeysColorOffset(int sourceAnimationId, int targetAnimationId, int sourceFrameId, int targetFrameId, const int* keys, int size); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeysColorOffset(int sourceAnimationId, int targetAnimationId, int sourceFrameId, int targetFrameId, int[] keys, int size); - /// - /// Copy animation color for a set of keys from the source animation to the - /// target animation from the source frame to the target frame. Reference the - /// source and target by name. - /// EXPORT_API void PluginCopyKeysColorOffsetName(const char* sourceAnimation, const char* targetAnimation, int sourceFrameId, int targetFrameId, const int* keys, int size); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyKeysColorOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int sourceFrameId, int targetFrameId, int[] keys, int size); - /// - /// Copy source animation to target animation for the given frame. Source and - /// target are referenced by id. - /// EXPORT_API void PluginCopyNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - /// Copy nonzero colors from a source animation to a target animation for all - /// frames. Reference source and target by id. - /// EXPORT_API void PluginCopyNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - /// Copy nonzero colors from a source animation to a target animation for all - /// frames. Reference source and target by name. - /// EXPORT_API void PluginCopyNonZeroAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyNonZeroAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyNonZeroAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Copy nonzero colors from a source animation to a target animation for all - /// frames starting at the offset for the length of the source animation. The - /// source and target are referenced by id. - /// EXPORT_API void PluginCopyNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - /// Copy nonzero colors from a source animation to a target animation for all - /// frames starting at the offset for the length of the source animation. The - /// source and target are referenced by name. - /// EXPORT_API void PluginCopyNonZeroAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyNonZeroAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyNonZeroAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); - /// - /// Copy nonzero colors from source animation to target animation for the specified - /// frame. Source and target are referenced by id. - /// EXPORT_API void PluginCopyNonZeroAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyNonZeroAllKeysNameD(const char* sourceAnimation, const char* targetAnimation, double frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyNonZeroAllKeysNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId); - /// - /// Copy nonzero colors from the source animation to the target animation from - /// the source frame to the target offset frame. Source and target are referenced - /// by id. - /// EXPORT_API void PluginCopyNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - /// Copy nonzero colors from the source animation to the target animation from - /// the source frame to the target offset frame. Source and target are referenced - /// by name. - /// EXPORT_API void PluginCopyNonZeroAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyNonZeroAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyNonZeroAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); - /// - /// Copy animation key color from the source animation to the target animation - /// for the given frame where color is not zero. - /// EXPORT_API void PluginCopyNonZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); - /// - /// Copy animation key color from the source animation to the target animation - /// for the given frame where color is not zero. - /// EXPORT_API void PluginCopyNonZeroKeyColorName(const char* sourceAnimation, const char* targetAnimation, int frameId, int rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroKeyColorName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int rzkey); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyNonZeroKeyColorNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyNonZeroKeyColorNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double rzkey); - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for the specified frame. Source and target - /// are referenced by id. - /// EXPORT_API void PluginCopyNonZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for all frames. Source and target are referenced - /// by id. - /// EXPORT_API void PluginCopyNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for all frames. Source and target are referenced - /// by name. - /// EXPORT_API void PluginCopyNonZeroTargetAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroTargetAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyNonZeroTargetAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyNonZeroTargetAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for all frames. Source and target are referenced - /// by name. - /// EXPORT_API void PluginCopyNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for all frames starting at the target offset - /// for the length of the source animation. Source and target animations are - /// referenced by name. - /// EXPORT_API void PluginCopyNonZeroTargetAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroTargetAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyNonZeroTargetAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyNonZeroTargetAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for the specified frame. The source and target - /// are referenced by name. - /// EXPORT_API void PluginCopyNonZeroTargetAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroTargetAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyNonZeroTargetAllKeysNameD(const char* sourceAnimation, const char* targetAnimation, double frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyNonZeroTargetAllKeysNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId); - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for the specified source frame and target offset - /// frame. The source and target are referenced by id. - /// EXPORT_API void PluginCopyNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is nonzero for the specified source frame and target offset - /// frame. The source and target are referenced by name. - /// EXPORT_API void PluginCopyNonZeroTargetAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroTargetAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyNonZeroTargetAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyNonZeroTargetAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is zero for all frames. Source and target are referenced - /// by id. - /// EXPORT_API void PluginCopyNonZeroTargetZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroTargetZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - /// Copy nonzero colors from the source animation to the target animation where - /// the target color is zero for all frames. Source and target are referenced - /// by name. - /// EXPORT_API void PluginCopyNonZeroTargetZeroAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyNonZeroTargetZeroAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyNonZeroTargetZeroAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyNonZeroTargetZeroAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Copy red channel to other channels for all frames. Intensity range is 0.0 - /// to 1.0. Reference the animation by id. - /// EXPORT_API void PluginCopyRedChannelAllFrames(int animationId, float greenIntensity, float blueIntensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyRedChannelAllFrames(int animationId, float greenIntensity, float blueIntensity); - /// - /// Copy green channel to other channels for all frames. Intensity range is - /// 0.0 to 1.0. Reference the animation by name. - /// EXPORT_API void PluginCopyRedChannelAllFramesName(const char* path, float greenIntensity, float blueIntensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyRedChannelAllFramesName(IntPtr path, float greenIntensity, float blueIntensity); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyRedChannelAllFramesNameD(const char* path, double greenIntensity, double blueIntensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyRedChannelAllFramesNameD(IntPtr path, double greenIntensity, double blueIntensity); - /// - /// Copy zero colors from source animation to target animation for the frame. - /// Source and target are referenced by id. - /// EXPORT_API void PluginCopyZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - /// Copy zero colors from source animation to target animation for all frames. - /// Source and target are referenced by id. - /// EXPORT_API void PluginCopyZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - /// Copy zero colors from source animation to target animation for all frames. - /// Source and target are referenced by name. - /// EXPORT_API void PluginCopyZeroAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyZeroAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyZeroAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Copy zero colors from source animation to target animation for all frames - /// starting at the target offset for the length of the source animation. Source - /// and target are referenced by id. - /// EXPORT_API void PluginCopyZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - /// Copy zero colors from source animation to target animation for all frames - /// starting at the target offset for the length of the source animation. Source - /// and target are referenced by name. - /// EXPORT_API void PluginCopyZeroAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyZeroAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyZeroAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); - /// - /// Copy zero colors from source animation to target animation for the frame. - /// Source and target are referenced by name. - /// EXPORT_API void PluginCopyZeroAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); - /// - /// Copy zero colors from source animation to target animation for the frame - /// id starting at the target offset for the length of the source animation. - /// Source and target are referenced by id. - /// EXPORT_API void PluginCopyZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - /// Copy zero colors from source animation to target animation for the frame - /// id starting at the target offset for the length of the source animation. - /// Source and target are referenced by name. - /// EXPORT_API void PluginCopyZeroAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); - /// - /// Copy zero key color from source animation to target animation for the specified - /// frame. Source and target are referenced by id. - /// EXPORT_API void PluginCopyZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroKeyColor(int sourceAnimationId, int targetAnimationId, int frameId, int rzkey); - /// - /// Copy zero key color from source animation to target animation for the specified - /// frame. Source and target are referenced by name. - /// EXPORT_API void PluginCopyZeroKeyColorName(const char* sourceAnimation, const char* targetAnimation, int frameId, int rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroKeyColorName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int rzkey); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyZeroKeyColorNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyZeroKeyColorNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double rzkey); - /// - /// Copy nonzero color from source animation to target animation where target - /// is zero for the frame. Source and target are referenced by id. - /// EXPORT_API void PluginCopyZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroTargetAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - /// Copy nonzero color from source animation to target animation where target - /// is zero for all frames. Source and target are referenced by id. - /// EXPORT_API void PluginCopyZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - /// Copy nonzero color from source animation to target animation where target - /// is zero for all frames. Source and target are referenced by name. - /// EXPORT_API void PluginCopyZeroTargetAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroTargetAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginCopyZeroTargetAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginCopyZeroTargetAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Copy nonzero color from source animation to target animation where target - /// is zero for the frame. Source and target are referenced by name. - /// EXPORT_API void PluginCopyZeroTargetAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCopyZeroTargetAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreCreateChromaLinkEffect(ChromaSDK::ChromaLink::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreCreateChromaLinkEffect(int effect, IntPtr pParam, out Guid pEffectId); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreCreateEffect(RZDEVICEID DeviceId, ChromaSDK::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreCreateEffect(Guid deviceId, int effect, IntPtr pParam, out Guid pEffectId); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreCreateHeadsetEffect(ChromaSDK::Headset::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreCreateHeadsetEffect(int effect, IntPtr pParam, out Guid pEffectId); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreCreateKeyboardEffect(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreCreateKeyboardEffect(int effect, IntPtr pParam, out Guid pEffectId); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreCreateKeypadEffect(ChromaSDK::Keypad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreCreateKeypadEffect(int effect, IntPtr pParam, out Guid pEffectId); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreCreateMouseEffect(ChromaSDK::Mouse::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreCreateMouseEffect(int effect, IntPtr pParam, out Guid pEffectId); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreCreateMousepadEffect(ChromaSDK::Mousepad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreCreateMousepadEffect(int effect, IntPtr pParam, out Guid pEffectId); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreDeleteEffect(RZEFFECTID EffectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreDeleteEffect(Guid effectId); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreInit(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreInit(); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreInitSDK(ChromaSDK::APPINFOTYPE* AppInfo); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreInitSDK(ref ChromaSDK.APPINFOTYPE appInfo); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreQueryDevice(RZDEVICEID DeviceId, ChromaSDK::DEVICE_INFO_TYPE& DeviceInfo); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreQueryDevice(Guid deviceId, out DEVICE_INFO_TYPE deviceInfo); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreSetEffect(RZEFFECTID EffectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreSetEffect(Guid effectId); - /// - /// Begin broadcasting Chroma RGB data using the stored stream key as the endpoint. - /// Intended for Cloud Gaming Platforms, restore the streaming key when the - /// game instance is launched to continue streaming. streamId is a null terminated - /// string streamKey is a null terminated string StreamGetStatus() should return - /// the READY status to use this method. - /// EXPORT_API bool PluginCoreStreamBroadcast(const char* streamId, const char* streamKey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginCoreStreamBroadcast(IntPtr streamId, IntPtr streamKey); - /// - /// End broadcasting Chroma RGB data. StreamGetStatus() should return the BROADCASTING - /// status to use this method. - /// EXPORT_API bool PluginCoreStreamBroadcastEnd(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginCoreStreamBroadcastEnd(); - /// - /// shortcode: Pass the address of a preallocated character buffer to get the - /// streaming auth code. The buffer should have a minimum length of 6. length: - /// Length will return as zero if the streaming auth code could not be obtained. - /// If length is greater than zero, it will be the length of the returned streaming - /// auth code. Once you have the shortcode, it should be shown to the user - /// so they can associate the stream with their Razer ID StreamGetStatus() - /// should return the READY status before invoking this method. platform: is - /// the null terminated string that identifies the source of the stream: { - /// GEFORCE_NOW, LUNA, STADIA, GAME_PASS } title: is the null terminated string - /// that identifies the application or game. - /// EXPORT_API void PluginCoreStreamGetAuthShortcode(char* shortcode, unsigned char* length, const wchar_t* platform, const wchar_t* title); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCoreStreamGetAuthShortcode(IntPtr shortcode, out byte length, IntPtr platform, IntPtr title); - /// - /// focus: Pass the address of a preallocated character buffer to get the stream - /// focus. The buffer should have a length of 48 length: Length will return - /// as zero if the stream focus could not be obtained. If length is greater - /// than zero, it will be the length of the returned stream focus. - /// EXPORT_API bool PluginCoreStreamGetFocus(char* focus, unsigned char* length); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginCoreStreamGetFocus(IntPtr focus, out byte length); - /// - /// Intended for Cloud Gaming Platforms, store the stream id to persist in user - /// preferences to continue streaming if the game is suspended or closed. shortcode: - /// The shortcode is a null terminated string. Use the shortcode that authorized - /// the stream to obtain the stream id. streamId should be a preallocated buffer - /// to get the stream key. The buffer should have a length of 48. length: Length - /// will return zero if the key could not be obtained. If the length is greater - /// than zero, it will be the length of the returned streaming id. Retrieve - /// the stream id after authorizing the shortcode. The authorization window - /// will expire in 5 minutes. Be sure to save the stream key before the window - /// expires. StreamGetStatus() should return the READY status to use this method. - /// - /// EXPORT_API void PluginCoreStreamGetId(const char* shortcode, char* streamId, unsigned char* length); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCoreStreamGetId(IntPtr shortcode, IntPtr streamId, out byte length); - /// - /// Intended for Cloud Gaming Platforms, store the streaming key to persist - /// in user preferences to continue streaming if the game is suspended or closed. - /// shortcode: The shortcode is a null terminated string. Use the shortcode - /// that authorized the stream to obtain the stream key. If the status is in - /// the BROADCASTING or WATCHING state, passing a NULL shortcode will return - /// the active streamId. streamKey should be a preallocated buffer to get the - /// stream key. The buffer should have a length of 48. length: Length will - /// return zero if the key could not be obtained. If the length is greater - /// than zero, it will be the length of the returned streaming key. Retrieve - /// the stream key after authorizing the shortcode. The authorization window - /// will expire in 5 minutes. Be sure to save the stream key before the window - /// expires. StreamGetStatus() should return the READY status to use this method. - /// - /// EXPORT_API void PluginCoreStreamGetKey(const char* shortcode, char* streamKey, unsigned char* length); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginCoreStreamGetKey(IntPtr shortcode, IntPtr streamKey, out byte length); - /// - /// Returns StreamStatus, the current status of the service - /// EXPORT_API ChromaSDK::Stream::StreamStatusType PluginCoreStreamGetStatus(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern ChromaSDK.Stream.StreamStatusType PluginCoreStreamGetStatus(); - /// - /// Convert StreamStatusType to a printable string - /// EXPORT_API const char* PluginCoreStreamGetStatusString(ChromaSDK::Stream::StreamStatusType status); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern IntPtr PluginCoreStreamGetStatusString(ChromaSDK.Stream.StreamStatusType status); - /// - /// This prevents the stream id and stream key from being obtained through the - /// shortcode. This closes the auth window. shortcode is a null terminated - /// string. StreamGetStatus() should return the READY status to use this method. - /// returns success when shortcode has been released - /// EXPORT_API bool PluginCoreStreamReleaseShortcode(const char* shortcode); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginCoreStreamReleaseShortcode(IntPtr shortcode); - /// - /// The focus is a null terminated string. Set the focus identifer for the application - /// designated to automatically change the streaming state. Returns true on - /// success. - /// EXPORT_API bool PluginCoreStreamSetFocus(const char* focus); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginCoreStreamSetFocus(IntPtr focus); - /// - /// Returns true if the Chroma streaming is supported. If false is returned, - /// avoid calling stream methods. - /// EXPORT_API bool PluginCoreStreamSupportsStreaming(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginCoreStreamSupportsStreaming(); - /// - /// Begin watching the Chroma RGB data using streamID parameter. streamId is - /// a null terminated string. StreamGetStatus() should return the READY status - /// to use this method. - /// EXPORT_API bool PluginCoreStreamWatch(const char* streamId, unsigned long long timestamp); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginCoreStreamWatch(IntPtr streamId, ulong timestamp); - /// - /// End watching Chroma RGB data stream. StreamGetStatus() should return the - /// WATCHING status to use this method. - /// EXPORT_API bool PluginCoreStreamWatchEnd(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginCoreStreamWatchEnd(); - /// - /// Direct access to low level API. - /// EXPORT_API RZRESULT PluginCoreUnInit(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCoreUnInit(); - /// - /// Creates a `Chroma` animation at the given path. The `deviceType` parameter - /// uses `EChromaSDKDeviceTypeEnum` as an integer. The `device` parameter uses - /// `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` as an integer, respective - /// to the `deviceType`. Returns the animation id upon success. Returns negative - /// one upon failure. Saves a `Chroma` animation file with the `.chroma` extension - /// at the given path. Returns the animation id upon success. Returns negative - /// one upon failure. - /// EXPORT_API int PluginCreateAnimation(const char* path, int deviceType, int device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCreateAnimation(IntPtr path, int deviceType, int device); - /// - /// Creates a `Chroma` animation in memory without creating a file. The `deviceType` - /// parameter uses `EChromaSDKDeviceTypeEnum` as an integer. The `device` parameter - /// uses `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` as an integer, - /// respective to the `deviceType`. Returns the animation id upon success. - /// Returns negative one upon failure. Returns the animation id upon success. - /// Returns negative one upon failure. - /// EXPORT_API int PluginCreateAnimationInMemory(int deviceType, int device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCreateAnimationInMemory(int deviceType, int device); - /// - /// Create a device specific effect. - /// EXPORT_API RZRESULT PluginCreateEffect(RZDEVICEID deviceId, ChromaSDK::EFFECT_TYPE effect, int* colors, int size, ChromaSDK::FChromaSDKGuid* effectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginCreateEffect(Guid deviceId, int effect, int[] colors, int size, out FChromaSDKGuid effectId); - /// - /// Delete an effect given the effect id. - /// EXPORT_API RZRESULT PluginDeleteEffect(const ChromaSDK::FChromaSDKGuid& effectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginDeleteEffect(Guid effectId); - /// - /// Duplicate the first animation frame so that the animation length matches - /// the frame count. Animation is referenced by id. - /// EXPORT_API void PluginDuplicateFirstFrame(int animationId, int frameCount); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginDuplicateFirstFrame(int animationId, int frameCount); - /// - /// Duplicate the first animation frame so that the animation length matches - /// the frame count. Animation is referenced by name. - /// EXPORT_API void PluginDuplicateFirstFrameName(const char* path, int frameCount); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginDuplicateFirstFrameName(IntPtr path, int frameCount); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginDuplicateFirstFrameNameD(const char* path, double frameCount); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginDuplicateFirstFrameNameD(IntPtr path, double frameCount); - /// - /// Duplicate all the frames of the animation to double the animation length. - /// Frame 1 becomes frame 1 and 2. Frame 2 becomes frame 3 and 4. And so on. - /// The animation is referenced by id. - /// EXPORT_API void PluginDuplicateFrames(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginDuplicateFrames(int animationId); - /// - /// Duplicate all the frames of the animation to double the animation length. - /// Frame 1 becomes frame 1 and 2. Frame 2 becomes frame 3 and 4. And so on. - /// The animation is referenced by name. - /// EXPORT_API void PluginDuplicateFramesName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginDuplicateFramesName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginDuplicateFramesNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginDuplicateFramesNameD(IntPtr path); - /// - /// Duplicate all the animation frames in reverse so that the animation plays - /// forwards and backwards. Animation is referenced by id. - /// EXPORT_API void PluginDuplicateMirrorFrames(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginDuplicateMirrorFrames(int animationId); - /// - /// Duplicate all the animation frames in reverse so that the animation plays - /// forwards and backwards. Animation is referenced by name. - /// EXPORT_API void PluginDuplicateMirrorFramesName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginDuplicateMirrorFramesName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginDuplicateMirrorFramesNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginDuplicateMirrorFramesNameD(IntPtr path); - /// - /// Fade the animation to black starting at the fade frame index to the end - /// of the animation. Animation is referenced by id. - /// EXPORT_API void PluginFadeEndFrames(int animationId, int fade); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFadeEndFrames(int animationId, int fade); - /// - /// Fade the animation to black starting at the fade frame index to the end - /// of the animation. Animation is referenced by name. - /// EXPORT_API void PluginFadeEndFramesName(const char* path, int fade); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFadeEndFramesName(IntPtr path, int fade); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFadeEndFramesNameD(const char* path, double fade); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFadeEndFramesNameD(IntPtr path, double fade); - /// - /// Fade the animation from black to full color starting at 0 to the fade frame - /// index. Animation is referenced by id. - /// EXPORT_API void PluginFadeStartFrames(int animationId, int fade); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFadeStartFrames(int animationId, int fade); - /// - /// Fade the animation from black to full color starting at 0 to the fade frame - /// index. Animation is referenced by name. - /// EXPORT_API void PluginFadeStartFramesName(const char* path, int fade); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFadeStartFramesName(IntPtr path, int fade); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFadeStartFramesNameD(const char* path, double fade); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFadeStartFramesNameD(IntPtr path, double fade); - /// - /// Set the RGB value for all colors in the specified frame. Animation is referenced - /// by id. - /// EXPORT_API void PluginFillColor(int animationId, int frameId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillColor(int animationId, int frameId, int color); - /// - /// Set the RGB value for all colors for all frames. Animation is referenced - /// by id. - /// EXPORT_API void PluginFillColorAllFrames(int animationId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillColorAllFrames(int animationId, int color); - /// - /// Set the RGB value for all colors for all frames. Animation is referenced - /// by name. - /// EXPORT_API void PluginFillColorAllFramesName(const char* path, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillColorAllFramesName(IntPtr path, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillColorAllFramesNameD(const char* path, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillColorAllFramesNameD(IntPtr path, double color); - /// - /// Set the RGB value for all colors for all frames. Use the range of 0 to 255 - /// for red, green, and blue parameters. Animation is referenced by id. - /// EXPORT_API void PluginFillColorAllFramesRGB(int animationId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillColorAllFramesRGB(int animationId, int red, int green, int blue); - /// - /// Set the RGB value for all colors for all frames. Use the range of 0 to 255 - /// for red, green, and blue parameters. Animation is referenced by name. - /// EXPORT_API void PluginFillColorAllFramesRGBName(const char* path, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillColorAllFramesRGBName(IntPtr path, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillColorAllFramesRGBNameD(const char* path, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillColorAllFramesRGBNameD(IntPtr path, double red, double green, double blue); - /// - /// Set the RGB value for all colors in the specified frame. Animation is referenced - /// by name. - /// EXPORT_API void PluginFillColorName(const char* path, int frameId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillColorName(IntPtr path, int frameId, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillColorNameD(const char* path, double frameId, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillColorNameD(IntPtr path, double frameId, double color); - /// - /// Set the RGB value for all colors in the specified frame. Animation is referenced - /// by id. - /// EXPORT_API void PluginFillColorRGB(int animationId, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillColorRGB(int animationId, int frameId, int red, int green, int blue); - /// - /// Set the RGB value for all colors in the specified frame. Animation is referenced - /// by name. - /// EXPORT_API void PluginFillColorRGBName(const char* path, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillColorRGBName(IntPtr path, int frameId, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillColorRGBNameD(const char* path, double frameId, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillColorRGBNameD(IntPtr path, double frameId, double red, double green, double blue); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors in the specified - /// frame. Animation is referenced by id. - /// EXPORT_API void PluginFillNonZeroColor(int animationId, int frameId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillNonZeroColor(int animationId, int frameId, int color); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors for all frames. - /// Animation is referenced by id. - /// EXPORT_API void PluginFillNonZeroColorAllFrames(int animationId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillNonZeroColorAllFrames(int animationId, int color); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors for all frames. - /// Animation is referenced by name. - /// EXPORT_API void PluginFillNonZeroColorAllFramesName(const char* path, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillNonZeroColorAllFramesName(IntPtr path, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillNonZeroColorAllFramesNameD(const char* path, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillNonZeroColorAllFramesNameD(IntPtr path, double color); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors for all frames. - /// Use the range of 0 to 255 for red, green, and blue parameters. Animation - /// is referenced by id. - /// EXPORT_API void PluginFillNonZeroColorAllFramesRGB(int animationId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillNonZeroColorAllFramesRGB(int animationId, int red, int green, int blue); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors for all frames. - /// Use the range of 0 to 255 for red, green, and blue parameters. Animation - /// is referenced by name. - /// EXPORT_API void PluginFillNonZeroColorAllFramesRGBName(const char* path, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillNonZeroColorAllFramesRGBName(IntPtr path, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillNonZeroColorAllFramesRGBNameD(const char* path, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillNonZeroColorAllFramesRGBNameD(IntPtr path, double red, double green, double blue); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors in the specified - /// frame. Animation is referenced by name. - /// EXPORT_API void PluginFillNonZeroColorName(const char* path, int frameId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillNonZeroColorName(IntPtr path, int frameId, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillNonZeroColorNameD(const char* path, double frameId, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillNonZeroColorNameD(IntPtr path, double frameId, double color); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors in the specified - /// frame. Use the range of 0 to 255 for red, green, and blue parameters. Animation - /// is referenced by id. - /// EXPORT_API void PluginFillNonZeroColorRGB(int animationId, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillNonZeroColorRGB(int animationId, int frameId, int red, int green, int blue); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Set the RGB value for a subset of colors in the specified - /// frame. Use the range of 0 to 255 for red, green, and blue parameters. Animation - /// is referenced by name. - /// EXPORT_API void PluginFillNonZeroColorRGBName(const char* path, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillNonZeroColorRGBName(IntPtr path, int frameId, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillNonZeroColorRGBNameD(const char* path, double frameId, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillNonZeroColorRGBNameD(IntPtr path, double frameId, double red, double green, double blue); - /// - /// Fill the frame with random RGB values for the given frame. Animation is - /// referenced by id. - /// EXPORT_API void PluginFillRandomColors(int animationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillRandomColors(int animationId, int frameId); - /// - /// Fill the frame with random RGB values for all frames. Animation is referenced - /// by id. - /// EXPORT_API void PluginFillRandomColorsAllFrames(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillRandomColorsAllFrames(int animationId); - /// - /// Fill the frame with random RGB values for all frames. Animation is referenced - /// by name. - /// EXPORT_API void PluginFillRandomColorsAllFramesName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillRandomColorsAllFramesName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillRandomColorsAllFramesNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillRandomColorsAllFramesNameD(IntPtr path); - /// - /// Fill the frame with random black and white values for the specified frame. - /// Animation is referenced by id. - /// EXPORT_API void PluginFillRandomColorsBlackAndWhite(int animationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillRandomColorsBlackAndWhite(int animationId, int frameId); - /// - /// Fill the frame with random black and white values for all frames. Animation - /// is referenced by id. - /// EXPORT_API void PluginFillRandomColorsBlackAndWhiteAllFrames(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillRandomColorsBlackAndWhiteAllFrames(int animationId); - /// - /// Fill the frame with random black and white values for all frames. Animation - /// is referenced by name. - /// EXPORT_API void PluginFillRandomColorsBlackAndWhiteAllFramesName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillRandomColorsBlackAndWhiteAllFramesName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillRandomColorsBlackAndWhiteAllFramesNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillRandomColorsBlackAndWhiteAllFramesNameD(IntPtr path); - /// - /// Fill the frame with random black and white values for the specified frame. - /// Animation is referenced by name. - /// EXPORT_API void PluginFillRandomColorsBlackAndWhiteName(const char* path, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillRandomColorsBlackAndWhiteName(IntPtr path, int frameId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillRandomColorsBlackAndWhiteNameD(const char* path, double frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillRandomColorsBlackAndWhiteNameD(IntPtr path, double frameId); - /// - /// Fill the frame with random RGB values for the given frame. Animation is - /// referenced by name. - /// EXPORT_API void PluginFillRandomColorsName(const char* path, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillRandomColorsName(IntPtr path, int frameId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillRandomColorsNameD(const char* path, double frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillRandomColorsNameD(IntPtr path, double frameId); - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by id. - /// EXPORT_API void PluginFillThresholdColors(int animationId, int frameId, int threshold, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColors(int animationId, int frameId, int threshold, int color); - /// - /// Fill all frames with RGB color where the animation color is less than the - /// RGB threshold. Animation is referenced by id. - /// EXPORT_API void PluginFillThresholdColorsAllFrames(int animationId, int threshold, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsAllFrames(int animationId, int threshold, int color); - /// - /// Fill all frames with RGB color where the animation color is less than the - /// RGB threshold. Animation is referenced by name. - /// EXPORT_API void PluginFillThresholdColorsAllFramesName(const char* path, int threshold, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsAllFramesName(IntPtr path, int threshold, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillThresholdColorsAllFramesNameD(const char* path, double threshold, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillThresholdColorsAllFramesNameD(IntPtr path, double threshold, double color); - /// - /// Fill all frames with RGB color where the animation color is less than the - /// threshold. Animation is referenced by id. - /// EXPORT_API void PluginFillThresholdColorsAllFramesRGB(int animationId, int threshold, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsAllFramesRGB(int animationId, int threshold, int red, int green, int blue); - /// - /// Fill all frames with RGB color where the animation color is less than the - /// threshold. Animation is referenced by name. - /// EXPORT_API void PluginFillThresholdColorsAllFramesRGBName(const char* path, int threshold, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsAllFramesRGBName(IntPtr path, int threshold, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillThresholdColorsAllFramesRGBNameD(const char* path, double threshold, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillThresholdColorsAllFramesRGBNameD(IntPtr path, double threshold, double red, double green, double blue); - /// - /// Fill all frames with the min RGB color where the animation color is less - /// than the min threshold AND with the max RGB color where the animation is - /// more than the max threshold. Animation is referenced by id. - /// EXPORT_API void PluginFillThresholdColorsMinMaxAllFramesRGB(int animationId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsMinMaxAllFramesRGB(int animationId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - /// Fill all frames with the min RGB color where the animation color is less - /// than the min threshold AND with the max RGB color where the animation is - /// more than the max threshold. Animation is referenced by name. - /// EXPORT_API void PluginFillThresholdColorsMinMaxAllFramesRGBName(const char* path, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsMinMaxAllFramesRGBName(IntPtr path, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillThresholdColorsMinMaxAllFramesRGBNameD(const char* path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillThresholdColorsMinMaxAllFramesRGBNameD(IntPtr path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); - /// - /// Fill the specified frame with the min RGB color where the animation color - /// is less than the min threshold AND with the max RGB color where the animation - /// is more than the max threshold. Animation is referenced by id. - /// EXPORT_API void PluginFillThresholdColorsMinMaxRGB(int animationId, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsMinMaxRGB(int animationId, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - /// Fill the specified frame with the min RGB color where the animation color - /// is less than the min threshold AND with the max RGB color where the animation - /// is more than the max threshold. Animation is referenced by name. - /// EXPORT_API void PluginFillThresholdColorsMinMaxRGBName(const char* path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsMinMaxRGBName(IntPtr path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillThresholdColorsMinMaxRGBNameD(const char* path, double frameId, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillThresholdColorsMinMaxRGBNameD(IntPtr path, double frameId, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by name. - /// EXPORT_API void PluginFillThresholdColorsName(const char* path, int frameId, int threshold, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsName(IntPtr path, int frameId, int threshold, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillThresholdColorsNameD(const char* path, double frameId, double threshold, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillThresholdColorsNameD(IntPtr path, double frameId, double threshold, double color); - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by id. - /// EXPORT_API void PluginFillThresholdColorsRGB(int animationId, int frameId, int threshold, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsRGB(int animationId, int frameId, int threshold, int red, int green, int blue); - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by name. - /// EXPORT_API void PluginFillThresholdColorsRGBName(const char* path, int frameId, int threshold, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdColorsRGBName(IntPtr path, int frameId, int threshold, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillThresholdColorsRGBNameD(const char* path, double frameId, double threshold, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillThresholdColorsRGBNameD(IntPtr path, double frameId, double threshold, double red, double green, double blue); - /// - /// Fill all frames with RGB color where the animation color is less than the - /// RGB threshold. Animation is referenced by id. - /// EXPORT_API void PluginFillThresholdRGBColorsAllFramesRGB(int animationId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdRGBColorsAllFramesRGB(int animationId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); - /// - /// Fill all frames with RGB color where the animation color is less than the - /// RGB threshold. Animation is referenced by name. - /// EXPORT_API void PluginFillThresholdRGBColorsAllFramesRGBName(const char* path, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdRGBColorsAllFramesRGBName(IntPtr path, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillThresholdRGBColorsAllFramesRGBNameD(const char* path, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillThresholdRGBColorsAllFramesRGBNameD(IntPtr path, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue); - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by id. - /// EXPORT_API void PluginFillThresholdRGBColorsRGB(int animationId, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdRGBColorsRGB(int animationId, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); - /// - /// Fill the specified frame with RGB color where the animation color is less - /// than the RGB threshold. Animation is referenced by name. - /// EXPORT_API void PluginFillThresholdRGBColorsRGBName(const char* path, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillThresholdRGBColorsRGBName(IntPtr path, int frameId, int redThreshold, int greenThreshold, int blueThreshold, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillThresholdRGBColorsRGBNameD(const char* path, double frameId, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillThresholdRGBColorsRGBNameD(IntPtr path, double frameId, double redThreshold, double greenThreshold, double blueThreshold, double red, double green, double blue); - /// - /// Fill the specified frame with RGB color where the animation color is zero. - /// Animation is referenced by id. - /// EXPORT_API void PluginFillZeroColor(int animationId, int frameId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillZeroColor(int animationId, int frameId, int color); - /// - /// Fill all frames with RGB color where the animation color is zero. Animation - /// is referenced by id. - /// EXPORT_API void PluginFillZeroColorAllFrames(int animationId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillZeroColorAllFrames(int animationId, int color); - /// - /// Fill all frames with RGB color where the animation color is zero. Animation - /// is referenced by name. - /// EXPORT_API void PluginFillZeroColorAllFramesName(const char* path, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillZeroColorAllFramesName(IntPtr path, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillZeroColorAllFramesNameD(const char* path, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillZeroColorAllFramesNameD(IntPtr path, double color); - /// - /// Fill all frames with RGB color where the animation color is zero. Animation - /// is referenced by id. - /// EXPORT_API void PluginFillZeroColorAllFramesRGB(int animationId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillZeroColorAllFramesRGB(int animationId, int red, int green, int blue); - /// - /// Fill all frames with RGB color where the animation color is zero. Animation - /// is referenced by name. - /// EXPORT_API void PluginFillZeroColorAllFramesRGBName(const char* path, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillZeroColorAllFramesRGBName(IntPtr path, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillZeroColorAllFramesRGBNameD(const char* path, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillZeroColorAllFramesRGBNameD(IntPtr path, double red, double green, double blue); - /// - /// Fill the specified frame with RGB color where the animation color is zero. - /// Animation is referenced by name. - /// EXPORT_API void PluginFillZeroColorName(const char* path, int frameId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillZeroColorName(IntPtr path, int frameId, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillZeroColorNameD(const char* path, double frameId, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillZeroColorNameD(IntPtr path, double frameId, double color); - /// - /// Fill the specified frame with RGB color where the animation color is zero. - /// Animation is referenced by id. - /// EXPORT_API void PluginFillZeroColorRGB(int animationId, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillZeroColorRGB(int animationId, int frameId, int red, int green, int blue); - /// - /// Fill the specified frame with RGB color where the animation color is zero. - /// Animation is referenced by name. - /// EXPORT_API void PluginFillZeroColorRGBName(const char* path, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginFillZeroColorRGBName(IntPtr path, int frameId, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginFillZeroColorRGBNameD(const char* path, double frameId, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginFillZeroColorRGBNameD(IntPtr path, double frameId, double red, double green, double blue); - /// - /// Get the animation color for a frame given the `1D` `led`. The `led` should - /// be greater than or equal to 0 and less than the `MaxLeds`. Animation is - /// referenced by id. - /// EXPORT_API int PluginGet1DColor(int animationId, int frameId, int led); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGet1DColor(int animationId, int frameId, int led); - /// - /// Get the animation color for a frame given the `1D` `led`. The `led` should - /// be greater than or equal to 0 and less than the `MaxLeds`. Animation is - /// referenced by name. - /// EXPORT_API int PluginGet1DColorName(const char* path, int frameId, int led); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGet1DColorName(IntPtr path, int frameId, int led); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGet1DColorNameD(const char* path, double frameId, double led); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGet1DColorNameD(IntPtr path, double frameId, double led); - /// - /// Get the animation color for a frame given the `2D` `row` and `column`. The - /// `row` should be greater than or equal to 0 and less than the `MaxRow`. - /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. - /// Animation is referenced by id. - /// EXPORT_API int PluginGet2DColor(int animationId, int frameId, int row, int column); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGet2DColor(int animationId, int frameId, int row, int column); - /// - /// Get the animation color for a frame given the `2D` `row` and `column`. The - /// `row` should be greater than or equal to 0 and less than the `MaxRow`. - /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. - /// Animation is referenced by name. - /// EXPORT_API int PluginGet2DColorName(const char* path, int frameId, int row, int column); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGet2DColorName(IntPtr path, int frameId, int row, int column); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGet2DColorNameD(const char* path, double frameId, double row, double column); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGet2DColorNameD(IntPtr path, double frameId, double row, double column); - /// - /// Get the animation id for the named animation. - /// EXPORT_API int PluginGetAnimation(const char* name); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetAnimation(IntPtr name); - /// - /// `PluginGetAnimationCount` will return the number of loaded animations. - /// EXPORT_API int PluginGetAnimationCount(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetAnimationCount(); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetAnimationD(const char* name); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetAnimationD(IntPtr name); - /// - /// `PluginGetAnimationId` will return the `animationId` given the `index` of - /// the loaded animation. The `index` is zero-based and less than the number - /// returned by `PluginGetAnimationCount`. Use `PluginGetAnimationName` to - /// get the name of the animation. - /// EXPORT_API int PluginGetAnimationId(int index); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetAnimationId(int index); - /// - /// `PluginGetAnimationName` takes an `animationId` and returns the name of - /// the animation of the `.chroma` animation file. If a name is not available - /// then an empty string will be returned. - /// EXPORT_API const char* PluginGetAnimationName(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern IntPtr PluginGetAnimationName(int animationId); - /// - /// Get the current frame of the animation referenced by id. - /// EXPORT_API int PluginGetCurrentFrame(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetCurrentFrame(int animationId); - /// - /// Get the current frame of the animation referenced by name. - /// EXPORT_API int PluginGetCurrentFrameName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetCurrentFrameName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetCurrentFrameNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetCurrentFrameNameD(IntPtr path); - /// - /// Returns the `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` of a `Chroma` - /// animation respective to the `deviceType`, as an integer upon success. Returns - /// negative one upon failure. - /// EXPORT_API int PluginGetDevice(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetDevice(int animationId); - /// - /// Returns the `EChromaSDKDevice1DEnum` or `EChromaSDKDevice2DEnum` of a `Chroma` - /// animation respective to the `deviceType`, as an integer upon success. Returns - /// negative one upon failure. - /// EXPORT_API int PluginGetDeviceName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetDeviceName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetDeviceNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetDeviceNameD(IntPtr path); - /// - /// Returns the `EChromaSDKDeviceTypeEnum` of a `Chroma` animation as an integer - /// upon success. Returns negative one upon failure. - /// EXPORT_API int PluginGetDeviceType(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetDeviceType(int animationId); - /// - /// Returns the `EChromaSDKDeviceTypeEnum` of a `Chroma` animation as an integer - /// upon success. Returns negative one upon failure. - /// EXPORT_API int PluginGetDeviceTypeName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetDeviceTypeName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetDeviceTypeNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetDeviceTypeNameD(IntPtr path); - /// - /// Get the frame colors and duration (in seconds) for a `Chroma` animation - /// referenced by id. The `color` is expected to be an array of the expected - /// dimensions for the `deviceType/device`. The `length` parameter is the size - /// of the `color` array. For `EChromaSDKDevice1DEnum` the array size should - /// be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should be `MAX - /// ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard - /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the - /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. - /// Returns the animation id upon success. Returns negative one upon failure. - /// - /// EXPORT_API int PluginGetFrame(int animationId, int frameIndex, float* duration, int* colors, int length, int* keys, int keysLength); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetFrame(int animationId, int frameIndex, out float duration, int[] colors, int length, int[] keys, int keysLength); - /// - /// Returns the frame count of a `Chroma` animation upon success. Returns negative - /// one upon failure. - /// EXPORT_API int PluginGetFrameCount(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetFrameCount(int animationId); - /// - /// Returns the frame count of a `Chroma` animation upon success. Returns negative - /// one upon failure. - /// EXPORT_API int PluginGetFrameCountName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetFrameCountName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetFrameCountNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetFrameCountNameD(IntPtr path); - /// - /// Get the frame colors and duration (in seconds) for a `Chroma` animation - /// referenced by name. The `color` is expected to be an array of the expected - /// dimensions for the `deviceType/device`. The `length` parameter is the size - /// of the `color` array. For `EChromaSDKDevice1DEnum` the array size should - /// be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should be `MAX - /// ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard - /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the - /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. - /// Returns the animation id upon success. Returns negative one upon failure. - /// - /// EXPORT_API int PluginGetFrameName(const char* path, int frameIndex, float* duration, int* colors, int length, int* keys, int keysLength); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetFrameName(IntPtr path, int frameIndex, out float duration, int[] colors, int length, int[] keys, int keysLength); - /// - /// Get the color of an animation key for the given frame referenced by id. - /// - /// EXPORT_API int PluginGetKeyColor(int animationId, int frameId, int rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetKeyColor(int animationId, int frameId, int rzkey); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetKeyColorD(const char* path, double frameId, double rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetKeyColorD(IntPtr path, double frameId, double rzkey); - /// - /// Get the color of an animation key for the given frame referenced by name. - /// - /// EXPORT_API int PluginGetKeyColorName(const char* path, int frameId, int rzkey); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetKeyColorName(IntPtr path, int frameId, int rzkey); - /// - /// Returns `RZRESULT_SUCCESS` if the plugin has been initialized successfully. - /// Returns `RZRESULT_DLL_NOT_FOUND` if core Chroma library is not found. Returns - /// `RZRESULT_DLL_INVALID_SIGNATURE` if core Chroma library has an invalid - /// signature. - /// EXPORT_API RZRESULT PluginGetLibraryLoadedState(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetLibraryLoadedState(); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetLibraryLoadedStateD(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetLibraryLoadedStateD(); - /// - /// Returns the `MAX COLUMN` given the `EChromaSDKDevice2DEnum` device as an - /// integer upon success. Returns negative one upon failure. - /// EXPORT_API int PluginGetMaxColumn(int device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetMaxColumn(int device); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetMaxColumnD(double device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetMaxColumnD(double device); - /// - /// Returns the MAX LEDS given the `EChromaSDKDevice1DEnum` device as an integer - /// upon success. Returns negative one upon failure. - /// EXPORT_API int PluginGetMaxLeds(int device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetMaxLeds(int device); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetMaxLedsD(double device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetMaxLedsD(double device); - /// - /// Returns the `MAX ROW` given the `EChromaSDKDevice2DEnum` device as an integer - /// upon success. Returns negative one upon failure. - /// EXPORT_API int PluginGetMaxRow(int device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetMaxRow(int device); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetMaxRowD(double device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetMaxRowD(double device); - /// - /// `PluginGetPlayingAnimationCount` will return the number of playing animations. - /// - /// EXPORT_API int PluginGetPlayingAnimationCount(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetPlayingAnimationCount(); - /// - /// `PluginGetPlayingAnimationId` will return the `animationId` given the `index` - /// of the playing animation. The `index` is zero-based and less than the number - /// returned by `PluginGetPlayingAnimationCount`. Use `PluginGetAnimationName` - /// to get the name of the animation. - /// EXPORT_API int PluginGetPlayingAnimationId(int index); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetPlayingAnimationId(int index); - /// - /// Get the RGB color given red, green, and blue. - /// EXPORT_API int PluginGetRGB(int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginGetRGB(int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginGetRGBD(double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginGetRGBD(double red, double green, double blue); - /// - /// Check if the animation has loop enabled referenced by id. - /// EXPORT_API bool PluginHasAnimationLoop(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginHasAnimationLoop(int animationId); - /// - /// Check if the animation has loop enabled referenced by name. - /// EXPORT_API bool PluginHasAnimationLoopName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginHasAnimationLoopName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginHasAnimationLoopNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginHasAnimationLoopNameD(IntPtr path); - /// - /// Initialize the ChromaSDK. Zero indicates success, otherwise failure. Many - /// API methods auto initialize the ChromaSDK if not already initialized. - /// EXPORT_API RZRESULT PluginInit(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginInit(); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginInitD(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginInitD(); - /// - /// Initialize the ChromaSDK. AppInfo populates the details in Synapse. Zero - /// indicates success, otherwise failure. Many API methods auto initialize - /// the ChromaSDK if not already initialized. - /// EXPORT_API RZRESULT PluginInitSDK(ChromaSDK::APPINFOTYPE* AppInfo); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginInitSDK(ref ChromaSDK.APPINFOTYPE appInfo); - /// - /// Insert an animation delay by duplicating the frame by the delay number of - /// times. Animation is referenced by id. - /// EXPORT_API void PluginInsertDelay(int animationId, int frameId, int delay); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginInsertDelay(int animationId, int frameId, int delay); - /// - /// Insert an animation delay by duplicating the frame by the delay number of - /// times. Animation is referenced by name. - /// EXPORT_API void PluginInsertDelayName(const char* path, int frameId, int delay); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginInsertDelayName(IntPtr path, int frameId, int delay); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginInsertDelayNameD(const char* path, double frameId, double delay); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginInsertDelayNameD(IntPtr path, double frameId, double delay); - /// - /// Duplicate the source frame index at the target frame index. Animation is - /// referenced by id. - /// EXPORT_API void PluginInsertFrame(int animationId, int sourceFrame, int targetFrame); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginInsertFrame(int animationId, int sourceFrame, int targetFrame); - /// - /// Duplicate the source frame index at the target frame index. Animation is - /// referenced by name. - /// EXPORT_API void PluginInsertFrameName(const char* path, int sourceFrame, int targetFrame); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginInsertFrameName(IntPtr path, int sourceFrame, int targetFrame); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginInsertFrameNameD(const char* path, double sourceFrame, double targetFrame); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginInsertFrameNameD(IntPtr path, double sourceFrame, double targetFrame); - /// - /// Invert all the colors at the specified frame. Animation is referenced by - /// id. - /// EXPORT_API void PluginInvertColors(int animationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginInvertColors(int animationId, int frameId); - /// - /// Invert all the colors for all frames. Animation is referenced by id. - /// EXPORT_API void PluginInvertColorsAllFrames(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginInvertColorsAllFrames(int animationId); - /// - /// Invert all the colors for all frames. Animation is referenced by name. - /// EXPORT_API void PluginInvertColorsAllFramesName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginInvertColorsAllFramesName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginInvertColorsAllFramesNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginInvertColorsAllFramesNameD(IntPtr path); - /// - /// Invert all the colors at the specified frame. Animation is referenced by - /// name. - /// EXPORT_API void PluginInvertColorsName(const char* path, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginInvertColorsName(IntPtr path, int frameId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginInvertColorsNameD(const char* path, double frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginInvertColorsNameD(IntPtr path, double frameId); - /// - /// Check if the animation is paused referenced by id. - /// EXPORT_API bool PluginIsAnimationPaused(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginIsAnimationPaused(int animationId); - /// - /// Check if the animation is paused referenced by name. - /// EXPORT_API bool PluginIsAnimationPausedName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginIsAnimationPausedName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginIsAnimationPausedNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginIsAnimationPausedNameD(IntPtr path); - /// - /// The editor dialog is a non-blocking modal window, this method returns true - /// if the modal window is open, otherwise false. - /// EXPORT_API bool PluginIsDialogOpen(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginIsDialogOpen(); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginIsDialogOpenD(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginIsDialogOpenD(); - /// - /// Returns true if the plugin has been initialized. Returns false if the plugin - /// is uninitialized. - /// EXPORT_API bool PluginIsInitialized(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginIsInitialized(); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginIsInitializedD(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginIsInitializedD(); - /// - /// If the method can be invoked the method returns true. - /// EXPORT_API bool PluginIsPlatformSupported(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginIsPlatformSupported(); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginIsPlatformSupportedD(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginIsPlatformSupportedD(); - /// - /// `PluginIsPlayingName` automatically handles initializing the `ChromaSDK`. - /// The named `.chroma` animation file will be automatically opened. The method - /// will return whether the animation is playing or not. Animation is referenced - /// by id. - /// EXPORT_API bool PluginIsPlaying(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginIsPlaying(int animationId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginIsPlayingD(double animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginIsPlayingD(double animationId); - /// - /// `PluginIsPlayingName` automatically handles initializing the `ChromaSDK`. - /// The named `.chroma` animation file will be automatically opened. The method - /// will return whether the animation is playing or not. Animation is referenced - /// by name. - /// EXPORT_API bool PluginIsPlayingName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginIsPlayingName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginIsPlayingNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginIsPlayingNameD(IntPtr path); - /// - /// `PluginIsPlayingType` automatically handles initializing the `ChromaSDK`. - /// If any animation is playing for the `deviceType` and `device` combination, - /// the method will return true, otherwise false. - /// EXPORT_API bool PluginIsPlayingType(int deviceType, int device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - private static extern bool PluginIsPlayingType(int deviceType, int device); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginIsPlayingTypeD(double deviceType, double device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginIsPlayingTypeD(double deviceType, double device); - /// - /// Do a lerp math operation on a float. - /// EXPORT_API float PluginLerp(float start, float end, float amt); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern float PluginLerp(float start, float end, float amt); - /// - /// Lerp from one color to another given t in the range 0.0 to 1.0. - /// EXPORT_API int PluginLerpColor(int from, int to, float t); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginLerpColor(int from, int to, float t); - /// - /// Loads `Chroma` effects so that the animation can be played immediately. - /// Returns the animation id upon success. Returns negative one upon failure. - /// - /// EXPORT_API int PluginLoadAnimation(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginLoadAnimation(int animationId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginLoadAnimationD(double animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginLoadAnimationD(double animationId); - /// - /// Load the named animation. - /// EXPORT_API void PluginLoadAnimationName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginLoadAnimationName(IntPtr path); - /// - /// Load a composite set of animations. - /// EXPORT_API void PluginLoadComposite(const char* name); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginLoadComposite(IntPtr name); - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color defaults to color. Animation - /// is referenced by id. - /// EXPORT_API void PluginMakeBlankFrames(int animationId, int frameCount, float duration, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMakeBlankFrames(int animationId, int frameCount, float duration, int color); - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color defaults to color. Animation - /// is referenced by name. - /// EXPORT_API void PluginMakeBlankFramesName(const char* path, int frameCount, float duration, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMakeBlankFramesName(IntPtr path, int frameCount, float duration, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMakeBlankFramesNameD(const char* path, double frameCount, double duration, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMakeBlankFramesNameD(IntPtr path, double frameCount, double duration, double color); - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color is random. Animation is referenced - /// by id. - /// EXPORT_API void PluginMakeBlankFramesRandom(int animationId, int frameCount, float duration); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMakeBlankFramesRandom(int animationId, int frameCount, float duration); - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color is random black and white. Animation - /// is referenced by id. - /// EXPORT_API void PluginMakeBlankFramesRandomBlackAndWhite(int animationId, int frameCount, float duration); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMakeBlankFramesRandomBlackAndWhite(int animationId, int frameCount, float duration); - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color is random black and white. Animation - /// is referenced by name. - /// EXPORT_API void PluginMakeBlankFramesRandomBlackAndWhiteName(const char* path, int frameCount, float duration); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMakeBlankFramesRandomBlackAndWhiteName(IntPtr path, int frameCount, float duration); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMakeBlankFramesRandomBlackAndWhiteNameD(const char* path, double frameCount, double duration); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMakeBlankFramesRandomBlackAndWhiteNameD(IntPtr path, double frameCount, double duration); - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color is random. Animation is referenced - /// by name. - /// EXPORT_API void PluginMakeBlankFramesRandomName(const char* path, int frameCount, float duration); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMakeBlankFramesRandomName(IntPtr path, int frameCount, float duration); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMakeBlankFramesRandomNameD(const char* path, double frameCount, double duration); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMakeBlankFramesRandomNameD(IntPtr path, double frameCount, double duration); - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color defaults to color. Animation - /// is referenced by id. - /// EXPORT_API void PluginMakeBlankFramesRGB(int animationId, int frameCount, float duration, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMakeBlankFramesRGB(int animationId, int frameCount, float duration, int red, int green, int blue); - /// - /// Make a blank animation for the length of the frame count. Frame duration - /// defaults to the duration. The frame color defaults to color. Animation - /// is referenced by name. - /// EXPORT_API void PluginMakeBlankFramesRGBName(const char* path, int frameCount, float duration, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMakeBlankFramesRGBName(IntPtr path, int frameCount, float duration, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMakeBlankFramesRGBNameD(const char* path, double frameCount, double duration, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMakeBlankFramesRGBNameD(IntPtr path, double frameCount, double duration, double red, double green, double blue); - /// - /// Flips the color grid horizontally for all `Chroma` animation frames. Returns - /// the animation id upon success. Returns negative one upon failure. - /// EXPORT_API int PluginMirrorHorizontally(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginMirrorHorizontally(int animationId); - /// - /// Flips the color grid vertically for all `Chroma` animation frames. This - /// method has no effect for `EChromaSDKDevice1DEnum` devices. Returns the - /// animation id upon success. Returns negative one upon failure. - /// EXPORT_API int PluginMirrorVertically(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginMirrorVertically(int animationId); - /// - /// Multiply the color intensity with the lerp result from color 1 to color - /// 2 using the frame index divided by the frame count for the `t` parameter. - /// Animation is referenced in id. - /// EXPORT_API void PluginMultiplyColorLerpAllFrames(int animationId, int color1, int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyColorLerpAllFrames(int animationId, int color1, int color2); - /// - /// Multiply the color intensity with the lerp result from color 1 to color - /// 2 using the frame index divided by the frame count for the `t` parameter. - /// Animation is referenced in name. - /// EXPORT_API void PluginMultiplyColorLerpAllFramesName(const char* path, int color1, int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyColorLerpAllFramesName(IntPtr path, int color1, int color2); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyColorLerpAllFramesNameD(const char* path, double color1, double color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyColorLerpAllFramesNameD(IntPtr path, double color1, double color2); - /// - /// Multiply all the colors in the frame by the intensity value. The valid the - /// intensity range is from 0.0 to 255.0. RGB components are multiplied equally. - /// An intensity of 0.5 would half the color value. Black colors in the frame - /// will not be affected by this method. - /// EXPORT_API void PluginMultiplyIntensity(int animationId, int frameId, float intensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensity(int animationId, int frameId, float intensity); - /// - /// Multiply all the colors for all frames by the intensity value. The valid - /// the intensity range is from 0.0 to 255.0. RGB components are multiplied - /// equally. An intensity of 0.5 would half the color value. Black colors in - /// the frame will not be affected by this method. - /// EXPORT_API void PluginMultiplyIntensityAllFrames(int animationId, float intensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityAllFrames(int animationId, float intensity); - /// - /// Multiply all the colors for all frames by the intensity value. The valid - /// the intensity range is from 0.0 to 255.0. RGB components are multiplied - /// equally. An intensity of 0.5 would half the color value. Black colors in - /// the frame will not be affected by this method. - /// EXPORT_API void PluginMultiplyIntensityAllFramesName(const char* path, float intensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityAllFramesName(IntPtr path, float intensity); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyIntensityAllFramesNameD(const char* path, double intensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyIntensityAllFramesNameD(IntPtr path, double intensity); - /// - /// Multiply all frames by the RBG color intensity. Animation is referenced - /// by id. - /// EXPORT_API void PluginMultiplyIntensityAllFramesRGB(int animationId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityAllFramesRGB(int animationId, int red, int green, int blue); - /// - /// Multiply all frames by the RBG color intensity. Animation is referenced - /// by name. - /// EXPORT_API void PluginMultiplyIntensityAllFramesRGBName(const char* path, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityAllFramesRGBName(IntPtr path, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyIntensityAllFramesRGBNameD(const char* path, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyIntensityAllFramesRGBNameD(IntPtr path, double red, double green, double blue); - /// - /// Multiply the specific frame by the RBG color intensity. Animation is referenced - /// by id. - /// EXPORT_API void PluginMultiplyIntensityColor(int animationId, int frameId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityColor(int animationId, int frameId, int color); - /// - /// Multiply all frames by the RBG color intensity. Animation is referenced - /// by id. - /// EXPORT_API void PluginMultiplyIntensityColorAllFrames(int animationId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityColorAllFrames(int animationId, int color); - /// - /// Multiply all frames by the RBG color intensity. Animation is referenced - /// by name. - /// EXPORT_API void PluginMultiplyIntensityColorAllFramesName(const char* path, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityColorAllFramesName(IntPtr path, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyIntensityColorAllFramesNameD(const char* path, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyIntensityColorAllFramesNameD(IntPtr path, double color); - /// - /// Multiply the specific frame by the RBG color intensity. Animation is referenced - /// by name. - /// EXPORT_API void PluginMultiplyIntensityColorName(const char* path, int frameId, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityColorName(IntPtr path, int frameId, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyIntensityColorNameD(const char* path, double frameId, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyIntensityColorNameD(IntPtr path, double frameId, double color); - /// - /// Multiply all the colors in the frame by the intensity value. The valid the - /// intensity range is from 0.0 to 255.0. RGB components are multiplied equally. - /// An intensity of 0.5 would half the color value. Black colors in the frame - /// will not be affected by this method. - /// EXPORT_API void PluginMultiplyIntensityName(const char* path, int frameId, float intensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityName(IntPtr path, int frameId, float intensity); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyIntensityNameD(const char* path, double frameId, double intensity); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyIntensityNameD(IntPtr path, double frameId, double intensity); - /// - /// Multiply the specific frame by the RBG color intensity. Animation is referenced - /// by id. - /// EXPORT_API void PluginMultiplyIntensityRGB(int animationId, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityRGB(int animationId, int frameId, int red, int green, int blue); - /// - /// Multiply the specific frame by the RBG color intensity. Animation is referenced - /// by name. - /// EXPORT_API void PluginMultiplyIntensityRGBName(const char* path, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyIntensityRGBName(IntPtr path, int frameId, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyIntensityRGBNameD(const char* path, double frameId, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyIntensityRGBNameD(IntPtr path, double frameId, double red, double green, double blue); - /// - /// Multiply the specific frame by the color lerp result between color 1 and - /// 2 using the frame color value as the `t` value. Animation is referenced - /// by id. - /// EXPORT_API void PluginMultiplyNonZeroTargetColorLerp(int animationId, int frameId, int color1, int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyNonZeroTargetColorLerp(int animationId, int frameId, int color1, int color2); - /// - /// Multiply all frames by the color lerp result between color 1 and 2 using - /// the frame color value as the `t` value. Animation is referenced by id. - /// - /// EXPORT_API void PluginMultiplyNonZeroTargetColorLerpAllFrames(int animationId, int color1, int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyNonZeroTargetColorLerpAllFrames(int animationId, int color1, int color2); - /// - /// Multiply all frames by the color lerp result between color 1 and 2 using - /// the frame color value as the `t` value. Animation is referenced by name. - /// - /// EXPORT_API void PluginMultiplyNonZeroTargetColorLerpAllFramesName(const char* path, int color1, int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyNonZeroTargetColorLerpAllFramesName(IntPtr path, int color1, int color2); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyNonZeroTargetColorLerpAllFramesNameD(const char* path, double color1, double color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyNonZeroTargetColorLerpAllFramesNameD(IntPtr path, double color1, double color2); - /// - /// Multiply the specific frame by the color lerp result between RGB 1 and 2 - /// using the frame color value as the `t` value. Animation is referenced by - /// id. - /// EXPORT_API void PluginMultiplyNonZeroTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyNonZeroTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2); - /// - /// Multiply the specific frame by the color lerp result between RGB 1 and 2 - /// using the frame color value as the `t` value. Animation is referenced by - /// name. - /// EXPORT_API void PluginMultiplyNonZeroTargetColorLerpAllFramesRGBName(const char* path, int red1, int green1, int blue1, int red2, int green2, int blue2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyNonZeroTargetColorLerpAllFramesRGBName(IntPtr path, int red1, int green1, int blue1, int red2, int green2, int blue2); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyNonZeroTargetColorLerpAllFramesRGBNameD(const char* path, double red1, double green1, double blue1, double red2, double green2, double blue2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyNonZeroTargetColorLerpAllFramesRGBNameD(IntPtr path, double red1, double green1, double blue1, double red2, double green2, double blue2); - /// - /// Multiply the specific frame by the color lerp result between color 1 and - /// 2 using the frame color value as the `t` value. Animation is referenced - /// by id. - /// EXPORT_API void PluginMultiplyTargetColorLerp(int animationId, int frameId, int color1, int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyTargetColorLerp(int animationId, int frameId, int color1, int color2); - /// - /// Multiply all frames by the color lerp result between color 1 and 2 using - /// the frame color value as the `t` value. Animation is referenced by id. - /// - /// EXPORT_API void PluginMultiplyTargetColorLerpAllFrames(int animationId, int color1, int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyTargetColorLerpAllFrames(int animationId, int color1, int color2); - /// - /// Multiply all frames by the color lerp result between color 1 and 2 using - /// the frame color value as the `t` value. Animation is referenced by name. - /// - /// EXPORT_API void PluginMultiplyTargetColorLerpAllFramesName(const char* path, int color1, int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyTargetColorLerpAllFramesName(IntPtr path, int color1, int color2); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyTargetColorLerpAllFramesNameD(const char* path, double color1, double color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyTargetColorLerpAllFramesNameD(IntPtr path, double color1, double color2); - /// - /// Multiply all frames by the color lerp result between RGB 1 and 2 using the - /// frame color value as the `t` value. Animation is referenced by id. - /// EXPORT_API void PluginMultiplyTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyTargetColorLerpAllFramesRGB(int animationId, int red1, int green1, int blue1, int red2, int green2, int blue2); - /// - /// Multiply all frames by the color lerp result between RGB 1 and 2 using the - /// frame color value as the `t` value. Animation is referenced by name. - /// EXPORT_API void PluginMultiplyTargetColorLerpAllFramesRGBName(const char* path, int red1, int green1, int blue1, int red2, int green2, int blue2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyTargetColorLerpAllFramesRGBName(IntPtr path, int red1, int green1, int blue1, int red2, int green2, int blue2); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginMultiplyTargetColorLerpAllFramesRGBNameD(const char* path, double red1, double green1, double blue1, double red2, double green2, double blue2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginMultiplyTargetColorLerpAllFramesRGBNameD(IntPtr path, double red1, double green1, double blue1, double red2, double green2, double blue2); - /// - /// Multiply the specific frame by the color lerp result between color 1 and - /// 2 using the frame color value as the `t` value. Animation is referenced - /// by name. - /// EXPORT_API void PluginMultiplyTargetColorLerpName(const char* path, int frameId, int color1, int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginMultiplyTargetColorLerpName(IntPtr path, int frameId, int color1, int color2); - /// - /// Offset all colors in the frame using the RGB offset. Use the range of -255 - /// to 255 for red, green, and blue parameters. Negative values remove color. - /// Positive values add color. - /// EXPORT_API void PluginOffsetColors(int animationId, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginOffsetColors(int animationId, int frameId, int red, int green, int blue); - /// - /// Offset all colors for all frames using the RGB offset. Use the range of - /// -255 to 255 for red, green, and blue parameters. Negative values remove - /// color. Positive values add color. - /// EXPORT_API void PluginOffsetColorsAllFrames(int animationId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginOffsetColorsAllFrames(int animationId, int red, int green, int blue); - /// - /// Offset all colors for all frames using the RGB offset. Use the range of - /// -255 to 255 for red, green, and blue parameters. Negative values remove - /// color. Positive values add color. - /// EXPORT_API void PluginOffsetColorsAllFramesName(const char* path, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginOffsetColorsAllFramesName(IntPtr path, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginOffsetColorsAllFramesNameD(const char* path, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginOffsetColorsAllFramesNameD(IntPtr path, double red, double green, double blue); - /// - /// Offset all colors in the frame using the RGB offset. Use the range of -255 - /// to 255 for red, green, and blue parameters. Negative values remove color. - /// Positive values add color. - /// EXPORT_API void PluginOffsetColorsName(const char* path, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginOffsetColorsName(IntPtr path, int frameId, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginOffsetColorsNameD(const char* path, double frameId, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginOffsetColorsNameD(IntPtr path, double frameId, double red, double green, double blue); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Offset a subset of colors in the frame using the RGB offset. - /// Use the range of -255 to 255 for red, green, and blue parameters. Negative - /// values remove color. Positive values add color. - /// EXPORT_API void PluginOffsetNonZeroColors(int animationId, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginOffsetNonZeroColors(int animationId, int frameId, int red, int green, int blue); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Offset a subset of colors for all frames using the RGB offset. - /// Use the range of -255 to 255 for red, green, and blue parameters. Negative - /// values remove color. Positive values add color. - /// EXPORT_API void PluginOffsetNonZeroColorsAllFrames(int animationId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginOffsetNonZeroColorsAllFrames(int animationId, int red, int green, int blue); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Offset a subset of colors for all frames using the RGB offset. - /// Use the range of -255 to 255 for red, green, and blue parameters. Negative - /// values remove color. Positive values add color. - /// EXPORT_API void PluginOffsetNonZeroColorsAllFramesName(const char* path, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginOffsetNonZeroColorsAllFramesName(IntPtr path, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginOffsetNonZeroColorsAllFramesNameD(const char* path, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginOffsetNonZeroColorsAllFramesNameD(IntPtr path, double red, double green, double blue); - /// - /// This method will only update colors in the animation that are not already - /// set to black. Offset a subset of colors in the frame using the RGB offset. - /// Use the range of -255 to 255 for red, green, and blue parameters. Negative - /// values remove color. Positive values add color. - /// EXPORT_API void PluginOffsetNonZeroColorsName(const char* path, int frameId, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginOffsetNonZeroColorsName(IntPtr path, int frameId, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginOffsetNonZeroColorsNameD(const char* path, double frameId, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginOffsetNonZeroColorsNameD(IntPtr path, double frameId, double red, double green, double blue); - /// - /// Opens a `Chroma` animation file so that it can be played. Returns an animation - /// id >= 0 upon success. Returns negative one if there was a failure. The - /// animation id is used in most of the API methods. - /// EXPORT_API int PluginOpenAnimation(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginOpenAnimation(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginOpenAnimationD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginOpenAnimationD(IntPtr path); - /// - /// Opens a `Chroma` animation data from memory so that it can be played. `Data` - /// is a pointer to BYTE array of the loaded animation in memory. `Name` will - /// be assigned to the animation when loaded. Returns an animation id >= 0 - /// upon success. Returns negative one if there was a failure. The animation - /// id is used in most of the API methods. - /// EXPORT_API int PluginOpenAnimationFromMemory(const BYTE* data, const char* name); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginOpenAnimationFromMemory(byte[] data, IntPtr name); - /// - /// Opens a `Chroma` animation file with the `.chroma` extension. Returns zero - /// upon success. Returns negative one if there was a failure. - /// EXPORT_API int PluginOpenEditorDialog(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginOpenEditorDialog(IntPtr path); - /// - /// Open the named animation in the editor dialog and play the animation at - /// start. - /// EXPORT_API int PluginOpenEditorDialogAndPlay(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginOpenEditorDialogAndPlay(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginOpenEditorDialogAndPlayD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginOpenEditorDialogAndPlayD(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginOpenEditorDialogD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginOpenEditorDialogD(IntPtr path); - /// - /// Sets the `duration` for all grames in the `Chroma` animation to the `duration` - /// parameter. Returns the animation id upon success. Returns negative one - /// upon failure. - /// EXPORT_API int PluginOverrideFrameDuration(int animationId, float duration); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginOverrideFrameDuration(int animationId, float duration); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginOverrideFrameDurationD(double animationId, double duration); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginOverrideFrameDurationD(double animationId, double duration); - /// - /// Override the duration of all frames with the `duration` value. Animation - /// is referenced by name. - /// EXPORT_API void PluginOverrideFrameDurationName(const char* path, float duration); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginOverrideFrameDurationName(IntPtr path, float duration); - /// - /// Pause the current animation referenced by id. - /// EXPORT_API void PluginPauseAnimation(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginPauseAnimation(int animationId); - /// - /// Pause the current animation referenced by name. - /// EXPORT_API void PluginPauseAnimationName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginPauseAnimationName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginPauseAnimationNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginPauseAnimationNameD(IntPtr path); - /// - /// Plays the `Chroma` animation. This will load the animation, if not loaded - /// previously. Returns the animation id upon success. Returns negative one - /// upon failure. - /// EXPORT_API int PluginPlayAnimation(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginPlayAnimation(int animationId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginPlayAnimationD(double animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginPlayAnimationD(double animationId); - /// - /// `PluginPlayAnimationFrame` automatically handles initializing the `ChromaSDK`. - /// The method will play the animation given the `animationId` with looping - /// `on` or `off` starting at the `frameId`. - /// EXPORT_API void PluginPlayAnimationFrame(int animationId, int frameId, bool loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginPlayAnimationFrame(int animationId, int frameId, bool loop); - /// - /// `PluginPlayAnimationFrameName` automatically handles initializing the `ChromaSDK`. - /// The named `.chroma` animation file will be automatically opened. The animation - /// will play with looping `on` or `off` starting at the `frameId`. - /// EXPORT_API void PluginPlayAnimationFrameName(const char* path, int frameId, bool loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginPlayAnimationFrameName(IntPtr path, int frameId, bool loop); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginPlayAnimationFrameNameD(const char* path, double frameId, double loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginPlayAnimationFrameNameD(IntPtr path, double frameId, double loop); - /// - /// `PluginPlayAnimationLoop` automatically handles initializing the `ChromaSDK`. - /// The method will play the animation given the `animationId` with looping - /// `on` or `off`. - /// EXPORT_API void PluginPlayAnimationLoop(int animationId, bool loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginPlayAnimationLoop(int animationId, bool loop); - /// - /// `PluginPlayAnimationName` automatically handles initializing the `ChromaSDK`. - /// The named `.chroma` animation file will be automatically opened. The animation - /// will play with looping `on` or `off`. - /// EXPORT_API void PluginPlayAnimationName(const char* path, bool loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginPlayAnimationName(IntPtr path, bool loop); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginPlayAnimationNameD(const char* path, double loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginPlayAnimationNameD(IntPtr path, double loop); - /// - /// `PluginPlayComposite` automatically handles initializing the `ChromaSDK`. - /// The named animation files for the `.chroma` set will be automatically opened. - /// The set of animations will play with looping `on` or `off`. - /// EXPORT_API void PluginPlayComposite(const char* name, bool loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginPlayComposite(IntPtr name, bool loop); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginPlayCompositeD(const char* name, double loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginPlayCompositeD(IntPtr name, double loop); - /// - /// Displays the `Chroma` animation frame on `Chroma` hardware given the `frameIndex`. - /// Returns the animation id upon success. Returns negative one upon failure. - /// - /// EXPORT_API int PluginPreviewFrame(int animationId, int frameIndex); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginPreviewFrame(int animationId, int frameIndex); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginPreviewFrameD(double animationId, double frameIndex); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginPreviewFrameD(double animationId, double frameIndex); - /// - /// Displays the `Chroma` animation frame on `Chroma` hardware given the `frameIndex`. - /// Animaton is referenced by name. - /// EXPORT_API void PluginPreviewFrameName(const char* path, int frameIndex); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginPreviewFrameName(IntPtr path, int frameIndex); - /// - /// Reduce the frames of the animation by removing every nth element. Animation - /// is referenced by id. - /// EXPORT_API void PluginReduceFrames(int animationId, int n); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginReduceFrames(int animationId, int n); - /// - /// Reduce the frames of the animation by removing every nth element. Animation - /// is referenced by name. - /// EXPORT_API void PluginReduceFramesName(const char* path, int n); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginReduceFramesName(IntPtr path, int n); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginReduceFramesNameD(const char* path, double n); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginReduceFramesNameD(IntPtr path, double n); - /// - /// Resets the `Chroma` animation to 1 blank frame. Returns the animation id - /// upon success. Returns negative one upon failure. - /// EXPORT_API int PluginResetAnimation(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginResetAnimation(int animationId); - /// - /// Resume the animation with loop `ON` or `OFF` referenced by id. - /// EXPORT_API void PluginResumeAnimation(int animationId, bool loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginResumeAnimation(int animationId, bool loop); - /// - /// Resume the animation with loop `ON` or `OFF` referenced by name. - /// EXPORT_API void PluginResumeAnimationName(const char* path, bool loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginResumeAnimationName(IntPtr path, bool loop); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginResumeAnimationNameD(const char* path, double loop); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginResumeAnimationNameD(IntPtr path, double loop); - /// - /// Reverse the animation frame order of the `Chroma` animation. Returns the - /// animation id upon success. Returns negative one upon failure. Animation - /// is referenced by id. - /// EXPORT_API int PluginReverse(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginReverse(int animationId); - /// - /// Reverse the animation frame order of the `Chroma` animation. Animation is - /// referenced by id. - /// EXPORT_API void PluginReverseAllFrames(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginReverseAllFrames(int animationId); - /// - /// Reverse the animation frame order of the `Chroma` animation. Animation is - /// referenced by name. - /// EXPORT_API void PluginReverseAllFramesName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginReverseAllFramesName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginReverseAllFramesNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginReverseAllFramesNameD(IntPtr path); - /// - /// Save the animation referenced by id to the path specified. - /// EXPORT_API int PluginSaveAnimation(int animationId, const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginSaveAnimation(int animationId, IntPtr path); - /// - /// Save the named animation to the target path specified. - /// EXPORT_API int PluginSaveAnimationName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginSaveAnimationName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Set the animation color for a frame given the `1D` `led`. The `led` should - /// be greater than or equal to 0 and less than the `MaxLeds`. The animation - /// is referenced by id. - /// EXPORT_API void PluginSet1DColor(int animationId, int frameId, int led, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSet1DColor(int animationId, int frameId, int led, int color); - /// - /// Set the animation color for a frame given the `1D` `led`. The `led` should - /// be greater than or equal to 0 and less than the `MaxLeds`. The animation - /// is referenced by name. - /// EXPORT_API void PluginSet1DColorName(const char* path, int frameId, int led, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSet1DColorName(IntPtr path, int frameId, int led, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSet1DColorNameD(const char* path, double frameId, double led, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSet1DColorNameD(IntPtr path, double frameId, double led, double color); - /// - /// Set the animation color for a frame given the `2D` `row` and `column`. The - /// `row` should be greater than or equal to 0 and less than the `MaxRow`. - /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. - /// The animation is referenced by id. - /// EXPORT_API void PluginSet2DColor(int animationId, int frameId, int row, int column, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSet2DColor(int animationId, int frameId, int row, int column, int color); - /// - /// Set the animation color for a frame given the `2D` `row` and `column`. The - /// `row` should be greater than or equal to 0 and less than the `MaxRow`. - /// The `column` should be greater than or equal to 0 and less than the `MaxColumn`. - /// The animation is referenced by name. - /// EXPORT_API void PluginSet2DColorName(const char* path, int frameId, int row, int column, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSet2DColorName(IntPtr path, int frameId, int row, int column, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSet2DColorNameD(const char* path, double frameId, double rowColumnIndex, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSet2DColorNameD(IntPtr path, double frameId, double rowColumnIndex, double color); - /// - /// When custom color is set, the custom key mode will be used. The animation - /// is referenced by id. - /// EXPORT_API void PluginSetChromaCustomColorAllFrames(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetChromaCustomColorAllFrames(int animationId); - /// - /// When custom color is set, the custom key mode will be used. The animation - /// is referenced by name. - /// EXPORT_API void PluginSetChromaCustomColorAllFramesName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetChromaCustomColorAllFramesName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetChromaCustomColorAllFramesNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetChromaCustomColorAllFramesNameD(IntPtr path); - /// - /// Set the Chroma custom key color flag on all frames. `True` changes the layout - /// from grid to key. `True` changes the layout from key to grid. Animation - /// is referenced by id. - /// EXPORT_API void PluginSetChromaCustomFlag(int animationId, bool flag); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetChromaCustomFlag(int animationId, bool flag); - /// - /// Set the Chroma custom key color flag on all frames. `True` changes the layout - /// from grid to key. `True` changes the layout from key to grid. Animation - /// is referenced by name. - /// EXPORT_API void PluginSetChromaCustomFlagName(const char* path, bool flag); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetChromaCustomFlagName(IntPtr path, bool flag); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetChromaCustomFlagNameD(const char* path, double flag); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetChromaCustomFlagNameD(IntPtr path, double flag); - /// - /// Set the current frame of the animation referenced by id. - /// EXPORT_API void PluginSetCurrentFrame(int animationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetCurrentFrame(int animationId, int frameId); - /// - /// Set the current frame of the animation referenced by name. - /// EXPORT_API void PluginSetCurrentFrameName(const char* path, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetCurrentFrameName(IntPtr path, int frameId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetCurrentFrameNameD(const char* path, double frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetCurrentFrameNameD(IntPtr path, double frameId); - /// - /// Set the custom alpha flag on the color array - /// EXPORT_API RZRESULT PluginSetCustomColorFlag2D(int device, int* colors); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginSetCustomColorFlag2D(int device, int[] colors); - /// - /// Changes the `deviceType` and `device` of a `Chroma` animation. If the device - /// is changed, the `Chroma` animation will be reset with 1 blank frame. Returns - /// the animation id upon success. Returns negative one upon failure. - /// EXPORT_API int PluginSetDevice(int animationId, int deviceType, int device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginSetDevice(int animationId, int deviceType, int device); - /// - /// SetEffect will display the referenced effect id. - /// EXPORT_API RZRESULT PluginSetEffect(const ChromaSDK::FChromaSDKGuid& effectId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginSetEffect(Guid effectId); - /// - /// SetEffectCustom1D will display the referenced colors immediately - /// EXPORT_API RZRESULT PluginSetEffectCustom1D(const int device, const int* colors); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginSetEffectCustom1D(int device, int[] colors); - /// - /// SetEffectCustom2D will display the referenced colors immediately. - /// EXPORT_API RZRESULT PluginSetEffectCustom2D(const int device, const int* colors); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginSetEffectCustom2D(int device, int[] colors); - /// - /// SetEffectKeyboardCustom2D will display the referenced custom keyboard colors - /// immediately. Colors represent a visual grid layout. Keys represent the - /// hotkeys for any layout. - /// EXPORT_API RZRESULT PluginSetEffectKeyboardCustom2D(const int device, const int* colors, const int* keys); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginSetEffectKeyboardCustom2D(int device, int[] colors, int[] keys); - /// - /// When the idle animation is used, the named animation will play when no other - /// animations are playing. Reference the animation by id. - /// EXPORT_API void PluginSetIdleAnimation(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetIdleAnimation(int animationId); - /// - /// When the idle animation is used, the named animation will play when no other - /// animations are playing. Reference the animation by name. - /// EXPORT_API void PluginSetIdleAnimationName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetIdleAnimationName(IntPtr path); - /// - /// Set animation key to a static color for the given frame. - /// EXPORT_API void PluginSetKeyColor(int animationId, int frameId, int rzkey, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyColor(int animationId, int frameId, int rzkey, int color); - /// - /// Set the key to the specified key color for all frames. Animation is referenced - /// by id. - /// EXPORT_API void PluginSetKeyColorAllFrames(int animationId, int rzkey, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyColorAllFrames(int animationId, int rzkey, int color); - /// - /// Set the key to the specified key color for all frames. Animation is referenced - /// by name. - /// EXPORT_API void PluginSetKeyColorAllFramesName(const char* path, int rzkey, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyColorAllFramesName(IntPtr path, int rzkey, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetKeyColorAllFramesNameD(const char* path, double rzkey, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetKeyColorAllFramesNameD(IntPtr path, double rzkey, double color); - /// - /// Set the key to the specified key color for all frames. Animation is referenced - /// by id. - /// EXPORT_API void PluginSetKeyColorAllFramesRGB(int animationId, int rzkey, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyColorAllFramesRGB(int animationId, int rzkey, int red, int green, int blue); - /// - /// Set the key to the specified key color for all frames. Animation is referenced - /// by name. - /// EXPORT_API void PluginSetKeyColorAllFramesRGBName(const char* path, int rzkey, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyColorAllFramesRGBName(IntPtr path, int rzkey, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetKeyColorAllFramesRGBNameD(const char* path, double rzkey, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetKeyColorAllFramesRGBNameD(IntPtr path, double rzkey, double red, double green, double blue); - /// - /// Set animation key to a static color for the given frame. - /// EXPORT_API void PluginSetKeyColorName(const char* path, int frameId, int rzkey, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyColorName(IntPtr path, int frameId, int rzkey, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetKeyColorNameD(const char* path, double frameId, double rzkey, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetKeyColorNameD(IntPtr path, double frameId, double rzkey, double color); - /// - /// Set the key to the specified key color for the specified frame. Animation - /// is referenced by id. - /// EXPORT_API void PluginSetKeyColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); - /// - /// Set the key to the specified key color for the specified frame. Animation - /// is referenced by name. - /// EXPORT_API void PluginSetKeyColorRGBName(const char* path, int frameId, int rzkey, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyColorRGBName(IntPtr path, int frameId, int rzkey, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetKeyColorRGBNameD(const char* path, double frameId, double rzkey, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetKeyColorRGBNameD(IntPtr path, double frameId, double rzkey, double red, double green, double blue); - /// - /// Set animation key to a static color for the given frame if the existing - /// color is not already black. - /// EXPORT_API void PluginSetKeyNonZeroColor(int animationId, int frameId, int rzkey, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyNonZeroColor(int animationId, int frameId, int rzkey, int color); - /// - /// Set animation key to a static color for the given frame if the existing - /// color is not already black. - /// EXPORT_API void PluginSetKeyNonZeroColorName(const char* path, int frameId, int rzkey, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyNonZeroColorName(IntPtr path, int frameId, int rzkey, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetKeyNonZeroColorNameD(const char* path, double frameId, double rzkey, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetKeyNonZeroColorNameD(IntPtr path, double frameId, double rzkey, double color); - /// - /// Set the key to the specified key color for the specified frame where color - /// is not black. Animation is referenced by id. - /// EXPORT_API void PluginSetKeyNonZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyNonZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); - /// - /// Set the key to the specified key color for the specified frame where color - /// is not black. Animation is referenced by name. - /// EXPORT_API void PluginSetKeyNonZeroColorRGBName(const char* path, int frameId, int rzkey, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyNonZeroColorRGBName(IntPtr path, int frameId, int rzkey, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetKeyNonZeroColorRGBNameD(const char* path, double frameId, double rzkey, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetKeyNonZeroColorRGBNameD(IntPtr path, double frameId, double rzkey, double red, double green, double blue); - /// - /// Set animation key by row and column to a static color for the given frame. - /// - /// EXPORT_API void PluginSetKeyRowColumnColorName(const char* path, int frameId, int row, int column, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyRowColumnColorName(IntPtr path, int frameId, int row, int column, int color); - /// - /// Set an array of animation keys to a static color for the given frame. Animation - /// is referenced by id. - /// EXPORT_API void PluginSetKeysColor(int animationId, int frameId, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for all frames. Animation - /// is referenced by id. - /// EXPORT_API void PluginSetKeysColorAllFrames(int animationId, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for all frames. Animation - /// is referenced by name. - /// EXPORT_API void PluginSetKeysColorAllFramesName(const char* path, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysColorAllFramesName(IntPtr path, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for all frames. Animation - /// is referenced by id. - /// EXPORT_API void PluginSetKeysColorAllFramesRGB(int animationId, const int* rzkeys, int keyCount, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysColorAllFramesRGB(int animationId, int[] rzkeys, int keyCount, int red, int green, int blue); - /// - /// Set an array of animation keys to a static color for all frames. Animation - /// is referenced by name. - /// EXPORT_API void PluginSetKeysColorAllFramesRGBName(const char* path, const int* rzkeys, int keyCount, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysColorAllFramesRGBName(IntPtr path, int[] rzkeys, int keyCount, int red, int green, int blue); - /// - /// Set an array of animation keys to a static color for the given frame. - /// EXPORT_API void PluginSetKeysColorName(const char* path, int frameId, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysColorName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for the given frame. Animation - /// is referenced by id. - /// EXPORT_API void PluginSetKeysColorRGB(int animationId, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); - /// - /// Set an array of animation keys to a static color for the given frame. Animation - /// is referenced by name. - /// EXPORT_API void PluginSetKeysColorRGBName(const char* path, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysColorRGBName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); - /// - /// Set an array of animation keys to a static color for the given frame if - /// the existing color is not already black. - /// EXPORT_API void PluginSetKeysNonZeroColor(int animationId, int frameId, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysNonZeroColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is not black. Animation is referenced by id. - /// EXPORT_API void PluginSetKeysNonZeroColorAllFrames(int animationId, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysNonZeroColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for all frames if the existing - /// color is not already black. Reference animation by name. - /// EXPORT_API void PluginSetKeysNonZeroColorAllFramesName(const char* path, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysNonZeroColorAllFramesName(IntPtr path, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for the given frame if - /// the existing color is not already black. Reference animation by name. - /// EXPORT_API void PluginSetKeysNonZeroColorName(const char* path, int frameId, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysNonZeroColorName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is not black. Animation is referenced by id. - /// EXPORT_API void PluginSetKeysNonZeroColorRGB(int animationId, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysNonZeroColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is not black. Animation is referenced by name. - /// EXPORT_API void PluginSetKeysNonZeroColorRGBName(const char* path, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysNonZeroColorRGBName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is black. Animation is referenced by id. - /// EXPORT_API void PluginSetKeysZeroColor(int animationId, int frameId, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysZeroColor(int animationId, int frameId, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for all frames where the - /// color is black. Animation is referenced by id. - /// EXPORT_API void PluginSetKeysZeroColorAllFrames(int animationId, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysZeroColorAllFrames(int animationId, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for all frames where the - /// color is black. Animation is referenced by name. - /// EXPORT_API void PluginSetKeysZeroColorAllFramesName(const char* path, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysZeroColorAllFramesName(IntPtr path, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for all frames where the - /// color is black. Animation is referenced by id. - /// EXPORT_API void PluginSetKeysZeroColorAllFramesRGB(int animationId, const int* rzkeys, int keyCount, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysZeroColorAllFramesRGB(int animationId, int[] rzkeys, int keyCount, int red, int green, int blue); - /// - /// Set an array of animation keys to a static color for all frames where the - /// color is black. Animation is referenced by name. - /// EXPORT_API void PluginSetKeysZeroColorAllFramesRGBName(const char* path, const int* rzkeys, int keyCount, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysZeroColorAllFramesRGBName(IntPtr path, int[] rzkeys, int keyCount, int red, int green, int blue); - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is black. Animation is referenced by name. - /// EXPORT_API void PluginSetKeysZeroColorName(const char* path, int frameId, const int* rzkeys, int keyCount, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysZeroColorName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int color); - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is black. Animation is referenced by id. - /// EXPORT_API void PluginSetKeysZeroColorRGB(int animationId, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysZeroColorRGB(int animationId, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); - /// - /// Set an array of animation keys to a static color for the given frame where - /// the color is black. Animation is referenced by name. - /// EXPORT_API void PluginSetKeysZeroColorRGBName(const char* path, int frameId, const int* rzkeys, int keyCount, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeysZeroColorRGBName(IntPtr path, int frameId, int[] rzkeys, int keyCount, int red, int green, int blue); - /// - /// Set animation key to a static color for the given frame where the color - /// is black. Animation is referenced by id. - /// EXPORT_API void PluginSetKeyZeroColor(int animationId, int frameId, int rzkey, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyZeroColor(int animationId, int frameId, int rzkey, int color); - /// - /// Set animation key to a static color for the given frame where the color - /// is black. Animation is referenced by name. - /// EXPORT_API void PluginSetKeyZeroColorName(const char* path, int frameId, int rzkey, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyZeroColorName(IntPtr path, int frameId, int rzkey, int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetKeyZeroColorNameD(const char* path, double frameId, double rzkey, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetKeyZeroColorNameD(IntPtr path, double frameId, double rzkey, double color); - /// - /// Set animation key to a static color for the given frame where the color - /// is black. Animation is referenced by id. - /// EXPORT_API void PluginSetKeyZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyZeroColorRGB(int animationId, int frameId, int rzkey, int red, int green, int blue); - /// - /// Set animation key to a static color for the given frame where the color - /// is black. Animation is referenced by name. - /// EXPORT_API void PluginSetKeyZeroColorRGBName(const char* path, int frameId, int rzkey, int red, int green, int blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetKeyZeroColorRGBName(IntPtr path, int frameId, int rzkey, int red, int green, int blue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSetKeyZeroColorRGBNameD(const char* path, double frameId, double rzkey, double red, double green, double blue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSetKeyZeroColorRGBNameD(IntPtr path, double frameId, double rzkey, double red, double green, double blue); - /// - /// Invokes the setup for a debug logging callback so that `stdout` is redirected - /// to the callback. This is used by `Unity` so that debug messages can appear - /// in the console window. - /// EXPORT_API void PluginSetLogDelegate(DebugLogPtr fp); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetLogDelegate(IntPtr fp); - /// - /// Sets the target device to the static color. - /// EXPORT_API void PluginSetStaticColor(int deviceType, int device, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetStaticColor(int deviceType, int device, int color); - /// - /// Sets all devices to the static color. - /// EXPORT_API void PluginSetStaticColorAll(int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSetStaticColorAll(int color); - /// - /// Sets the target device to the static color. - /// EXPORT_API void PluginStaticColor(int deviceType, int device, int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginStaticColor(int deviceType, int device, int color); - /// - /// Sets all devices to the static color. - /// EXPORT_API void PluginStaticColorAll(int color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginStaticColorAll(int color); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginStaticColorD(double deviceType, double device, double color); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginStaticColorD(double deviceType, double device, double color); - /// - /// `PluginStopAll` will automatically stop all animations that are playing. - /// - /// EXPORT_API void PluginStopAll(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginStopAll(); - /// - /// Stops animation playback if in progress. Returns the animation id upon success. - /// Returns negative one upon failure. - /// EXPORT_API int PluginStopAnimation(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginStopAnimation(int animationId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginStopAnimationD(double animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginStopAnimationD(double animationId); - /// - /// `PluginStopAnimationName` automatically handles initializing the `ChromaSDK`. - /// The named `.chroma` animation file will be automatically opened. The animation - /// will stop if playing. - /// EXPORT_API void PluginStopAnimationName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginStopAnimationName(IntPtr path); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginStopAnimationNameD(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginStopAnimationNameD(IntPtr path); - /// - /// `PluginStopAnimationType` automatically handles initializing the `ChromaSDK`. - /// If any animation is playing for the `deviceType` and `device` combination, - /// it will be stopped. - /// EXPORT_API void PluginStopAnimationType(int deviceType, int device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginStopAnimationType(int deviceType, int device); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginStopAnimationTypeD(double deviceType, double device); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginStopAnimationTypeD(double deviceType, double device); - /// - /// `PluginStopComposite` automatically handles initializing the `ChromaSDK`. - /// The named animation files for the `.chroma` set will be automatically opened. - /// The set of animations will be stopped if playing. - /// EXPORT_API void PluginStopComposite(const char* name); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginStopComposite(IntPtr name); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginStopCompositeD(const char* name); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginStopCompositeD(IntPtr name); - /// - /// Return color1 - color2 - /// EXPORT_API int PluginSubtractColor(const int color1, const int color2); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginSubtractColor(int color1, int color2); - /// - /// Subtract the source color from the target color for the frame where the - /// target color is not black. Source and target are referenced by id. - /// EXPORT_API void PluginSubtractNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroAllKeys(int sourceAnimationId, int targetAnimationId, int frameId); - /// - /// Subtract the source color from the target color for all frames where the - /// target color is not black. Source and target are referenced by id. - /// EXPORT_API void PluginSubtractNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - /// Subtract the source color from the target color for all frames where the - /// target color is not black. Source and target are referenced by name. - /// EXPORT_API void PluginSubtractNonZeroAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSubtractNonZeroAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSubtractNonZeroAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Subtract the source color from the target color for all frames where the - /// target color is not black starting at offset for the length of the source. - /// Source and target are referenced by id. - /// EXPORT_API void PluginSubtractNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - /// Subtract the source color from the target color for all frames where the - /// target color is not black starting at offset for the length of the source. - /// Source and target are referenced by name. - /// EXPORT_API void PluginSubtractNonZeroAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSubtractNonZeroAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSubtractNonZeroAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); - /// - /// Subtract the source color from the target color for the frame where the - /// target color is not black. Source and target are referenced by name. - /// EXPORT_API void PluginSubtractNonZeroAllKeysName(const char* sourceAnimation, const char* targetAnimation, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroAllKeysName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId); - /// - /// Subtract the source color from the target where color is not black for the - /// source frame and target offset frame, reference source and target by id. - /// - /// EXPORT_API void PluginSubtractNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - /// Subtract the source color from the target where color is not black for the - /// source frame and target offset frame, reference source and target by name. - /// - /// EXPORT_API void PluginSubtractNonZeroAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSubtractNonZeroAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSubtractNonZeroAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); - /// - /// Subtract the source color from the target color where the target color is - /// not black for all frames. Reference source and target by id. - /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroTargetAllKeysAllFrames(int sourceAnimationId, int targetAnimationId); - /// - /// Subtract the source color from the target color where the target color is - /// not black for all frames. Reference source and target by name. - /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysAllFramesName(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroTargetAllKeysAllFramesName(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSubtractNonZeroTargetAllKeysAllFramesNameD(const char* sourceAnimation, const char* targetAnimation); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSubtractNonZeroTargetAllKeysAllFramesNameD(IntPtr sourceAnimation, IntPtr targetAnimation); - /// - /// Subtract the source color from the target color where the target color is - /// not black for all frames starting at the target offset for the length of - /// the source. Reference source and target by id. - /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroTargetAllKeysAllFramesOffset(int sourceAnimationId, int targetAnimationId, int offset); - /// - /// Subtract the source color from the target color where the target color is - /// not black for all frames starting at the target offset for the length of - /// the source. Reference source and target by name. - /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysAllFramesOffsetName(const char* sourceAnimation, const char* targetAnimation, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroTargetAllKeysAllFramesOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSubtractNonZeroTargetAllKeysAllFramesOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSubtractNonZeroTargetAllKeysAllFramesOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double offset); - /// - /// Subtract the source color from the target color where the target color is - /// not black from the source frame to the target offset frame. Reference source - /// and target by id. - /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroTargetAllKeysOffset(int sourceAnimationId, int targetAnimationId, int frameId, int offset); - /// - /// Subtract the source color from the target color where the target color is - /// not black from the source frame to the target offset frame. Reference source - /// and target by name. - /// EXPORT_API void PluginSubtractNonZeroTargetAllKeysOffsetName(const char* sourceAnimation, const char* targetAnimation, int frameId, int offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractNonZeroTargetAllKeysOffsetName(IntPtr sourceAnimation, IntPtr targetAnimation, int frameId, int offset); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSubtractNonZeroTargetAllKeysOffsetNameD(const char* sourceAnimation, const char* targetAnimation, double frameId, double offset); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSubtractNonZeroTargetAllKeysOffsetNameD(IntPtr sourceAnimation, IntPtr targetAnimation, double frameId, double offset); - /// - /// Subtract all frames with the min RGB color where the animation color is - /// less than the min threshold AND with the max RGB color where the animation - /// is more than the max threshold. Animation is referenced by id. - /// EXPORT_API void PluginSubtractThresholdColorsMinMaxAllFramesRGB(const int animationId, const int minThreshold, const int minRed, const int minGreen, const int minBlue, const int maxThreshold, const int maxRed, const int maxGreen, const int maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractThresholdColorsMinMaxAllFramesRGB(int animationId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - /// Subtract all frames with the min RGB color where the animation color is - /// less than the min threshold AND with the max RGB color where the animation - /// is more than the max threshold. Animation is referenced by name. - /// EXPORT_API void PluginSubtractThresholdColorsMinMaxAllFramesRGBName(const char* path, const int minThreshold, const int minRed, const int minGreen, const int minBlue, const int maxThreshold, const int maxRed, const int maxGreen, const int maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractThresholdColorsMinMaxAllFramesRGBName(IntPtr path, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSubtractThresholdColorsMinMaxAllFramesRGBNameD(const char* path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSubtractThresholdColorsMinMaxAllFramesRGBNameD(IntPtr path, double minThreshold, double minRed, double minGreen, double minBlue, double maxThreshold, double maxRed, double maxGreen, double maxBlue); - /// - /// Subtract the specified frame with the min RGB color where the animation - /// color is less than the min threshold AND with the max RGB color where the - /// animation is more than the max threshold. Animation is referenced by id. - /// - /// EXPORT_API void PluginSubtractThresholdColorsMinMaxRGB(const int animationId, const int frameId, const int minThreshold, const int minRed, const int minGreen, const int minBlue, const int maxThreshold, const int maxRed, const int maxGreen, const int maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractThresholdColorsMinMaxRGB(int animationId, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - /// Subtract the specified frame with the min RGB color where the animation - /// color is less than the min threshold AND with the max RGB color where the - /// animation is more than the max threshold. Animation is referenced by name. - /// - /// EXPORT_API void PluginSubtractThresholdColorsMinMaxRGBName(const char* path, const int frameId, const int minThreshold, const int minRed, const int minGreen, const int minBlue, const int maxThreshold, const int maxRed, const int maxGreen, const int maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginSubtractThresholdColorsMinMaxRGBName(IntPtr path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginSubtractThresholdColorsMinMaxRGBNameD(const char* path, const int frameId, const int minThreshold, const int minRed, const int minGreen, const int minBlue, const int maxThreshold, const int maxRed, const int maxGreen, const int maxBlue); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginSubtractThresholdColorsMinMaxRGBNameD(IntPtr path, int frameId, int minThreshold, int minRed, int minGreen, int minBlue, int maxThreshold, int maxRed, int maxGreen, int maxBlue); - /// - /// Trim the end of the animation. The length of the animation will be the lastFrameId - /// plus one. Reference the animation by id. - /// EXPORT_API void PluginTrimEndFrames(int animationId, int lastFrameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginTrimEndFrames(int animationId, int lastFrameId); - /// - /// Trim the end of the animation. The length of the animation will be the lastFrameId - /// plus one. Reference the animation by name. - /// EXPORT_API void PluginTrimEndFramesName(const char* path, int lastFrameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginTrimEndFramesName(IntPtr path, int lastFrameId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginTrimEndFramesNameD(const char* path, double lastFrameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginTrimEndFramesNameD(IntPtr path, double lastFrameId); - /// - /// Remove the frame from the animation. Reference animation by id. - /// EXPORT_API void PluginTrimFrame(int animationId, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginTrimFrame(int animationId, int frameId); - /// - /// Remove the frame from the animation. Reference animation by name. - /// EXPORT_API void PluginTrimFrameName(const char* path, int frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginTrimFrameName(IntPtr path, int frameId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginTrimFrameNameD(const char* path, double frameId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginTrimFrameNameD(IntPtr path, double frameId); - /// - /// Trim the start of the animation starting at frame 0 for the number of frames. - /// Reference the animation by id. - /// EXPORT_API void PluginTrimStartFrames(int animationId, int numberOfFrames); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginTrimStartFrames(int animationId, int numberOfFrames); - /// - /// Trim the start of the animation starting at frame 0 for the number of frames. - /// Reference the animation by name. - /// EXPORT_API void PluginTrimStartFramesName(const char* path, int numberOfFrames); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginTrimStartFramesName(IntPtr path, int numberOfFrames); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginTrimStartFramesNameD(const char* path, double numberOfFrames); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginTrimStartFramesNameD(IntPtr path, double numberOfFrames); - /// - /// Uninitializes the `ChromaSDK`. Returns 0 upon success. Returns negative - /// one upon failure. - /// EXPORT_API RZRESULT PluginUninit(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginUninit(); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginUninitD(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginUninitD(); - /// - /// Unloads `Chroma` effects to free up resources. Returns the animation id - /// upon success. Returns negative one upon failure. Reference the animation - /// by id. - /// EXPORT_API int PluginUnloadAnimation(int animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginUnloadAnimation(int animationId); - /// - /// D suffix for limited data types. - /// EXPORT_API double PluginUnloadAnimationD(double animationId); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern double PluginUnloadAnimationD(double animationId); - /// - /// Unload the animation effects. Reference the animation by name. - /// EXPORT_API void PluginUnloadAnimationName(const char* path); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginUnloadAnimationName(IntPtr path); - /// - /// Unload the the composite set of animation effects. Reference the animation - /// by name. - /// EXPORT_API void PluginUnloadComposite(const char* name); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginUnloadComposite(IntPtr name); - /// - /// Unload the Razer Chroma SDK Library before exiting the application. - /// EXPORT_API void PluginUnloadLibrarySDK(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginUnloadLibrarySDK(); - /// - /// Unload the Razer Chroma Streaming Plugin Library before exiting the application. - /// - /// EXPORT_API void PluginUnloadLibraryStreamingPlugin(); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginUnloadLibraryStreamingPlugin(); - /// - /// Updates the `frameIndex` of the `Chroma` animation referenced by id and - /// sets the `duration` (in seconds). The `color` is expected to be an array - /// of the dimensions for the `deviceType/device`. The `length` parameter is - /// the size of the `color` array. For `EChromaSDKDevice1DEnum` the array size - /// should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should - /// be `MAX ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard - /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the - /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. - /// - /// EXPORT_API int PluginUpdateFrame(int animationId, int frameIndex, float duration, int* colors, int length, int* keys, int keysLength); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginUpdateFrame(int animationId, int frameIndex, float duration, int[] colors, int length, int[] keys, int keysLength); - /// - /// Update the `frameIndex` of the `Chroma` animation referenced by name and - /// sets the `duration` (in seconds). The `color` is expected to be an array - /// of the dimensions for the `deviceType/device`. The `length` parameter is - /// the size of the `color` array. For `EChromaSDKDevice1DEnum` the array size - /// should be `MAX LEDS`. For `EChromaSDKDevice2DEnum` the array size should - /// be `MAX ROW` times `MAX COLUMN`. Keys are populated only for EChromaSDKDevice2DEnum::DE_Keyboard - /// and EChromaSDKDevice2DEnum::DE_KeyboardExtended. Keys will only use the - /// EChromaSDKDevice2DEnum::DE_Keyboard `MAX_ROW` times `MAX_COLUMN` keysLength. - /// Returns the animation id upon success. Returns negative one upon failure. - /// - /// EXPORT_API int PluginUpdateFrameName(const char* path, int frameIndex, float duration, int* colors, int length, int* keys, int keysLength); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern int PluginUpdateFrameName(IntPtr path, int frameIndex, float duration, int[] colors, int length, int[] keys, int keysLength); - /// - /// When the idle animation flag is true, when no other animations are playing, - /// the idle animation will be used. The idle animation will not be affected - /// by the API calls to PluginIsPlaying, PluginStopAnimationType, PluginGetPlayingAnimationId, - /// and PluginGetPlayingAnimationCount. Then the idle animation flag is false, - /// the idle animation is disabled. `Device` uses `EChromaSDKDeviceEnum` enums. - /// - /// EXPORT_API void PluginUseIdleAnimation(int device, bool flag); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginUseIdleAnimation(int device, bool flag); - /// - /// Set idle animation flag for all devices. - /// EXPORT_API void PluginUseIdleAnimations(bool flag); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginUseIdleAnimations(bool flag); - /// - /// Set preloading animation flag, which is set to true by default. Reference - /// animation by id. - /// EXPORT_API void PluginUsePreloading(int animationId, bool flag); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginUsePreloading(int animationId, bool flag); - /// - /// Set preloading animation flag, which is set to true by default. Reference - /// animation by name. - /// EXPORT_API void PluginUsePreloadingName(const char* path, bool flag); - /// - [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - private static extern void PluginUsePreloadingName(IntPtr path, bool flag); - #endregion - } -} diff --git a/Qwilight/ChromaSDK/RazerErrors.cs b/Qwilight/ChromaSDK/RazerErrors.cs deleted file mode 100644 index ad7756a..0000000 --- a/Qwilight/ChromaSDK/RazerErrors.cs +++ /dev/null @@ -1,90 +0,0 @@ -namespace ChromaSDK -{ - class RazerErrors - { - // Error codes - //! Invalid - public const int RZRESULT_INVALID = -1; - //! Success - public const int RZRESULT_SUCCESS = 0; - //! Access denied - public const int RZRESULT_ACCESS_DENIED = 5; - //! Invalid handle - public const int RZRESULT_INVALID_HANDLE = 6; - //! Not supported - public const int RZRESULT_NOT_SUPPORTED = 50; - //! Invalid parameter. - public const int RZRESULT_INVALID_PARAMETER = 87; - //! The service has not been started - public const int RZRESULT_SERVICE_NOT_ACTIVE = 1062; - //! Cannot start more than one instance of the specified program. - public const int RZRESULT_SINGLE_INSTANCE_APP = 1152; - //! Device not connected - public const int RZRESULT_DEVICE_NOT_CONNECTED = 1167; - //! Element not found. - public const int RZRESULT_NOT_FOUND = 1168; - //! Request aborted. - public const int RZRESULT_REQUEST_ABORTED = 1235; - //! An attempt was made to perform an initialization operation when initialization has already been completed. - public const int RZRESULT_ALREADY_INITIALIZED = 1247; - //! Resource not available or disabled - public const int RZRESULT_RESOURCE_DISABLED = 4309; - //! Device not available or supported - public const int RZRESULT_DEVICE_NOT_AVAILABLE = 4319; - //! The group or resource is not in the correct state to perform the requested operation. - public const int RZRESULT_NOT_VALID_STATE = 5023; - //! No more items - public const int RZRESULT_NO_MORE_ITEMS = 259; - //! DLL not found - public const int RZRESULT_DLL_NOT_FOUND = 6023; - //! Invalid signature - public const int RZRESULT_DLL_INVALID_SIGNATURE = 6033; - //! General failure. - public const int RZRESULT_FAILED = unchecked((int)2147500037); - public static string GetResultString(int result) - { - switch (result) - { - case RZRESULT_INVALID: - return "RZRESULT_INVALID"; - case RZRESULT_SUCCESS: - return "RZRESULT_SUCCESS"; - case RZRESULT_ACCESS_DENIED: - return "RZRESULT_ACCESS_DENIED"; - case RZRESULT_INVALID_HANDLE: - return "RZRESULT_INVALID_HANDLE"; - case RZRESULT_NOT_SUPPORTED: - return "RZRESULT_NOT_SUPPORTED"; - case RZRESULT_INVALID_PARAMETER: - return "RZRESULT_INVALID_PARAMETER"; - case RZRESULT_SERVICE_NOT_ACTIVE: - return "RZRESULT_SERVICE_NOT_ACTIVE"; - case RZRESULT_SINGLE_INSTANCE_APP: - return "RZRESULT_SINGLE_INSTANCE_APP"; - case RZRESULT_DEVICE_NOT_CONNECTED: - return "RZRESULT_DEVICE_NOT_CONNECTED"; - case RZRESULT_NOT_FOUND: - return "RZRESULT_NOT_FOUND"; - case RZRESULT_REQUEST_ABORTED: - return "RZRESULT_REQUEST_ABORTED"; - case RZRESULT_ALREADY_INITIALIZED: - return "RZRESULT_ALREADY_INITIALIZED"; - case RZRESULT_RESOURCE_DISABLED: - return "RZRESULT_RESOURCE_DISABLED"; - case RZRESULT_DEVICE_NOT_AVAILABLE: - return "RZRESULT_DEVICE_NOT_AVAILABLE"; - case RZRESULT_NOT_VALID_STATE: - return "RZRESULT_NOT_VALID_STATE"; - case RZRESULT_NO_MORE_ITEMS: - return "RZRESULT_NO_MORE_ITEMS"; - case RZRESULT_DLL_NOT_FOUND: - return "RZRESULT_DLL_NOT_FOUND"; - case RZRESULT_DLL_INVALID_SIGNATURE: - return "RZRESULT_DLL_INVALID_SIGNATURE"; - case RZRESULT_FAILED: - return "RZRESULT_FAILED"; - } - return result.ToString(); - } - } -} diff --git a/Qwilight/FMOD/fmod.cs b/Qwilight/FMOD/fmod.cs deleted file mode 100644 index ecb0274..0000000 --- a/Qwilight/FMOD/fmod.cs +++ /dev/null @@ -1,4083 +0,0 @@ -/* ======================================================================================== */ -/* FMOD Core API - C# wrapper. */ -/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2023. */ -/* */ -/* For more detail visit: */ -/* https://fmod.com/docs/2.02/api/core-api.html */ -/* ======================================================================================== */ - -using System; -using System.Text; -using System.Runtime.InteropServices; -using System.Collections.Generic; - -namespace FMOD -{ - /* - FMOD version number. Check this against FMOD::System::getVersion / System_GetVersion - 0xaaaabbcc -> aaaa = major version number. bb = minor version number. cc = development version number. - */ - public partial class VERSION - { - public const int number = 0x00020219; -#if !UNITY_2019_4_OR_NEWER - public const string dll = "fmod"; -#endif - } - - public class CONSTANTS - { - public const int MAX_CHANNEL_WIDTH = 32; - public const int MAX_LISTENERS = 8; - public const int REVERB_MAXINSTANCES = 4; - public const int MAX_SYSTEMS = 8; - } - - /* - FMOD core types - */ - public enum RESULT : int - { - OK, - ERR_BADCOMMAND, - ERR_CHANNEL_ALLOC, - ERR_CHANNEL_STOLEN, - ERR_DMA, - ERR_DSP_CONNECTION, - ERR_DSP_DONTPROCESS, - ERR_DSP_FORMAT, - ERR_DSP_INUSE, - ERR_DSP_NOTFOUND, - ERR_DSP_RESERVED, - ERR_DSP_SILENCE, - ERR_DSP_TYPE, - ERR_FILE_BAD, - ERR_FILE_COULDNOTSEEK, - ERR_FILE_DISKEJECTED, - ERR_FILE_EOF, - ERR_FILE_ENDOFDATA, - ERR_FILE_NOTFOUND, - ERR_FORMAT, - ERR_HEADER_MISMATCH, - ERR_HTTP, - ERR_HTTP_ACCESS, - ERR_HTTP_PROXY_AUTH, - ERR_HTTP_SERVER_ERROR, - ERR_HTTP_TIMEOUT, - ERR_INITIALIZATION, - ERR_INITIALIZED, - ERR_INTERNAL, - ERR_INVALID_FLOAT, - ERR_INVALID_HANDLE, - ERR_INVALID_PARAM, - ERR_INVALID_POSITION, - ERR_INVALID_SPEAKER, - ERR_INVALID_SYNCPOINT, - ERR_INVALID_THREAD, - ERR_INVALID_VECTOR, - ERR_MAXAUDIBLE, - ERR_MEMORY, - ERR_MEMORY_CANTPOINT, - ERR_NEEDS3D, - ERR_NEEDSHARDWARE, - ERR_NET_CONNECT, - ERR_NET_SOCKET_ERROR, - ERR_NET_URL, - ERR_NET_WOULD_BLOCK, - ERR_NOTREADY, - ERR_OUTPUT_ALLOCATED, - ERR_OUTPUT_CREATEBUFFER, - ERR_OUTPUT_DRIVERCALL, - ERR_OUTPUT_FORMAT, - ERR_OUTPUT_INIT, - ERR_OUTPUT_NODRIVERS, - ERR_PLUGIN, - ERR_PLUGIN_MISSING, - ERR_PLUGIN_RESOURCE, - ERR_PLUGIN_VERSION, - ERR_RECORD, - ERR_REVERB_CHANNELGROUP, - ERR_REVERB_INSTANCE, - ERR_SUBSOUNDS, - ERR_SUBSOUND_ALLOCATED, - ERR_SUBSOUND_CANTMOVE, - ERR_TAGNOTFOUND, - ERR_TOOMANYCHANNELS, - ERR_TRUNCATED, - ERR_UNIMPLEMENTED, - ERR_UNINITIALIZED, - ERR_UNSUPPORTED, - ERR_VERSION, - ERR_EVENT_ALREADY_LOADED, - ERR_EVENT_LIVEUPDATE_BUSY, - ERR_EVENT_LIVEUPDATE_MISMATCH, - ERR_EVENT_LIVEUPDATE_TIMEOUT, - ERR_EVENT_NOTFOUND, - ERR_STUDIO_UNINITIALIZED, - ERR_STUDIO_NOT_LOADED, - ERR_INVALID_STRING, - ERR_ALREADY_LOCKED, - ERR_NOT_LOCKED, - ERR_RECORD_DISCONNECTED, - ERR_TOOMANYSAMPLES, - } - - public enum CHANNELCONTROL_TYPE : int - { - CHANNEL, - CHANNELGROUP, - MAX - } - - [StructLayout(LayoutKind.Sequential)] - public struct VECTOR - { - public float x; - public float y; - public float z; - } - - [StructLayout(LayoutKind.Sequential)] - public struct ATTRIBUTES_3D - { - public VECTOR position; - public VECTOR velocity; - public VECTOR forward; - public VECTOR up; - } - - [StructLayout(LayoutKind.Sequential)] - public partial struct GUID - { - public int Data1; - public int Data2; - public int Data3; - public int Data4; - } - - [StructLayout(LayoutKind.Sequential)] - public struct ASYNCREADINFO - { - public IntPtr handle; - public uint offset; - public uint sizebytes; - public int priority; - - public IntPtr userdata; - public IntPtr buffer; - public uint bytesread; - public FILE_ASYNCDONE_FUNC done; - } - - public enum OUTPUTTYPE : int - { - AUTODETECT, - - UNKNOWN, - NOSOUND, - WAVWRITER, - NOSOUND_NRT, - WAVWRITER_NRT, - - WASAPI, - ASIO, - PULSEAUDIO, - ALSA, - COREAUDIO, - AUDIOTRACK, - OPENSL, - AUDIOOUT, - AUDIO3D, - WEBAUDIO, - NNAUDIO, - WINSONIC, - AAUDIO, - AUDIOWORKLET, - PHASE, - OHAUDIO, - - MAX, - } - - public enum PORT_TYPE : int - { - MUSIC, - COPYRIGHT_MUSIC, - VOICE, - CONTROLLER, - PERSONAL, - VIBRATION, - AUX, - - MAX - } - - public enum DEBUG_MODE : int - { - TTY, - FILE, - CALLBACK, - } - - [Flags] - public enum DEBUG_FLAGS : uint - { - NONE = 0x00000000, - ERROR = 0x00000001, - WARNING = 0x00000002, - LOG = 0x00000004, - - TYPE_MEMORY = 0x00000100, - TYPE_FILE = 0x00000200, - TYPE_CODEC = 0x00000400, - TYPE_TRACE = 0x00000800, - - DISPLAY_TIMESTAMPS = 0x00010000, - DISPLAY_LINENUMBERS = 0x00020000, - DISPLAY_THREAD = 0x00040000, - } - - [Flags] - public enum MEMORY_TYPE : uint - { - NORMAL = 0x00000000, - STREAM_FILE = 0x00000001, - STREAM_DECODE = 0x00000002, - SAMPLEDATA = 0x00000004, - DSP_BUFFER = 0x00000008, - PLUGIN = 0x00000010, - PERSISTENT = 0x00200000, - ALL = 0xFFFFFFFF - } - - public enum SPEAKERMODE : int - { - DEFAULT, - RAW, - MONO, - STEREO, - QUAD, - SURROUND, - _5POINT1, - _7POINT1, - _7POINT1POINT4, - - MAX, - } - - public enum SPEAKER : int - { - NONE = -1, - FRONT_LEFT, - FRONT_RIGHT, - FRONT_CENTER, - LOW_FREQUENCY, - SURROUND_LEFT, - SURROUND_RIGHT, - BACK_LEFT, - BACK_RIGHT, - TOP_FRONT_LEFT, - TOP_FRONT_RIGHT, - TOP_BACK_LEFT, - TOP_BACK_RIGHT, - - MAX, - } - - [Flags] - public enum CHANNELMASK : uint - { - FRONT_LEFT = 0x00000001, - FRONT_RIGHT = 0x00000002, - FRONT_CENTER = 0x00000004, - LOW_FREQUENCY = 0x00000008, - SURROUND_LEFT = 0x00000010, - SURROUND_RIGHT = 0x00000020, - BACK_LEFT = 0x00000040, - BACK_RIGHT = 0x00000080, - BACK_CENTER = 0x00000100, - - MONO = (FRONT_LEFT), - STEREO = (FRONT_LEFT | FRONT_RIGHT), - LRC = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER), - QUAD = (FRONT_LEFT | FRONT_RIGHT | SURROUND_LEFT | SURROUND_RIGHT), - SURROUND = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT), - _5POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT), - _5POINT1_REARS = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT), - _7POINT0 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT), - _7POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT) - } - - public enum CHANNELORDER : int - { - DEFAULT, - WAVEFORMAT, - PROTOOLS, - ALLMONO, - ALLSTEREO, - ALSA, - - MAX, - } - - public enum PLUGINTYPE : int - { - OUTPUT, - CODEC, - DSP, - - MAX, - } - - [StructLayout(LayoutKind.Sequential)] - public struct PLUGINLIST - { - PLUGINTYPE type; - IntPtr description; - } - - [Flags] - public enum INITFLAGS : uint - { - NORMAL = 0x00000000, - STREAM_FROM_UPDATE = 0x00000001, - MIX_FROM_UPDATE = 0x00000002, - _3D_RIGHTHANDED = 0x00000004, - CLIP_OUTPUT = 0x00000008, - CHANNEL_LOWPASS = 0x00000100, - CHANNEL_DISTANCEFILTER = 0x00000200, - PROFILE_ENABLE = 0x00010000, - VOL0_BECOMES_VIRTUAL = 0x00020000, - GEOMETRY_USECLOSEST = 0x00040000, - PREFER_DOLBY_DOWNMIX = 0x00080000, - THREAD_UNSAFE = 0x00100000, - PROFILE_METER_ALL = 0x00200000, - MEMORY_TRACKING = 0x00400000, - } - - public enum SOUND_TYPE : int - { - UNKNOWN, - AIFF, - ASF, - DLS, - FLAC, - FSB, - IT, - MIDI, - MOD, - MPEG, - OGGVORBIS, - PLAYLIST, - RAW, - S3M, - USER, - WAV, - XM, - XMA, - AUDIOQUEUE, - AT9, - VORBIS, - MEDIA_FOUNDATION, - MEDIACODEC, - FADPCM, - OPUS, - - MAX, - } - - public enum SOUND_FORMAT : int - { - NONE, - PCM8, - PCM16, - PCM24, - PCM32, - PCMFLOAT, - BITSTREAM, - - MAX - } - - [Flags] - public enum MODE : uint - { - DEFAULT = 0x00000000, - LOOP_OFF = 0x00000001, - LOOP_NORMAL = 0x00000002, - LOOP_BIDI = 0x00000004, - _2D = 0x00000008, - _3D = 0x00000010, - CREATESTREAM = 0x00000080, - CREATESAMPLE = 0x00000100, - CREATECOMPRESSEDSAMPLE = 0x00000200, - OPENUSER = 0x00000400, - OPENMEMORY = 0x00000800, - OPENMEMORY_POINT = 0x10000000, - OPENRAW = 0x00001000, - OPENONLY = 0x00002000, - ACCURATETIME = 0x00004000, - MPEGSEARCH = 0x00008000, - NONBLOCKING = 0x00010000, - UNIQUE = 0x00020000, - _3D_HEADRELATIVE = 0x00040000, - _3D_WORLDRELATIVE = 0x00080000, - _3D_INVERSEROLLOFF = 0x00100000, - _3D_LINEARROLLOFF = 0x00200000, - _3D_LINEARSQUAREROLLOFF = 0x00400000, - _3D_INVERSETAPEREDROLLOFF = 0x00800000, - _3D_CUSTOMROLLOFF = 0x04000000, - _3D_IGNOREGEOMETRY = 0x40000000, - IGNORETAGS = 0x02000000, - LOWMEM = 0x08000000, - VIRTUAL_PLAYFROMSTART = 0x80000000 - } - - public enum OPENSTATE : int - { - READY = 0, - LOADING, - ERROR, - CONNECTING, - BUFFERING, - SEEKING, - PLAYING, - SETPOSITION, - - MAX, - } - - public enum SOUNDGROUP_BEHAVIOR : int - { - BEHAVIOR_FAIL, - BEHAVIOR_MUTE, - BEHAVIOR_STEALLOWEST, - - MAX, - } - - public enum CHANNELCONTROL_CALLBACK_TYPE : int - { - END, - VIRTUALVOICE, - SYNCPOINT, - OCCLUSION, - - MAX, - } - - public struct CHANNELCONTROL_DSP_INDEX - { - public const int HEAD = -1; - public const int FADER = -2; - public const int TAIL = -3; - } - - public enum ERRORCALLBACK_INSTANCETYPE : int - { - NONE, - SYSTEM, - CHANNEL, - CHANNELGROUP, - CHANNELCONTROL, - SOUND, - SOUNDGROUP, - DSP, - DSPCONNECTION, - GEOMETRY, - REVERB3D, - STUDIO_SYSTEM, - STUDIO_EVENTDESCRIPTION, - STUDIO_EVENTINSTANCE, - STUDIO_PARAMETERINSTANCE, - STUDIO_BUS, - STUDIO_VCA, - STUDIO_BANK, - STUDIO_COMMANDREPLAY - } - - [StructLayout(LayoutKind.Sequential)] - public struct ERRORCALLBACK_INFO - { - public RESULT result; - public ERRORCALLBACK_INSTANCETYPE instancetype; - public IntPtr instance; - public StringWrapper functionname; - public StringWrapper functionparams; - } - - [StructLayout(LayoutKind.Sequential)] - public struct CPU_USAGE - { - public float dsp; /* DSP mixing CPU usage. */ - public float stream; /* Streaming engine CPU usage. */ - public float geometry; /* Geometry engine CPU usage. */ - public float update; /* System::update CPU usage. */ - public float convolution1; /* Convolution reverb processing thread #1 CPU usage */ - public float convolution2; /* Convolution reverb processing thread #2 CPU usage */ - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_DATA_PARAMETER_INFO - { - public IntPtr data; - public uint length; - public int index; - } - - [Flags] - public enum SYSTEM_CALLBACK_TYPE : uint - { - DEVICELISTCHANGED = 0x00000001, - DEVICELOST = 0x00000002, - MEMORYALLOCATIONFAILED = 0x00000004, - THREADCREATED = 0x00000008, - BADDSPCONNECTION = 0x00000010, - PREMIX = 0x00000020, - POSTMIX = 0x00000040, - ERROR = 0x00000080, - MIDMIX = 0x00000100, - THREADDESTROYED = 0x00000200, - PREUPDATE = 0x00000400, - POSTUPDATE = 0x00000800, - RECORDLISTCHANGED = 0x00001000, - BUFFEREDNOMIX = 0x00002000, - DEVICEREINITIALIZE = 0x00004000, - OUTPUTUNDERRUN = 0x00008000, - RECORDPOSITIONCHANGED = 0x00010000, - ALL = 0xFFFFFFFF, - } - - /* - FMOD Callbacks - */ - public delegate RESULT DEBUG_CALLBACK (DEBUG_FLAGS flags, IntPtr file, int line, IntPtr func, IntPtr message); - public delegate RESULT SYSTEM_CALLBACK (IntPtr system, SYSTEM_CALLBACK_TYPE type, IntPtr commanddata1, IntPtr commanddata2, IntPtr userdata); - public delegate RESULT CHANNELCONTROL_CALLBACK (IntPtr channelcontrol, CHANNELCONTROL_TYPE controltype, CHANNELCONTROL_CALLBACK_TYPE callbacktype, IntPtr commanddata1, IntPtr commanddata2); - public delegate RESULT DSP_CALLBACK (IntPtr dsp, DSP_CALLBACK_TYPE type, IntPtr data); - public delegate RESULT SOUND_NONBLOCK_CALLBACK (IntPtr sound, RESULT result); - public delegate RESULT SOUND_PCMREAD_CALLBACK (IntPtr sound, IntPtr data, uint datalen); - public delegate RESULT SOUND_PCMSETPOS_CALLBACK (IntPtr sound, int subsound, uint position, TIMEUNIT postype); - public delegate RESULT FILE_OPEN_CALLBACK (IntPtr name, ref uint filesize, ref IntPtr handle, IntPtr userdata); - public delegate RESULT FILE_CLOSE_CALLBACK (IntPtr handle, IntPtr userdata); - public delegate RESULT FILE_READ_CALLBACK (IntPtr handle, IntPtr buffer, uint sizebytes, ref uint bytesread, IntPtr userdata); - public delegate RESULT FILE_SEEK_CALLBACK (IntPtr handle, uint pos, IntPtr userdata); - public delegate RESULT FILE_ASYNCREAD_CALLBACK (IntPtr info, IntPtr userdata); - public delegate RESULT FILE_ASYNCCANCEL_CALLBACK(IntPtr info, IntPtr userdata); - public delegate void FILE_ASYNCDONE_FUNC (IntPtr info, RESULT result); - public delegate IntPtr MEMORY_ALLOC_CALLBACK (uint size, MEMORY_TYPE type, IntPtr sourcestr); - public delegate IntPtr MEMORY_REALLOC_CALLBACK (IntPtr ptr, uint size, MEMORY_TYPE type, IntPtr sourcestr); - public delegate void MEMORY_FREE_CALLBACK (IntPtr ptr, MEMORY_TYPE type, IntPtr sourcestr); - public delegate float CB_3D_ROLLOFF_CALLBACK (IntPtr channelcontrol, float distance); - - public enum DSP_RESAMPLER : int - { - DEFAULT, - NOINTERP, - LINEAR, - CUBIC, - SPLINE, - - MAX, - } - - public enum DSP_CALLBACK_TYPE : int - { - DATAPARAMETERRELEASE, - - MAX, - } - - public enum DSPCONNECTION_TYPE : int - { - STANDARD, - SIDECHAIN, - SEND, - SEND_SIDECHAIN, - - MAX, - } - - public enum TAGTYPE : int - { - UNKNOWN = 0, - ID3V1, - ID3V2, - VORBISCOMMENT, - SHOUTCAST, - ICECAST, - ASF, - MIDI, - PLAYLIST, - FMOD, - USER, - - MAX - } - - public enum TAGDATATYPE : int - { - BINARY = 0, - INT, - FLOAT, - STRING, - STRING_UTF16, - STRING_UTF16BE, - STRING_UTF8, - - MAX - } - - [StructLayout(LayoutKind.Sequential)] - public struct TAG - { - public TAGTYPE type; - public TAGDATATYPE datatype; - public StringWrapper name; - public IntPtr data; - public uint datalen; - public bool updated; - } - - [Flags] - public enum TIMEUNIT : uint - { - MS = 0x00000001, - PCM = 0x00000002, - PCMBYTES = 0x00000004, - RAWBYTES = 0x00000008, - PCMFRACTION = 0x00000010, - MODORDER = 0x00000100, - MODROW = 0x00000200, - MODPATTERN = 0x00000400, - } - - public struct PORT_INDEX - { - public const ulong NONE = 0xFFFFFFFFFFFFFFFF; - public const ulong FLAG_VR_CONTROLLER = 0x1000000000000000; - } - - [StructLayout(LayoutKind.Sequential)] - public struct CREATESOUNDEXINFO - { - public int cbsize; - public uint length; - public uint fileoffset; - public int numchannels; - public int defaultfrequency; - public SOUND_FORMAT format; - public uint decodebuffersize; - public int initialsubsound; - public int numsubsounds; - public IntPtr inclusionlist; - public int inclusionlistnum; - public IntPtr pcmreadcallback_internal; - public IntPtr pcmsetposcallback_internal; - public IntPtr nonblockcallback_internal; - public IntPtr dlsname; - public IntPtr encryptionkey; - public int maxpolyphony; - public IntPtr userdata; - public SOUND_TYPE suggestedsoundtype; - public IntPtr fileuseropen_internal; - public IntPtr fileuserclose_internal; - public IntPtr fileuserread_internal; - public IntPtr fileuserseek_internal; - public IntPtr fileuserasyncread_internal; - public IntPtr fileuserasynccancel_internal; - public IntPtr fileuserdata; - public int filebuffersize; - public CHANNELORDER channelorder; - public IntPtr initialsoundgroup; - public uint initialseekposition; - public TIMEUNIT initialseekpostype; - public int ignoresetfilesystem; - public uint audioqueuepolicy; - public uint minmidigranularity; - public int nonblockthreadid; - public IntPtr fsbguid; - - public SOUND_PCMREAD_CALLBACK pcmreadcallback - { - set { pcmreadcallback_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } - get { return pcmreadcallback_internal == IntPtr.Zero ? null : (SOUND_PCMREAD_CALLBACK)Marshal.GetDelegateForFunctionPointer(pcmreadcallback_internal, typeof(SOUND_PCMREAD_CALLBACK)); } - } - public SOUND_PCMSETPOS_CALLBACK pcmsetposcallback - { - set { pcmsetposcallback_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } - get { return pcmsetposcallback_internal == IntPtr.Zero ? null : (SOUND_PCMSETPOS_CALLBACK)Marshal.GetDelegateForFunctionPointer(pcmsetposcallback_internal, typeof(SOUND_PCMSETPOS_CALLBACK)); } - } - public SOUND_NONBLOCK_CALLBACK nonblockcallback - { - set { nonblockcallback_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } - get { return nonblockcallback_internal == IntPtr.Zero ? null : (SOUND_NONBLOCK_CALLBACK)Marshal.GetDelegateForFunctionPointer(nonblockcallback_internal, typeof(SOUND_NONBLOCK_CALLBACK)); } - } - public FILE_OPEN_CALLBACK fileuseropen - { - set { fileuseropen_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } - get { return fileuseropen_internal == IntPtr.Zero ? null : (FILE_OPEN_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuseropen_internal, typeof(FILE_OPEN_CALLBACK)); } - } - public FILE_CLOSE_CALLBACK fileuserclose - { - set { fileuserclose_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } - get { return fileuserclose_internal == IntPtr.Zero ? null : (FILE_CLOSE_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuserclose_internal, typeof(FILE_CLOSE_CALLBACK)); } - } - public FILE_READ_CALLBACK fileuserread - { - set { fileuserread_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } - get { return fileuserread_internal == IntPtr.Zero ? null : (FILE_READ_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuserread_internal, typeof(FILE_READ_CALLBACK)); } - } - public FILE_SEEK_CALLBACK fileuserseek - { - set { fileuserseek_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } - get { return fileuserseek_internal == IntPtr.Zero ? null : (FILE_SEEK_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuserseek_internal, typeof(FILE_SEEK_CALLBACK)); } - } - public FILE_ASYNCREAD_CALLBACK fileuserasyncread - { - set { fileuserasyncread_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } - get { return fileuserasyncread_internal == IntPtr.Zero ? null : (FILE_ASYNCREAD_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuserasyncread_internal, typeof(FILE_ASYNCREAD_CALLBACK)); } - } - public FILE_ASYNCCANCEL_CALLBACK fileuserasynccancel - { - set { fileuserasynccancel_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } - get { return fileuserasynccancel_internal == IntPtr.Zero ? null : (FILE_ASYNCCANCEL_CALLBACK)Marshal.GetDelegateForFunctionPointer(fileuserasynccancel_internal, typeof(FILE_ASYNCCANCEL_CALLBACK)); } - } - - } - -#pragma warning disable 414 - [StructLayout(LayoutKind.Sequential)] - public struct REVERB_PROPERTIES - { - public float DecayTime; - public float EarlyDelay; - public float LateDelay; - public float HFReference; - public float HFDecayRatio; - public float Diffusion; - public float Density; - public float LowShelfFrequency; - public float LowShelfGain; - public float HighCut; - public float EarlyLateMix; - public float WetLevel; - - #region wrapperinternal - public REVERB_PROPERTIES(float decayTime, float earlyDelay, float lateDelay, float hfReference, - float hfDecayRatio, float diffusion, float density, float lowShelfFrequency, float lowShelfGain, - float highCut, float earlyLateMix, float wetLevel) - { - DecayTime = decayTime; - EarlyDelay = earlyDelay; - LateDelay = lateDelay; - HFReference = hfReference; - HFDecayRatio = hfDecayRatio; - Diffusion = diffusion; - Density = density; - LowShelfFrequency = lowShelfFrequency; - LowShelfGain = lowShelfGain; - HighCut = highCut; - EarlyLateMix = earlyLateMix; - WetLevel = wetLevel; - } - #endregion - } -#pragma warning restore 414 - - public class PRESET - { - public static REVERB_PROPERTIES OFF() { return new REVERB_PROPERTIES( 1000, 7, 11, 5000, 100, 100, 100, 250, 0, 20, 96, -80.0f );} - public static REVERB_PROPERTIES GENERIC() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 83, 100, 100, 250, 0, 14500, 96, -8.0f );} - public static REVERB_PROPERTIES PADDEDCELL() { return new REVERB_PROPERTIES( 170, 1, 2, 5000, 10, 100, 100, 250, 0, 160, 84, -7.8f );} - public static REVERB_PROPERTIES ROOM() { return new REVERB_PROPERTIES( 400, 2, 3, 5000, 83, 100, 100, 250, 0, 6050, 88, -9.4f );} - public static REVERB_PROPERTIES BATHROOM() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 54, 100, 60, 250, 0, 2900, 83, 0.5f );} - public static REVERB_PROPERTIES LIVINGROOM() { return new REVERB_PROPERTIES( 500, 3, 4, 5000, 10, 100, 100, 250, 0, 160, 58, -19.0f );} - public static REVERB_PROPERTIES STONEROOM() { return new REVERB_PROPERTIES( 2300, 12, 17, 5000, 64, 100, 100, 250, 0, 7800, 71, -8.5f );} - public static REVERB_PROPERTIES AUDITORIUM() { return new REVERB_PROPERTIES( 4300, 20, 30, 5000, 59, 100, 100, 250, 0, 5850, 64, -11.7f );} - public static REVERB_PROPERTIES CONCERTHALL() { return new REVERB_PROPERTIES( 3900, 20, 29, 5000, 70, 100, 100, 250, 0, 5650, 80, -9.8f );} - public static REVERB_PROPERTIES CAVE() { return new REVERB_PROPERTIES( 2900, 15, 22, 5000, 100, 100, 100, 250, 0, 20000, 59, -11.3f );} - public static REVERB_PROPERTIES ARENA() { return new REVERB_PROPERTIES( 7200, 20, 30, 5000, 33, 100, 100, 250, 0, 4500, 80, -9.6f );} - public static REVERB_PROPERTIES HANGAR() { return new REVERB_PROPERTIES( 10000, 20, 30, 5000, 23, 100, 100, 250, 0, 3400, 72, -7.4f );} - public static REVERB_PROPERTIES CARPETTEDHALLWAY() { return new REVERB_PROPERTIES( 300, 2, 30, 5000, 10, 100, 100, 250, 0, 500, 56, -24.0f );} - public static REVERB_PROPERTIES HALLWAY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 59, 100, 100, 250, 0, 7800, 87, -5.5f );} - public static REVERB_PROPERTIES STONECORRIDOR() { return new REVERB_PROPERTIES( 270, 13, 20, 5000, 79, 100, 100, 250, 0, 9000, 86, -6.0f );} - public static REVERB_PROPERTIES ALLEY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 86, 100, 100, 250, 0, 8300, 80, -9.8f );} - public static REVERB_PROPERTIES FOREST() { return new REVERB_PROPERTIES( 1500, 162, 88, 5000, 54, 79, 100, 250, 0, 760, 94, -12.3f );} - public static REVERB_PROPERTIES CITY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 67, 50, 100, 250, 0, 4050, 66, -26.0f );} - public static REVERB_PROPERTIES MOUNTAINS() { return new REVERB_PROPERTIES( 1500, 300, 100, 5000, 21, 27, 100, 250, 0, 1220, 82, -24.0f );} - public static REVERB_PROPERTIES QUARRY() { return new REVERB_PROPERTIES( 1500, 61, 25, 5000, 83, 100, 100, 250, 0, 3400, 100, -5.0f );} - public static REVERB_PROPERTIES PLAIN() { return new REVERB_PROPERTIES( 1500, 179, 100, 5000, 50, 21, 100, 250, 0, 1670, 65, -28.0f );} - public static REVERB_PROPERTIES PARKINGLOT() { return new REVERB_PROPERTIES( 1700, 8, 12, 5000, 100, 100, 100, 250, 0, 20000, 56, -19.5f );} - public static REVERB_PROPERTIES SEWERPIPE() { return new REVERB_PROPERTIES( 2800, 14, 21, 5000, 14, 80, 60, 250, 0, 3400, 66, 1.2f );} - public static REVERB_PROPERTIES UNDERWATER() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 10, 100, 100, 250, 0, 500, 92, 7.0f );} - } - - [StructLayout(LayoutKind.Sequential)] - public struct ADVANCEDSETTINGS - { - public int cbSize; - public int maxMPEGCodecs; - public int maxADPCMCodecs; - public int maxXMACodecs; - public int maxVorbisCodecs; - public int maxAT9Codecs; - public int maxFADPCMCodecs; - public int maxPCMCodecs; - public int ASIONumChannels; - public IntPtr ASIOChannelList; - public IntPtr ASIOSpeakerList; - public float vol0virtualvol; - public uint defaultDecodeBufferSize; - public ushort profilePort; - public uint geometryMaxFadeTime; - public float distanceFilterCenterFreq; - public int reverb3Dinstance; - public int DSPBufferPoolSize; - public DSP_RESAMPLER resamplerMethod; - public uint randomSeed; - public int maxConvolutionThreads; - public int maxOpusCodecs; - } - - [Flags] - public enum DRIVER_STATE : uint - { - CONNECTED = 0x00000001, - DEFAULT = 0x00000002, - } - - public enum THREAD_PRIORITY : int - { - /* Platform specific priority range */ - PLATFORM_MIN = -32 * 1024, - PLATFORM_MAX = 32 * 1024, - - /* Platform agnostic priorities, maps internally to platform specific value */ - DEFAULT = PLATFORM_MIN - 1, - LOW = PLATFORM_MIN - 2, - MEDIUM = PLATFORM_MIN - 3, - HIGH = PLATFORM_MIN - 4, - VERY_HIGH = PLATFORM_MIN - 5, - EXTREME = PLATFORM_MIN - 6, - CRITICAL = PLATFORM_MIN - 7, - - /* Thread defaults */ - MIXER = EXTREME, - FEEDER = CRITICAL, - STREAM = VERY_HIGH, - FILE = HIGH, - NONBLOCKING = HIGH, - RECORD = HIGH, - GEOMETRY = LOW, - PROFILER = MEDIUM, - STUDIO_UPDATE = MEDIUM, - STUDIO_LOAD_BANK = MEDIUM, - STUDIO_LOAD_SAMPLE = MEDIUM, - CONVOLUTION1 = VERY_HIGH, - CONVOLUTION2 = VERY_HIGH - - } - - public enum THREAD_STACK_SIZE : uint - { - DEFAULT = 0, - MIXER = 80 * 1024, - FEEDER = 16 * 1024, - STREAM = 96 * 1024, - FILE = 64 * 1024, - NONBLOCKING = 112 * 1024, - RECORD = 16 * 1024, - GEOMETRY = 48 * 1024, - PROFILER = 128 * 1024, - STUDIO_UPDATE = 96 * 1024, - STUDIO_LOAD_BANK = 96 * 1024, - STUDIO_LOAD_SAMPLE = 96 * 1024, - CONVOLUTION1 = 16 * 1024, - CONVOLUTION2 = 16 * 1024 - } - - [Flags] - public enum THREAD_AFFINITY : long - { - /* Platform agnostic thread groupings */ - GROUP_DEFAULT = 0x4000000000000000, - GROUP_A = 0x4000000000000001, - GROUP_B = 0x4000000000000002, - GROUP_C = 0x4000000000000003, - - /* Thread defaults */ - MIXER = GROUP_A, - FEEDER = GROUP_C, - STREAM = GROUP_C, - FILE = GROUP_C, - NONBLOCKING = GROUP_C, - RECORD = GROUP_C, - GEOMETRY = GROUP_C, - PROFILER = GROUP_C, - STUDIO_UPDATE = GROUP_B, - STUDIO_LOAD_BANK = GROUP_C, - STUDIO_LOAD_SAMPLE = GROUP_C, - CONVOLUTION1 = GROUP_C, - CONVOLUTION2 = GROUP_C, - - /* Core mask, valid up to 1 << 61 */ - CORE_ALL = 0, - CORE_0 = 1 << 0, - CORE_1 = 1 << 1, - CORE_2 = 1 << 2, - CORE_3 = 1 << 3, - CORE_4 = 1 << 4, - CORE_5 = 1 << 5, - CORE_6 = 1 << 6, - CORE_7 = 1 << 7, - CORE_8 = 1 << 8, - CORE_9 = 1 << 9, - CORE_10 = 1 << 10, - CORE_11 = 1 << 11, - CORE_12 = 1 << 12, - CORE_13 = 1 << 13, - CORE_14 = 1 << 14, - CORE_15 = 1 << 15 - } - - public enum THREAD_TYPE : int - { - MIXER, - FEEDER, - STREAM, - FILE, - NONBLOCKING, - RECORD, - GEOMETRY, - PROFILER, - STUDIO_UPDATE, - STUDIO_LOAD_BANK, - STUDIO_LOAD_SAMPLE, - CONVOLUTION1, - CONVOLUTION2, - - MAX - } - - /* - FMOD System factory functions. Use this to create an FMOD System Instance. below you will see System init/close to get started. - */ - public struct Factory - { - public static RESULT System_Create(out System system) - { - return FMOD5_System_Create(out system.handle, VERSION.number); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Create(out IntPtr system, uint headerversion); - - #endregion - } - - /* - FMOD global system functions (optional). - */ - public struct Memory - { - public static RESULT Initialize(IntPtr poolmem, int poollen, MEMORY_ALLOC_CALLBACK useralloc, MEMORY_REALLOC_CALLBACK userrealloc, MEMORY_FREE_CALLBACK userfree, MEMORY_TYPE memtypeflags = MEMORY_TYPE.ALL) - { - return FMOD5_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); - } - - public static RESULT GetStats(out int currentalloced, out int maxalloced, bool blocking = true) - { - return FMOD5_Memory_GetStats(out currentalloced, out maxalloced, blocking); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Memory_Initialize(IntPtr poolmem, int poollen, MEMORY_ALLOC_CALLBACK useralloc, MEMORY_REALLOC_CALLBACK userrealloc, MEMORY_FREE_CALLBACK userfree, MEMORY_TYPE memtypeflags); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Memory_GetStats (out int currentalloced, out int maxalloced, bool blocking); - - #endregion - } - - public struct Debug - { - public static RESULT Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode = DEBUG_MODE.TTY, DEBUG_CALLBACK callback = null, string filename = null) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return FMOD5_Debug_Initialize(flags, mode, callback, encoder.byteFromStringUTF8(filename)); - } - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Debug_Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode, DEBUG_CALLBACK callback, byte[] filename); - - #endregion - } - - public struct Thread - { - public static RESULT SetAttributes(THREAD_TYPE type, THREAD_AFFINITY affinity = THREAD_AFFINITY.GROUP_DEFAULT, THREAD_PRIORITY priority = THREAD_PRIORITY.DEFAULT, THREAD_STACK_SIZE stacksize = THREAD_STACK_SIZE.DEFAULT) - { - return FMOD5_Thread_SetAttributes(type, affinity, priority, stacksize); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Thread_SetAttributes(THREAD_TYPE type, THREAD_AFFINITY affinity, THREAD_PRIORITY priority, THREAD_STACK_SIZE stacksize); - #endregion - } - - /* - 'System' API. - */ - public struct System - { - public RESULT release() - { - return FMOD5_System_Release(this.handle); - } - - // Setup functions. - public RESULT setOutput(OUTPUTTYPE output) - { - return FMOD5_System_SetOutput(this.handle, output); - } - public RESULT getOutput(out OUTPUTTYPE output) - { - return FMOD5_System_GetOutput(this.handle, out output); - } - public RESULT getNumDrivers(out int numdrivers) - { - return FMOD5_System_GetNumDrivers(this.handle, out numdrivers); - } - public RESULT getDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) - { - IntPtr stringMem = Marshal.AllocHGlobal(namelen); - - RESULT result = FMOD5_System_GetDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels); - using (StringHelper.ThreadSafeEncoding encoding = StringHelper.GetFreeHelper()) - { - name = encoding.stringFromNative(stringMem); - } - Marshal.FreeHGlobal(stringMem); - - return result; - } - public RESULT getDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) - { - return FMOD5_System_GetDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels); - } - public RESULT setDriver(int driver) - { - return FMOD5_System_SetDriver(this.handle, driver); - } - public RESULT getDriver(out int driver) - { - return FMOD5_System_GetDriver(this.handle, out driver); - } - public RESULT setSoftwareChannels(int numsoftwarechannels) - { - return FMOD5_System_SetSoftwareChannels(this.handle, numsoftwarechannels); - } - public RESULT getSoftwareChannels(out int numsoftwarechannels) - { - return FMOD5_System_GetSoftwareChannels(this.handle, out numsoftwarechannels); - } - public RESULT setSoftwareFormat(int samplerate, SPEAKERMODE speakermode, int numrawspeakers) - { - return FMOD5_System_SetSoftwareFormat(this.handle, samplerate, speakermode, numrawspeakers); - } - public RESULT getSoftwareFormat(out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers) - { - return FMOD5_System_GetSoftwareFormat(this.handle, out samplerate, out speakermode, out numrawspeakers); - } - public RESULT setDSPBufferSize(uint bufferlength, int numbuffers) - { - return FMOD5_System_SetDSPBufferSize(this.handle, bufferlength, numbuffers); - } - public RESULT getDSPBufferSize(out uint bufferlength, out int numbuffers) - { - return FMOD5_System_GetDSPBufferSize(this.handle, out bufferlength, out numbuffers); - } - public RESULT setFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek, FILE_ASYNCREAD_CALLBACK userasyncread, FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign) - { - return FMOD5_System_SetFileSystem(this.handle, useropen, userclose, userread, userseek, userasyncread, userasynccancel, blockalign); - } - public RESULT attachFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek) - { - return FMOD5_System_AttachFileSystem(this.handle, useropen, userclose, userread, userseek); - } - public RESULT setAdvancedSettings(ref ADVANCEDSETTINGS settings) - { - settings.cbSize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); - return FMOD5_System_SetAdvancedSettings(this.handle, ref settings); - } - public RESULT getAdvancedSettings(ref ADVANCEDSETTINGS settings) - { - settings.cbSize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); - return FMOD5_System_GetAdvancedSettings(this.handle, ref settings); - } - public RESULT setCallback(SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL) - { - return FMOD5_System_SetCallback(this.handle, callback, callbackmask); - } - - // Plug-in support. - public RESULT setPluginPath(string path) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return FMOD5_System_SetPluginPath(this.handle, encoder.byteFromStringUTF8(path)); - } - } - public RESULT loadPlugin(string filename, out uint handle, uint priority = 0) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return FMOD5_System_LoadPlugin(this.handle, encoder.byteFromStringUTF8(filename), out handle, priority); - } - } - public RESULT unloadPlugin(uint handle) - { - return FMOD5_System_UnloadPlugin(this.handle, handle); - } - public RESULT getNumNestedPlugins(uint handle, out int count) - { - return FMOD5_System_GetNumNestedPlugins(this.handle, handle, out count); - } - public RESULT getNestedPlugin(uint handle, int index, out uint nestedhandle) - { - return FMOD5_System_GetNestedPlugin(this.handle, handle, index, out nestedhandle); - } - public RESULT getNumPlugins(PLUGINTYPE plugintype, out int numplugins) - { - return FMOD5_System_GetNumPlugins(this.handle, plugintype, out numplugins); - } - public RESULT getPluginHandle(PLUGINTYPE plugintype, int index, out uint handle) - { - return FMOD5_System_GetPluginHandle(this.handle, plugintype, index, out handle); - } - public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out string name, int namelen, out uint version) - { - IntPtr stringMem = Marshal.AllocHGlobal(namelen); - - RESULT result = FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, stringMem, namelen, out version); - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - name = encoder.stringFromNative(stringMem); - } - Marshal.FreeHGlobal(stringMem); - - return result; - } - public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out uint version) - { - return FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, IntPtr.Zero, 0, out version); - } - public RESULT setOutputByPlugin(uint handle) - { - return FMOD5_System_SetOutputByPlugin(this.handle, handle); - } - public RESULT getOutputByPlugin(out uint handle) - { - return FMOD5_System_GetOutputByPlugin(this.handle, out handle); - } - public RESULT createDSPByPlugin(uint handle, out DSP dsp) - { - return FMOD5_System_CreateDSPByPlugin(this.handle, handle, out dsp.handle); - } - public RESULT getDSPInfoByPlugin(uint handle, out IntPtr description) - { - return FMOD5_System_GetDSPInfoByPlugin(this.handle, handle, out description); - } - public RESULT registerDSP(ref DSP_DESCRIPTION description, out uint handle) - { - return FMOD5_System_RegisterDSP(this.handle, ref description, out handle); - } - - // Init/Close. - public RESULT init(int maxchannels, INITFLAGS flags, IntPtr extradriverdata) - { - return FMOD5_System_Init(this.handle, maxchannels, flags, extradriverdata); - } - public RESULT close() - { - return FMOD5_System_Close(this.handle); - } - - // General post-init system functions. - public RESULT update() - { - return FMOD5_System_Update(this.handle); - } - public RESULT setSpeakerPosition(SPEAKER speaker, float x, float y, bool active) - { - return FMOD5_System_SetSpeakerPosition(this.handle, speaker, x, y, active); - } - public RESULT getSpeakerPosition(SPEAKER speaker, out float x, out float y, out bool active) - { - return FMOD5_System_GetSpeakerPosition(this.handle, speaker, out x, out y, out active); - } - public RESULT setStreamBufferSize(uint filebuffersize, TIMEUNIT filebuffersizetype) - { - return FMOD5_System_SetStreamBufferSize(this.handle, filebuffersize, filebuffersizetype); - } - public RESULT getStreamBufferSize(out uint filebuffersize, out TIMEUNIT filebuffersizetype) - { - return FMOD5_System_GetStreamBufferSize(this.handle, out filebuffersize, out filebuffersizetype); - } - public RESULT set3DSettings(float dopplerscale, float distancefactor, float rolloffscale) - { - return FMOD5_System_Set3DSettings(this.handle, dopplerscale, distancefactor, rolloffscale); - } - public RESULT get3DSettings(out float dopplerscale, out float distancefactor, out float rolloffscale) - { - return FMOD5_System_Get3DSettings(this.handle, out dopplerscale, out distancefactor, out rolloffscale); - } - public RESULT set3DNumListeners(int numlisteners) - { - return FMOD5_System_Set3DNumListeners(this.handle, numlisteners); - } - public RESULT get3DNumListeners(out int numlisteners) - { - return FMOD5_System_Get3DNumListeners(this.handle, out numlisteners); - } - public RESULT set3DListenerAttributes(int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up) - { - return FMOD5_System_Set3DListenerAttributes(this.handle, listener, ref pos, ref vel, ref forward, ref up); - } - public RESULT get3DListenerAttributes(int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up) - { - return FMOD5_System_Get3DListenerAttributes(this.handle, listener, out pos, out vel, out forward, out up); - } - public RESULT set3DRolloffCallback(CB_3D_ROLLOFF_CALLBACK callback) - { - return FMOD5_System_Set3DRolloffCallback(this.handle, callback); - } - public RESULT mixerSuspend() - { - return FMOD5_System_MixerSuspend(this.handle); - } - public RESULT mixerResume() - { - return FMOD5_System_MixerResume(this.handle); - } - public RESULT getDefaultMixMatrix(SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop) - { - return FMOD5_System_GetDefaultMixMatrix(this.handle, sourcespeakermode, targetspeakermode, matrix, matrixhop); - } - public RESULT getSpeakerModeChannels(SPEAKERMODE mode, out int channels) - { - return FMOD5_System_GetSpeakerModeChannels(this.handle, mode, out channels); - } - - // System information functions. - public RESULT getVersion(out uint version) - { - return FMOD5_System_GetVersion(this.handle, out version); - } - public RESULT getOutputHandle(out IntPtr handle) - { - return FMOD5_System_GetOutputHandle(this.handle, out handle); - } - public RESULT getChannelsPlaying(out int channels) - { - return FMOD5_System_GetChannelsPlaying(this.handle, out channels, IntPtr.Zero); - } - public RESULT getChannelsPlaying(out int channels, out int realchannels) - { - return FMOD5_System_GetChannelsPlaying(this.handle, out channels, out realchannels); - } - public RESULT getCPUUsage(out CPU_USAGE usage) - { - return FMOD5_System_GetCPUUsage(this.handle, out usage); - } - public RESULT getFileUsage(out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead) - { - return FMOD5_System_GetFileUsage(this.handle, out sampleBytesRead, out streamBytesRead, out otherBytesRead); - } - - // Sound/DSP/Channel/FX creation and retrieval. - public RESULT createSound(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return FMOD5_System_CreateSound(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); - } - } - public RESULT createSound(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) - { - return FMOD5_System_CreateSound(this.handle, data, mode, ref exinfo, out sound.handle); - } - public RESULT createSound(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) - { - return FMOD5_System_CreateSound(this.handle, name_or_data, mode, ref exinfo, out sound.handle); - } - public RESULT createSound(string name, MODE mode, out Sound sound) - { - CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); - exinfo.cbsize = MarshalHelper.SizeOf(typeof(CREATESOUNDEXINFO)); - - return createSound(name, mode, ref exinfo, out sound); - } - public RESULT createStream(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return FMOD5_System_CreateStream(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); - } - } - public RESULT createStream(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) - { - return FMOD5_System_CreateStream(this.handle, data, mode, ref exinfo, out sound.handle); - } - public RESULT createStream(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) - { - return FMOD5_System_CreateStream(this.handle, name_or_data, mode, ref exinfo, out sound.handle); - } - public RESULT createStream(string name, MODE mode, out Sound sound) - { - CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); - exinfo.cbsize = MarshalHelper.SizeOf(typeof(CREATESOUNDEXINFO)); - - return createStream(name, mode, ref exinfo, out sound); - } - public RESULT createDSP(ref DSP_DESCRIPTION description, out DSP dsp) - { - return FMOD5_System_CreateDSP(this.handle, ref description, out dsp.handle); - } - public RESULT createDSPByType(DSP_TYPE type, out DSP dsp) - { - return FMOD5_System_CreateDSPByType(this.handle, type, out dsp.handle); - } - public RESULT createChannelGroup(string name, out ChannelGroup channelgroup) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return FMOD5_System_CreateChannelGroup(this.handle, encoder.byteFromStringUTF8(name), out channelgroup.handle); - } - } - public RESULT createSoundGroup(string name, out SoundGroup soundgroup) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return FMOD5_System_CreateSoundGroup(this.handle, encoder.byteFromStringUTF8(name), out soundgroup.handle); - } - } - public RESULT createReverb3D(out Reverb3D reverb) - { - return FMOD5_System_CreateReverb3D(this.handle, out reverb.handle); - } - public RESULT playSound(Sound sound, ChannelGroup channelgroup, bool paused, out Channel channel) - { - return FMOD5_System_PlaySound(this.handle, sound.handle, channelgroup.handle, paused, out channel.handle); - } - public RESULT playDSP(DSP dsp, ChannelGroup channelgroup, bool paused, out Channel channel) - { - return FMOD5_System_PlayDSP(this.handle, dsp.handle, channelgroup.handle, paused, out channel.handle); - } - public RESULT getChannel(int channelid, out Channel channel) - { - return FMOD5_System_GetChannel(this.handle, channelid, out channel.handle); - } - public RESULT getDSPInfoByType(DSP_TYPE type, out IntPtr description) - { - return FMOD5_System_GetDSPInfoByType(this.handle, type, out description); - } - public RESULT getMasterChannelGroup(out ChannelGroup channelgroup) - { - return FMOD5_System_GetMasterChannelGroup(this.handle, out channelgroup.handle); - } - public RESULT getMasterSoundGroup(out SoundGroup soundgroup) - { - return FMOD5_System_GetMasterSoundGroup(this.handle, out soundgroup.handle); - } - - // Routing to ports. - public RESULT attachChannelGroupToPort(PORT_TYPE portType, ulong portIndex, ChannelGroup channelgroup, bool passThru = false) - { - return FMOD5_System_AttachChannelGroupToPort(this.handle, portType, portIndex, channelgroup.handle, passThru); - } - public RESULT detachChannelGroupFromPort(ChannelGroup channelgroup) - { - return FMOD5_System_DetachChannelGroupFromPort(this.handle, channelgroup.handle); - } - - // Reverb api. - public RESULT setReverbProperties(int instance, ref REVERB_PROPERTIES prop) - { - return FMOD5_System_SetReverbProperties(this.handle, instance, ref prop); - } - public RESULT getReverbProperties(int instance, out REVERB_PROPERTIES prop) - { - return FMOD5_System_GetReverbProperties(this.handle, instance, out prop); - } - - // System level DSP functionality. - public RESULT lockDSP() - { - return FMOD5_System_LockDSP(this.handle); - } - public RESULT unlockDSP() - { - return FMOD5_System_UnlockDSP(this.handle); - } - - // Recording api - public RESULT getRecordNumDrivers(out int numdrivers, out int numconnected) - { - return FMOD5_System_GetRecordNumDrivers(this.handle, out numdrivers, out numconnected); - } - public RESULT getRecordDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) - { - IntPtr stringMem = Marshal.AllocHGlobal(namelen); - - RESULT result = FMOD5_System_GetRecordDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels, out state); - - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - name = encoder.stringFromNative(stringMem); - } - Marshal.FreeHGlobal(stringMem); - - return result; - } - public RESULT getRecordDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) - { - return FMOD5_System_GetRecordDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels, out state); - } - public RESULT getRecordPosition(int id, out uint position) - { - return FMOD5_System_GetRecordPosition(this.handle, id, out position); - } - public RESULT recordStart(int id, Sound sound, bool loop) - { - return FMOD5_System_RecordStart(this.handle, id, sound.handle, loop); - } - public RESULT recordStop(int id) - { - return FMOD5_System_RecordStop(this.handle, id); - } - public RESULT isRecording(int id, out bool recording) - { - return FMOD5_System_IsRecording(this.handle, id, out recording); - } - - // Geometry api - public RESULT createGeometry(int maxpolygons, int maxvertices, out Geometry geometry) - { - return FMOD5_System_CreateGeometry(this.handle, maxpolygons, maxvertices, out geometry.handle); - } - public RESULT setGeometrySettings(float maxworldsize) - { - return FMOD5_System_SetGeometrySettings(this.handle, maxworldsize); - } - public RESULT getGeometrySettings(out float maxworldsize) - { - return FMOD5_System_GetGeometrySettings(this.handle, out maxworldsize); - } - public RESULT loadGeometry(IntPtr data, int datasize, out Geometry geometry) - { - return FMOD5_System_LoadGeometry(this.handle, data, datasize, out geometry.handle); - } - public RESULT getGeometryOcclusion(ref VECTOR listener, ref VECTOR source, out float direct, out float reverb) - { - return FMOD5_System_GetGeometryOcclusion(this.handle, ref listener, ref source, out direct, out reverb); - } - - // Network functions - public RESULT setNetworkProxy(string proxy) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return FMOD5_System_SetNetworkProxy(this.handle, encoder.byteFromStringUTF8(proxy)); - } - } - public RESULT getNetworkProxy(out string proxy, int proxylen) - { - IntPtr stringMem = Marshal.AllocHGlobal(proxylen); - - RESULT result = FMOD5_System_GetNetworkProxy(this.handle, stringMem, proxylen); - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - proxy = encoder.stringFromNative(stringMem); - } - Marshal.FreeHGlobal(stringMem); - - return result; - } - public RESULT setNetworkTimeout(int timeout) - { - return FMOD5_System_SetNetworkTimeout(this.handle, timeout); - } - public RESULT getNetworkTimeout(out int timeout) - { - return FMOD5_System_GetNetworkTimeout(this.handle, out timeout); - } - - // Userdata set/get - public RESULT setUserData(IntPtr userdata) - { - return FMOD5_System_SetUserData(this.handle, userdata); - } - public RESULT getUserData(out IntPtr userdata) - { - return FMOD5_System_GetUserData(this.handle, out userdata); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Release (IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetOutput (IntPtr system, OUTPUTTYPE output); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetOutput (IntPtr system, out OUTPUTTYPE output); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetNumDrivers (IntPtr system, out int numdrivers); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetDriver (IntPtr system, int driver); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetDriver (IntPtr system, out int driver); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetSoftwareChannels (IntPtr system, int numsoftwarechannels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetSoftwareChannels (IntPtr system, out int numsoftwarechannels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetSoftwareFormat (IntPtr system, int samplerate, SPEAKERMODE speakermode, int numrawspeakers); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetSoftwareFormat (IntPtr system, out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetDSPBufferSize (IntPtr system, uint bufferlength, int numbuffers); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetDSPBufferSize (IntPtr system, out uint bufferlength, out int numbuffers); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetFileSystem (IntPtr system, FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek, FILE_ASYNCREAD_CALLBACK userasyncread, FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_AttachFileSystem (IntPtr system, FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetCallback (IntPtr system, SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetPluginPath (IntPtr system, byte[] path); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_LoadPlugin (IntPtr system, byte[] filename, out uint handle, uint priority); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_UnloadPlugin (IntPtr system, uint handle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetNumNestedPlugins (IntPtr system, uint handle, out int count); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetNestedPlugin (IntPtr system, uint handle, int index, out uint nestedhandle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetNumPlugins (IntPtr system, PLUGINTYPE plugintype, out int numplugins); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetPluginHandle (IntPtr system, PLUGINTYPE plugintype, int index, out uint handle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetPluginInfo (IntPtr system, uint handle, out PLUGINTYPE plugintype, IntPtr name, int namelen, out uint version); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetOutputByPlugin (IntPtr system, uint handle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetOutputByPlugin (IntPtr system, out uint handle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateDSPByPlugin (IntPtr system, uint handle, out IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetDSPInfoByPlugin (IntPtr system, uint handle, out IntPtr description); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_RegisterDSP (IntPtr system, ref DSP_DESCRIPTION description, out uint handle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Init (IntPtr system, int maxchannels, INITFLAGS flags, IntPtr extradriverdata); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Close (IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Update (IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetSpeakerPosition (IntPtr system, SPEAKER speaker, float x, float y, bool active); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetSpeakerPosition (IntPtr system, SPEAKER speaker, out float x, out float y, out bool active); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetStreamBufferSize (IntPtr system, uint filebuffersize, TIMEUNIT filebuffersizetype); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetStreamBufferSize (IntPtr system, out uint filebuffersize, out TIMEUNIT filebuffersizetype); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Set3DSettings (IntPtr system, float dopplerscale, float distancefactor, float rolloffscale); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Get3DSettings (IntPtr system, out float dopplerscale, out float distancefactor, out float rolloffscale); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Set3DNumListeners (IntPtr system, int numlisteners); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Get3DNumListeners (IntPtr system, out int numlisteners); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Set3DListenerAttributes (IntPtr system, int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Get3DListenerAttributes (IntPtr system, int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Set3DRolloffCallback (IntPtr system, CB_3D_ROLLOFF_CALLBACK callback); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_MixerSuspend (IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_MixerResume (IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetDefaultMixMatrix (IntPtr system, SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetSpeakerModeChannels (IntPtr system, SPEAKERMODE mode, out int channels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetVersion (IntPtr system, out uint version); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetOutputHandle (IntPtr system, out IntPtr handle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, IntPtr zero); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, out int realchannels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetCPUUsage (IntPtr system, out CPU_USAGE usage); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetFileUsage (IntPtr system, out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateSound (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateSound (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateStream (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateStream (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateDSP (IntPtr system, ref DSP_DESCRIPTION description, out IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateDSPByType (IntPtr system, DSP_TYPE type, out IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateChannelGroup (IntPtr system, byte[] name, out IntPtr channelgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateSoundGroup (IntPtr system, byte[] name, out IntPtr soundgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateReverb3D (IntPtr system, out IntPtr reverb); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_PlaySound (IntPtr system, IntPtr sound, IntPtr channelgroup, bool paused, out IntPtr channel); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_PlayDSP (IntPtr system, IntPtr dsp, IntPtr channelgroup, bool paused, out IntPtr channel); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetChannel (IntPtr system, int channelid, out IntPtr channel); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetDSPInfoByType (IntPtr system, DSP_TYPE type, out IntPtr description); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetMasterChannelGroup (IntPtr system, out IntPtr channelgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetMasterSoundGroup (IntPtr system, out IntPtr soundgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_AttachChannelGroupToPort (IntPtr system, PORT_TYPE portType, ulong portIndex, IntPtr channelgroup, bool passThru); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_DetachChannelGroupFromPort(IntPtr system, IntPtr channelgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetReverbProperties (IntPtr system, int instance, ref REVERB_PROPERTIES prop); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetReverbProperties (IntPtr system, int instance, out REVERB_PROPERTIES prop); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_LockDSP (IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_UnlockDSP (IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetRecordNumDrivers (IntPtr system, out int numdrivers, out int numconnected); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetRecordDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetRecordPosition (IntPtr system, int id, out uint position); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_RecordStart (IntPtr system, int id, IntPtr sound, bool loop); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_RecordStop (IntPtr system, int id); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_IsRecording (IntPtr system, int id, out bool recording); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_CreateGeometry (IntPtr system, int maxpolygons, int maxvertices, out IntPtr geometry); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetGeometrySettings (IntPtr system, float maxworldsize); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetGeometrySettings (IntPtr system, out float maxworldsize); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_LoadGeometry (IntPtr system, IntPtr data, int datasize, out IntPtr geometry); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetGeometryOcclusion (IntPtr system, ref VECTOR listener, ref VECTOR source, out float direct, out float reverb); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetNetworkProxy (IntPtr system, byte[] proxy); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetNetworkProxy (IntPtr system, IntPtr proxy, int proxylen); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetNetworkTimeout (IntPtr system, int timeout); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetNetworkTimeout (IntPtr system, out int timeout); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_SetUserData (IntPtr system, IntPtr userdata); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetUserData (IntPtr system, out IntPtr userdata); - #endregion - - #region wrapperinternal - - public IntPtr handle; - - public System(IntPtr ptr) { this.handle = ptr; } - public bool hasHandle() { return this.handle != IntPtr.Zero; } - public void clearHandle() { this.handle = IntPtr.Zero; } - - #endregion - } - - - /* - 'Sound' API. - */ - public struct Sound - { - public RESULT release() - { - return FMOD5_Sound_Release(this.handle); - } - public RESULT getSystemObject(out System system) - { - return FMOD5_Sound_GetSystemObject(this.handle, out system.handle); - } - - // Standard sound manipulation functions. - public RESULT @lock(uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2) - { - return FMOD5_Sound_Lock(this.handle, offset, length, out ptr1, out ptr2, out len1, out len2); - } - public RESULT unlock(IntPtr ptr1, IntPtr ptr2, uint len1, uint len2) - { - return FMOD5_Sound_Unlock(this.handle, ptr1, ptr2, len1, len2); - } - public RESULT setDefaults(float frequency, int priority) - { - return FMOD5_Sound_SetDefaults(this.handle, frequency, priority); - } - public RESULT getDefaults(out float frequency, out int priority) - { - return FMOD5_Sound_GetDefaults(this.handle, out frequency, out priority); - } - public RESULT set3DMinMaxDistance(float min, float max) - { - return FMOD5_Sound_Set3DMinMaxDistance(this.handle, min, max); - } - public RESULT get3DMinMaxDistance(out float min, out float max) - { - return FMOD5_Sound_Get3DMinMaxDistance(this.handle, out min, out max); - } - public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) - { - return FMOD5_Sound_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); - } - public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) - { - return FMOD5_Sound_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); - } - public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) - { - return FMOD5_Sound_Set3DCustomRolloff(this.handle, ref points, numpoints); - } - public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) - { - return FMOD5_Sound_Get3DCustomRolloff(this.handle, out points, out numpoints); - } - - public RESULT getSubSound(int index, out Sound subsound) - { - return FMOD5_Sound_GetSubSound(this.handle, index, out subsound.handle); - } - public RESULT getSubSoundParent(out Sound parentsound) - { - return FMOD5_Sound_GetSubSoundParent(this.handle, out parentsound.handle); - } - public RESULT getName(out string name, int namelen) - { - IntPtr stringMem = Marshal.AllocHGlobal(namelen); - - RESULT result = FMOD5_Sound_GetName(this.handle, stringMem, namelen); - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - name = encoder.stringFromNative(stringMem); - } - Marshal.FreeHGlobal(stringMem); - - return result; - } - public RESULT getLength(out uint length, TIMEUNIT lengthtype) - { - return FMOD5_Sound_GetLength(this.handle, out length, lengthtype); - } - public RESULT getFormat(out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits) - { - return FMOD5_Sound_GetFormat(this.handle, out type, out format, out channels, out bits); - } - public RESULT getNumSubSounds(out int numsubsounds) - { - return FMOD5_Sound_GetNumSubSounds(this.handle, out numsubsounds); - } - public RESULT getNumTags(out int numtags, out int numtagsupdated) - { - return FMOD5_Sound_GetNumTags(this.handle, out numtags, out numtagsupdated); - } - public RESULT getTag(string name, int index, out TAG tag) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return FMOD5_Sound_GetTag(this.handle, encoder.byteFromStringUTF8(name), index, out tag); - } - } - public RESULT getOpenState(out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy) - { - return FMOD5_Sound_GetOpenState(this.handle, out openstate, out percentbuffered, out starving, out diskbusy); - } - public RESULT readData(byte[] buffer) - { - return FMOD5_Sound_ReadData(this.handle, buffer, (uint)buffer.Length, IntPtr.Zero); - } - public RESULT readData(byte[] buffer, out uint read) - { - return FMOD5_Sound_ReadData(this.handle, buffer, (uint)buffer.Length, out read); - } - [Obsolete("Use Sound.readData(byte[], out uint) or Sound.readData(byte[]) instead.")] - public RESULT readData(IntPtr buffer, uint length, out uint read) - { - return FMOD5_Sound_ReadData(this.handle, buffer, length, out read); - } - public RESULT seekData(uint pcm) - { - return FMOD5_Sound_SeekData(this.handle, pcm); - } - public RESULT setSoundGroup(SoundGroup soundgroup) - { - return FMOD5_Sound_SetSoundGroup(this.handle, soundgroup.handle); - } - public RESULT getSoundGroup(out SoundGroup soundgroup) - { - return FMOD5_Sound_GetSoundGroup(this.handle, out soundgroup.handle); - } - - // Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks. - public RESULT getNumSyncPoints(out int numsyncpoints) - { - return FMOD5_Sound_GetNumSyncPoints(this.handle, out numsyncpoints); - } - public RESULT getSyncPoint(int index, out IntPtr point) - { - return FMOD5_Sound_GetSyncPoint(this.handle, index, out point); - } - public RESULT getSyncPointInfo(IntPtr point, out string name, int namelen, out uint offset, TIMEUNIT offsettype) - { - IntPtr stringMem = Marshal.AllocHGlobal(namelen); - - RESULT result = FMOD5_Sound_GetSyncPointInfo(this.handle, point, stringMem, namelen, out offset, offsettype); - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - name = encoder.stringFromNative(stringMem); - } - Marshal.FreeHGlobal(stringMem); - - return result; - } - public RESULT getSyncPointInfo(IntPtr point, out uint offset, TIMEUNIT offsettype) - { - return FMOD5_Sound_GetSyncPointInfo(this.handle, point, IntPtr.Zero, 0, out offset, offsettype); - } - public RESULT addSyncPoint(uint offset, TIMEUNIT offsettype, string name, out IntPtr point) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return FMOD5_Sound_AddSyncPoint(this.handle, offset, offsettype, encoder.byteFromStringUTF8(name), out point); - } - } - public RESULT deleteSyncPoint(IntPtr point) - { - return FMOD5_Sound_DeleteSyncPoint(this.handle, point); - } - - // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time. - public RESULT setMode(MODE mode) - { - return FMOD5_Sound_SetMode(this.handle, mode); - } - public RESULT getMode(out MODE mode) - { - return FMOD5_Sound_GetMode(this.handle, out mode); - } - public RESULT setLoopCount(int loopcount) - { - return FMOD5_Sound_SetLoopCount(this.handle, loopcount); - } - public RESULT getLoopCount(out int loopcount) - { - return FMOD5_Sound_GetLoopCount(this.handle, out loopcount); - } - public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) - { - return FMOD5_Sound_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); - } - public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) - { - return FMOD5_Sound_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); - } - - // For MOD/S3M/XM/IT/MID sequenced formats only. - public RESULT getMusicNumChannels(out int numchannels) - { - return FMOD5_Sound_GetMusicNumChannels(this.handle, out numchannels); - } - public RESULT setMusicChannelVolume(int channel, float volume) - { - return FMOD5_Sound_SetMusicChannelVolume(this.handle, channel, volume); - } - public RESULT getMusicChannelVolume(int channel, out float volume) - { - return FMOD5_Sound_GetMusicChannelVolume(this.handle, channel, out volume); - } - public RESULT setMusicSpeed(float speed) - { - return FMOD5_Sound_SetMusicSpeed(this.handle, speed); - } - public RESULT getMusicSpeed(out float speed) - { - return FMOD5_Sound_GetMusicSpeed(this.handle, out speed); - } - - // Userdata set/get. - public RESULT setUserData(IntPtr userdata) - { - return FMOD5_Sound_SetUserData(this.handle, userdata); - } - public RESULT getUserData(out IntPtr userdata) - { - return FMOD5_Sound_GetUserData(this.handle, out userdata); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_Release (IntPtr sound); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetSystemObject (IntPtr sound, out IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_Lock (IntPtr sound, uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_Unlock (IntPtr sound, IntPtr ptr1, IntPtr ptr2, uint len1, uint len2); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_SetDefaults (IntPtr sound, float frequency, int priority); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetDefaults (IntPtr sound, out float frequency, out int priority); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_Set3DMinMaxDistance (IntPtr sound, float min, float max); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_Get3DMinMaxDistance (IntPtr sound, out float min, out float max); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_Set3DConeSettings (IntPtr sound, float insideconeangle, float outsideconeangle, float outsidevolume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_Get3DConeSettings (IntPtr sound, out float insideconeangle, out float outsideconeangle, out float outsidevolume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_Set3DCustomRolloff (IntPtr sound, ref VECTOR points, int numpoints); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_Get3DCustomRolloff (IntPtr sound, out IntPtr points, out int numpoints); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetSubSound (IntPtr sound, int index, out IntPtr subsound); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetSubSoundParent (IntPtr sound, out IntPtr parentsound); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetName (IntPtr sound, IntPtr name, int namelen); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetLength (IntPtr sound, out uint length, TIMEUNIT lengthtype); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetFormat (IntPtr sound, out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetNumSubSounds (IntPtr sound, out int numsubsounds); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetNumTags (IntPtr sound, out int numtags, out int numtagsupdated); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetTag (IntPtr sound, byte[] name, int index, out TAG tag); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetOpenState (IntPtr sound, out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, byte[] buffer, uint length, IntPtr zero); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, byte[] buffer, uint length, out uint read); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, IntPtr buffer, uint length, out uint read); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_SeekData (IntPtr sound, uint pcm); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_SetSoundGroup (IntPtr sound, IntPtr soundgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetSoundGroup (IntPtr sound, out IntPtr soundgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetNumSyncPoints (IntPtr sound, out int numsyncpoints); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetSyncPoint (IntPtr sound, int index, out IntPtr point); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetSyncPointInfo (IntPtr sound, IntPtr point, IntPtr name, int namelen, out uint offset, TIMEUNIT offsettype); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_AddSyncPoint (IntPtr sound, uint offset, TIMEUNIT offsettype, byte[] name, out IntPtr point); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_DeleteSyncPoint (IntPtr sound, IntPtr point); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_SetMode (IntPtr sound, MODE mode); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetMode (IntPtr sound, out MODE mode); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_SetLoopCount (IntPtr sound, int loopcount); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetLoopCount (IntPtr sound, out int loopcount); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_SetLoopPoints (IntPtr sound, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetLoopPoints (IntPtr sound, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetMusicNumChannels (IntPtr sound, out int numchannels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_SetMusicChannelVolume (IntPtr sound, int channel, float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetMusicChannelVolume (IntPtr sound, int channel, out float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_SetMusicSpeed (IntPtr sound, float speed); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetMusicSpeed (IntPtr sound, out float speed); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_SetUserData (IntPtr sound, IntPtr userdata); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Sound_GetUserData (IntPtr sound, out IntPtr userdata); - #endregion - - #region wrapperinternal - - public IntPtr handle; - - public Sound(IntPtr ptr) { this.handle = ptr; } - public bool hasHandle() { return this.handle != IntPtr.Zero; } - public void clearHandle() { this.handle = IntPtr.Zero; } - - #endregion - } - - /* - 'ChannelControl' API - */ - interface IChannelControl - { - RESULT getSystemObject (out System system); - - // General control functionality for Channels and ChannelGroups. - RESULT stop (); - RESULT setPaused (bool paused); - RESULT getPaused (out bool paused); - RESULT setVolume (float volume); - RESULT getVolume (out float volume); - RESULT setVolumeRamp (bool ramp); - RESULT getVolumeRamp (out bool ramp); - RESULT getAudibility (out float audibility); - RESULT setPitch (float pitch); - RESULT getPitch (out float pitch); - RESULT setMute (bool mute); - RESULT getMute (out bool mute); - RESULT setReverbProperties (int instance, float wet); - RESULT getReverbProperties (int instance, out float wet); - RESULT setLowPassGain (float gain); - RESULT getLowPassGain (out float gain); - RESULT setMode (MODE mode); - RESULT getMode (out MODE mode); - RESULT setCallback (CHANNELCONTROL_CALLBACK callback); - RESULT isPlaying (out bool isplaying); - - // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. - RESULT setPan (float pan); - RESULT setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); - RESULT setMixLevelsInput (float[] levels, int numlevels); - RESULT setMixMatrix (float[] matrix, int outchannels, int inchannels, int inchannel_hop); - RESULT getMixMatrix (float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); - - // Clock based functionality. - RESULT getDSPClock (out ulong dspclock, out ulong parentclock); - RESULT setDelay (ulong dspclock_start, ulong dspclock_end, bool stopchannels); - RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end); - RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); - RESULT addFadePoint (ulong dspclock, float volume); - RESULT setFadePointRamp (ulong dspclock, float volume); - RESULT removeFadePoints (ulong dspclock_start, ulong dspclock_end); - RESULT getFadePoints (ref uint numpoints, ulong[] point_dspclock, float[] point_volume); - - // DSP effects. - RESULT getDSP (int index, out DSP dsp); - RESULT addDSP (int index, DSP dsp); - RESULT removeDSP (DSP dsp); - RESULT getNumDSPs (out int numdsps); - RESULT setDSPIndex (DSP dsp, int index); - RESULT getDSPIndex (DSP dsp, out int index); - - // 3D functionality. - RESULT set3DAttributes (ref VECTOR pos, ref VECTOR vel); - RESULT get3DAttributes (out VECTOR pos, out VECTOR vel); - RESULT set3DMinMaxDistance (float mindistance, float maxdistance); - RESULT get3DMinMaxDistance (out float mindistance, out float maxdistance); - RESULT set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume); - RESULT get3DConeSettings (out float insideconeangle, out float outsideconeangle, out float outsidevolume); - RESULT set3DConeOrientation (ref VECTOR orientation); - RESULT get3DConeOrientation (out VECTOR orientation); - RESULT set3DCustomRolloff (ref VECTOR points, int numpoints); - RESULT get3DCustomRolloff (out IntPtr points, out int numpoints); - RESULT set3DOcclusion (float directocclusion, float reverbocclusion); - RESULT get3DOcclusion (out float directocclusion, out float reverbocclusion); - RESULT set3DSpread (float angle); - RESULT get3DSpread (out float angle); - RESULT set3DLevel (float level); - RESULT get3DLevel (out float level); - RESULT set3DDopplerLevel (float level); - RESULT get3DDopplerLevel (out float level); - RESULT set3DDistanceFilter (bool custom, float customLevel, float centerFreq); - RESULT get3DDistanceFilter (out bool custom, out float customLevel, out float centerFreq); - - // Userdata set/get. - RESULT setUserData (IntPtr userdata); - RESULT getUserData (out IntPtr userdata); - } - - /* - 'Channel' API - */ - public struct Channel : IChannelControl - { - // Channel specific control functionality. - public RESULT setFrequency(float frequency) - { - return FMOD5_Channel_SetFrequency(this.handle, frequency); - } - public RESULT getFrequency(out float frequency) - { - return FMOD5_Channel_GetFrequency(this.handle, out frequency); - } - public RESULT setPriority(int priority) - { - return FMOD5_Channel_SetPriority(this.handle, priority); - } - public RESULT getPriority(out int priority) - { - return FMOD5_Channel_GetPriority(this.handle, out priority); - } - public RESULT setPosition(uint position, TIMEUNIT postype) - { - return FMOD5_Channel_SetPosition(this.handle, position, postype); - } - public RESULT getPosition(out uint position, TIMEUNIT postype) - { - return FMOD5_Channel_GetPosition(this.handle, out position, postype); - } - public RESULT setChannelGroup(ChannelGroup channelgroup) - { - return FMOD5_Channel_SetChannelGroup(this.handle, channelgroup.handle); - } - public RESULT getChannelGroup(out ChannelGroup channelgroup) - { - return FMOD5_Channel_GetChannelGroup(this.handle, out channelgroup.handle); - } - public RESULT setLoopCount(int loopcount) - { - return FMOD5_Channel_SetLoopCount(this.handle, loopcount); - } - public RESULT getLoopCount(out int loopcount) - { - return FMOD5_Channel_GetLoopCount(this.handle, out loopcount); - } - public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) - { - return FMOD5_Channel_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); - } - public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) - { - return FMOD5_Channel_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); - } - - // Information only functions. - public RESULT isVirtual(out bool isvirtual) - { - return FMOD5_Channel_IsVirtual(this.handle, out isvirtual); - } - public RESULT getCurrentSound(out Sound sound) - { - return FMOD5_Channel_GetCurrentSound(this.handle, out sound.handle); - } - public RESULT getIndex(out int index) - { - return FMOD5_Channel_GetIndex(this.handle, out index); - } - - public RESULT getSystemObject(out System system) - { - return FMOD5_Channel_GetSystemObject(this.handle, out system.handle); - } - - // General control functionality for Channels and ChannelGroups. - public RESULT stop() - { - return FMOD5_Channel_Stop(this.handle); - } - public RESULT setPaused(bool paused) - { - return FMOD5_Channel_SetPaused(this.handle, paused); - } - public RESULT getPaused(out bool paused) - { - return FMOD5_Channel_GetPaused(this.handle, out paused); - } - public RESULT setVolume(float volume) - { - return FMOD5_Channel_SetVolume(this.handle, volume); - } - public RESULT getVolume(out float volume) - { - return FMOD5_Channel_GetVolume(this.handle, out volume); - } - public RESULT setVolumeRamp(bool ramp) - { - return FMOD5_Channel_SetVolumeRamp(this.handle, ramp); - } - public RESULT getVolumeRamp(out bool ramp) - { - return FMOD5_Channel_GetVolumeRamp(this.handle, out ramp); - } - public RESULT getAudibility(out float audibility) - { - return FMOD5_Channel_GetAudibility(this.handle, out audibility); - } - public RESULT setPitch(float pitch) - { - return FMOD5_Channel_SetPitch(this.handle, pitch); - } - public RESULT getPitch(out float pitch) - { - return FMOD5_Channel_GetPitch(this.handle, out pitch); - } - public RESULT setMute(bool mute) - { - return FMOD5_Channel_SetMute(this.handle, mute); - } - public RESULT getMute(out bool mute) - { - return FMOD5_Channel_GetMute(this.handle, out mute); - } - public RESULT setReverbProperties(int instance, float wet) - { - return FMOD5_Channel_SetReverbProperties(this.handle, instance, wet); - } - public RESULT getReverbProperties(int instance, out float wet) - { - return FMOD5_Channel_GetReverbProperties(this.handle, instance, out wet); - } - public RESULT setLowPassGain(float gain) - { - return FMOD5_Channel_SetLowPassGain(this.handle, gain); - } - public RESULT getLowPassGain(out float gain) - { - return FMOD5_Channel_GetLowPassGain(this.handle, out gain); - } - public RESULT setMode(MODE mode) - { - return FMOD5_Channel_SetMode(this.handle, mode); - } - public RESULT getMode(out MODE mode) - { - return FMOD5_Channel_GetMode(this.handle, out mode); - } - public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) - { - return FMOD5_Channel_SetCallback(this.handle, callback); - } - public RESULT isPlaying(out bool isplaying) - { - return FMOD5_Channel_IsPlaying(this.handle, out isplaying); - } - - // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. - public RESULT setPan(float pan) - { - return FMOD5_Channel_SetPan(this.handle, pan); - } - public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) - { - return FMOD5_Channel_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); - } - public RESULT setMixLevelsInput(float[] levels, int numlevels) - { - return FMOD5_Channel_SetMixLevelsInput(this.handle, levels, numlevels); - } - public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) - { - return FMOD5_Channel_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); - } - public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) - { - return FMOD5_Channel_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); - } - - // Clock based functionality. - public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) - { - return FMOD5_Channel_GetDSPClock(this.handle, out dspclock, out parentclock); - } - public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels = true) - { - return FMOD5_Channel_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); - } - public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) - { - return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); - } - public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) - { - return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); - } - public RESULT addFadePoint(ulong dspclock, float volume) - { - return FMOD5_Channel_AddFadePoint(this.handle, dspclock, volume); - } - public RESULT setFadePointRamp(ulong dspclock, float volume) - { - return FMOD5_Channel_SetFadePointRamp(this.handle, dspclock, volume); - } - public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) - { - return FMOD5_Channel_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); - } - public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) - { - return FMOD5_Channel_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); - } - - // DSP effects. - public RESULT getDSP(int index, out DSP dsp) - { - return FMOD5_Channel_GetDSP(this.handle, index, out dsp.handle); - } - public RESULT addDSP(int index, DSP dsp) - { - return FMOD5_Channel_AddDSP(this.handle, index, dsp.handle); - } - public RESULT removeDSP(DSP dsp) - { - return FMOD5_Channel_RemoveDSP(this.handle, dsp.handle); - } - public RESULT getNumDSPs(out int numdsps) - { - return FMOD5_Channel_GetNumDSPs(this.handle, out numdsps); - } - public RESULT setDSPIndex(DSP dsp, int index) - { - return FMOD5_Channel_SetDSPIndex(this.handle, dsp.handle, index); - } - public RESULT getDSPIndex(DSP dsp, out int index) - { - return FMOD5_Channel_GetDSPIndex(this.handle, dsp.handle, out index); - } - - // 3D functionality. - public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) - { - return FMOD5_Channel_Set3DAttributes(this.handle, ref pos, ref vel); - } - public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) - { - return FMOD5_Channel_Get3DAttributes(this.handle, out pos, out vel); - } - public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) - { - return FMOD5_Channel_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); - } - public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) - { - return FMOD5_Channel_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); - } - public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) - { - return FMOD5_Channel_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); - } - public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) - { - return FMOD5_Channel_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); - } - public RESULT set3DConeOrientation(ref VECTOR orientation) - { - return FMOD5_Channel_Set3DConeOrientation(this.handle, ref orientation); - } - public RESULT get3DConeOrientation(out VECTOR orientation) - { - return FMOD5_Channel_Get3DConeOrientation(this.handle, out orientation); - } - public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) - { - return FMOD5_Channel_Set3DCustomRolloff(this.handle, ref points, numpoints); - } - public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) - { - return FMOD5_Channel_Get3DCustomRolloff(this.handle, out points, out numpoints); - } - public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) - { - return FMOD5_Channel_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); - } - public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) - { - return FMOD5_Channel_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); - } - public RESULT set3DSpread(float angle) - { - return FMOD5_Channel_Set3DSpread(this.handle, angle); - } - public RESULT get3DSpread(out float angle) - { - return FMOD5_Channel_Get3DSpread(this.handle, out angle); - } - public RESULT set3DLevel(float level) - { - return FMOD5_Channel_Set3DLevel(this.handle, level); - } - public RESULT get3DLevel(out float level) - { - return FMOD5_Channel_Get3DLevel(this.handle, out level); - } - public RESULT set3DDopplerLevel(float level) - { - return FMOD5_Channel_Set3DDopplerLevel(this.handle, level); - } - public RESULT get3DDopplerLevel(out float level) - { - return FMOD5_Channel_Get3DDopplerLevel(this.handle, out level); - } - public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) - { - return FMOD5_Channel_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); - } - public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) - { - return FMOD5_Channel_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); - } - - // Userdata set/get. - public RESULT setUserData(IntPtr userdata) - { - return FMOD5_Channel_SetUserData(this.handle, userdata); - } - public RESULT getUserData(out IntPtr userdata) - { - return FMOD5_Channel_GetUserData(this.handle, out userdata); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetFrequency (IntPtr channel, float frequency); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetFrequency (IntPtr channel, out float frequency); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetPriority (IntPtr channel, int priority); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetPriority (IntPtr channel, out int priority); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetPosition (IntPtr channel, uint position, TIMEUNIT postype); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetPosition (IntPtr channel, out uint position, TIMEUNIT postype); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetChannelGroup (IntPtr channel, IntPtr channelgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetChannelGroup (IntPtr channel, out IntPtr channelgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetLoopCount (IntPtr channel, int loopcount); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetLoopCount (IntPtr channel, out int loopcount); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetLoopPoints (IntPtr channel, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetLoopPoints (IntPtr channel, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_IsVirtual (IntPtr channel, out bool isvirtual); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetCurrentSound (IntPtr channel, out IntPtr sound); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetIndex (IntPtr channel, out int index); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetSystemObject (IntPtr channel, out IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Stop (IntPtr channel); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetPaused (IntPtr channel, bool paused); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetPaused (IntPtr channel, out bool paused); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetVolume (IntPtr channel, float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetVolume (IntPtr channel, out float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetVolumeRamp (IntPtr channel, bool ramp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetVolumeRamp (IntPtr channel, out bool ramp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetAudibility (IntPtr channel, out float audibility); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetPitch (IntPtr channel, float pitch); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetPitch (IntPtr channel, out float pitch); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetMute (IntPtr channel, bool mute); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetMute (IntPtr channel, out bool mute); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetReverbProperties (IntPtr channel, int instance, float wet); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetReverbProperties (IntPtr channel, int instance, out float wet); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetLowPassGain (IntPtr channel, float gain); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetLowPassGain (IntPtr channel, out float gain); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetMode (IntPtr channel, MODE mode); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetMode (IntPtr channel, out MODE mode); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetCallback (IntPtr channel, CHANNELCONTROL_CALLBACK callback); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_IsPlaying (IntPtr channel, out bool isplaying); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetPan (IntPtr channel, float pan); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetMixLevelsOutput (IntPtr channel, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetMixLevelsInput (IntPtr channel, float[] levels, int numlevels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetMixMatrix (IntPtr channel, float[] matrix, int outchannels, int inchannels, int inchannel_hop); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetMixMatrix (IntPtr channel, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetDSPClock (IntPtr channel, out ulong dspclock, out ulong parentclock); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetDelay (IntPtr channel, ulong dspclock_start, ulong dspclock_end, bool stopchannels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_AddFadePoint (IntPtr channel, ulong dspclock, float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetFadePointRamp (IntPtr channel, ulong dspclock, float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_RemoveFadePoints (IntPtr channel, ulong dspclock_start, ulong dspclock_end); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetFadePoints (IntPtr channel, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetDSP (IntPtr channel, int index, out IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_AddDSP (IntPtr channel, int index, IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_RemoveDSP (IntPtr channel, IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetNumDSPs (IntPtr channel, out int numdsps); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetDSPIndex (IntPtr channel, IntPtr dsp, int index); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetDSPIndex (IntPtr channel, IntPtr dsp, out int index); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Set3DAttributes (IntPtr channel, ref VECTOR pos, ref VECTOR vel); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Get3DAttributes (IntPtr channel, out VECTOR pos, out VECTOR vel); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Set3DMinMaxDistance (IntPtr channel, float mindistance, float maxdistance); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Get3DMinMaxDistance (IntPtr channel, out float mindistance, out float maxdistance); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Set3DConeSettings (IntPtr channel, float insideconeangle, float outsideconeangle, float outsidevolume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Get3DConeSettings (IntPtr channel, out float insideconeangle, out float outsideconeangle, out float outsidevolume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Set3DConeOrientation (IntPtr channel, ref VECTOR orientation); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Get3DConeOrientation (IntPtr channel, out VECTOR orientation); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Set3DCustomRolloff (IntPtr channel, ref VECTOR points, int numpoints); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Get3DCustomRolloff (IntPtr channel, out IntPtr points, out int numpoints); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Set3DOcclusion (IntPtr channel, float directocclusion, float reverbocclusion); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Get3DOcclusion (IntPtr channel, out float directocclusion, out float reverbocclusion); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Set3DSpread (IntPtr channel, float angle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Get3DSpread (IntPtr channel, out float angle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Set3DLevel (IntPtr channel, float level); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Get3DLevel (IntPtr channel, out float level); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Set3DDopplerLevel (IntPtr channel, float level); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Get3DDopplerLevel (IntPtr channel, out float level); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Set3DDistanceFilter (IntPtr channel, bool custom, float customLevel, float centerFreq); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_Get3DDistanceFilter (IntPtr channel, out bool custom, out float customLevel, out float centerFreq); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_SetUserData (IntPtr channel, IntPtr userdata); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Channel_GetUserData (IntPtr channel, out IntPtr userdata); - #endregion - - #region wrapperinternal - - public IntPtr handle; - - public Channel(IntPtr ptr) { this.handle = ptr; } - public bool hasHandle() { return this.handle != IntPtr.Zero; } - public void clearHandle() { this.handle = IntPtr.Zero; } - - #endregion - } - - /* - 'ChannelGroup' API - */ - public struct ChannelGroup : IChannelControl - { - public RESULT release() - { - return FMOD5_ChannelGroup_Release(this.handle); - } - - // Nested channel groups. - public RESULT addGroup(ChannelGroup group, bool propagatedspclock = true) - { - return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, IntPtr.Zero); - } - public RESULT addGroup(ChannelGroup group, bool propagatedspclock, out DSPConnection connection) - { - return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, out connection.handle); - } - public RESULT getNumGroups(out int numgroups) - { - return FMOD5_ChannelGroup_GetNumGroups(this.handle, out numgroups); - } - public RESULT getGroup(int index, out ChannelGroup group) - { - return FMOD5_ChannelGroup_GetGroup(this.handle, index, out group.handle); - } - public RESULT getParentGroup(out ChannelGroup group) - { - return FMOD5_ChannelGroup_GetParentGroup(this.handle, out group.handle); - } - - // Information only functions. - public RESULT getName(out string name, int namelen) - { - IntPtr stringMem = Marshal.AllocHGlobal(namelen); - - RESULT result = FMOD5_ChannelGroup_GetName(this.handle, stringMem, namelen); - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - name = encoder.stringFromNative(stringMem); - } - Marshal.FreeHGlobal(stringMem); - - return result; - } - public RESULT getNumChannels(out int numchannels) - { - return FMOD5_ChannelGroup_GetNumChannels(this.handle, out numchannels); - } - public RESULT getChannel(int index, out Channel channel) - { - return FMOD5_ChannelGroup_GetChannel(this.handle, index, out channel.handle); - } - - public RESULT getSystemObject(out System system) - { - return FMOD5_ChannelGroup_GetSystemObject(this.handle, out system.handle); - } - - // General control functionality for Channels and ChannelGroups. - public RESULT stop() - { - return FMOD5_ChannelGroup_Stop(this.handle); - } - public RESULT setPaused(bool paused) - { - return FMOD5_ChannelGroup_SetPaused(this.handle, paused); - } - public RESULT getPaused(out bool paused) - { - return FMOD5_ChannelGroup_GetPaused(this.handle, out paused); - } - public RESULT setVolume(float volume) - { - return FMOD5_ChannelGroup_SetVolume(this.handle, volume); - } - public RESULT getVolume(out float volume) - { - return FMOD5_ChannelGroup_GetVolume(this.handle, out volume); - } - public RESULT setVolumeRamp(bool ramp) - { - return FMOD5_ChannelGroup_SetVolumeRamp(this.handle, ramp); - } - public RESULT getVolumeRamp(out bool ramp) - { - return FMOD5_ChannelGroup_GetVolumeRamp(this.handle, out ramp); - } - public RESULT getAudibility(out float audibility) - { - return FMOD5_ChannelGroup_GetAudibility(this.handle, out audibility); - } - public RESULT setPitch(float pitch) - { - return FMOD5_ChannelGroup_SetPitch(this.handle, pitch); - } - public RESULT getPitch(out float pitch) - { - return FMOD5_ChannelGroup_GetPitch(this.handle, out pitch); - } - public RESULT setMute(bool mute) - { - return FMOD5_ChannelGroup_SetMute(this.handle, mute); - } - public RESULT getMute(out bool mute) - { - return FMOD5_ChannelGroup_GetMute(this.handle, out mute); - } - public RESULT setReverbProperties(int instance, float wet) - { - return FMOD5_ChannelGroup_SetReverbProperties(this.handle, instance, wet); - } - public RESULT getReverbProperties(int instance, out float wet) - { - return FMOD5_ChannelGroup_GetReverbProperties(this.handle, instance, out wet); - } - public RESULT setLowPassGain(float gain) - { - return FMOD5_ChannelGroup_SetLowPassGain(this.handle, gain); - } - public RESULT getLowPassGain(out float gain) - { - return FMOD5_ChannelGroup_GetLowPassGain(this.handle, out gain); - } - public RESULT setMode(MODE mode) - { - return FMOD5_ChannelGroup_SetMode(this.handle, mode); - } - public RESULT getMode(out MODE mode) - { - return FMOD5_ChannelGroup_GetMode(this.handle, out mode); - } - public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) - { - return FMOD5_ChannelGroup_SetCallback(this.handle, callback); - } - public RESULT isPlaying(out bool isplaying) - { - return FMOD5_ChannelGroup_IsPlaying(this.handle, out isplaying); - } - - // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. - public RESULT setPan(float pan) - { - return FMOD5_ChannelGroup_SetPan(this.handle, pan); - } - public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) - { - return FMOD5_ChannelGroup_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); - } - public RESULT setMixLevelsInput(float[] levels, int numlevels) - { - return FMOD5_ChannelGroup_SetMixLevelsInput(this.handle, levels, numlevels); - } - public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop) - { - return FMOD5_ChannelGroup_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); - } - public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop) - { - return FMOD5_ChannelGroup_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); - } - - // Clock based functionality. - public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) - { - return FMOD5_ChannelGroup_GetDSPClock(this.handle, out dspclock, out parentclock); - } - public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels) - { - return FMOD5_ChannelGroup_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); - } - public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) - { - return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); - } - public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) - { - return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); - } - public RESULT addFadePoint(ulong dspclock, float volume) - { - return FMOD5_ChannelGroup_AddFadePoint(this.handle, dspclock, volume); - } - public RESULT setFadePointRamp(ulong dspclock, float volume) - { - return FMOD5_ChannelGroup_SetFadePointRamp(this.handle, dspclock, volume); - } - public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) - { - return FMOD5_ChannelGroup_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); - } - public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) - { - return FMOD5_ChannelGroup_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); - } - - // DSP effects. - public RESULT getDSP(int index, out DSP dsp) - { - return FMOD5_ChannelGroup_GetDSP(this.handle, index, out dsp.handle); - } - public RESULT addDSP(int index, DSP dsp) - { - return FMOD5_ChannelGroup_AddDSP(this.handle, index, dsp.handle); - } - public RESULT removeDSP(DSP dsp) - { - return FMOD5_ChannelGroup_RemoveDSP(this.handle, dsp.handle); - } - public RESULT getNumDSPs(out int numdsps) - { - return FMOD5_ChannelGroup_GetNumDSPs(this.handle, out numdsps); - } - public RESULT setDSPIndex(DSP dsp, int index) - { - return FMOD5_ChannelGroup_SetDSPIndex(this.handle, dsp.handle, index); - } - public RESULT getDSPIndex(DSP dsp, out int index) - { - return FMOD5_ChannelGroup_GetDSPIndex(this.handle, dsp.handle, out index); - } - - // 3D functionality. - public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) - { - return FMOD5_ChannelGroup_Set3DAttributes(this.handle, ref pos, ref vel); - } - public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) - { - return FMOD5_ChannelGroup_Get3DAttributes(this.handle, out pos, out vel); - } - public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) - { - return FMOD5_ChannelGroup_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); - } - public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) - { - return FMOD5_ChannelGroup_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); - } - public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) - { - return FMOD5_ChannelGroup_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); - } - public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) - { - return FMOD5_ChannelGroup_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); - } - public RESULT set3DConeOrientation(ref VECTOR orientation) - { - return FMOD5_ChannelGroup_Set3DConeOrientation(this.handle, ref orientation); - } - public RESULT get3DConeOrientation(out VECTOR orientation) - { - return FMOD5_ChannelGroup_Get3DConeOrientation(this.handle, out orientation); - } - public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) - { - return FMOD5_ChannelGroup_Set3DCustomRolloff(this.handle, ref points, numpoints); - } - public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) - { - return FMOD5_ChannelGroup_Get3DCustomRolloff(this.handle, out points, out numpoints); - } - public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) - { - return FMOD5_ChannelGroup_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); - } - public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) - { - return FMOD5_ChannelGroup_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); - } - public RESULT set3DSpread(float angle) - { - return FMOD5_ChannelGroup_Set3DSpread(this.handle, angle); - } - public RESULT get3DSpread(out float angle) - { - return FMOD5_ChannelGroup_Get3DSpread(this.handle, out angle); - } - public RESULT set3DLevel(float level) - { - return FMOD5_ChannelGroup_Set3DLevel(this.handle, level); - } - public RESULT get3DLevel(out float level) - { - return FMOD5_ChannelGroup_Get3DLevel(this.handle, out level); - } - public RESULT set3DDopplerLevel(float level) - { - return FMOD5_ChannelGroup_Set3DDopplerLevel(this.handle, level); - } - public RESULT get3DDopplerLevel(out float level) - { - return FMOD5_ChannelGroup_Get3DDopplerLevel(this.handle, out level); - } - public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) - { - return FMOD5_ChannelGroup_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); - } - public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) - { - return FMOD5_ChannelGroup_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); - } - - // Userdata set/get. - public RESULT setUserData(IntPtr userdata) - { - return FMOD5_ChannelGroup_SetUserData(this.handle, userdata); - } - public RESULT getUserData(out IntPtr userdata) - { - return FMOD5_ChannelGroup_GetUserData(this.handle, out userdata); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Release (IntPtr channelgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, IntPtr zero); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, out IntPtr connection); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetNumGroups (IntPtr channelgroup, out int numgroups); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetGroup (IntPtr channelgroup, int index, out IntPtr group); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetParentGroup (IntPtr channelgroup, out IntPtr group); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetName (IntPtr channelgroup, IntPtr name, int namelen); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetNumChannels (IntPtr channelgroup, out int numchannels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetChannel (IntPtr channelgroup, int index, out IntPtr channel); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetSystemObject (IntPtr channelgroup, out IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Stop (IntPtr channelgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetPaused (IntPtr channelgroup, bool paused); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetPaused (IntPtr channelgroup, out bool paused); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetVolume (IntPtr channelgroup, float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetVolume (IntPtr channelgroup, out float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetVolumeRamp (IntPtr channelgroup, bool ramp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetVolumeRamp (IntPtr channelgroup, out bool ramp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetAudibility (IntPtr channelgroup, out float audibility); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetPitch (IntPtr channelgroup, float pitch); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetPitch (IntPtr channelgroup, out float pitch); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetMute (IntPtr channelgroup, bool mute); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetMute (IntPtr channelgroup, out bool mute); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetReverbProperties (IntPtr channelgroup, int instance, float wet); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetReverbProperties (IntPtr channelgroup, int instance, out float wet); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetLowPassGain (IntPtr channelgroup, float gain); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetLowPassGain (IntPtr channelgroup, out float gain); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetMode (IntPtr channelgroup, MODE mode); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetMode (IntPtr channelgroup, out MODE mode); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetCallback (IntPtr channelgroup, CHANNELCONTROL_CALLBACK callback); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_IsPlaying (IntPtr channelgroup, out bool isplaying); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetPan (IntPtr channelgroup, float pan); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsOutput (IntPtr channelgroup, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsInput (IntPtr channelgroup, float[] levels, int numlevels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetMixMatrix (IntPtr channelgroup, float[] matrix, int outchannels, int inchannels, int inchannel_hop); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetMixMatrix (IntPtr channelgroup, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetDSPClock (IntPtr channelgroup, out ulong dspclock, out ulong parentclock); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetDelay (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end, bool stopchannels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_AddFadePoint (IntPtr channelgroup, ulong dspclock, float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetFadePointRamp (IntPtr channelgroup, ulong dspclock, float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_RemoveFadePoints (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetFadePoints (IntPtr channelgroup, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetDSP (IntPtr channelgroup, int index, out IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_AddDSP (IntPtr channelgroup, int index, IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_RemoveDSP (IntPtr channelgroup, IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetNumDSPs (IntPtr channelgroup, out int numdsps); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetDSPIndex (IntPtr channelgroup, IntPtr dsp, int index); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetDSPIndex (IntPtr channelgroup, IntPtr dsp, out int index); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Set3DAttributes (IntPtr channelgroup, ref VECTOR pos, ref VECTOR vel); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Get3DAttributes (IntPtr channelgroup, out VECTOR pos, out VECTOR vel); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Set3DMinMaxDistance (IntPtr channelgroup, float mindistance, float maxdistance); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Get3DMinMaxDistance (IntPtr channelgroup, out float mindistance, out float maxdistance); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Set3DConeSettings (IntPtr channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Get3DConeSettings (IntPtr channelgroup, out float insideconeangle, out float outsideconeangle, out float outsidevolume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Set3DConeOrientation(IntPtr channelgroup, ref VECTOR orientation); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Get3DConeOrientation(IntPtr channelgroup, out VECTOR orientation); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Set3DCustomRolloff (IntPtr channelgroup, ref VECTOR points, int numpoints); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Get3DCustomRolloff (IntPtr channelgroup, out IntPtr points, out int numpoints); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Set3DOcclusion (IntPtr channelgroup, float directocclusion, float reverbocclusion); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Get3DOcclusion (IntPtr channelgroup, out float directocclusion, out float reverbocclusion); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Set3DSpread (IntPtr channelgroup, float angle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Get3DSpread (IntPtr channelgroup, out float angle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Set3DLevel (IntPtr channelgroup, float level); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Get3DLevel (IntPtr channelgroup, out float level); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Set3DDopplerLevel (IntPtr channelgroup, float level); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Get3DDopplerLevel (IntPtr channelgroup, out float level); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Set3DDistanceFilter (IntPtr channelgroup, bool custom, float customLevel, float centerFreq); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_Get3DDistanceFilter (IntPtr channelgroup, out bool custom, out float customLevel, out float centerFreq); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_SetUserData (IntPtr channelgroup, IntPtr userdata); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_ChannelGroup_GetUserData (IntPtr channelgroup, out IntPtr userdata); - #endregion - - #region wrapperinternal - - public IntPtr handle; - - public ChannelGroup(IntPtr ptr) { this.handle = ptr; } - public bool hasHandle() { return this.handle != IntPtr.Zero; } - public void clearHandle() { this.handle = IntPtr.Zero; } - - #endregion - } - - /* - 'SoundGroup' API - */ - public struct SoundGroup - { - public RESULT release() - { - return FMOD5_SoundGroup_Release(this.handle); - } - - public RESULT getSystemObject(out System system) - { - return FMOD5_SoundGroup_GetSystemObject(this.handle, out system.handle); - } - - // SoundGroup control functions. - public RESULT setMaxAudible(int maxaudible) - { - return FMOD5_SoundGroup_SetMaxAudible(this.handle, maxaudible); - } - public RESULT getMaxAudible(out int maxaudible) - { - return FMOD5_SoundGroup_GetMaxAudible(this.handle, out maxaudible); - } - public RESULT setMaxAudibleBehavior(SOUNDGROUP_BEHAVIOR behavior) - { - return FMOD5_SoundGroup_SetMaxAudibleBehavior(this.handle, behavior); - } - public RESULT getMaxAudibleBehavior(out SOUNDGROUP_BEHAVIOR behavior) - { - return FMOD5_SoundGroup_GetMaxAudibleBehavior(this.handle, out behavior); - } - public RESULT setMuteFadeSpeed(float speed) - { - return FMOD5_SoundGroup_SetMuteFadeSpeed(this.handle, speed); - } - public RESULT getMuteFadeSpeed(out float speed) - { - return FMOD5_SoundGroup_GetMuteFadeSpeed(this.handle, out speed); - } - public RESULT setVolume(float volume) - { - return FMOD5_SoundGroup_SetVolume(this.handle, volume); - } - public RESULT getVolume(out float volume) - { - return FMOD5_SoundGroup_GetVolume(this.handle, out volume); - } - public RESULT stop() - { - return FMOD5_SoundGroup_Stop(this.handle); - } - - // Information only functions. - public RESULT getName(out string name, int namelen) - { - IntPtr stringMem = Marshal.AllocHGlobal(namelen); - - RESULT result = FMOD5_SoundGroup_GetName(this.handle, stringMem, namelen); - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - name = encoder.stringFromNative(stringMem); - } - Marshal.FreeHGlobal(stringMem); - - return result; - } - public RESULT getNumSounds(out int numsounds) - { - return FMOD5_SoundGroup_GetNumSounds(this.handle, out numsounds); - } - public RESULT getSound(int index, out Sound sound) - { - return FMOD5_SoundGroup_GetSound(this.handle, index, out sound.handle); - } - public RESULT getNumPlaying(out int numplaying) - { - return FMOD5_SoundGroup_GetNumPlaying(this.handle, out numplaying); - } - - // Userdata set/get. - public RESULT setUserData(IntPtr userdata) - { - return FMOD5_SoundGroup_SetUserData(this.handle, userdata); - } - public RESULT getUserData(out IntPtr userdata) - { - return FMOD5_SoundGroup_GetUserData(this.handle, out userdata); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_Release (IntPtr soundgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_GetSystemObject (IntPtr soundgroup, out IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_SetMaxAudible (IntPtr soundgroup, int maxaudible); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_GetMaxAudible (IntPtr soundgroup, out int maxaudible); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_SetMaxAudibleBehavior (IntPtr soundgroup, SOUNDGROUP_BEHAVIOR behavior); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_GetMaxAudibleBehavior (IntPtr soundgroup, out SOUNDGROUP_BEHAVIOR behavior); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_SetMuteFadeSpeed (IntPtr soundgroup, float speed); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_GetMuteFadeSpeed (IntPtr soundgroup, out float speed); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_SetVolume (IntPtr soundgroup, float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_GetVolume (IntPtr soundgroup, out float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_Stop (IntPtr soundgroup); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_GetName (IntPtr soundgroup, IntPtr name, int namelen); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_GetNumSounds (IntPtr soundgroup, out int numsounds); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_GetSound (IntPtr soundgroup, int index, out IntPtr sound); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_GetNumPlaying (IntPtr soundgroup, out int numplaying); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_SetUserData (IntPtr soundgroup, IntPtr userdata); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_SoundGroup_GetUserData (IntPtr soundgroup, out IntPtr userdata); - #endregion - - #region wrapperinternal - - public IntPtr handle; - - public SoundGroup(IntPtr ptr) { this.handle = ptr; } - public bool hasHandle() { return this.handle != IntPtr.Zero; } - public void clearHandle() { this.handle = IntPtr.Zero; } - - #endregion - } - - /* - 'DSP' API - */ - public struct DSP - { - public RESULT release() - { - return FMOD5_DSP_Release(this.handle); - } - public RESULT getSystemObject(out System system) - { - return FMOD5_DSP_GetSystemObject(this.handle, out system.handle); - } - - // Connection / disconnection / input and output enumeration. - public RESULT addInput(DSP input) - { - return FMOD5_DSP_AddInput(this.handle, input.handle, IntPtr.Zero, DSPCONNECTION_TYPE.STANDARD); - } - public RESULT addInput(DSP input, out DSPConnection connection, DSPCONNECTION_TYPE type = DSPCONNECTION_TYPE.STANDARD) - { - return FMOD5_DSP_AddInput(this.handle, input.handle, out connection.handle, type); - } - public RESULT disconnectFrom(DSP target, DSPConnection connection) - { - return FMOD5_DSP_DisconnectFrom(this.handle, target.handle, connection.handle); - } - public RESULT disconnectAll(bool inputs, bool outputs) - { - return FMOD5_DSP_DisconnectAll(this.handle, inputs, outputs); - } - public RESULT getNumInputs(out int numinputs) - { - return FMOD5_DSP_GetNumInputs(this.handle, out numinputs); - } - public RESULT getNumOutputs(out int numoutputs) - { - return FMOD5_DSP_GetNumOutputs(this.handle, out numoutputs); - } - public RESULT getInput(int index, out DSP input, out DSPConnection inputconnection) - { - return FMOD5_DSP_GetInput(this.handle, index, out input.handle, out inputconnection.handle); - } - public RESULT getOutput(int index, out DSP output, out DSPConnection outputconnection) - { - return FMOD5_DSP_GetOutput(this.handle, index, out output.handle, out outputconnection.handle); - } - - // DSP unit control. - public RESULT setActive(bool active) - { - return FMOD5_DSP_SetActive(this.handle, active); - } - public RESULT getActive(out bool active) - { - return FMOD5_DSP_GetActive(this.handle, out active); - } - public RESULT setBypass(bool bypass) - { - return FMOD5_DSP_SetBypass(this.handle, bypass); - } - public RESULT getBypass(out bool bypass) - { - return FMOD5_DSP_GetBypass(this.handle, out bypass); - } - public RESULT setWetDryMix(float prewet, float postwet, float dry) - { - return FMOD5_DSP_SetWetDryMix(this.handle, prewet, postwet, dry); - } - public RESULT getWetDryMix(out float prewet, out float postwet, out float dry) - { - return FMOD5_DSP_GetWetDryMix(this.handle, out prewet, out postwet, out dry); - } - public RESULT setChannelFormat(CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode) - { - return FMOD5_DSP_SetChannelFormat(this.handle, channelmask, numchannels, source_speakermode); - } - public RESULT getChannelFormat(out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode) - { - return FMOD5_DSP_GetChannelFormat(this.handle, out channelmask, out numchannels, out source_speakermode); - } - public RESULT getOutputChannelFormat(CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode) - { - return FMOD5_DSP_GetOutputChannelFormat(this.handle, inmask, inchannels, inspeakermode, out outmask, out outchannels, out outspeakermode); - } - public RESULT reset() - { - return FMOD5_DSP_Reset(this.handle); - } - public RESULT setCallback(DSP_CALLBACK callback) - { - return FMOD5_DSP_SetCallback(this.handle, callback); - } - - // DSP parameter control. - public RESULT setParameterFloat(int index, float value) - { - return FMOD5_DSP_SetParameterFloat(this.handle, index, value); - } - public RESULT setParameterInt(int index, int value) - { - return FMOD5_DSP_SetParameterInt(this.handle, index, value); - } - public RESULT setParameterBool(int index, bool value) - { - return FMOD5_DSP_SetParameterBool(this.handle, index, value); - } - public RESULT setParameterData(int index, byte[] data) - { - return FMOD5_DSP_SetParameterData(this.handle, index, Marshal.UnsafeAddrOfPinnedArrayElement(data, 0), (uint)data.Length); - } - public RESULT getParameterFloat(int index, out float value) - { - return FMOD5_DSP_GetParameterFloat(this.handle, index, out value, IntPtr.Zero, 0); - } - public RESULT getParameterInt(int index, out int value) - { - return FMOD5_DSP_GetParameterInt(this.handle, index, out value, IntPtr.Zero, 0); - } - public RESULT getParameterBool(int index, out bool value) - { - return FMOD5_DSP_GetParameterBool(this.handle, index, out value, IntPtr.Zero, 0); - } - public RESULT getParameterData(int index, out IntPtr data, out uint length) - { - return FMOD5_DSP_GetParameterData(this.handle, index, out data, out length, IntPtr.Zero, 0); - } - public RESULT getNumParameters(out int numparams) - { - return FMOD5_DSP_GetNumParameters(this.handle, out numparams); - } - public RESULT getParameterInfo(int index, out DSP_PARAMETER_DESC desc) - { - IntPtr descPtr; - RESULT result = FMOD5_DSP_GetParameterInfo(this.handle, index, out descPtr); - desc = (DSP_PARAMETER_DESC)MarshalHelper.PtrToStructure(descPtr, typeof(DSP_PARAMETER_DESC)); - return result; - } - public RESULT getDataParameterIndex(int datatype, out int index) - { - return FMOD5_DSP_GetDataParameterIndex(this.handle, datatype, out index); - } - public RESULT showConfigDialog(IntPtr hwnd, bool show) - { - return FMOD5_DSP_ShowConfigDialog(this.handle, hwnd, show); - } - - // DSP attributes. - public RESULT getInfo(out string name, out uint version, out int channels, out int configwidth, out int configheight) - { - IntPtr nameMem = Marshal.AllocHGlobal(32); - - RESULT result = FMOD5_DSP_GetInfo(this.handle, nameMem, out version, out channels, out configwidth, out configheight); - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - name = encoder.stringFromNative(nameMem); - } - Marshal.FreeHGlobal(nameMem); - return result; - } - public RESULT getInfo(out uint version, out int channels, out int configwidth, out int configheight) - { - return FMOD5_DSP_GetInfo(this.handle, IntPtr.Zero, out version, out channels, out configwidth, out configheight); ; - } - public RESULT getType(out DSP_TYPE type) - { - return FMOD5_DSP_GetType(this.handle, out type); - } - public RESULT getIdle(out bool idle) - { - return FMOD5_DSP_GetIdle(this.handle, out idle); - } - - // Userdata set/get. - public RESULT setUserData(IntPtr userdata) - { - return FMOD5_DSP_SetUserData(this.handle, userdata); - } - public RESULT getUserData(out IntPtr userdata) - { - return FMOD5_DSP_GetUserData(this.handle, out userdata); - } - - // Metering. - public RESULT setMeteringEnabled(bool inputEnabled, bool outputEnabled) - { - return FMOD5_DSP_SetMeteringEnabled(this.handle, inputEnabled, outputEnabled); - } - public RESULT getMeteringEnabled(out bool inputEnabled, out bool outputEnabled) - { - return FMOD5_DSP_GetMeteringEnabled(this.handle, out inputEnabled, out outputEnabled); - } - - public RESULT getMeteringInfo(IntPtr zero, out DSP_METERING_INFO outputInfo) - { - return FMOD5_DSP_GetMeteringInfo(this.handle, zero, out outputInfo); - } - public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, IntPtr zero) - { - return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, zero); - } - public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo) - { - return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, out outputInfo); - } - - public RESULT getCPUUsage(out uint exclusive, out uint inclusive) - { - return FMOD5_DSP_GetCPUUsage(this.handle, out exclusive, out inclusive); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_Release (IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetSystemObject (IntPtr dsp, out IntPtr system); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, IntPtr zero, DSPCONNECTION_TYPE type); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, out IntPtr connection, DSPCONNECTION_TYPE type); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_DisconnectFrom (IntPtr dsp, IntPtr target, IntPtr connection); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_DisconnectAll (IntPtr dsp, bool inputs, bool outputs); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetNumInputs (IntPtr dsp, out int numinputs); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetNumOutputs (IntPtr dsp, out int numoutputs); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetInput (IntPtr dsp, int index, out IntPtr input, out IntPtr inputconnection); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetOutput (IntPtr dsp, int index, out IntPtr output, out IntPtr outputconnection); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_SetActive (IntPtr dsp, bool active); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetActive (IntPtr dsp, out bool active); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_SetBypass (IntPtr dsp, bool bypass); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetBypass (IntPtr dsp, out bool bypass); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_SetWetDryMix (IntPtr dsp, float prewet, float postwet, float dry); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetWetDryMix (IntPtr dsp, out float prewet, out float postwet, out float dry); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_SetChannelFormat (IntPtr dsp, CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetChannelFormat (IntPtr dsp, out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetOutputChannelFormat (IntPtr dsp, CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_Reset (IntPtr dsp); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_SetCallback (IntPtr dsp, DSP_CALLBACK callback); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_SetParameterFloat (IntPtr dsp, int index, float value); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_SetParameterInt (IntPtr dsp, int index, int value); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_SetParameterBool (IntPtr dsp, int index, bool value); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_SetParameterData (IntPtr dsp, int index, IntPtr data, uint length); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetParameterFloat (IntPtr dsp, int index, out float value, IntPtr valuestr, int valuestrlen); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetParameterInt (IntPtr dsp, int index, out int value, IntPtr valuestr, int valuestrlen); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetParameterBool (IntPtr dsp, int index, out bool value, IntPtr valuestr, int valuestrlen); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetParameterData (IntPtr dsp, int index, out IntPtr data, out uint length, IntPtr valuestr, int valuestrlen); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetNumParameters (IntPtr dsp, out int numparams); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetParameterInfo (IntPtr dsp, int index, out IntPtr desc); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetDataParameterIndex (IntPtr dsp, int datatype, out int index); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_ShowConfigDialog (IntPtr dsp, IntPtr hwnd, bool show); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetInfo (IntPtr dsp, IntPtr name, out uint version, out int channels, out int configwidth, out int configheight); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetType (IntPtr dsp, out DSP_TYPE type); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetIdle (IntPtr dsp, out bool idle); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_SetUserData (IntPtr dsp, IntPtr userdata); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSP_GetUserData (IntPtr dsp, out IntPtr userdata); - [DllImport(VERSION.dll)] - public static extern RESULT FMOD5_DSP_SetMeteringEnabled (IntPtr dsp, bool inputEnabled, bool outputEnabled); - [DllImport(VERSION.dll)] - public static extern RESULT FMOD5_DSP_GetMeteringEnabled (IntPtr dsp, out bool inputEnabled, out bool outputEnabled); - [DllImport(VERSION.dll)] - public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, IntPtr zero, out DSP_METERING_INFO outputInfo); - [DllImport(VERSION.dll)] - public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, IntPtr zero); - [DllImport(VERSION.dll)] - public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo); - [DllImport(VERSION.dll)] - public static extern RESULT FMOD5_DSP_GetCPUUsage (IntPtr dsp, out uint exclusive, out uint inclusive); - #endregion - - #region wrapperinternal - - public IntPtr handle; - - public DSP(IntPtr ptr) { this.handle = ptr; } - public bool hasHandle() { return this.handle != IntPtr.Zero; } - public void clearHandle() { this.handle = IntPtr.Zero; } - - #endregion - } - - /* - 'DSPConnection' API - */ - public struct DSPConnection - { - public RESULT getInput(out DSP input) - { - return FMOD5_DSPConnection_GetInput(this.handle, out input.handle); - } - public RESULT getOutput(out DSP output) - { - return FMOD5_DSPConnection_GetOutput(this.handle, out output.handle); - } - public RESULT setMix(float volume) - { - return FMOD5_DSPConnection_SetMix(this.handle, volume); - } - public RESULT getMix(out float volume) - { - return FMOD5_DSPConnection_GetMix(this.handle, out volume); - } - public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) - { - return FMOD5_DSPConnection_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); - } - public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) - { - return FMOD5_DSPConnection_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); - } - public RESULT getType(out DSPCONNECTION_TYPE type) - { - return FMOD5_DSPConnection_GetType(this.handle, out type); - } - - // Userdata set/get. - public RESULT setUserData(IntPtr userdata) - { - return FMOD5_DSPConnection_SetUserData(this.handle, userdata); - } - public RESULT getUserData(out IntPtr userdata) - { - return FMOD5_DSPConnection_GetUserData(this.handle, out userdata); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSPConnection_GetInput (IntPtr dspconnection, out IntPtr input); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSPConnection_GetOutput (IntPtr dspconnection, out IntPtr output); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSPConnection_SetMix (IntPtr dspconnection, float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSPConnection_GetMix (IntPtr dspconnection, out float volume); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSPConnection_SetMixMatrix (IntPtr dspconnection, float[] matrix, int outchannels, int inchannels, int inchannel_hop); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSPConnection_GetMixMatrix (IntPtr dspconnection, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSPConnection_GetType (IntPtr dspconnection, out DSPCONNECTION_TYPE type); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSPConnection_SetUserData (IntPtr dspconnection, IntPtr userdata); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_DSPConnection_GetUserData (IntPtr dspconnection, out IntPtr userdata); - #endregion - - #region wrapperinternal - - public IntPtr handle; - - public DSPConnection(IntPtr ptr) { this.handle = ptr; } - public bool hasHandle() { return this.handle != IntPtr.Zero; } - public void clearHandle() { this.handle = IntPtr.Zero; } - - #endregion - } - - /* - 'Geometry' API - */ - public struct Geometry - { - public RESULT release() - { - return FMOD5_Geometry_Release(this.handle); - } - - // Polygon manipulation. - public RESULT addPolygon(float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex) - { - return FMOD5_Geometry_AddPolygon(this.handle, directocclusion, reverbocclusion, doublesided, numvertices, vertices, out polygonindex); - } - public RESULT getNumPolygons(out int numpolygons) - { - return FMOD5_Geometry_GetNumPolygons(this.handle, out numpolygons); - } - public RESULT getMaxPolygons(out int maxpolygons, out int maxvertices) - { - return FMOD5_Geometry_GetMaxPolygons(this.handle, out maxpolygons, out maxvertices); - } - public RESULT getPolygonNumVertices(int index, out int numvertices) - { - return FMOD5_Geometry_GetPolygonNumVertices(this.handle, index, out numvertices); - } - public RESULT setPolygonVertex(int index, int vertexindex, ref VECTOR vertex) - { - return FMOD5_Geometry_SetPolygonVertex(this.handle, index, vertexindex, ref vertex); - } - public RESULT getPolygonVertex(int index, int vertexindex, out VECTOR vertex) - { - return FMOD5_Geometry_GetPolygonVertex(this.handle, index, vertexindex, out vertex); - } - public RESULT setPolygonAttributes(int index, float directocclusion, float reverbocclusion, bool doublesided) - { - return FMOD5_Geometry_SetPolygonAttributes(this.handle, index, directocclusion, reverbocclusion, doublesided); - } - public RESULT getPolygonAttributes(int index, out float directocclusion, out float reverbocclusion, out bool doublesided) - { - return FMOD5_Geometry_GetPolygonAttributes(this.handle, index, out directocclusion, out reverbocclusion, out doublesided); - } - - // Object manipulation. - public RESULT setActive(bool active) - { - return FMOD5_Geometry_SetActive(this.handle, active); - } - public RESULT getActive(out bool active) - { - return FMOD5_Geometry_GetActive(this.handle, out active); - } - public RESULT setRotation(ref VECTOR forward, ref VECTOR up) - { - return FMOD5_Geometry_SetRotation(this.handle, ref forward, ref up); - } - public RESULT getRotation(out VECTOR forward, out VECTOR up) - { - return FMOD5_Geometry_GetRotation(this.handle, out forward, out up); - } - public RESULT setPosition(ref VECTOR position) - { - return FMOD5_Geometry_SetPosition(this.handle, ref position); - } - public RESULT getPosition(out VECTOR position) - { - return FMOD5_Geometry_GetPosition(this.handle, out position); - } - public RESULT setScale(ref VECTOR scale) - { - return FMOD5_Geometry_SetScale(this.handle, ref scale); - } - public RESULT getScale(out VECTOR scale) - { - return FMOD5_Geometry_GetScale(this.handle, out scale); - } - public RESULT save(IntPtr data, out int datasize) - { - return FMOD5_Geometry_Save(this.handle, data, out datasize); - } - - // Userdata set/get. - public RESULT setUserData(IntPtr userdata) - { - return FMOD5_Geometry_SetUserData(this.handle, userdata); - } - public RESULT getUserData(out IntPtr userdata) - { - return FMOD5_Geometry_GetUserData(this.handle, out userdata); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_Release (IntPtr geometry); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_AddPolygon (IntPtr geometry, float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_GetNumPolygons (IntPtr geometry, out int numpolygons); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_GetMaxPolygons (IntPtr geometry, out int maxpolygons, out int maxvertices); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_GetPolygonNumVertices(IntPtr geometry, int index, out int numvertices); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_SetPolygonVertex (IntPtr geometry, int index, int vertexindex, ref VECTOR vertex); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_GetPolygonVertex (IntPtr geometry, int index, int vertexindex, out VECTOR vertex); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_SetPolygonAttributes (IntPtr geometry, int index, float directocclusion, float reverbocclusion, bool doublesided); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_GetPolygonAttributes (IntPtr geometry, int index, out float directocclusion, out float reverbocclusion, out bool doublesided); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_SetActive (IntPtr geometry, bool active); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_GetActive (IntPtr geometry, out bool active); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_SetRotation (IntPtr geometry, ref VECTOR forward, ref VECTOR up); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_GetRotation (IntPtr geometry, out VECTOR forward, out VECTOR up); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_SetPosition (IntPtr geometry, ref VECTOR position); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_GetPosition (IntPtr geometry, out VECTOR position); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_SetScale (IntPtr geometry, ref VECTOR scale); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_GetScale (IntPtr geometry, out VECTOR scale); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_Save (IntPtr geometry, IntPtr data, out int datasize); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_SetUserData (IntPtr geometry, IntPtr userdata); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Geometry_GetUserData (IntPtr geometry, out IntPtr userdata); - #endregion - - #region wrapperinternal - - public IntPtr handle; - - public Geometry(IntPtr ptr) { this.handle = ptr; } - public bool hasHandle() { return this.handle != IntPtr.Zero; } - public void clearHandle() { this.handle = IntPtr.Zero; } - - #endregion - } - - /* - 'Reverb3D' API - */ - public struct Reverb3D - { - public RESULT release() - { - return FMOD5_Reverb3D_Release(this.handle); - } - - // Reverb manipulation. - public RESULT set3DAttributes(ref VECTOR position, float mindistance, float maxdistance) - { - return FMOD5_Reverb3D_Set3DAttributes(this.handle, ref position, mindistance, maxdistance); - } - public RESULT get3DAttributes(ref VECTOR position, ref float mindistance, ref float maxdistance) - { - return FMOD5_Reverb3D_Get3DAttributes(this.handle, ref position, ref mindistance, ref maxdistance); - } - public RESULT setProperties(ref REVERB_PROPERTIES properties) - { - return FMOD5_Reverb3D_SetProperties(this.handle, ref properties); - } - public RESULT getProperties(ref REVERB_PROPERTIES properties) - { - return FMOD5_Reverb3D_GetProperties(this.handle, ref properties); - } - public RESULT setActive(bool active) - { - return FMOD5_Reverb3D_SetActive(this.handle, active); - } - public RESULT getActive(out bool active) - { - return FMOD5_Reverb3D_GetActive(this.handle, out active); - } - - // Userdata set/get. - public RESULT setUserData(IntPtr userdata) - { - return FMOD5_Reverb3D_SetUserData(this.handle, userdata); - } - public RESULT getUserData(out IntPtr userdata) - { - return FMOD5_Reverb3D_GetUserData(this.handle, out userdata); - } - - #region importfunctions - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Reverb3D_Release (IntPtr reverb3d); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Reverb3D_Set3DAttributes (IntPtr reverb3d, ref VECTOR position, float mindistance, float maxdistance); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Reverb3D_Get3DAttributes (IntPtr reverb3d, ref VECTOR position, ref float mindistance, ref float maxdistance); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Reverb3D_SetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Reverb3D_GetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Reverb3D_SetActive (IntPtr reverb3d, bool active); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Reverb3D_GetActive (IntPtr reverb3d, out bool active); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Reverb3D_SetUserData (IntPtr reverb3d, IntPtr userdata); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_Reverb3D_GetUserData (IntPtr reverb3d, out IntPtr userdata); - #endregion - - #region wrapperinternal - - public IntPtr handle; - - public Reverb3D(IntPtr ptr) { this.handle = ptr; } - public bool hasHandle() { return this.handle != IntPtr.Zero; } - public void clearHandle() { this.handle = IntPtr.Zero; } - - #endregion - } - - #region Helper Functions - [StructLayout(LayoutKind.Sequential)] - public struct StringWrapper - { - IntPtr nativeUtf8Ptr; - - public StringWrapper(IntPtr ptr) - { - nativeUtf8Ptr = ptr; - } - - public static implicit operator string(StringWrapper fstring) - { - using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) - { - return encoder.stringFromNative(fstring.nativeUtf8Ptr); - } - } - - public bool StartsWith(byte[] prefix) - { - if (nativeUtf8Ptr == IntPtr.Zero) - { - return false; - } - - for (int i = 0; i < prefix.Length; i++) - { - if (Marshal.ReadByte(nativeUtf8Ptr, i) != prefix[i]) - { - return false; - } - } - - return true; - } - - public bool Equals(byte[] comparison) - { - if (nativeUtf8Ptr == IntPtr.Zero) - { - return false; - } - - for (int i = 0; i < comparison.Length; i++) - { - if (Marshal.ReadByte(nativeUtf8Ptr, i) != comparison[i]) - { - return false; - } - } - - if (Marshal.ReadByte(nativeUtf8Ptr, comparison.Length) != 0) - { - return false; - } - - return true; - } - } - - static class StringHelper - { - public class ThreadSafeEncoding : IDisposable - { - UTF8Encoding encoding = new UTF8Encoding(); - byte[] encodedBuffer = new byte[128]; - char[] decodedBuffer = new char[128]; - bool inUse; - GCHandle gcHandle; - - public bool InUse() { return inUse; } - public void SetInUse() { inUse = true; } - - private int roundUpPowerTwo(int number) - { - int newNumber = 1; - while (newNumber <= number) - { - newNumber *= 2; - } - - return newNumber; - } - - public byte[] byteFromStringUTF8(string s) - { - if (s == null) - { - return null; - } - - int maximumLength = encoding.GetMaxByteCount(s.Length) + 1; // +1 for null terminator - if (maximumLength > encodedBuffer.Length) - { - int encodedLength = encoding.GetByteCount(s) + 1; // +1 for null terminator - if (encodedLength > encodedBuffer.Length) - { - encodedBuffer = new byte[roundUpPowerTwo(encodedLength)]; - } - } - - int byteCount = encoding.GetBytes(s, 0, s.Length, encodedBuffer, 0); - encodedBuffer[byteCount] = 0; // Apply null terminator - - return encodedBuffer; - } - - public IntPtr intptrFromStringUTF8(string s) - { - if (s == null) - { - return IntPtr.Zero; - } - - gcHandle = GCHandle.Alloc(byteFromStringUTF8(s), GCHandleType.Pinned); - return gcHandle.AddrOfPinnedObject(); - } - - public string stringFromNative(IntPtr nativePtr) - { - if (nativePtr == IntPtr.Zero) - { - return ""; - } - - int nativeLen = 0; - while (Marshal.ReadByte(nativePtr, nativeLen) != 0) - { - nativeLen++; - } - - if (nativeLen == 0) - { - return ""; - } - - if (nativeLen > encodedBuffer.Length) - { - encodedBuffer = new byte[roundUpPowerTwo(nativeLen)]; - } - - Marshal.Copy(nativePtr, encodedBuffer, 0, nativeLen); - - int maximumLength = encoding.GetMaxCharCount(nativeLen); - if (maximumLength > decodedBuffer.Length) - { - int decodedLength = encoding.GetCharCount(encodedBuffer, 0, nativeLen); - if (decodedLength > decodedBuffer.Length) - { - decodedBuffer = new char[roundUpPowerTwo(decodedLength)]; - } - } - - int charCount = encoding.GetChars(encodedBuffer, 0, nativeLen, decodedBuffer, 0); - - return new String(decodedBuffer, 0, charCount); - } - - public void Dispose() - { - if (gcHandle.IsAllocated) - { - gcHandle.Free(); - } - lock (encoders) - { - inUse = false; - } - } - } - - static List encoders = new List(1); - - public static ThreadSafeEncoding GetFreeHelper() - { - lock (encoders) - { - ThreadSafeEncoding helper = null; - // Search for not in use helper - for (int i = 0; i < encoders.Count; i++) - { - if (!encoders[i].InUse()) - { - helper = encoders[i]; - break; - } - } - // Otherwise create another helper - if (helper == null) - { - helper = new ThreadSafeEncoding(); - encoders.Add(helper); - } - helper.SetInUse(); - return helper; - } - } - } - - // Some of the Marshal functions were marked as deprecated / obsolete, however that decision was reversed: https://github.com/dotnet/corefx/pull/10541 - // Use the old syntax (non-generic) to ensure maximum compatibility (especially with Unity) ignoring the warnings - public static class MarshalHelper - { -#pragma warning disable 618 - public static int SizeOf(Type t) - { - return Marshal.SizeOf(t); // Always use Type version, never Object version as it boxes causes GC allocations - } - - public static object PtrToStructure(IntPtr ptr, Type structureType) - { - return Marshal.PtrToStructure(ptr, structureType); - } -#pragma warning restore 618 - } - - #endregion -} diff --git a/Qwilight/FMOD/fmod_dsp.cs b/Qwilight/FMOD/fmod_dsp.cs deleted file mode 100644 index 537fe5c..0000000 --- a/Qwilight/FMOD/fmod_dsp.cs +++ /dev/null @@ -1,897 +0,0 @@ -/* ======================================================================================== */ -/* FMOD Core API - DSP header file. */ -/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2023. */ -/* */ -/* Use this header if you are wanting to develop your own DSP plugin to use with FMODs */ -/* dsp system. With this header you can make your own DSP plugin that FMOD can */ -/* register and use. See the documentation and examples on how to make a working plugin. */ -/* */ -/* For more detail visit: */ -/* https://fmod.com/docs/2.02/api/plugin-api-dsp.html */ -/* =========================================================================================*/ - -using System; -using System.Text; -using System.Runtime.InteropServices; - -namespace FMOD -{ - [StructLayout(LayoutKind.Sequential)] - public struct DSP_BUFFER_ARRAY - { - public int numbuffers; - public int[] buffernumchannels; - public CHANNELMASK[] bufferchannelmask; - public IntPtr[] buffers; - public SPEAKERMODE speakermode; - } - - public enum DSP_PROCESS_OPERATION - { - PROCESS_PERFORM = 0, - PROCESS_QUERY - } - - [StructLayout(LayoutKind.Sequential)] - public struct COMPLEX - { - public float real; - public float imag; - } - - public enum DSP_PAN_SURROUND_FLAGS - { - DEFAULT = 0, - ROTATION_NOT_BIASED = 1, - } - - - /* - DSP callbacks - */ - public delegate RESULT DSP_CREATE_CALLBACK (ref DSP_STATE dsp_state); - public delegate RESULT DSP_RELEASE_CALLBACK (ref DSP_STATE dsp_state); - public delegate RESULT DSP_RESET_CALLBACK (ref DSP_STATE dsp_state); - public delegate RESULT DSP_SETPOSITION_CALLBACK (ref DSP_STATE dsp_state, uint pos); - public delegate RESULT DSP_READ_CALLBACK (ref DSP_STATE dsp_state, IntPtr inbuffer, IntPtr outbuffer, uint length, int inchannels, ref int outchannels); - public delegate RESULT DSP_SHOULDIPROCESS_CALLBACK (ref DSP_STATE dsp_state, bool inputsidle, uint length, CHANNELMASK inmask, int inchannels, SPEAKERMODE speakermode); - public delegate RESULT DSP_PROCESS_CALLBACK (ref DSP_STATE dsp_state, uint length, ref DSP_BUFFER_ARRAY inbufferarray, ref DSP_BUFFER_ARRAY outbufferarray, bool inputsidle, DSP_PROCESS_OPERATION op); - public delegate RESULT DSP_SETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, float value); - public delegate RESULT DSP_SETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, int value); - public delegate RESULT DSP_SETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, bool value); - public delegate RESULT DSP_SETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, IntPtr data, uint length); - public delegate RESULT DSP_GETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, ref float value, IntPtr valuestr); - public delegate RESULT DSP_GETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, ref int value, IntPtr valuestr); - public delegate RESULT DSP_GETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, ref bool value, IntPtr valuestr); - public delegate RESULT DSP_GETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, ref IntPtr data, ref uint length, IntPtr valuestr); - public delegate RESULT DSP_SYSTEM_REGISTER_CALLBACK (ref DSP_STATE dsp_state); - public delegate RESULT DSP_SYSTEM_DEREGISTER_CALLBACK (ref DSP_STATE dsp_state); - public delegate RESULT DSP_SYSTEM_MIX_CALLBACK (ref DSP_STATE dsp_state, int stage); - - - /* - DSP functions - */ - public delegate IntPtr DSP_ALLOC_FUNC (uint size, MEMORY_TYPE type, IntPtr sourcestr); - public delegate IntPtr DSP_REALLOC_FUNC (IntPtr ptr, uint size, MEMORY_TYPE type, IntPtr sourcestr); - public delegate void DSP_FREE_FUNC (IntPtr ptr, MEMORY_TYPE type, IntPtr sourcestr); - public delegate void DSP_LOG_FUNC (DEBUG_FLAGS level, IntPtr file, int line, IntPtr function, IntPtr str); - public delegate RESULT DSP_GETSAMPLERATE_FUNC (ref DSP_STATE dsp_state, ref int rate); - public delegate RESULT DSP_GETBLOCKSIZE_FUNC (ref DSP_STATE dsp_state, ref uint blocksize); - public delegate RESULT DSP_GETSPEAKERMODE_FUNC (ref DSP_STATE dsp_state, ref int speakermode_mixer, ref int speakermode_output); - public delegate RESULT DSP_GETCLOCK_FUNC (ref DSP_STATE dsp_state, out ulong clock, out uint offset, out uint length); - public delegate RESULT DSP_GETLISTENERATTRIBUTES_FUNC (ref DSP_STATE dsp_state, ref int numlisteners, IntPtr attributes); - public delegate RESULT DSP_GETUSERDATA_FUNC (ref DSP_STATE dsp_state, out IntPtr userdata); - public delegate RESULT DSP_DFT_FFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr signal, IntPtr dft, IntPtr window, int signalhop); - public delegate RESULT DSP_DFT_IFFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr dft, IntPtr signal, IntPtr window, int signalhop); - public delegate RESULT DSP_PAN_SUMMONOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float lowFrequencyGain, float overallGain, IntPtr matrix); - public delegate RESULT DSP_PAN_SUMSTEREOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float pan, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); - public delegate RESULT DSP_PAN_SUMSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix, DSP_PAN_SURROUND_FLAGS flags); - public delegate RESULT DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int targetSpeakerMode, float direction, float extent, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); - public delegate RESULT DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); - public delegate RESULT DSP_PAN_GETROLLOFFGAIN_FUNC (ref DSP_STATE dsp_state, DSP_PAN_3D_ROLLOFF_TYPE rolloff, float distance, float mindistance, float maxdistance, out float gain); - - - public enum DSP_TYPE : int - { - UNKNOWN, - MIXER, - OSCILLATOR, - LOWPASS, - ITLOWPASS, - HIGHPASS, - ECHO, - FADER, - FLANGE, - DISTORTION, - NORMALIZE, - LIMITER, - PARAMEQ, - PITCHSHIFT, - CHORUS, - VSTPLUGIN, - WINAMPPLUGIN, - ITECHO, - COMPRESSOR, - SFXREVERB, - LOWPASS_SIMPLE, - DELAY, - TREMOLO, - LADSPAPLUGIN, - SEND, - RETURN, - HIGHPASS_SIMPLE, - PAN, - THREE_EQ, - FFT, - LOUDNESS_METER, - ENVELOPEFOLLOWER, - CONVOLUTIONREVERB, - CHANNELMIX, - TRANSCEIVER, - OBJECTPAN, - MULTIBAND_EQ, - MAX - } - - public enum DSP_PARAMETER_TYPE - { - FLOAT = 0, - INT, - BOOL, - DATA, - MAX - } - - public enum DSP_PARAMETER_FLOAT_MAPPING_TYPE - { - DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR = 0, - DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO, - DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR, - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR - { - public int numpoints; - public IntPtr pointparamvalues; - public IntPtr pointpositions; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_FLOAT_MAPPING - { - public DSP_PARAMETER_FLOAT_MAPPING_TYPE type; - public DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping; - } - - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_DESC_FLOAT - { - public float min; - public float max; - public float defaultval; - public DSP_PARAMETER_FLOAT_MAPPING mapping; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_DESC_INT - { - public int min; - public int max; - public int defaultval; - public bool goestoinf; - public IntPtr valuenames; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_DESC_BOOL - { - public bool defaultval; - public IntPtr valuenames; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_DESC_DATA - { - public int datatype; - } - - [StructLayout(LayoutKind.Explicit)] - public struct DSP_PARAMETER_DESC_UNION - { - [FieldOffset(0)] - public DSP_PARAMETER_DESC_FLOAT floatdesc; - [FieldOffset(0)] - public DSP_PARAMETER_DESC_INT intdesc; - [FieldOffset(0)] - public DSP_PARAMETER_DESC_BOOL booldesc; - [FieldOffset(0)] - public DSP_PARAMETER_DESC_DATA datadesc; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_DESC - { - public DSP_PARAMETER_TYPE type; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[] name; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[] label; - public string description; - - public DSP_PARAMETER_DESC_UNION desc; - } - - public enum DSP_PARAMETER_DATA_TYPE - { - DSP_PARAMETER_DATA_TYPE_USER = 0, - DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1, - DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2, - DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3, - DSP_PARAMETER_DATA_TYPE_FFT = -4, - DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5, - DSP_PARAMETER_DATA_TYPE_ATTENUATION_RANGE = -6 - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_OVERALLGAIN - { - public float linear_gain; - public float linear_gain_additive; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_3DATTRIBUTES - { - public ATTRIBUTES_3D relative; - public ATTRIBUTES_3D absolute; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_3DATTRIBUTES_MULTI - { - public int numlisteners; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public ATTRIBUTES_3D[] relative; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public float[] weight; - public ATTRIBUTES_3D absolute; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_SIDECHAIN - { - public int sidechainenable; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_FFT - { - public int length; - public int numchannels; - - [MarshalAs(UnmanagedType.ByValArray,SizeConst=32)] - private IntPtr[] spectrum_internal; - - public float[][] spectrum - { - get - { - var buffer = new float[numchannels][]; - - for (int i = 0; i < numchannels; ++i) - { - buffer[i] = new float[length]; - Marshal.Copy(spectrum_internal[i], buffer[i], 0, length); - } - - return buffer; - } - } - - public void getSpectrum(ref float[][] buffer) - { - int bufferLength = Math.Min(buffer.Length, numchannels); - for (int i = 0; i < bufferLength; ++i) - { - getSpectrum(i, ref buffer[i]); - } - } - - public void getSpectrum(int channel, ref float[] buffer) - { - int bufferLength = Math.Min(buffer.Length, length); - Marshal.Copy(spectrum_internal[channel], buffer, 0, bufferLength); - } - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_LOUDNESS_METER_INFO_TYPE - { - public float momentaryloudness; - public float shorttermloudness; - public float integratedloudness; - public float loudness10thpercentile; - public float loudness95thpercentile; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 66)] - public float[] loudnesshistogram; - public float maxtruepeak; - public float maxmomentaryloudness; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_LOUDNESS_METER_WEIGHTING_TYPE - { - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public float[] channelweight; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_PARAMETER_ATTENUATION_RANGE - { - public float min; - public float max; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_DESCRIPTION - { - public uint pluginsdkversion; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public byte[] name; - public uint version; - public int numinputbuffers; - public int numoutputbuffers; - public DSP_CREATE_CALLBACK create; - public DSP_RELEASE_CALLBACK release; - public DSP_RESET_CALLBACK reset; - public DSP_READ_CALLBACK read; - public DSP_PROCESS_CALLBACK process; - public DSP_SETPOSITION_CALLBACK setposition; - - public int numparameters; - public IntPtr paramdesc; - public DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat; - public DSP_SETPARAM_INT_CALLBACK setparameterint; - public DSP_SETPARAM_BOOL_CALLBACK setparameterbool; - public DSP_SETPARAM_DATA_CALLBACK setparameterdata; - public DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat; - public DSP_GETPARAM_INT_CALLBACK getparameterint; - public DSP_GETPARAM_BOOL_CALLBACK getparameterbool; - public DSP_GETPARAM_DATA_CALLBACK getparameterdata; - public DSP_SHOULDIPROCESS_CALLBACK shouldiprocess; - public IntPtr userdata; - - public DSP_SYSTEM_REGISTER_CALLBACK sys_register; - public DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister; - public DSP_SYSTEM_MIX_CALLBACK sys_mix; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_STATE_DFT_FUNCTIONS - { - public DSP_DFT_FFTREAL_FUNC fftreal; - public DSP_DFT_IFFTREAL_FUNC inversefftreal; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_STATE_PAN_FUNCTIONS - { - public DSP_PAN_SUMMONOMATRIX_FUNC summonomatrix; - public DSP_PAN_SUMSTEREOMATRIX_FUNC sumstereomatrix; - public DSP_PAN_SUMSURROUNDMATRIX_FUNC sumsurroundmatrix; - public DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC summonotosurroundmatrix; - public DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC sumstereotosurroundmatrix; - public DSP_PAN_GETROLLOFFGAIN_FUNC getrolloffgain; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_STATE_FUNCTIONS - { - public DSP_ALLOC_FUNC alloc; - public DSP_REALLOC_FUNC realloc; - public DSP_FREE_FUNC free; - public DSP_GETSAMPLERATE_FUNC getsamplerate; - public DSP_GETBLOCKSIZE_FUNC getblocksize; - public IntPtr dft; - public IntPtr pan; - public DSP_GETSPEAKERMODE_FUNC getspeakermode; - public DSP_GETCLOCK_FUNC getclock; - public DSP_GETLISTENERATTRIBUTES_FUNC getlistenerattributes; - public DSP_LOG_FUNC log; - public DSP_GETUSERDATA_FUNC getuserdata; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_STATE - { - public IntPtr instance; - public IntPtr plugindata; - public uint channelmask; - public int source_speakermode; - public IntPtr sidechaindata; - public int sidechainchannels; - public IntPtr functions; - public int systemobject; - } - - [StructLayout(LayoutKind.Sequential)] - public struct DSP_METERING_INFO - { - public int numsamples; - [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] - public float[] peaklevel; - [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] - public float[] rmslevel; - public short numchannels; - } - - /* - ============================================================================================================== - - FMOD built in effect parameters. - Use DSP::setParameter with these enums for the 'index' parameter. - - ============================================================================================================== - */ - - public enum DSP_OSCILLATOR : int - { - TYPE, - RATE - } - - public enum DSP_LOWPASS : int - { - CUTOFF, - RESONANCE - } - - public enum DSP_ITLOWPASS : int - { - CUTOFF, - RESONANCE - } - - public enum DSP_HIGHPASS : int - { - CUTOFF, - RESONANCE - } - - public enum DSP_ECHO : int - { - DELAY, - FEEDBACK, - DRYLEVEL, - WETLEVEL - } - - public enum DSP_FADER : int - { - GAIN, - OVERALL_GAIN, - } - - public enum DSP_DELAY : int - { - CH0, - CH1, - CH2, - CH3, - CH4, - CH5, - CH6, - CH7, - CH8, - CH9, - CH10, - CH11, - CH12, - CH13, - CH14, - CH15, - MAXDELAY, - } - - public enum DSP_FLANGE : int - { - MIX, - DEPTH, - RATE - } - - public enum DSP_TREMOLO : int - { - FREQUENCY, - DEPTH, - SHAPE, - SKEW, - DUTY, - SQUARE, - PHASE, - SPREAD - } - - public enum DSP_DISTORTION : int - { - LEVEL - } - - public enum DSP_NORMALIZE : int - { - FADETIME, - THRESHOLD, - MAXAMP - } - - public enum DSP_LIMITER : int - { - RELEASETIME, - CEILING, - MAXIMIZERGAIN, - MODE, - } - - public enum DSP_PARAMEQ : int - { - CENTER, - BANDWIDTH, - GAIN - } - - public enum DSP_MULTIBAND_EQ : int - { - A_FILTER, - A_FREQUENCY, - A_Q, - A_GAIN, - B_FILTER, - B_FREQUENCY, - B_Q, - B_GAIN, - C_FILTER, - C_FREQUENCY, - C_Q, - C_GAIN, - D_FILTER, - D_FREQUENCY, - D_Q, - D_GAIN, - E_FILTER, - E_FREQUENCY, - E_Q, - E_GAIN, - } - - public enum DSP_MULTIBAND_EQ_FILTER_TYPE : int - { - DISABLED, - LOWPASS_12DB, - LOWPASS_24DB, - LOWPASS_48DB, - HIGHPASS_12DB, - HIGHPASS_24DB, - HIGHPASS_48DB, - LOWSHELF, - HIGHSHELF, - PEAKING, - BANDPASS, - NOTCH, - ALLPASS, - } - - public enum DSP_PITCHSHIFT : int - { - PITCH, - FFTSIZE, - OVERLAP, - MAXCHANNELS - } - - public enum DSP_CHORUS : int - { - MIX, - RATE, - DEPTH, - } - - public enum DSP_ITECHO : int - { - WETDRYMIX, - FEEDBACK, - LEFTDELAY, - RIGHTDELAY, - PANDELAY - } - - public enum DSP_COMPRESSOR : int - { - THRESHOLD, - RATIO, - ATTACK, - RELEASE, - GAINMAKEUP, - USESIDECHAIN, - LINKED - } - - public enum DSP_SFXREVERB : int - { - DECAYTIME, - EARLYDELAY, - LATEDELAY, - HFREFERENCE, - HFDECAYRATIO, - DIFFUSION, - DENSITY, - LOWSHELFFREQUENCY, - LOWSHELFGAIN, - HIGHCUT, - EARLYLATEMIX, - WETLEVEL, - DRYLEVEL - } - - public enum DSP_LOWPASS_SIMPLE : int - { - CUTOFF - } - - public enum DSP_SEND : int - { - RETURNID, - LEVEL, - } - - public enum DSP_RETURN : int - { - ID, - INPUT_SPEAKER_MODE - } - - public enum DSP_HIGHPASS_SIMPLE : int - { - CUTOFF - } - - public enum DSP_PAN_2D_STEREO_MODE_TYPE : int - { - DISTRIBUTED, - DISCRETE - } - - public enum DSP_PAN_MODE_TYPE : int - { - MONO, - STEREO, - SURROUND - } - - public enum DSP_PAN_3D_ROLLOFF_TYPE : int - { - LINEARSQUARED, - LINEAR, - INVERSE, - INVERSETAPERED, - CUSTOM - } - - public enum DSP_PAN_3D_EXTENT_MODE_TYPE : int - { - AUTO, - USER, - OFF - } - - public enum DSP_PAN : int - { - MODE, - _2D_STEREO_POSITION, - _2D_DIRECTION, - _2D_EXTENT, - _2D_ROTATION, - _2D_LFE_LEVEL, - _2D_STEREO_MODE, - _2D_STEREO_SEPARATION, - _2D_STEREO_AXIS, - ENABLED_SPEAKERS, - _3D_POSITION, - _3D_ROLLOFF, - _3D_MIN_DISTANCE, - _3D_MAX_DISTANCE, - _3D_EXTENT_MODE, - _3D_SOUND_SIZE, - _3D_MIN_EXTENT, - _3D_PAN_BLEND, - LFE_UPMIX_ENABLED, - OVERALL_GAIN, - SURROUND_SPEAKER_MODE, - _2D_HEIGHT_BLEND, - ATTENUATION_RANGE, - OVERRIDE_RANGE - } - - public enum DSP_THREE_EQ_CROSSOVERSLOPE_TYPE : int - { - _12DB, - _24DB, - _48DB - } - - public enum DSP_THREE_EQ : int - { - LOWGAIN, - MIDGAIN, - HIGHGAIN, - LOWCROSSOVER, - HIGHCROSSOVER, - CROSSOVERSLOPE - } - - public enum DSP_FFT_WINDOW : int - { - RECT, - TRIANGLE, - HAMMING, - HANNING, - BLACKMAN, - BLACKMANHARRIS - } - - public enum DSP_FFT : int - { - WINDOWSIZE, - WINDOWTYPE, - SPECTRUMDATA, - DOMINANT_FREQ - } - - - public enum DSP_LOUDNESS_METER : int - { - STATE, - WEIGHTING, - INFO - } - - - public enum DSP_LOUDNESS_METER_STATE_TYPE : int - { - RESET_INTEGRATED = -3, - RESET_MAXPEAK = -2, - RESET_ALL = -1, - PAUSED = 0, - ANALYZING = 1 - } - - public enum DSP_ENVELOPEFOLLOWER : int - { - ATTACK, - RELEASE, - ENVELOPE, - USESIDECHAIN - } - - public enum DSP_CONVOLUTION_REVERB : int - { - IR, - WET, - DRY, - LINKED - } - - public enum DSP_CHANNELMIX_OUTPUT : int - { - DEFAULT, - ALLMONO, - ALLSTEREO, - ALLQUAD, - ALL5POINT1, - ALL7POINT1, - ALLLFE, - ALL7POINT1POINT4 - } - - public enum DSP_CHANNELMIX : int - { - OUTPUTGROUPING, - GAIN_CH0, - GAIN_CH1, - GAIN_CH2, - GAIN_CH3, - GAIN_CH4, - GAIN_CH5, - GAIN_CH6, - GAIN_CH7, - GAIN_CH8, - GAIN_CH9, - GAIN_CH10, - GAIN_CH11, - GAIN_CH12, - GAIN_CH13, - GAIN_CH14, - GAIN_CH15, - GAIN_CH16, - GAIN_CH17, - GAIN_CH18, - GAIN_CH19, - GAIN_CH20, - GAIN_CH21, - GAIN_CH22, - GAIN_CH23, - GAIN_CH24, - GAIN_CH25, - GAIN_CH26, - GAIN_CH27, - GAIN_CH28, - GAIN_CH29, - GAIN_CH30, - GAIN_CH31, - OUTPUT_CH0, - OUTPUT_CH1, - OUTPUT_CH2, - OUTPUT_CH3, - OUTPUT_CH4, - OUTPUT_CH5, - OUTPUT_CH6, - OUTPUT_CH7, - OUTPUT_CH8, - OUTPUT_CH9, - OUTPUT_CH10, - OUTPUT_CH11, - OUTPUT_CH12, - OUTPUT_CH13, - OUTPUT_CH14, - OUTPUT_CH15, - OUTPUT_CH16, - OUTPUT_CH17, - OUTPUT_CH18, - OUTPUT_CH19, - OUTPUT_CH20, - OUTPUT_CH21, - OUTPUT_CH22, - OUTPUT_CH23, - OUTPUT_CH24, - OUTPUT_CH25, - OUTPUT_CH26, - OUTPUT_CH27, - OUTPUT_CH28, - OUTPUT_CH29, - OUTPUT_CH30, - OUTPUT_CH31, - } - - public enum DSP_TRANSCEIVER_SPEAKERMODE : int - { - AUTO = -1, - MONO = 0, - STEREO, - SURROUND, - } - - public enum DSP_TRANSCEIVER : int - { - TRANSMIT, - GAIN, - CHANNEL, - TRANSMITSPEAKERMODE - } - - public enum DSP_OBJECTPAN : int - { - _3D_POSITION, - _3D_ROLLOFF, - _3D_MIN_DISTANCE, - _3D_MAX_DISTANCE, - _3D_EXTENT_MODE, - _3D_SOUND_SIZE, - _3D_MIN_EXTENT, - OVERALL_GAIN, - OUTPUTGAIN, - ATTENUATION_RANGE, - OVERRIDE_RANGE - } -} diff --git a/Qwilight/FMOD/fmod_errors.cs b/Qwilight/FMOD/fmod_errors.cs deleted file mode 100644 index 63f3140..0000000 --- a/Qwilight/FMOD/fmod_errors.cs +++ /dev/null @@ -1,106 +0,0 @@ -/* ============================================================================================== */ -/* FMOD Core / Studio API - Error string header file. */ -/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2023. */ -/* */ -/* Use this header if you want to store or display a string version / english explanation */ -/* of the FMOD error codes. */ -/* */ -/* For more detail visit: */ -/* https://fmod.com/docs/2.02/api/core-api-common.html#fmod_result */ -/* =============================================================================================== */ - -namespace FMOD -{ - public class Error - { - public static string String(FMOD.RESULT errcode) - { - switch (errcode) - { - case FMOD.RESULT.OK: return "No errors."; - case FMOD.RESULT.ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound)."; - case FMOD.RESULT.ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel."; - case FMOD.RESULT.ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound."; - case FMOD.RESULT.ERR_DMA: return "DMA Failure. See debug output for more information."; - case FMOD.RESULT.ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts."; - case FMOD.RESULT.ERR_DSP_DONTPROCESS: return "DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph."; - case FMOD.RESULT.ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map."; - case FMOD.RESULT.ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released."; - case FMOD.RESULT.ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified."; - case FMOD.RESULT.ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system."; - case FMOD.RESULT.ERR_DSP_SILENCE: return "DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph."; - case FMOD.RESULT.ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type."; - case FMOD.RESULT.ERR_FILE_BAD: return "Error loading file."; - case FMOD.RESULT.ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format."; - case FMOD.RESULT.ERR_FILE_DISKEJECTED: return "Media was ejected while reading."; - case FMOD.RESULT.ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?)."; - case FMOD.RESULT.ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data."; - case FMOD.RESULT.ERR_FILE_NOTFOUND: return "File not found."; - case FMOD.RESULT.ERR_FORMAT: return "Unsupported file or audio format."; - case FMOD.RESULT.ERR_HEADER_MISMATCH: return "There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library."; - case FMOD.RESULT.ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere."; - case FMOD.RESULT.ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden."; - case FMOD.RESULT.ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource."; - case FMOD.RESULT.ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred."; - case FMOD.RESULT.ERR_HTTP_TIMEOUT: return "The HTTP request timed out."; - case FMOD.RESULT.ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function."; - case FMOD.RESULT.ERR_INITIALIZED: return "Cannot call this command after System::init."; - case FMOD.RESULT.ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support."; - case FMOD.RESULT.ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float."; - case FMOD.RESULT.ERR_INVALID_HANDLE: return "An invalid object handle was used."; - case FMOD.RESULT.ERR_INVALID_PARAM: return "An invalid parameter was passed to this function."; - case FMOD.RESULT.ERR_INVALID_POSITION: return "An invalid seek position was passed to this function."; - case FMOD.RESULT.ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode."; - case FMOD.RESULT.ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle."; - case FMOD.RESULT.ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported."; - case FMOD.RESULT.ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular."; - case FMOD.RESULT.ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup."; - case FMOD.RESULT.ERR_MEMORY: return "Not enough memory or resources."; - case FMOD.RESULT.ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used."; - case FMOD.RESULT.ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound."; - case FMOD.RESULT.ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support."; - case FMOD.RESULT.ERR_NET_CONNECT: return "Couldn't connect to the specified host."; - case FMOD.RESULT.ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere."; - case FMOD.RESULT.ERR_NET_URL: return "The specified URL couldn't be resolved."; - case FMOD.RESULT.ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately."; - case FMOD.RESULT.ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready."; - case FMOD.RESULT.ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused."; - case FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer."; - case FMOD.RESULT.ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted."; - case FMOD.RESULT.ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format."; - case FMOD.RESULT.ERR_OUTPUT_INIT: return "Error initializing output device."; - case FMOD.RESULT.ERR_OUTPUT_NODRIVERS: return "The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails."; - case FMOD.RESULT.ERR_PLUGIN: return "An unspecified error has been returned from a plugin."; - case FMOD.RESULT.ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available."; - case FMOD.RESULT.ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be allocated or found. (ie the DLS file for MIDI playback)"; - case FMOD.RESULT.ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version."; - case FMOD.RESULT.ERR_RECORD: return "An error occurred trying to initialize the recording device."; - case FMOD.RESULT.ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection."; - case FMOD.RESULT.ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist."; - case FMOD.RESULT.ERR_SUBSOUNDS: return "The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound."; - case FMOD.RESULT.ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first."; - case FMOD.RESULT.ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file."; - case FMOD.RESULT.ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags."; - case FMOD.RESULT.ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat."; - case FMOD.RESULT.ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated."; - case FMOD.RESULT.ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!"; - case FMOD.RESULT.ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called."; - case FMOD.RESULT.ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified."; - case FMOD.RESULT.ERR_VERSION: return "The version number of this file format is not supported."; - case FMOD.RESULT.ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded."; - case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected."; - case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool."; - case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out."; - case FMOD.RESULT.ERR_EVENT_NOTFOUND: return "The requested event, bus or vca could not be found."; - case FMOD.RESULT.ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized."; - case FMOD.RESULT.ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded."; - case FMOD.RESULT.ERR_INVALID_STRING: return "An invalid string was passed to this function."; - case FMOD.RESULT.ERR_ALREADY_LOCKED: return "The specified resource is already locked."; - case FMOD.RESULT.ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked."; - case FMOD.RESULT.ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected."; - case FMOD.RESULT.ERR_TOOMANYSAMPLES: return "The length provided exceed the allowable limit."; - default: return "Unknown error."; - } - } - } -} diff --git a/Qwilight/LedCSharp/LogitechGSDK.cs b/Qwilight/LedCSharp/LogitechGSDK.cs deleted file mode 100644 index 44576f8..0000000 --- a/Qwilight/LedCSharp/LogitechGSDK.cs +++ /dev/null @@ -1,238 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Text; - -namespace LedCSharp -{ - public enum keyboardNames - { - ESC = 0x01, - F1 = 0x3b, - F2 = 0x3c, - F3 = 0x3d, - F4 = 0x3e, - F5 = 0x3f, - F6 = 0x40, - F7 = 0x41, - F8 = 0x42, - F9 = 0x43, - F10 = 0x44, - F11 = 0x57, - F12 = 0x58, - PRINT_SCREEN = 0x137, - SCROLL_LOCK = 0x46, - PAUSE_BREAK = 0x145, - TILDE = 0x29, - ONE = 0x02, - TWO = 0x03, - THREE = 0x04, - FOUR = 0x05, - FIVE = 0x06, - SIX = 0x07, - SEVEN = 0x08, - EIGHT = 0x09, - NINE = 0x0A, - ZERO = 0x0B, - MINUS = 0x0C, - EQUALS = 0x0D, - BACKSPACE = 0x0E, - INSERT = 0x152, - HOME = 0x147, - PAGE_UP = 0x149, - NUM_LOCK = 0x45, - NUM_SLASH = 0x135, - NUM_ASTERISK = 0x37, - NUM_MINUS = 0x4A, - TAB = 0x0F, - Q = 0x10, - W = 0x11, - E = 0x12, - R = 0x13, - T = 0x14, - Y = 0x15, - U = 0x16, - I = 0x17, - O = 0x18, - P = 0x19, - OPEN_BRACKET = 0x1A, - CLOSE_BRACKET = 0x1B, - BACKSLASH = 0x2B, - KEYBOARD_DELETE = 0x153, - END = 0x14F, - PAGE_DOWN = 0x151, - NUM_SEVEN = 0x47, - NUM_EIGHT = 0x48, - NUM_NINE = 0x49, - NUM_PLUS = 0x4E, - CAPS_LOCK = 0x3A, - A = 0x1E, - S = 0x1F, - D = 0x20, - F = 0x21, - G = 0x22, - H = 0x23, - J = 0x24, - K = 0x25, - L = 0x26, - SEMICOLON = 0x27, - APOSTROPHE = 0x28, - ENTER = 0x1C, - NUM_FOUR = 0x4B, - NUM_FIVE = 0x4C, - NUM_SIX = 0x4D, - LEFT_SHIFT = 0x2A, - Z = 0x2C, - X = 0x2D, - C = 0x2E, - V = 0x2F, - B = 0x30, - N = 0x31, - M = 0x32, - COMMA = 0x33, - PERIOD = 0x34, - FORWARD_SLASH = 0x35, - RIGHT_SHIFT = 0x36, - ARROW_UP = 0x148, - NUM_ONE = 0x4F, - NUM_TWO = 0x50, - NUM_THREE = 0x51, - NUM_ENTER = 0x11C, - LEFT_CONTROL = 0x1D, - LEFT_WINDOWS = 0x15B, - LEFT_ALT = 0x38, - SPACE = 0x39, - RIGHT_ALT = 0x138, - RIGHT_WINDOWS = 0x15C, - APPLICATION_SELECT = 0x15D, - RIGHT_CONTROL = 0x11D, - ARROW_LEFT = 0x14B, - ARROW_DOWN = 0x150, - ARROW_RIGHT = 0x14D, - NUM_ZERO = 0x52, - NUM_PERIOD = 0x53, - G_1 = 0xFFF1, - G_2 = 0xFFF2, - G_3 = 0xFFF3, - G_4 = 0xFFF4, - G_5 = 0xFFF5, - G_6 = 0xFFF6, - G_7 = 0xFFF7, - G_8 = 0xFFF8, - G_9 = 0xFFF9, - G_LOGO = 0xFFFF1, - G_BADGE = 0xFFFF2 - }; - - public enum DeviceType - { - Keyboard = 0x0, - Mouse = 0x3, - Mousemat = 0x4, - Headset = 0x8, - Speaker = 0xe - } - - public class LogitechGSDK - { - //LED SDK - private const int LOGI_DEVICETYPE_MONOCHROME_ORD = 0; - private const int LOGI_DEVICETYPE_RGB_ORD = 1; - private const int LOGI_DEVICETYPE_PERKEY_RGB_ORD = 2; - - public const int LOGI_DEVICETYPE_MONOCHROME = (1 << LOGI_DEVICETYPE_MONOCHROME_ORD); - public const int LOGI_DEVICETYPE_RGB = (1 << LOGI_DEVICETYPE_RGB_ORD); - public const int LOGI_DEVICETYPE_PERKEY_RGB = (1 << LOGI_DEVICETYPE_PERKEY_RGB_ORD); - public const int LOGI_DEVICETYPE_ALL = (LOGI_DEVICETYPE_MONOCHROME | LOGI_DEVICETYPE_RGB | LOGI_DEVICETYPE_PERKEY_RGB); - - public const int LOGI_LED_BITMAP_WIDTH = 21; - public const int LOGI_LED_BITMAP_HEIGHT = 6; - public const int LOGI_LED_BITMAP_BYTES_PER_KEY = 4; - - public const int LOGI_LED_BITMAP_SIZE = LOGI_LED_BITMAP_WIDTH * LOGI_LED_BITMAP_HEIGHT * LOGI_LED_BITMAP_BYTES_PER_KEY; - public const int LOGI_LED_DURATION_INFINITE = 0; - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedInit(); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedInitWithName(String name); - - //Config option functions - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedGetConfigOptionNumber([MarshalAs(UnmanagedType.LPWStr)]String configPath, ref double defaultNumber); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedGetConfigOptionBool([MarshalAs(UnmanagedType.LPWStr)]String configPath, ref bool defaultRed); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedGetConfigOptionColor([MarshalAs(UnmanagedType.LPWStr)]String configPath, ref int defaultRed, ref int defaultGreen, ref int defaultBlue); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedGetConfigOptionKeyInput([MarshalAs(UnmanagedType.LPWStr)]String configPath, StringBuilder buffer, int bufsize); - ///////////////////// - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetTargetDevice(int targetDevice); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedGetSdkVersion(ref int majorNum, ref int minorNum, ref int buildNum); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSaveCurrentLighting(); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedRestoreLighting(); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedFlashLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedPulseLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedStopEffects(); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedExcludeKeysFromBitmap(keyboardNames[] keyList, int listCount); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingFromBitmap(byte[] bitmap); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingForKeyWithQuartzCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingForKeyWithKeyName(keyboardNames keyCode, int redPercentage, int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSaveLightingForKey(keyboardNames keyName); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedRestoreLightingForKey(keyboardNames keyName); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedFlashSingleKey(keyboardNames keyName, int redPercentage, int greenPercentage, int bluePercentage, int msDuration, int msInterval); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedPulseSingleKey(keyboardNames keyName, int startRedPercentage, int startGreenPercentage, int startBluePercentage, int finishRedPercentage, int finishGreenPercentage, int finishBluePercentage, int msDuration, bool isInfinite); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedStopEffectsOnKey(keyboardNames keyName); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingForTargetZone(DeviceType deviceType, int zone, int redPercentage, int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern void LogiLedShutdown(); - } - -} diff --git a/Qwilight/Qwilight.csproj b/Qwilight/Qwilight.csproj index f15233b..90e833c 100644 --- a/Qwilight/Qwilight.csproj +++ b/Qwilight/Qwilight.csproj @@ -239,9 +239,6 @@ - - Always - Always @@ -251,15 +248,9 @@ Always - - Always - Always - - Always - Always @@ -308,6 +299,9 @@ + + + diff --git a/Qwilight/Qwilight/Note/MeterNote.cs b/Qwilight/Qwilight/Note/MeterNote.cs index 453559e..907586b 100644 --- a/Qwilight/Qwilight/Note/MeterNote.cs +++ b/Qwilight/Qwilight/Note/MeterNote.cs @@ -81,7 +81,10 @@ var isMeterVisible = defaultComputer.IsMeterVisible; if (isMeterVisible) { - r.Position0 -= p1BuiltLength; + if (has2P) + { + r.Position0 -= p1BuiltLength; + } var faintClearPaint = DrawingSystem.Instance.FaintClearedPaints[faint]; var textItem = PoolSystem.Instance.GetTextItem(_meter, DrawingSystem.Instance.MeterFont); diff --git a/Qwilight/Qwilight/System/IlluminationSystem/BWSystem.cs b/Qwilight/Qwilight/System/IlluminationSystem/BWSystem.cs index fe7e3ed..7ad8fc4 100644 --- a/Qwilight/Qwilight/System/IlluminationSystem/BWSystem.cs +++ b/Qwilight/Qwilight/System/IlluminationSystem/BWSystem.cs @@ -134,7 +134,7 @@ SupportedDevice = 1, Category = 2 }; - var isOK = ChromaAnimationAPI.InitSDK(ref data) == RazerErrors.RZRESULT_SUCCESS; + var isOK = ChromaAnimationAPI.InitSDK(ref data) == 0; if (isOK) { _dataInputColors = new int[ChromaAnimationAPI.GetMaxRow(ChromaAnimationAPI.Device2D.Keyboard) * ChromaAnimationAPI.GetMaxColumn(ChromaAnimationAPI.Device2D.Keyboard)]; diff --git a/Qwilight/Qwilight/ViewModel/MainViewModel.cs b/Qwilight/Qwilight/ViewModel/MainViewModel.cs index f68f307..c93ce9f 100644 --- a/Qwilight/Qwilight/ViewModel/MainViewModel.cs +++ b/Qwilight/Qwilight/ViewModel/MainViewModel.cs @@ -28,7 +28,6 @@ using Windows.ApplicationModel.DataTransfer; using Windows.System; using Windows.Win32.UI.WindowsAndMessaging; -using Xml2CSharp; using Clipboard = Windows.ApplicationModel.DataTransfer.Clipboard; namespace Qwilight.ViewModel @@ -680,17 +679,17 @@ { var date = DateTime.Now; using var fs = File.OpenRead(filePath); - foreach (var eventNote in (new XmlSerializer(typeof(Courselist)).Deserialize(fs) as Courselist).Course) + foreach (var eventNote in (new XmlSerializer(typeof(XML.Courselist)).Deserialize(fs) as XML.Courselist).Course) { try { - var eventNoteID = eventNote.Hash[32..]; + var eventNoteID = eventNote.hash[32..]; for (var m = eventNoteID.Length - 32; m > 0; m -= 32) { eventNoteID = eventNoteID.Insert(m, ":0/"); } eventNoteID += ":0"; - var eventNoteName = eventNote.Title; + var eventNoteName = eventNote.title; var eventNoteVariety = DB.EventNoteVariety.MD5; _ = DB.Instance.SetEventNote(eventNoteID, eventNoteName, date, eventNoteVariety); lastEventNoteID = eventNoteID; diff --git a/Qwilight/Qwilight/ViewModel/NoteFileViewModel.cs b/Qwilight/Qwilight/ViewModel/NoteFileViewModel.cs index d67e1a1..8e7d925 100644 --- a/Qwilight/Qwilight/ViewModel/NoteFileViewModel.cs +++ b/Qwilight/Qwilight/ViewModel/NoteFileViewModel.cs @@ -9,9 +9,8 @@ using System.Text; using System.Windows; using System.Windows.Media; -using System.Xml.Serialization; +using System.Xml; using Windows.System; -using Xml2CSharp; namespace Qwilight.ViewModel { @@ -132,64 +131,57 @@ """; bmseViewerData.AddRange(data.Split(Environment.NewLine)); - Utility.SaveText(bmseViewerFilePath, bmseViewerText + data, Encoding.ASCII); + Utility.SaveText(bmseViewerFilePath, bmseViewerText + data, Encoding.UTF8); } - var doEdit = false; var bmseCompiler = new FileIniDataParser(); IniData bmse; using (var sr = File.OpenText(bmseFilePath)) { bmse = bmseCompiler.ReadData(sr); - var targetViewerID = (bmseViewerData.IndexOf(flintFilePath) / 6).ToString(); - if (bmse["View"]["ViewerNum"] != targetViewerID) + var flintID = (bmseViewerData.IndexOf(flintFilePath) / 6).ToString(); + if (bmse["View"]["ViewerNum"] != flintID) { - doEdit = true; - bmse["View"]["ViewerNum"] = targetViewerID; + bmse["View"]["ViewerNum"] = flintID; } } - if (doEdit) + using (var fw = File.Open(bmscFilePath, FileMode.Create)) + using (var sw = new StreamWriter(fw, Encoding.UTF8)) { - using var fw = File.Open(bmseFilePath, FileMode.Create); - using var sw = new StreamWriter(fw); bmseCompiler.WriteData(sw, bmse); } Utility.OpenAs(Configure.Instance.BMSEditorFilePath, $"\"{noteFilePath}\""); } else if (File.Exists(bmscFilePath)) { - var doEdit = false; - var bmsdCompiler = new XmlSerializer(typeof(IBMSC)); - IBMSC bmsc; - using (var fs = File.OpenRead(bmscFilePath)) + var bmscCompiler = new XmlDocument(); + bmscCompiler.LoadXml(File.ReadAllText(bmscFilePath)); + + var nodesViewer = bmscCompiler.SelectNodes("/iBMSC/Player/Player").Cast().ToList(); + var flintID = nodesViewer.FindIndex(node => Utility.EqualsCaseless(node.Attributes["Path"].Value, flintFilePath)); + if (flintID == -1) { - bmsc = bmsdCompiler.Deserialize(fs) as IBMSC; - var targetViewerID = bmsc.Players.Player.FindIndex(line => line.Path == flintFilePath); - if (targetViewerID == -1) - { - doEdit = true; - targetViewerID = bmsc.Players.Player.Count; - bmsc.Players.Player.Add(new Player - { - Index = targetViewerID.ToString(), - Path = flintFilePath, - FromBeginning = "-P -N0 \"\"", - FromHere = "-P -N \"\"", - Stop = "-S" - }); - bmsc.Players.Count = bmsc.Players.Player.Count.ToString(); - } - if (Utility.ToInt32(bmsc.Players.CurrentPlayer) != targetViewerID) - { - doEdit = true; - bmsc.Players.CurrentPlayer = targetViewerID.ToString(); - } + flintID = nodesViewer.Count; + var flintViewer = bmscCompiler.CreateElement("Player"); + flintViewer.SetAttribute("Index", flintID.ToString()); + flintViewer.SetAttribute("Path", flintFilePath); + flintViewer.SetAttribute("FromBeginning", "-P -N0 \"\""); + flintViewer.SetAttribute("FromHere", "-P -N \"\""); + flintViewer.SetAttribute("Stop", "-S"); + var nodeViewer = bmscCompiler.SelectSingleNode("/iBMSC/Player"); + nodeViewer.AppendChild(flintViewer); + nodeViewer.Attributes["Count"].Value = nodeViewer.ChildNodes.Count.ToString(); + nodeViewer.Attributes["CurrentPlayer"].Value = flintID.ToString(); } - if (doEdit) + else { - using var fw = File.Open(bmscFilePath, FileMode.Create); - using var sw = new StreamWriter(fw, Encoding.Unicode); - bmsdCompiler.Serialize(sw, bmsc); + var nodeViewer = bmscCompiler.SelectSingleNode("/iBMSC/Player"); + nodeViewer.Attributes["CurrentPlayer"].Value = flintID.ToString(); + } + using (var fw = File.Open(bmscFilePath, FileMode.Create)) + using (var sw = new StreamWriter(fw, Encoding.Unicode)) + { + bmscCompiler.Save(sw); } Utility.OpenAs(Configure.Instance.BMSEditorFilePath, $"\"{noteFilePath}\""); } @@ -228,7 +220,6 @@ var bms1FilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "BmsONE", "Settings.ini"); if (File.Exists(bms1FilePath)) { - var doEdit = false; var bms1Compiler = new FileIniDataParser(); IniData bms1; using (var sr = File.OpenText(bms1FilePath)) @@ -239,7 +230,6 @@ flintFilePath = flintFilePath.Replace(@"\", @"\\"); if (!Enumerable.Range(0, targetViewerID).Any(i => targetViewer[$@"Viewer{i}\Path"] == flintFilePath)) { - doEdit = true; targetViewer[$@"Viewer{targetViewerID}\Name"] = "Qwilight"; targetViewer[$@"Viewer{targetViewerID}\Path"] = flintFilePath; targetViewer[$@"Viewer{targetViewerID}\Icon"] = ""; @@ -251,10 +241,9 @@ targetViewer["ViewerCount"] = (targetViewerID + 1).ToString(); } } - if (doEdit) + using (var fw = File.Open(bms1FilePath, FileMode.Create)) + using (var sw = new StreamWriter(fw, Encoding.UTF8)) { - using var fw = File.Open(bms1FilePath, FileMode.Create); - using var sw = new StreamWriter(fw, Encoding.UTF8); bms1Compiler.WriteData(sw, bms1); } Utility.OpenAs(Configure.Instance.BMSONEditorFilePath, $"\"{noteFilePath}\""); diff --git a/Qwilight/Qwilight/XML.cs b/Qwilight/Qwilight/XML.cs new file mode 100644 index 0000000..94b5fdb --- /dev/null +++ b/Qwilight/Qwilight/XML.cs @@ -0,0 +1,20 @@ +using System.Xml.Serialization; + +namespace Qwilight +{ + public static class XML + { + [XmlRoot(ElementName = "courselist")] + public sealed class Courselist + { + [XmlElement(ElementName = "course")] + public Course[] Course { get; set; } + } + + public struct Course + { + public string title; + public string hash; + } + } +} diff --git a/Qwilight/Xml2CSharp/Courselist.cs b/Qwilight/Xml2CSharp/Courselist.cs deleted file mode 100644 index 1bfbe42..0000000 --- a/Qwilight/Xml2CSharp/Courselist.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - Licensed under the Apache License, Version 2.0 - - http://www.apache.org/licenses/LICENSE-2.0 - */ -using System; -using System.Xml.Serialization; -using System.Collections.Generic; -namespace Xml2CSharp -{ - [XmlRoot(ElementName = "course")] - public class Course - { - [XmlElement(ElementName = "title")] - public string Title { get; set; } - [XmlElement(ElementName = "line")] - public string Line { get; set; } - [XmlElement(ElementName = "hash")] - public string Hash { get; set; } - [XmlElement(ElementName = "type")] - public string Type { get; set; } - } - - [XmlRoot(ElementName = "courselist")] - public class Courselist - { - [XmlElement(ElementName = "course")] - public List Course { get; set; } - } - -} diff --git a/Qwilight/Xml2CSharp/IBMSC.cs b/Qwilight/Xml2CSharp/IBMSC.cs deleted file mode 100644 index e93bb3f..0000000 --- a/Qwilight/Xml2CSharp/IBMSC.cs +++ /dev/null @@ -1,517 +0,0 @@ -/* - Licensed under the Apache License, Version 2.0 - - http://www.apache.org/licenses/LICENSE-2.0 - */ -using System; -using System.Xml.Serialization; -using System.Collections.Generic; -namespace Xml2CSharp -{ - [XmlRoot(ElementName = "Form")] - public class Form - { - [XmlAttribute(AttributeName = "WindowState")] - public string WindowState { get; set; } - [XmlAttribute(AttributeName = "Width")] - public string Width { get; set; } - [XmlAttribute(AttributeName = "Height")] - public string Height { get; set; } - [XmlAttribute(AttributeName = "Top")] - public string Top { get; set; } - [XmlAttribute(AttributeName = "Left")] - public string Left { get; set; } - } - - [XmlRoot(ElementName = "Recent")] - public class Recent - { - [XmlAttribute(AttributeName = "Recent0")] - public string Recent0 { get; set; } - [XmlAttribute(AttributeName = "Recent1")] - public string Recent1 { get; set; } - [XmlAttribute(AttributeName = "Recent2")] - public string Recent2 { get; set; } - [XmlAttribute(AttributeName = "Recent3")] - public string Recent3 { get; set; } - [XmlAttribute(AttributeName = "Recent4")] - public string Recent4 { get; set; } - } - - [XmlRoot(ElementName = "Edit")] - public class Edit - { - [XmlAttribute(AttributeName = "NTInput")] - public string NTInput { get; set; } - [XmlAttribute(AttributeName = "Language")] - public string Language { get; set; } - [XmlAttribute(AttributeName = "ErrorCheck")] - public string ErrorCheck { get; set; } - [XmlAttribute(AttributeName = "AutoFocusMouseEnter")] - public string AutoFocusMouseEnter { get; set; } - [XmlAttribute(AttributeName = "FirstClickDisabled")] - public string FirstClickDisabled { get; set; } - [XmlAttribute(AttributeName = "ShowFileName")] - public string ShowFileName { get; set; } - [XmlAttribute(AttributeName = "MiddleButtonMoveMethod")] - public string MiddleButtonMoveMethod { get; set; } - [XmlAttribute(AttributeName = "AutoSaveInterval")] - public string AutoSaveInterval { get; set; } - [XmlAttribute(AttributeName = "PreviewOnClick")] - public string PreviewOnClick { get; set; } - [XmlAttribute(AttributeName = "ClickStopPreview")] - public string ClickStopPreview { get; set; } - } - - [XmlRoot(ElementName = "Save")] - public class Save - { - [XmlAttribute(AttributeName = "TextEncoding")] - public string TextEncoding { get; set; } - [XmlAttribute(AttributeName = "BMSGridLimit")] - public string BMSGridLimit { get; set; } - [XmlAttribute(AttributeName = "BeepWhileSaved")] - public string BeepWhileSaved { get; set; } - [XmlAttribute(AttributeName = "BPMx1296")] - public string BPMx1296 { get; set; } - [XmlAttribute(AttributeName = "STOPx1296")] - public string STOPx1296 { get; set; } - } - - [XmlRoot(ElementName = "WAV")] - public class WAV - { - [XmlAttribute(AttributeName = "WAVMultiSelect")] - public string WAVMultiSelect { get; set; } - [XmlAttribute(AttributeName = "WAVChangeLabel")] - public string WAVChangeLabel { get; set; } - [XmlAttribute(AttributeName = "BeatChangeMode")] - public string BeatChangeMode { get; set; } - } - - [XmlRoot(ElementName = "ShowHide")] - public class ShowHide - { - [XmlAttribute(AttributeName = "showMenu")] - public string ShowMenu { get; set; } - [XmlAttribute(AttributeName = "showTB")] - public string ShowTB { get; set; } - [XmlAttribute(AttributeName = "showOpPanel")] - public string ShowOpPanel { get; set; } - [XmlAttribute(AttributeName = "showStatus")] - public string ShowStatus { get; set; } - [XmlAttribute(AttributeName = "showLSplit")] - public string ShowLSplit { get; set; } - [XmlAttribute(AttributeName = "showRSplit")] - public string ShowRSplit { get; set; } - } - - [XmlRoot(ElementName = "Grid")] - public class Grid - { - [XmlAttribute(AttributeName = "gSnap")] - public string GSnap { get; set; } - [XmlAttribute(AttributeName = "gWheel")] - public string GWheel { get; set; } - [XmlAttribute(AttributeName = "gPgUpDn")] - public string GPgUpDn { get; set; } - [XmlAttribute(AttributeName = "gShow")] - public string GShow { get; set; } - [XmlAttribute(AttributeName = "gShowS")] - public string GShowS { get; set; } - [XmlAttribute(AttributeName = "gShowBG")] - public string GShowBG { get; set; } - [XmlAttribute(AttributeName = "gShowM")] - public string GShowM { get; set; } - [XmlAttribute(AttributeName = "gShowV")] - public string GShowV { get; set; } - [XmlAttribute(AttributeName = "gShowMB")] - public string GShowMB { get; set; } - [XmlAttribute(AttributeName = "gShowC")] - public string GShowC { get; set; } - [XmlAttribute(AttributeName = "gBPM")] - public string GBPM { get; set; } - [XmlAttribute(AttributeName = "gSTOP")] - public string GSTOP { get; set; } - [XmlAttribute(AttributeName = "gSCROLL")] - public string GSCROLL { get; set; } - [XmlAttribute(AttributeName = "gBLP")] - public string GBLP { get; set; } - [XmlAttribute(AttributeName = "gP2")] - public string GP2 { get; set; } - [XmlAttribute(AttributeName = "gCol")] - public string GCol { get; set; } - [XmlAttribute(AttributeName = "gDivide")] - public string GDivide { get; set; } - [XmlAttribute(AttributeName = "gSub")] - public string GSub { get; set; } - [XmlAttribute(AttributeName = "gSlash")] - public string GSlash { get; set; } - [XmlAttribute(AttributeName = "gxHeight")] - public string GxHeight { get; set; } - [XmlAttribute(AttributeName = "gxWidth")] - public string GxWidth { get; set; } - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "WaveForm")] - public class WaveForm - { - [XmlAttribute(AttributeName = "wLock")] - public string WLock { get; set; } - [XmlAttribute(AttributeName = "wPosition")] - public string WPosition { get; set; } - [XmlAttribute(AttributeName = "wLeft")] - public string WLeft { get; set; } - [XmlAttribute(AttributeName = "wWidth")] - public string WWidth { get; set; } - [XmlAttribute(AttributeName = "wPrecision")] - public string WPrecision { get; set; } - } - - [XmlRoot(ElementName = "Player")] - public class Player - { - [XmlAttribute(AttributeName = "Index")] - public string Index { get; set; } - [XmlAttribute(AttributeName = "Path")] - public string Path { get; set; } - [XmlAttribute(AttributeName = "FromBeginning")] - public string FromBeginning { get; set; } - [XmlAttribute(AttributeName = "FromHere")] - public string FromHere { get; set; } - [XmlAttribute(AttributeName = "Stop")] - public string Stop { get; set; } - } - - [XmlRoot(ElementName = "Player")] - public class Players - { - [XmlElement(ElementName = "Player")] - public List Player { get; set; } - [XmlAttribute(AttributeName = "Count")] - public string Count { get; set; } - [XmlAttribute(AttributeName = "CurrentPlayer")] - public string CurrentPlayer { get; set; } - } - - [XmlRoot(ElementName = "Column")] - public class Column - { - [XmlAttribute(AttributeName = "Index")] - public string Index { get; set; } - [XmlAttribute(AttributeName = "Width")] - public string Width { get; set; } - [XmlAttribute(AttributeName = "Title")] - public string Title { get; set; } - [XmlAttribute(AttributeName = "NoteColor")] - public string NoteColor { get; set; } - [XmlAttribute(AttributeName = "TextColor")] - public string TextColor { get; set; } - [XmlAttribute(AttributeName = "LongNoteColor")] - public string LongNoteColor { get; set; } - [XmlAttribute(AttributeName = "LongTextColor")] - public string LongTextColor { get; set; } - [XmlAttribute(AttributeName = "BG")] - public string BG { get; set; } - } - - [XmlRoot(ElementName = "Columns")] - public class Columns - { - [XmlElement(ElementName = "Column")] - public List Column { get; set; } - } - - [XmlRoot(ElementName = "ColumnTitle")] - public class ColumnTitle - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "ColumnTitleFont")] - public class ColumnTitleFont - { - [XmlAttribute(AttributeName = "Name")] - public string Name { get; set; } - [XmlAttribute(AttributeName = "Size")] - public string Size { get; set; } - [XmlAttribute(AttributeName = "Style")] - public string Style { get; set; } - } - - [XmlRoot(ElementName = "Bg")] - public class Bg - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "Sub")] - public class Sub - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "VLine")] - public class VLine - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "MLine")] - public class MLine - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "BGMWav")] - public class BGMWav - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "SelBox")] - public class SelBox - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "TSCursor")] - public class TSCursor - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "TSHalf")] - public class TSHalf - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "TSDeltaMouseOver")] - public class TSDeltaMouseOver - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "TSMouseOver")] - public class TSMouseOver - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "TSSel")] - public class TSSel - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "TSBPM")] - public class TSBPM - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "TSBPMFont")] - public class TSBPMFont - { - [XmlAttribute(AttributeName = "Name")] - public string Name { get; set; } - [XmlAttribute(AttributeName = "Size")] - public string Size { get; set; } - [XmlAttribute(AttributeName = "Style")] - public string Style { get; set; } - } - - [XmlRoot(ElementName = "MiddleDeltaRelease")] - public class MiddleDeltaRelease - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "kHeight")] - public class KHeight - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "kFont")] - public class KFont - { - [XmlAttribute(AttributeName = "Name")] - public string Name { get; set; } - [XmlAttribute(AttributeName = "Size")] - public string Size { get; set; } - [XmlAttribute(AttributeName = "Style")] - public string Style { get; set; } - } - - [XmlRoot(ElementName = "kMFont")] - public class KMFont - { - [XmlAttribute(AttributeName = "Name")] - public string Name { get; set; } - [XmlAttribute(AttributeName = "Size")] - public string Size { get; set; } - [XmlAttribute(AttributeName = "Style")] - public string Style { get; set; } - } - - [XmlRoot(ElementName = "kLabelVShift")] - public class KLabelVShift - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "kLabelHShift")] - public class KLabelHShift - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "kLabelHShiftL")] - public class KLabelHShiftL - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "kMouseOver")] - public class KMouseOver - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "kMouseOverE")] - public class KMouseOverE - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "kSelected")] - public class KSelected - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "kOpacity")] - public class KOpacity - { - [XmlAttribute(AttributeName = "Value")] - public string Value { get; set; } - } - - [XmlRoot(ElementName = "VisualSettings")] - public class VisualSettings - { - [XmlElement(ElementName = "ColumnTitle")] - public ColumnTitle ColumnTitle { get; set; } - [XmlElement(ElementName = "ColumnTitleFont")] - public ColumnTitleFont ColumnTitleFont { get; set; } - [XmlElement(ElementName = "Bg")] - public Bg Bg { get; set; } - [XmlElement(ElementName = "Grid")] - public Grid Grid { get; set; } - [XmlElement(ElementName = "Sub")] - public Sub Sub { get; set; } - [XmlElement(ElementName = "VLine")] - public VLine VLine { get; set; } - [XmlElement(ElementName = "MLine")] - public MLine MLine { get; set; } - [XmlElement(ElementName = "BGMWav")] - public BGMWav BGMWav { get; set; } - [XmlElement(ElementName = "SelBox")] - public SelBox SelBox { get; set; } - [XmlElement(ElementName = "TSCursor")] - public TSCursor TSCursor { get; set; } - [XmlElement(ElementName = "TSHalf")] - public TSHalf TSHalf { get; set; } - [XmlElement(ElementName = "TSDeltaMouseOver")] - public TSDeltaMouseOver TSDeltaMouseOver { get; set; } - [XmlElement(ElementName = "TSMouseOver")] - public TSMouseOver TSMouseOver { get; set; } - [XmlElement(ElementName = "TSSel")] - public TSSel TSSel { get; set; } - [XmlElement(ElementName = "TSBPM")] - public TSBPM TSBPM { get; set; } - [XmlElement(ElementName = "TSBPMFont")] - public TSBPMFont TSBPMFont { get; set; } - [XmlElement(ElementName = "MiddleDeltaRelease")] - public MiddleDeltaRelease MiddleDeltaRelease { get; set; } - [XmlElement(ElementName = "kHeight")] - public KHeight KHeight { get; set; } - [XmlElement(ElementName = "kFont")] - public KFont KFont { get; set; } - [XmlElement(ElementName = "kMFont")] - public KMFont KMFont { get; set; } - [XmlElement(ElementName = "kLabelVShift")] - public KLabelVShift KLabelVShift { get; set; } - [XmlElement(ElementName = "kLabelHShift")] - public KLabelHShift KLabelHShift { get; set; } - [XmlElement(ElementName = "kLabelHShiftL")] - public KLabelHShiftL KLabelHShiftL { get; set; } - [XmlElement(ElementName = "kMouseOver")] - public KMouseOver KMouseOver { get; set; } - [XmlElement(ElementName = "kMouseOverE")] - public KMouseOverE KMouseOverE { get; set; } - [XmlElement(ElementName = "kSelected")] - public KSelected KSelected { get; set; } - [XmlElement(ElementName = "kOpacity")] - public KOpacity KOpacity { get; set; } - } - - [XmlRoot(ElementName = "iBMSC")] - public class IBMSC - { - [XmlElement(ElementName = "Form")] - public Form Form { get; set; } - [XmlElement(ElementName = "Recent")] - public Recent Recent { get; set; } - [XmlElement(ElementName = "Edit")] - public Edit Edit { get; set; } - [XmlElement(ElementName = "Save")] - public Save Save { get; set; } - [XmlElement(ElementName = "WAV")] - public WAV WAV { get; set; } - [XmlElement(ElementName = "ShowHide")] - public ShowHide ShowHide { get; set; } - [XmlElement(ElementName = "Grid")] - public Grid Grid { get; set; } - [XmlElement(ElementName = "WaveForm")] - public WaveForm WaveForm { get; set; } - [XmlElement(ElementName = "Player")] - public Players Players { get; set; } - [XmlElement(ElementName = "Columns")] - public Columns Columns { get; set; } - [XmlElement(ElementName = "VisualSettings")] - public VisualSettings VisualSettings { get; set; } - [XmlAttribute(AttributeName = "Major")] - public string Major { get; set; } - [XmlAttribute(AttributeName = "Minor")] - public string Minor { get; set; } - [XmlAttribute(AttributeName = "Build")] - public string Build { get; set; } - } - -}