... | ... | @@ -10,7 +10,7 @@ These Functions are used to report to the backend the general device information |
|
|
*Publisher and Device Name*
|
|
|
---
|
|
|
These are basic string returning functions for what to display on the devices panel for the device's name, and for who created the plugin.
|
|
|
```
|
|
|
``` javascript
|
|
|
export function Name() { return "Device Product name as a String"; };
|
|
|
export function Publisher() { return "This is You! as a String"; };
|
|
|
```
|
... | ... | @@ -19,7 +19,7 @@ export function Publisher() { return "This is You! as a String"; }; |
|
|
---
|
|
|
These are used to search the system for the device. Both are Encoded in Hex values in the format "0x****". These to need to be exactly matching your device. If your device/plugin is not showing up in signal it's is most likely a mismatched Vendor and Product Id. The bare Minimum needed to get a device to be detected(Not Running) in Signal is a matching vid and pid.
|
|
|
|
|
|
```
|
|
|
``` javascript
|
|
|
export function VendorId() { return 0xABCD;}; //Device's USB Vendor Id in Hex
|
|
|
export function ProductId() { return 0xABCD;}; //Device's USB Product Id in Hex
|
|
|
```
|
... | ... | @@ -30,7 +30,7 @@ This is the base size of the device's box on the Canvas before any scaling in a |
|
|
export function Size() { return [X,Y]; };
|
|
|
```
|
|
|
These will set the devices Default Positoning(the values before any user customization). the DefaultPosition is returning the 2d Point coordinates of the top left corner. While the Default Scale returns the scaling multiplier on a scale of 1.0-20.0.
|
|
|
```
|
|
|
``` javascript
|
|
|
export function DefaultPosition(){return [X,Y]};
|
|
|
export function DefaultScale(){return 8.0};
|
|
|
```
|
... | ... | @@ -40,31 +40,31 @@ export function DefaultScale(){return 8.0}; |
|
|
---
|
|
|
|
|
|
This function returns a 2d Array of all Led names on the device. These should follow the Supported Key Names Located [Here](https://onlinepngtools.com/convert-png-to-base64) to support keypress effects and Led Painting Features.
|
|
|
```
|
|
|
``` javascript
|
|
|
export function LedNames(){return vLedNames;};
|
|
|
```
|
|
|
|
|
|
This returns a Matrix of the individual Led's positions within the device's Canvas Box. All of the positions must be within the bounds set by the device's Size() export.
|
|
|
```
|
|
|
``` javascript
|
|
|
export function LedPositions(){return vLedPositions;};
|
|
|
```
|
|
|
|
|
|
*Base 64 Image*
|
|
|
---
|
|
|
This returns the device's Image encoded in a base 64 image string. Online conversion of a PNG to Base64 can be done [Here](https://onlinepngtools.com/convert-png-to-base64).
|
|
|
```
|
|
|
``` javascript
|
|
|
export function Image(){ return "Base 64 Image String";}
|
|
|
```
|
|
|
|
|
|
This function is responsible for determining which USB endpoints SingalRGB wants to open and use for the device. Every endpoint will 4 parameters with it to use as filters. Multiple endpoints can be opened for each Device.
|
|
|
|
|
|
```
|
|
|
``` javascript
|
|
|
endpoint.interface
|
|
|
endpoint.usage
|
|
|
endpoint.usage_page
|
|
|
endpoint.collection
|
|
|
```
|
|
|
```
|
|
|
``` javascript
|
|
|
export function Validate(endpoint)
|
|
|
{
|
|
|
return (endpoint.interface === 2 && endpoint.collection == 0x0003) ||
|
... | ... | @@ -78,13 +78,13 @@ export function Validate(endpoint) |
|
|
|
|
|
Usb Protocol Type, Most devices use Hid Protocols, But some devices like AIO's will use Libusb functions instead. Modes are case insensitive and are "HID" and "LIBUSB".
|
|
|
|
|
|
```
|
|
|
``` javascript
|
|
|
export function Type() { return "[Hid|LibUsb]"; }
|
|
|
```
|
|
|
|
|
|
This Function exports a list of conflicting exe's. Signal will not Initialize the plugin while one of these is running. When the conflicting process is closed SignalRGB will then initialize the plugin.
|
|
|
|
|
|
```
|
|
|
``` javascript
|
|
|
export function ConflictingProcesses() {
|
|
|
return ["NGenuity2.exe"];
|
|
|
}
|
... | ... | @@ -96,7 +96,7 @@ export function ConflictingProcesses() { |
|
|
|
|
|
This function contains all of the settings for the device plugin. These Settings are stored as JS/JSON objects and the function returns an array of them.
|
|
|
|
|
|
```
|
|
|
``` javascript
|
|
|
export function ControllableParameters(){
|
|
|
return [
|
|
|
{SETTING},
|
... | ... | @@ -105,7 +105,7 @@ export function ControllableParameters(){ |
|
|
}
|
|
|
```
|
|
|
Each Setting object will contain a set of values depending on the setting type. The Regular ones are as follows:
|
|
|
```
|
|
|
``` javascript
|
|
|
{
|
|
|
"property":"VariableName", //VariableName is the name of the global variable created on the backend and exposed to the JS plugin. These Values do not currently support reassignment from the JS plugin.
|
|
|
"label":"Settings Name", //Label is the settings name displaying in the settings panel of the device
|
... | ... | @@ -116,20 +116,20 @@ Each Setting object will contain a set of values depending on the setting type. |
|
|
```
|
|
|
|
|
|
Color picker: min and max Being Hue Value range
|
|
|
```
|
|
|
``` javascript
|
|
|
{"property":"ColorValue", "label":"User Color","min":"0","max":"360","type":"color","default":"#FFFFF"}
|
|
|
```
|
|
|
Drop Down Menu: values being an array of options names. These can be an array of strings, or a single comma-separated string, or option values.
|
|
|
|
|
|
```
|
|
|
``` javascript
|
|
|
{"property":"ComboBoxValue", "label":"User DropDown", "type":"combobox", "values":["Option 1","Option 2"], "default":"Option 1"}
|
|
|
```
|
|
|
Number Slider: min and max being int Values. Step is an optional inclusion to change the sliders increments. "step":"5" will increment in steps of 5
|
|
|
```
|
|
|
``` javascript
|
|
|
{"property":"SliderValue", "label":"User Slider","type":"number","min":"0", "max":"10","step":"1","default":"0"}
|
|
|
```
|
|
|
Boolean Toggle Switch
|
|
|
```
|
|
|
``` javascript
|
|
|
{"property":"BooleanValue", "label":"User Boolean","type":"boolean","default":"false"}
|
|
|
```
|
|
|
|
... | ... | @@ -141,7 +141,7 @@ These functions contain the runtime elements of your plugin. |
|
|
Initialize() is called from the backend any time the device gets initialized. This runs on the first launch of SignalRGB and any time the device's Enabled Toggle switched to true. This can be blank for so
|
|
|
me devices, But most will require a few command packets before you can send RGB data to them.
|
|
|
|
|
|
```
|
|
|
``` javascript
|
|
|
export function Initialize() {
|
|
|
DoDeviceStartup();
|
|
|
}
|
... | ... | @@ -149,7 +149,7 @@ export function Initialize() { |
|
|
|
|
|
Shutdown() is called from the backend any time the device needs to shut down. This will happen anytime devices Enabled Toggle switches to false, or SignalRGB tries to exit. This function can be blank for some devices, But some devices like Corsair's need to be put back into hardware mode when SignalRGB is done.
|
|
|
|
|
|
```
|
|
|
``` javascript
|
|
|
export function Shutdown()
|
|
|
{
|
|
|
SendShutdownColors();
|
... | ... | @@ -158,7 +158,7 @@ export function Shutdown() |
|
|
```
|
|
|
Render() is the function that gets repeatedly called to render devices color changes, and handles all of the logic in your plugin. This function is where you'll need to make your Color packets, handle changes to settings, and control the flow of your plugin's logic.
|
|
|
|
|
|
```
|
|
|
``` javascript
|
|
|
export function Render()
|
|
|
{
|
|
|
InitCustomStrip();
|
... | ... | |