-
Notifications
You must be signed in to change notification settings - Fork 5
How to implement a plugin?
Create a dll that exports single function:
plugin_interface const* getPluginInterface();This function returns a pointer to a struct that contains pointers to functions that WinLIRC can call to decode user interaction into remote control codes. WinLIRC calls this function to get access to the plugin's functionality.
struct plugin_interface
{
uint32_t plugin_api_version;
int (*init)(WLEventHandle exitEvent);
void (*deinit)();
int (*hasGui)();
void (*loadSetupGui)();
int (*sendIR)(ir_remote* remote, ir_ncode* code, int32_t repeats);
int (*decodeIR)(ir_remote* remotes, char* out, size_t out_size);
int (*setTransmitters)(uint32_t transmitterMask);
hardware const* (*getHardware)();
hardware const* hardware;
};Called after loading the plugin. exitEvent is the event that WinLIRC signals when the plugin should cancel any operations that are in progress, stop threads, if any.
Return nonzero to indicate success.
Called before unloading the plugin.
Called to determine if there is a GUI for configuring the plugin. Return non-zero from this function to indicate presence of GUI, 0 otherwise.
Called when WinLIRC attempts to display plugin's configuration GUI.
Implement this function if the plugin supports sending signals.
Implement this function if the plugin supports receiving signals.