Plugin API
Making plugins for Brm BT Remote is really easy. You just need to include PluginBase.h and create a simple DLL similar to the following example:
MyPlugin.cpp
#include "stdafx.h" #include "../PluginBase.h" class MyPlugin : public PluginBase { public: MyPlugin() { actions.insert(std::pair<CString, executableAction>( L"MyPlugin: Message Box", executableAction(true/* uses parameter */, L"The parameter will be displayed to the user", this, 1) ) ); infoCollectors.insert(std::pair<CString, executableAction>( L"Hello World", executableAction(false/* no parameters */, L"Nothing to configure", this, 1) ) ); } ~MyPlugin() { } void callAction(int actionId, CString params, bool keyDown) { // you can omit this function if you don't plan to use any actions switch(actionId) { case 1: // message box with a user defined message if (keyDown) MessageBox(NULL, params, L"Message", MB_ICONINFORMATION); break; } } CString callInfoCollector(int infoCollectorId, CString params) { // you can omit this function if you don't plan to use any info collectors switch(infoCollectorId) { case 1: return L"Hello world!"; } return L""; } }; extern "C" __declspec(dllexport) PluginBase * loadPlugin() { return new MyPlugin(); }
Actions are assigned to buttons and executed when a button is pressed or released.
InfoCollectors send information from programs running on you computer to the cell phone.
Please note that they are called periodically (every second) from a worker thread for as long as the Bluetooth connection is active.
So, for instance, when using OLE, you need to initialize it for multithreaded environment. (Check the Powerpoint remote control plugin