2024-05-27 21:01:40 +02:00
|
|
|
export function Name() { return "Corsair Virtuoso XT Headset"; }
|
|
|
|
export function VendorId() { return 0x1b1c; }
|
|
|
|
export function ProductId() { return 0x0A64; }
|
|
|
|
export function Publisher() { return "WhirlwindFX"; }
|
2024-05-27 21:07:39 +02:00
|
|
|
export function Documentation(){ return "troubleshooting/corsair"; }
|
2024-05-27 22:47:37 +02:00
|
|
|
export function Size() { return [1,1]; }
|
2024-05-27 21:01:40 +02:00
|
|
|
export function DefaultPosition(){return [145, 85];}
|
2024-05-27 22:47:37 +02:00
|
|
|
export function DefaultScale(){return 8.0}
|
|
|
|
|
|
|
|
export function ControllableParameters() {
|
2024-05-27 21:01:40 +02:00
|
|
|
return [
|
2024-05-27 22:47:37 +02:00
|
|
|
{"property":"shutdownColor", "group":"lighting", "label":"Shutdown Color", "min":"0", "max":"360", "type":"color", "default":"009bde"},
|
2024-05-27 21:01:40 +02:00
|
|
|
{"property":"LightingMode", "group":"lighting", "label":"Lighting Mode", "type":"combobox", "values":["Canvas", "Forced"], "default":"Canvas"},
|
2024-05-27 22:47:37 +02:00
|
|
|
{"property":"forcedColor", "group":"lighting", "label":"Forced Color", "min":"0", "max":"360", "type":"color", "default":"009bde"},
|
2024-05-27 21:01:40 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2024-05-27 22:47:37 +02:00
|
|
|
const vLedNames = ["Led 1"];
|
|
|
|
var vLedPositions = [ [0,0] ];
|
2024-05-27 21:01:40 +02:00
|
|
|
|
|
|
|
export function LedNames() {
|
|
|
|
return vLedNames;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function LedPositions() {
|
|
|
|
return vLedPositions;
|
|
|
|
}
|
|
|
|
|
|
|
|
function EnableSoftwareControl() {
|
2024-05-27 21:07:39 +02:00
|
|
|
device.write([0x02, 0x09, 0x01, 0x03, 0x00, 0x02], 64); // Enable Software Mode
|
|
|
|
device.write([0x02, 0x09, 0x0D, 0x00, 0x01], 64); //Open lighting endpoint
|
2024-05-27 21:01:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function ReturnToHardwareControl() {
|
2024-05-27 21:07:39 +02:00
|
|
|
device.write([0x02, 0x09, 0x01, 0x03, 0x00, 0x01], 64);
|
2024-05-27 21:01:40 +02:00
|
|
|
}
|
|
|
|
|
2024-05-27 22:47:37 +02:00
|
|
|
|
2024-05-27 21:01:40 +02:00
|
|
|
export function Initialize() {
|
|
|
|
EnableSoftwareControl();
|
2024-05-27 21:07:39 +02:00
|
|
|
console.log("Developed on Firmware: 5.11.88");
|
2024-05-27 21:01:40 +02:00
|
|
|
}
|
|
|
|
|
2024-05-27 22:47:37 +02:00
|
|
|
|
2024-05-27 22:49:25 +02:00
|
|
|
function sendColors(overrideColor){
|
|
|
|
const packet = [];
|
|
|
|
let col;
|
|
|
|
|
|
|
|
if(overrideColor){
|
|
|
|
col = hexToRgb(overrideColor);
|
|
|
|
}else if (LightingMode === "Forced") {
|
|
|
|
col = hexToRgb(forcedColor);
|
|
|
|
}else{
|
|
|
|
col = device.color(0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
packet[0] = 0x02;
|
|
|
|
packet[1] = 0x09;
|
|
|
|
packet[2] = 0x06;
|
|
|
|
packet[4] = 0x09;
|
|
|
|
packet[8] = col[0];
|
|
|
|
packet[11] = col[1];
|
|
|
|
packet[14] = col[2];
|
|
|
|
|
|
|
|
device.write(packet, 64);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-05-27 21:01:40 +02:00
|
|
|
export function Render() {
|
|
|
|
sendColors();
|
|
|
|
}
|
|
|
|
|
2024-05-27 22:47:37 +02:00
|
|
|
export function Shutdown() {
|
2024-05-27 21:07:39 +02:00
|
|
|
if(SystemSuspending){
|
|
|
|
// Go Dark on System Sleep/Shutdown
|
|
|
|
sendColors("#000000");
|
|
|
|
}else{
|
|
|
|
ReturnToHardwareControl();
|
2024-05-27 21:01:40 +02:00
|
|
|
}
|
2024-05-27 21:07:39 +02:00
|
|
|
}
|
2024-05-27 21:01:40 +02:00
|
|
|
|
2024-05-27 21:07:39 +02:00
|
|
|
function hexToRgb(hex) {
|
2024-05-27 22:47:37 +02:00
|
|
|
let result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
|
|
let colors = [];
|
2024-05-27 21:07:39 +02:00
|
|
|
colors[0] = parseInt(result[1], 16);
|
|
|
|
colors[1] = parseInt(result[2], 16);
|
|
|
|
colors[2] = parseInt(result[3], 16);
|
2024-05-27 21:01:40 +02:00
|
|
|
|
2024-05-27 21:07:39 +02:00
|
|
|
return colors;
|
2024-05-27 21:01:40 +02:00
|
|
|
}
|
|
|
|
|
2024-05-27 21:07:39 +02:00
|
|
|
export function Validate(endpoint) {
|
2024-05-27 22:47:37 +02:00
|
|
|
return endpoint.interface === 0 && endpoint.usage === 0 && endpoint.usage_page === 0;
|
2024-05-27 21:01:40 +02:00
|
|
|
}
|
2024-05-27 21:07:39 +02:00
|
|
|
|
2024-05-27 22:47:37 +02:00
|
|
|
export function Image() {
|
|
|
|
return "iVBORw0KGgoAAAANSUhEUgAAA+gAAAH0CAYAAAHZLze7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAGfmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDUgNzkuMTY0NTkwLCAyMDIwLzEyLzA5LTExOjU3OjQ0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLz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