renamed constants
This commit is contained in:
parent
50fe30ca8b
commit
9524f4e91d
3 changed files with 90 additions and 80 deletions
|
|
@ -17,7 +17,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onDidReceiveSettings(fn) {
|
onDidReceiveSettings(fn) {
|
||||||
this.#on(`${this.UUID}.${DID_RECEIVE_SETTINGS}`, (jsn) => fn(jsn));
|
this.#on(`${this.UUID}.${Events.didReceiveSettings}`, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -26,7 +26,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onDidReceiveGlobalSettings(fn) {
|
onDidReceiveGlobalSettings(fn) {
|
||||||
this.#on(DID_RECEIVE_GLOBAL_SETTINGS, (jsn) => fn(jsn));
|
this.#on(Events.didReceiveGlobalSettings, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -35,7 +35,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onKeyDown(fn) {
|
onKeyDown(fn) {
|
||||||
this.#on(`${this.UUID}.${KEY_DOWN}`, (jsn) => fn(jsn));
|
this.#on(`${this.UUID}.${Events.keyDown}`, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onKeyUp(fn) {
|
onKeyUp(fn) {
|
||||||
this.#on(`${this.UUID}.${KEY_UP}`, (jsn) => fn(jsn));
|
this.#on(`${this.UUID}.${Events.keyUp}`, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onWillAppear(fn) {
|
onWillAppear(fn) {
|
||||||
this.#on(`${this.UUID}.${WILL_APPEAR}`, (jsn) => fn(jsn));
|
this.#on(`${this.UUID}.${Events.willAppear}`, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onWillDisappear(fn) {
|
onWillDisappear(fn) {
|
||||||
this.#on(`${this.UUID}.${WILL_DISAPPEAR}`, (jsn) => fn(jsn));
|
this.#on(`${this.UUID}.${Events.willDisappear}`, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onTitleParametersDidChange(fn) {
|
onTitleParametersDidChange(fn) {
|
||||||
this.#on(`${this.UUID}.${TITLE_PARAMETERS_DID_CHANGE}`, (jsn) => fn(jsn));
|
this.#on(`${this.UUID}.${Events.titleParametersDidChange}`, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,7 +80,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onPropertyInspectorDidAppear(fn) {
|
onPropertyInspectorDidAppear(fn) {
|
||||||
this.#on(`${this.UUID}.${PROPERTY_INSPECTOR_DID_APPEAR}`, (jsn) => fn(jsn));
|
this.#on(`${this.UUID}.${Events.propertyInspectorDidAppear}`, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,7 +89,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onPropertyInspectorDidDisappear(fn) {
|
onPropertyInspectorDidDisappear(fn) {
|
||||||
this.#on(`${this.UUID}.${PROPERTY_INSPECTOR_DID_DISAPPEAR}`, (jsn) => fn(jsn));
|
this.#on(`${this.UUID}.${Events.propertyInspectorDidDisappear}`, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onSendToPlugin(fn) {
|
onSendToPlugin(fn) {
|
||||||
this.#on(`${this.UUID}.${SEND_TO_PLUGIN}`, (jsn) => fn(jsn));
|
this.#on(`${this.UUID}.${Events.sendToPlugin}`, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ class ELGSDAction {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onSendToPropertyInspector(fn) {
|
onSendToPropertyInspector(fn) {
|
||||||
this.#on(`${this.UUID}.${SEND_TO_PROPERTY_INSPECTOR}`, (jsn) => fn(jsn));
|
this.#on(`${this.UUID}.${Events.sendToPropertyInspector}`, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
/**
|
||||||
|
* Errors Receieved from WebSocket
|
||||||
|
* @type {{"1000": string, "1011": string, "1010": string, "0": string, "1008": string, "1": string, "1007": string, "2": string, "1006": string, "3": string, "1005": string, "1004": string, "1015": string, "1003": string, "1002": string, "1001": string, "1009": string}}
|
||||||
|
*/
|
||||||
const SocketErrors = {
|
const SocketErrors = {
|
||||||
0: 'The connection has not yet been established',
|
0: 'The connection has not yet been established',
|
||||||
1: 'The connection is established and communication is possible',
|
1: 'The connection is established and communication is possible',
|
||||||
|
|
@ -19,44 +23,51 @@ const SocketErrors = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Events
|
* Events used for communicating with Stream Deck
|
||||||
|
* @type {{sendToPlugin: string, deviceDidDisconnect: string, getSettings: string, deviceDidConnect: string, logMessage: string, keyUp: string, didReceiveGlobalSettings: string, showOk: string, didReceiveSettings: string, willAppear: string, applicationDidLaunch: string, setGlobalSettings: string, getGlobalSettings: string, applicationDidTerminate: string, willDisappear: string, propertyInspectorDidAppear: string, setTitle: string, titleParametersDidChange: string, registerPropertyInspector: string, connected: string, openUrl: string, setSettings: string, sendToPropertyInspector: string, registerPlugin: string, systemDidWakeUp: string, setState: string, propertyInspectorDidDisappear: string, keyDown: string, showAlert: string, setImage: string}}
|
||||||
*/
|
*/
|
||||||
//TODO: group these in objects that make sense & rename
|
const Events = {
|
||||||
const DID_RECEIVE_SETTINGS = 'didReceiveSettings';
|
didReceiveSettings: 'didReceiveSettings',
|
||||||
const DID_RECEIVE_GLOBAL_SETTINGS = 'didReceiveGlobalSettings';
|
didReceiveGlobalSettings: 'didReceiveGlobalSettings',
|
||||||
const KEY_DOWN = 'keyDown';
|
keyDown: 'keyDown',
|
||||||
const KEY_UP = 'keyUp';
|
keyUp: 'keyUp',
|
||||||
const WILL_APPEAR = 'willAppear';
|
willAppear: 'willAppear',
|
||||||
const WILL_DISAPPEAR = 'willDisappear';
|
willDisappear: 'willDisappear',
|
||||||
const TITLE_PARAMETERS_DID_CHANGE = 'titleParametersDidChange';
|
titleParametersDidChange: 'titleParametersDidChange',
|
||||||
const DEVICE_DID_CONNECT = 'deviceDidConnect';
|
deviceDidConnect: 'deviceDidConnect',
|
||||||
const DEVICE_DID_DISCONNECT = 'deviceDidDisconnect';
|
deviceDidDisconnect: 'deviceDidDisconnect',
|
||||||
const APPLICATION_DID_LAUNCH = 'applicationDidLaunch';
|
applicationDidLaunch: 'applicationDidLaunch',
|
||||||
const APPLICATION_DID_TERMINATE = 'applicationDidTerminate';
|
applicationDidTerminate: 'applicationDidTerminate',
|
||||||
const SYSTEM_DID_WAKE_UP = 'systemDidWakeUp';
|
systemDidWakeUp: 'systemDidWakeUp',
|
||||||
const PROPERTY_INSPECTOR_DID_APPEAR = 'propertyInspectorDidAppear';
|
propertyInspectorDidAppear: 'propertyInspectorDidAppear',
|
||||||
const PROPERTY_INSPECTOR_DID_DISAPPEAR = 'propertyInspectorDidDisappear';
|
propertyInspectorDidDisappear: 'propertyInspectorDidDisappear',
|
||||||
const SEND_TO_PLUGIN = 'sendToPlugin';
|
sendToPlugin: 'sendToPlugin',
|
||||||
const SEND_TO_PROPERTY_INSPECTOR = 'sendToPropertyInspector';
|
sendToPropertyInspector: 'sendToPropertyInspector',
|
||||||
const CONNECTED = 'connected';
|
connected: 'connected',
|
||||||
const SET_IMAGE = 'setImage';
|
setImage: 'setImage',
|
||||||
const SET_TITLE = 'setTitle';
|
setTitle: 'setTitle',
|
||||||
const SET_STATE = 'setState';
|
setState: 'setState',
|
||||||
const SHOW_OK = 'showOk';
|
showOk: 'showOk',
|
||||||
const SHOW_ALERT = 'showAlert';
|
showAlert: 'showAlert',
|
||||||
const OPEN_URL = 'openUrl';
|
openUrl: 'openUrl',
|
||||||
const SET_GLOBAL_SETTINGS = 'setGlobalSettings';
|
setGlobalSettings: 'setGlobalSettings',
|
||||||
const GET_GLOBAL_SETTINGS = 'getGlobalSettings';
|
getGlobalSettings: 'getGlobalSettings',
|
||||||
const SET_SETTINGS = 'setSettings';
|
setSettings: 'setSettings',
|
||||||
const GET_SETTINGS = 'getSettings';
|
getSettings: 'getSettings',
|
||||||
const REGISTER_PROPERTY_INSPECTOR = 'registerPropertyInspector';
|
registerPropertyInspector: 'registerPropertyInspector',
|
||||||
const REGISTER_PLUGIN = 'registerPlugin';
|
registerPlugin: 'registerPlugin',
|
||||||
const DATA_LOCALIZE = '[data-localize]';
|
logMessage: 'logMessage',
|
||||||
const LOG_MESSAGE = 'logMessage';
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destination
|
* Constants used for Stream Deck
|
||||||
|
* @type {{softwareOnly: number, dataLocalize: string, hardwareAndSoftware: number, hardwareOnly: number}}
|
||||||
*/
|
*/
|
||||||
const HARDWARE_AND_SOFTWARE = 0;
|
const Constants = {
|
||||||
const HARDWARE_ONLY = 1;
|
dataLocalize: '[data-localize]',
|
||||||
const SOFTWARE_ONLY = 2;
|
|
||||||
|
//TODOZ: Try the things that use this in stream-deck.js to see if we really need it?
|
||||||
|
hardwareAndSoftware : 0,
|
||||||
|
hardwareOnly : 1,
|
||||||
|
softwareOnly : 2,
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ class ELGSDStreamDeck {
|
||||||
language;
|
language;
|
||||||
localization;
|
localization;
|
||||||
appInfo;
|
appInfo;
|
||||||
on = EventEmitter.on;
|
#on = EventEmitter.on;
|
||||||
emit = EventEmitter.emit;
|
#emit = EventEmitter.emit;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
if (ELGSDStreamDeck.__instance) {
|
if (ELGSDStreamDeck.__instance) {
|
||||||
|
|
@ -35,7 +35,6 @@ class ELGSDStreamDeck {
|
||||||
* @param messageType
|
* @param messageType
|
||||||
* @param appInfoString
|
* @param appInfoString
|
||||||
* @param actionString
|
* @param actionString
|
||||||
* @private
|
|
||||||
*/
|
*/
|
||||||
connect([port, uuid, messageType, appInfoString, actionString]) {
|
connect([port, uuid, messageType, appInfoString, actionString]) {
|
||||||
this.port = port;
|
this.port = port;
|
||||||
|
|
@ -60,7 +59,7 @@ class ELGSDStreamDeck {
|
||||||
|
|
||||||
this.websocket.send(JSON.stringify(json));
|
this.websocket.send(JSON.stringify(json));
|
||||||
|
|
||||||
this.emit(CONNECTED, {
|
this.#emit(Events.connected, {
|
||||||
connection: this.websocket,
|
connection: this.websocket,
|
||||||
port: this.port,
|
port: this.port,
|
||||||
uuid: this.uuid,
|
uuid: this.uuid,
|
||||||
|
|
@ -82,10 +81,10 @@ class ELGSDStreamDeck {
|
||||||
|
|
||||||
this.websocket.onmessage = (evt) => {
|
this.websocket.onmessage = (evt) => {
|
||||||
const data = evt?.data ? JSON.parse(evt.data) : {};
|
const data = evt?.data ? JSON.parse(evt.data) : {};
|
||||||
const { action, event } = data;
|
const {action, event} = data;
|
||||||
const message = action ? `${action}.${event}` : event;
|
const message = action ? `${action}.${event}` : event;
|
||||||
|
|
||||||
if (message && message !== '') this.emit(message, data);
|
if (message && message !== '') this.#emit(message, data);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,7 +96,7 @@ class ELGSDStreamDeck {
|
||||||
try {
|
try {
|
||||||
if (this.websocket) {
|
if (this.websocket) {
|
||||||
const json = {
|
const json = {
|
||||||
event: LOG_MESSAGE,
|
event: Events.logMessage,
|
||||||
payload: {
|
payload: {
|
||||||
message: message,
|
message: message,
|
||||||
},
|
},
|
||||||
|
|
@ -118,8 +117,8 @@ class ELGSDStreamDeck {
|
||||||
const manifest = await this.readJson(`${pathPrefix}${this.language}.json`);
|
const manifest = await this.readJson(`${pathPrefix}${this.language}.json`);
|
||||||
this.localization = manifest['Localization'] ?? null;
|
this.localization = manifest['Localization'] ?? null;
|
||||||
|
|
||||||
if (this.messageType === REGISTER_PROPERTY_INSPECTOR && this.localization) {
|
if (this.messageType === Events.registerPropertyInspector && this.localization) {
|
||||||
const elements = document.querySelectorAll(DATA_LOCALIZE);
|
const elements = document.querySelectorAll(Constants.dataLocalize);
|
||||||
|
|
||||||
elements.forEach((element) => {
|
elements.forEach((element) => {
|
||||||
element.textContent =
|
element.textContent =
|
||||||
|
|
@ -161,7 +160,7 @@ class ELGSDStreamDeck {
|
||||||
* @param payload
|
* @param payload
|
||||||
*/
|
*/
|
||||||
send(context, fn, payload) {
|
send(context, fn, payload) {
|
||||||
const pl = Object.assign({}, { event: fn, context: context }, payload);
|
const pl = Object.assign({}, {event: fn, context: context}, payload);
|
||||||
this.websocket && this.websocket.send(JSON.stringify(pl));
|
this.websocket && this.websocket.send(JSON.stringify(pl));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,7 +169,7 @@ class ELGSDStreamDeck {
|
||||||
* @param context
|
* @param context
|
||||||
*/
|
*/
|
||||||
getSettings(context) {
|
getSettings(context) {
|
||||||
this.send(context ?? this.uuid, GET_SETTINGS, {});
|
this.send(context ?? this.uuid, Events.getSettings, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -179,7 +178,7 @@ class ELGSDStreamDeck {
|
||||||
* @param context
|
* @param context
|
||||||
*/
|
*/
|
||||||
setSettings(payload, context) {
|
setSettings(payload, context) {
|
||||||
this.send(context ?? this.uuid, SET_SETTINGS, {
|
this.send(context ?? this.uuid, Events.setSettings, {
|
||||||
action: StreamDeck?.actionInfo?.action,
|
action: StreamDeck?.actionInfo?.action,
|
||||||
payload: payload || {},
|
payload: payload || {},
|
||||||
targetContext: StreamDeck?.actionInfo?.context,
|
targetContext: StreamDeck?.actionInfo?.context,
|
||||||
|
|
@ -190,7 +189,7 @@ class ELGSDStreamDeck {
|
||||||
* Request the plugin's persistent data. StreamDeck does not return the data, but trigger the plugin/property inspectors didReceiveGlobalSettings event
|
* Request the plugin's persistent data. StreamDeck does not return the data, but trigger the plugin/property inspectors didReceiveGlobalSettings event
|
||||||
*/
|
*/
|
||||||
getGlobalSettings() {
|
getGlobalSettings() {
|
||||||
this.send(this.uuid, GET_GLOBAL_SETTINGS, {});
|
this.send(this.uuid, Events.getGlobalSettings, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -198,7 +197,7 @@ class ELGSDStreamDeck {
|
||||||
* @param payload
|
* @param payload
|
||||||
*/
|
*/
|
||||||
setGlobalSettings(payload) {
|
setGlobalSettings(payload) {
|
||||||
this.send(this.uuid, SET_GLOBAL_SETTINGS, {
|
this.send(this.uuid, Events.setGlobalSettings, {
|
||||||
payload: payload,
|
payload: payload,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -208,7 +207,7 @@ class ELGSDStreamDeck {
|
||||||
* @param urlToOpen
|
* @param urlToOpen
|
||||||
*/
|
*/
|
||||||
openUrl(urlToOpen) {
|
openUrl(urlToOpen) {
|
||||||
this.send(this.uuid, OPEN_URL, {
|
this.send(this.uuid, Events.openUrl, {
|
||||||
payload: {
|
payload: {
|
||||||
url: urlToOpen,
|
url: urlToOpen,
|
||||||
},
|
},
|
||||||
|
|
@ -223,7 +222,7 @@ class ELGSDStreamDeck {
|
||||||
sendToPlugin(payload, context) {
|
sendToPlugin(payload, context) {
|
||||||
this.send(
|
this.send(
|
||||||
context ?? this.uuid,
|
context ?? this.uuid,
|
||||||
SEND_TO_PLUGIN,
|
Events.sendToPlugin,
|
||||||
{
|
{
|
||||||
action: StreamDeck?.actionInfo?.action,
|
action: StreamDeck?.actionInfo?.action,
|
||||||
payload: payload || {},
|
payload: payload || {},
|
||||||
|
|
@ -238,7 +237,7 @@ class ELGSDStreamDeck {
|
||||||
* @param context
|
* @param context
|
||||||
*/
|
*/
|
||||||
showAlert(context) {
|
showAlert(context) {
|
||||||
this.send(context, SHOW_ALERT, {});
|
this.send(context, Events.showAlert, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -246,7 +245,7 @@ class ELGSDStreamDeck {
|
||||||
* @param context
|
* @param context
|
||||||
*/
|
*/
|
||||||
showOk(context) {
|
showOk(context) {
|
||||||
this.send(context, SHOW_OK, {});
|
this.send(context, Events.showOk, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -255,7 +254,7 @@ class ELGSDStreamDeck {
|
||||||
* @param payload
|
* @param payload
|
||||||
*/
|
*/
|
||||||
setState(payload, context) {
|
setState(payload, context) {
|
||||||
this.send(context, SET_STATE, {
|
this.send(context, Events.setState, {
|
||||||
payload: {
|
payload: {
|
||||||
state: 1 - Number(payload === 0),
|
state: 1 - Number(payload === 0),
|
||||||
},
|
},
|
||||||
|
|
@ -269,10 +268,10 @@ class ELGSDStreamDeck {
|
||||||
* @param target
|
* @param target
|
||||||
*/
|
*/
|
||||||
setTitle(title, target, context) {
|
setTitle(title, target, context) {
|
||||||
this.send(context, SET_TITLE, {
|
this.send(context, Events.setTitle, {
|
||||||
payload: {
|
payload: {
|
||||||
title: '' + title || '',
|
title: '' + title || '',
|
||||||
target: target || HARDWARE_AND_SOFTWARE,
|
target: target || Constants.hardwareAndSoftware,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -283,7 +282,7 @@ class ELGSDStreamDeck {
|
||||||
* @param payload
|
* @param payload
|
||||||
*/
|
*/
|
||||||
sendToPropertyInspector(payload, context) {
|
sendToPropertyInspector(payload, context) {
|
||||||
this.send(context, SEND_TO_PROPERTY_INSPECTOR, {
|
this.send(context, Events.sendToPropertyInspector, {
|
||||||
action: this.actionInfo.action,
|
action: this.actionInfo.action,
|
||||||
payload: payload,
|
payload: payload,
|
||||||
});
|
});
|
||||||
|
|
@ -296,10 +295,10 @@ class ELGSDStreamDeck {
|
||||||
* @param target
|
* @param target
|
||||||
*/
|
*/
|
||||||
setImage(context, img, target) {
|
setImage(context, img, target) {
|
||||||
this.send(context, SET_IMAGE, {
|
this.send(context, Events.setImage, {
|
||||||
payload: {
|
payload: {
|
||||||
image: img || '',
|
image: img || '',
|
||||||
target: target || HARDWARE_AND_SOFTWARE,
|
target: target || Constants.hardwareAndSoftware,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -309,7 +308,7 @@ class ELGSDStreamDeck {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onConnected(fn) {
|
onConnected(fn) {
|
||||||
this.on(CONNECTED, (jsn) => fn(jsn));
|
this.#on(Events.connected, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -318,7 +317,7 @@ class ELGSDStreamDeck {
|
||||||
* @param fn
|
* @param fn
|
||||||
*/
|
*/
|
||||||
onSendToPropertyInspector(fn) {
|
onSendToPropertyInspector(fn) {
|
||||||
this.on(SEND_TO_PROPERTY_INSPECTOR, (jsn) => fn(jsn));
|
this.#on(Events.sendToPropertyInspector, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -327,7 +326,7 @@ class ELGSDStreamDeck {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onDeviceDidConnect(fn) {
|
onDeviceDidConnect(fn) {
|
||||||
this.on(DEVICE_DID_CONNECT, (jsn) => fn(jsn));
|
this.#on(Events.deviceDidConnect, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -336,7 +335,7 @@ class ELGSDStreamDeck {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onDeviceDidDisconnect(fn) {
|
onDeviceDidDisconnect(fn) {
|
||||||
this.on(DEVICE_DID_DISCONNECT, (jsn) => fn(jsn));
|
this.#on(Events.deviceDidDisconnect, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -345,7 +344,7 @@ class ELGSDStreamDeck {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onApplicationDidLaunch(fn) {
|
onApplicationDidLaunch(fn) {
|
||||||
this.on(APPLICATION_DID_LAUNCH, (jsn) => fn(jsn));
|
this.#on(Events.applicationDidLaunch, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -354,7 +353,7 @@ class ELGSDStreamDeck {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onApplicationDidTerminate(fn) {
|
onApplicationDidTerminate(fn) {
|
||||||
this.on(APPLICATION_DID_TERMINATE, (jsn) => fn(jsn));
|
this.#on(Events.applicationDidTerminate, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -363,12 +362,12 @@ class ELGSDStreamDeck {
|
||||||
* @param {*} fn
|
* @param {*} fn
|
||||||
*/
|
*/
|
||||||
onSystemDidWakeUp(fn) {
|
onSystemDidWakeUp(fn) {
|
||||||
this.on(SYSTEM_DID_WAKE_UP, (jsn) => fn(jsn));
|
this.#on(Events.systemDidWakeUp, (jsn) => fn(jsn));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var $SD = new ELGSDStreamDeck();
|
const $SD = new ELGSDStreamDeck();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* connectElgatoStreamDeckSocket
|
* connectElgatoStreamDeckSocket
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue