Создание плагинов
Материал из AmbiBox
(Различия между версиями)
Ambibox (обсуждение | вклад) (Новая страница: «{{DISPLAYTITLE:<span style="display:none">{{FULLPAGENAME}}</span>}} == Создание плагинов подсветки == Плагины подсветки …») |
Версия 06:05, 10 апреля 2014
Создание плагинов подсветки
Плагины подсветки предназначены для создания световых эффектов в интеллектуальной подсветке и располагаются они в каталоге:
c:\Program Files\AmbiBox\Plugins\Backlight\[Имя каталога плагина]
В программе плагины расположены тут:
//--------------------------------------------------------------------------- // AmbiBox backlight plugins interface // Copyright (C) AmbiBox 2004-2014 // AmbiBox@mail.ru // http://www.ambibox.ru //--------------------------------------------------------------------------- #ifndef BACKLIGHT_PLUGINS_H #define BACKLIGHT_PLUGINS_H #include <windows.h> typedef int (__stdcall *SIR_INPUTCALLBACK)(DWORD *InputData, DWORD dwLedsCount); #pragma pack (push, 1) typedef struct _BACKLIGHT_PLUGIN_SETTINGS { DWORD dwPluginVersion; // Версия плагина и полей структуры. // Start structure plugin version 1 DWORD dwEventMethod; // Способ передачи данных основной программе // 0 - через функцию обратного вызова. // 1 - через сообщение WM_SETPLUGINDATA DWORD dwMinEventTime; // Минимальный интервал вызова CallBack(SendMessage) функции в миллисекундах. DWORD dwLedsCount; // Количество RGB LED светодиодов (зон) поддерживаемых устройством DWORD dwBitOfColor; // Размер RGB пространства в битах, // 8, 9, 10, 11, 12 - бит на цвет. SIR_INPUTCALLBACK input_func; // Функция обратного вызова которая вызывается плагином. HWND hWndEvent; // Хэндл для передачи данных плагина через WM_SETPLUGINDATA DWORD dwMessageID; // идентификатор сообщения WM_SETPLUGINDATA = dwMessageID // SendMessage(hWndEvent, WM_SETPLUGINDATA, ....); // lParam = (WPARAM)InputData; wParam = (WPARAM)dwLedsCount; wchar_t Language[100]; // Имя языка "English", "Deutsch", "Russian" и т.д. DWORD dwProfile; // Передаем в плагин номер профиля // End structure plugin version 1 } BACKLIGHT_PLUGIN_SETTINGS, *LPBACKLIGHT_PLUGIN_SETTINGS; #pragma pack (pop) typedef wchar_t *(__stdcall *SIR_DLL_FUNC_GETNAME)(void); typedef wchar_t *(__stdcall *SIR_DLL_FUNC_GETVERSION)(void); typedef wchar_t *(__stdcall *SIR_DLL_FUNC_GETDESCRIPTION)(void); typedef int (__stdcall *SIR_DLL_FUNC_INIT)(void); typedef int (__stdcall *SIR_DLL_FUNC_UNINIT)(void); typedef int (__stdcall *SIR_DLL_FUNC_START)(void); typedef int (__stdcall *SIR_DLL_FUNC_STOP)(void); typedef int (__stdcall *SIR_DLL_FUNC_SHOWSETTINGS)(HWND); typedef int (__stdcall *SIR_DLL_FUNC_SETBACKLIGHTSETTINGS)(LPBACKLIGHT_PLUGIN_SETTINGS settings); typedef int (__stdcall *SIR_DLL_FUNC_SAVESETTINGS)(void); /* Экспортируемые функции плагина */ extern "C" __declspec(dllexport) wchar_t * __stdcall SIR_GetName(void); extern "C" __declspec(dllexport) wchar_t * __stdcall SIR_GetVersion(void); extern "C" __declspec(dllexport) wchar_t * __stdcall SIR_GetDescription(void); extern "C" __declspec(dllexport) int __stdcall SIR_Init(void); extern "C" __declspec(dllexport) int __stdcall SIR_UnInit(void); extern "C" __declspec(dllexport) int __stdcall SIR_Start(void); extern "C" __declspec(dllexport) int __stdcall SIR_Stop(void); extern "C" __declspec(dllexport) int __stdcall SIR_ShowSettings(HWND hWndParent); extern "C" __declspec(dllexport) int __stdcall SIR_SetBacklightSettings(LPBACKLIGHT_PLUGIN_SETTINGS settings); extern "C" __declspec(dllexport) int __stdcall SIR_SaveSettings(void); /* Examle: //------------------------------------------------------------------------------ // Get plugin name wchar_t * __stdcall SIR_GetName(void) { return L"ColorMusic"; } //------------------------------------------------------------------------------ // Get plugin version wchar_t * __stdcall SIR_GetVersion(void) { return L"2.0.3"; } //------------------------------------------------------------------------------ // Get more information plugin wchar_t * __stdcall SIR_GetDescription(void) { return L"Plugin for Backlight\n\rDeveloper Maxim\n\r Web: http://www.ambibox.ru\n\rE-mail:AmbiBox@mail.ru"; } //------------------------------------------------------------------------------ // Initialize the plugin int __stdcall SIR_Init(void) { int ErrorCode = 3; return 0; // Success return ErrorCode; // Error code > 0 } //------------------------------------------------------------------------------ // UnInitialize the plugin int __stdcall SIR_UnInit(void) { int ErrorCode = 3; return 0; // Success return ErrorCode; // Error code > 0 } //------------------------------------------------------------------------------ // Start transmission of data from the plugin int __stdcall SIR_Start(void) { int ErrorCode = 3; return 0; // Success return ErrorCode; // Error code > 0 } //------------------------------------------------------------------------------ // Stop transmission of data from the plugin int __stdcall SIR_Stop(void) { int ErrorCode = 3; return 0; // Success return ErrorCode; // Error code > 0 } //------------------------------------------------------------------------------ // Display settings window plug-in int __stdcall SIR_ShowSettings(HWND hWndParent) { int ErrorCode = 3; return 0; // Success return ErrorCode; // Error code > 0 } //------------------------------------------------------------------------------ // Set parameters to the plug-in int __stdcall SIR_SetBacklightSettings(LPBACKLIGHT_PLUGIN_SETTINGS settings) { int ErrorCode = 3; return 0; // Success return ErrorCode; // Error code > 0 } //------------------------------------------------------------------------------ // Save settings of plug-in int __stdcall SIR_SaveSettings(void) { int ErrorCode = 3; return 0; // Success return ErrorCode; // Error code > 0 } */ #endif
Создание глобальных плагинов
Глобальные плагины предназначены для создания световых эффектов и взаимодействуют