From 5a43112d07132f37a546c6606ae6b717676f9c4a Mon Sep 17 00:00:00 2001
From: BarRaider
Date: Wed, 6 Mar 2019 21:35:53 -0800
Subject: [PATCH] v1.2
## What's new in v1.2
- Brand new Action - The `Advanced PTT` action allows you to set a bunch of settings until you release the key. See the ***VoiceMeeter Advanced PTT*** section below
- New `TitlePrefix` parameter allows you to add a prefix before showing the value on the key [ProTip: Type `\n` to make the title multi-line]
- The *VoiceMeeter Advanced Click/Long-Click* is now called ***VoiceMeeter Advanced Press/Long-Press***
- Added support to additional file types in the image picker
- Improved Stability and small bug fixes
---
README.md | 50 ++--
VoiceMeeter/Program.cs | 9 +-
.../PropertyInspector/AdvancedToggle.js | 243 ------------------
VoiceMeeter/PropertyInspector/Microphone.js | 241 -----------------
VoiceMeeter/PropertyInspector/Modify.js | 214 ---------------
.../VoiceMeeter/Advanced.html | 19 +-
.../VoiceMeeter/AdvancedPTT.html | 48 ++++
.../VoiceMeeter/AdvancedToggle.html | 32 ++-
.../VoiceMeeter/Microphone.html | 28 +-
.../PropertyInspector/VoiceMeeter/Modify.html | 22 +-
VoiceMeeter/PropertyInspector/sdpi.css | 6 +
.../{Advanced.js => sdtools.common.js} | 128 +++++----
VoiceMeeter/VMAdvancedPTT.cs | 121 +++++++++
.../{VMAdvanced.cs => VMAdvancedPress.cs} | 76 +++---
VoiceMeeter/VMAdvancedToggle.cs | 77 +++---
VoiceMeeter/VMManager.cs | 8 +-
VoiceMeeter/VMMicrophone.cs | 69 +++--
VoiceMeeter/VMModify.cs | 70 +++--
VoiceMeeter/VoiceMeeter.csproj | 40 +--
VoiceMeeter/manifest.json | 33 ++-
VoiceMeeter/packages.config | 6 +-
21 files changed, 534 insertions(+), 1006 deletions(-)
delete mode 100644 VoiceMeeter/PropertyInspector/AdvancedToggle.js
delete mode 100644 VoiceMeeter/PropertyInspector/Microphone.js
delete mode 100644 VoiceMeeter/PropertyInspector/Modify.js
create mode 100644 VoiceMeeter/PropertyInspector/VoiceMeeter/AdvancedPTT.html
rename VoiceMeeter/PropertyInspector/{Advanced.js => sdtools.common.js} (58%)
create mode 100644 VoiceMeeter/VMAdvancedPTT.cs
rename VoiceMeeter/{VMAdvanced.cs => VMAdvancedPress.cs} (63%)
diff --git a/README.md b/README.md
index 58eead5..410981b 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,12 @@
# streamdeck-voicemeeter
VoiceMeeter integration and live feedback for the Elgato Stream Deck device.
-## What's new in v1.0
-### 1.
-VoiceMeeter Advanced Plugin is now called *VoiceMeeter Advanced Click/Long-Click* to differentiate from the brand new *VoiceMeeter Advanced Toggle* plugin
-
-### 2.
-#### Changes to "VoiceMeeter Mute/Unmute":
-- You can now choose your own images to display, instead of the 4 pre-defined icons
-
-### 3.
-#### "VoiceMeeter Advanced Toogle"
-- **Brand new plugin!**
-- Read below for full features list
+## What's new in v1.2
+- Brand new Action - The `Advanced PTT` action allows you to set a bunch of settings until you release the key. See the ***VoiceMeeter Advanced PTT*** section below
+- New `TitlePrefix` parameter allows you to add a prefix before showing the value on the key [ProTip: Type `\n` to make the title multi-line]
+- The *VoiceMeeter Advanced Click/Long-Click* is now called ***VoiceMeeter Advanced Press/Long-Press***
+- Added support to additional file types in the image picker
+- Improved Stability and small bug fixes
## Current functionality
### 4 Plugins built into one:
@@ -30,37 +24,39 @@ VoiceMeeter Advanced Plugin is now called *VoiceMeeter Advanced Click/Long-Click
* Options include modifying the: Gain slider, gate, comp, mono button, solo button, audibility, color_x, color_y, eqgain1, eqgain2, eqgain3, fx_x, fx_y, mc,pan_x, pan_y
(Valid values can be found starting on page 9 of VoiceMeeter API PDF: https://download.vb-audio.com/Download_CABLE/VoicemeeterRemoteAPI.pdf )
- Live feedback on the current value of that setting
-- Supports both Click and Long Click (allows you to toggle between two preset values for this setting)
-- Option to turn off the Live feedback and set the title to whatever you want
+- Supports both Press and Long Press (allows you to toggle between two preset values for this setting)
+- Option to turn off the Live feedback and set the title to whatever you want (including a prefix using the `TitlePrefix` parameter)
+
-#### VoiceMeeter Advanced Click/Long-Click
+#### VoiceMeeter Advanced Press/Long-Press
- **Note:** This is for advanced users (you better know what you're doing)
- Allows you to directly modify a whole set of settings
- Example: `Strip[0].mono=1;Strip[1].Mute=1;Bus[2].Gain=-20;`
* Additional examples can be found on the VoiceMeeter forum: https://forum.vb-audio.com/viewtopic.php?f=8&t=346&sid=a773394396c10847fd6fd7e332a55e49#p495
and the VoiceMeeter API PDF: https://download.vb-audio.com/Download_CABLE/VoicemeeterRemoteAPI.pdf
-- Supports both Click and Long Click (allows you to change between two preset list of settings)
+- Supports both Press and Long Press (allows you to change between two preset list of settings)
- Live feedback on whatever setting you choose
-- Option to turn off the Live feedback and set the title to whatever you want
+- Option to turn off the Live feedback and set the title to whatever you want (including a prefix using the `TitlePrefix` parameter)
#### VoiceMeeter Advanced Toogle
- **Note:** This is for advanced users (you better know what you're doing)
-- Focused on toggling between two modes (versus click and long click in the VoiceMeeter Advanced Click/Long-Click)
+- Focused on toggling between two modes (versus press and long press in the VoiceMeeter Advanced Press/Long-Press)
- Example: `Strip[0].mono=1;Strip[1].Mute=1;Bus[2].Gain=-20;`
* Additional examples can be found on the VoiceMeeter forum: https://forum.vb-audio.com/viewtopic.php?f=8&t=346&sid=a773394396c10847fd6fd7e332a55e49#p495
and the VoiceMeeter API PDF: https://download.vb-audio.com/Download_CABLE/VoicemeeterRemoteAPI.pdf
- Supports toggling between two preset list of settings
- Supports different user-defined icons for each preset
- Live feedback on whatever setting you choose
-- Option to turn off the Live feedback and set the title to whatever you want
+- Option to turn off the Live feedback and set the title to whatever you want (including a prefix using the `TitlePrefix` parameter)
-##### Advanced fields explained:
+### Fields explained:
- Mode1 Key Press - The configuration to set when we're toggling into Mode1 -> Use this to turn ON the setting e.g. `Strip[0].Mute=1`
- Mode1 Check - True/False value to determine if we're in Mode1. Example: If you input: `Strip[0].Mute` the plugin will determine you're in Mode1 every time Strip0 is muted.
- Mode1 Image - Customizable image that will be shown when you're in Mode1
- Mode2 Key Press - The configuration to set when we're toggling into Mode2 -> Use this to turn OFF the setting e.g. `Strip[0].Mute=0`
- Mode2 Key Press - Customizable image that will be shown when you're in Mode1
- Title - Used to determine if you want a dynamic title (Based on the "Title Value" field) or a static title (Based on the "Title field" at the very top)
+- Title Prefix - Text to add before displaying the `Title Value`. ProTip: Type `\n` to make the title multi-line
- Title Value - Value to display in the title. Example: If you input: `Strip[0].Mono` it will display `1` when Mono is enabled on Strip0 and `0` otherwise.
@@ -74,19 +70,21 @@ A: This means that VoiceMeeter is either not running or not properly installed.
Q: What are the valid values for each setting?
A: Valid values can be found starting on page 9 of VoiceMeeter API PDF: https://download.vb-audio.com/Download_CABLE/VoicemeeterRemoteAPI.pdf
-## Dependencies
-- This library uses the [streamdeck-client-csharp](https://github.com/TyrenDe/streamdeck-client-csharp) wrapper
-- This library uses a modified version of [VoiceMeeterWrapper](https://github.com/tocklime/VoiceMeeterWrapper) and includes additional functionality
+Q: Can I make the title multi-line?
+A: Yes, write `\n` in the `Title Prefix` parameter to add lines
-## Feature roadmap
-Always open to more suggestions.
+## Dependencies
+This plugin uses the [StreamDeck-Tools](https://github.com/BarRaider/streamdeck-tools) v2.0
## How do I get started using it?
Install by clicking the com.barraider.voicemeeter.streamDeckPlugin file in the Releases folder:
https://github.com/BarRaider/streamdeck-voicemeeter/releases
## I found a bug, who do I contact?
-Just head over to the issues page and create a new issue.
+For support please contact the developer. Contact information is available at https://barraider.github.io
+
+## I have a feature request, who do I contact?
+Please contact the developer. Contact information is available at https://barraider.github.io
## License
MIT License
diff --git a/VoiceMeeter/Program.cs b/VoiceMeeter/Program.cs
index 84d31d7..f1dec45 100644
--- a/VoiceMeeter/Program.cs
+++ b/VoiceMeeter/Program.cs
@@ -11,14 +11,7 @@ static void Main(string[] args)
{
// Uncomment this line of code to allow for debugging
//while (!System.Diagnostics.Debugger.IsAttached) { System.Threading.Thread.Sleep(100); }
-
- List supportedActionIds = new List();
- supportedActionIds.Add(new PluginActionId("com.barraider.vmmicrophone", typeof(VMMicrophone)));
- supportedActionIds.Add(new PluginActionId("com.barraider.vmmodify", typeof(VMModify)));
- supportedActionIds.Add(new PluginActionId("com.barraider.vmadvanced", typeof(VMAdvanced)));
- supportedActionIds.Add(new PluginActionId("com.barraider.vmadvancedtoggle", typeof(VMAdvancedToggle)));
-
- SDWrapper.Run(args, supportedActionIds.ToArray());
+ SDWrapper.Run(args);
}
}
}
diff --git a/VoiceMeeter/PropertyInspector/AdvancedToggle.js b/VoiceMeeter/PropertyInspector/AdvancedToggle.js
deleted file mode 100644
index 5c8c7ed..0000000
--- a/VoiceMeeter/PropertyInspector/AdvancedToggle.js
+++ /dev/null
@@ -1,243 +0,0 @@
-var websocket = null,
- uuid = null,
- actionInfo = {},
- inInfo = {},
- runningApps = [],
- isQT = navigator.appVersion.includes('QtWebEngine');
-
-function connectSocket(inPort, inUUID, inRegisterEvent, inInfo, inActionInfo) {
- uuid = inUUID;
- actionInfo = JSON.parse(inActionInfo); // cache the info
- inInfo = JSON.parse(inInfo);
- websocket = new WebSocket('ws://localhost:' + inPort);
-
- addDynamicStyles(inInfo.colors);
-
- websocket.onopen = function () {
- var json = {
- event: inRegisterEvent,
- uuid: inUUID
- };
-
- websocket.send(JSON.stringify(json));
-
- // Notify the plugin that we are connected
- sendValueToPlugin('propertyInspectorConnected', 'property_inspector');
- };
-
- websocket.onmessage = function (evt) {
- // Received message from Stream Deck
- var jsonObj = JSON.parse(evt.data);
-
- if (jsonObj.event === 'sendToPropertyInspector') {
- var payload = jsonObj.payload;
-
- var mode1Value = document.getElementById('mode1Value');
- mode1Value.value = payload['mode1Value'];
-
- var mode1Param = document.getElementById('mode1Param');
- mode1Param.value = payload['mode1Param'];
-
- var mode2Value = document.getElementById('mode2Value');
- mode2Value.value = payload['mode2Value'];
-
- var userImage1_filename = document.getElementById('userImage1_filename');
- userImage1_filename.innerText = payload['userImage1'];
- if (!userImage1_filename.innerText) {
- userImage1_filename.innerText = "No file...";
- }
-
- var userImage2_filename = document.getElementById('userImage2_filename');
- userImage2_filename.innerText = payload['userImage2'];
- if (!userImage2_filename.innerText) {
- userImage2_filename.innerText = "No file...";
- }
-
- var titleType = document.getElementById('titleType');
- titleType.value = payload['titleType'];
-
- var titleParam = document.getElementById('titleParam');
- titleParam.value = payload['titleParam'];
- }
- };
-}
-
-function updateSettings() {
- var mode1Value = document.getElementById('mode1Value');
- var mode1Param = document.getElementById('mode1Param');
- var mode2Value = document.getElementById('mode2Value');
- var titleType = document.getElementById('titleType');
- var titleParam = document.getElementById('titleParam');
- var userImage1 = document.getElementById('userImage1');
- var userImage2 = document.getElementById('userImage2');
- var userImage1_filename = document.getElementById('userImage1_filename');
- var userImage2_filename = document.getElementById('userImage2_filename');
-
-
- var payload = {};
-
- payload.property_inspector = 'updateSettings';
- payload.mode1Value = mode1Value.value;
- payload.mode1Param = mode1Param.value;
- payload.mode2Value = mode2Value.value;
- payload.titleType = titleType.value;
- payload.titleParam = titleParam.value;
- payload.userImage1 = userImage1.value;
- if (!userImage1.value) {
- // Fetch innerText if file is empty (happens when we lose and regain focus to this key)
- payload.userImage1 = userImage1_filename.innerText;
- }
- else {
- // Set value on initial file selction
- userImage1_filename.innerText = userImage1.value;
- }
-
- payload.userImage2 = userImage2.value;
- if (!userImage2.value) {
- // Fetch innerText if file is empty (happens when we lose and regain focus to this key)
- payload.userImage2 = userImage2_filename.innerText;
- }
- else {
- // Set value on initial file selction
- userImage2_filename.innerText = userImage2.value;
- }
-
-
- sendPayloadToPlugin(payload);
-}
-
-function sendPayloadToPlugin(payload) {
- if (websocket && (websocket.readyState === 1)) {
- const json = {
- 'action': actionInfo['action'],
- 'event': 'sendToPlugin',
- 'context': uuid,
- 'payload': payload
- };
- websocket.send(JSON.stringify(json));
- }
-}
-
-// our method to pass values to the plugin
-function sendValueToPlugin(value, param) {
- if (websocket && (websocket.readyState === 1)) {
- const json = {
- 'action': actionInfo['action'],
- 'event': 'sendToPlugin',
- 'context': uuid,
- 'payload': {
- [param]: value
- }
- };
- websocket.send(JSON.stringify(json));
- }
-}
-
-function openWebsite() {
- if (websocket && (websocket.readyState === 1)) {
- const json = {
- 'event': 'openUrl',
- 'payload': {
- 'url': 'https://BarRaider.github.io'
- }
- };
- websocket.send(JSON.stringify(json));
- }
-}
-
-if (!isQT) {
- document.addEventListener('DOMContentLoaded', function () {
- initPropertyInspector();
- });
-}
-
-window.addEventListener('beforeunload', function (e) {
- e.preventDefault();
-
- // Notify the plugin we are about to leave
- sendValueToPlugin('propertyInspectorWillDisappear', 'property_inspector');
-
- // Don't set a returnValue to the event, otherwise Chromium with throw an error.
-});
-
-function initPropertyInspector() {
- // Place to add functions
-}
-
-
-function addDynamicStyles(clrs) {
- const node = document.getElementById('#sdpi-dynamic-styles') || document.createElement('style');
- if (!clrs.mouseDownColor) clrs.mouseDownColor = fadeColor(clrs.highlightColor, -100);
- const clr = clrs.highlightColor.slice(0, 7);
- const clr1 = fadeColor(clr, 100);
- const clr2 = fadeColor(clr, 60);
- const metersActiveColor = fadeColor(clr, -60);
-
- node.setAttribute('id', 'sdpi-dynamic-styles');
- node.innerHTML = `
-
- input[type="radio"]:checked + label span,
- input[type="checkbox"]:checked + label span {
- background-color: ${clrs.highlightColor};
- }
-
- input[type="radio"]:active:checked + label span,
- input[type="radio"]:active + label span,
- input[type="checkbox"]:active:checked + label span,
- input[type="checkbox"]:active + label span {
- background-color: ${clrs.mouseDownColor};
- }
-
- input[type="radio"]:active + label span,
- input[type="checkbox"]:active + label span {
- background-color: ${clrs.buttonPressedBorderColor};
- }
-
- td.selected,
- td.selected:hover,
- li.selected:hover,
- li.selected {
- color: white;
- background-color: ${clrs.highlightColor};
- }
-
- .sdpi-file-label > label:active,
- .sdpi-file-label.file:active,
- label.sdpi-file-label:active,
- label.sdpi-file-info:active,
- input[type="file"]::-webkit-file-upload-button:active,
- button:active {
- background-color: ${clrs.buttonPressedBackgroundColor};
- color: ${clrs.buttonPressedTextColor};
- border-color: ${clrs.buttonPressedBorderColor};
- }
-
- ::-webkit-progress-value,
- meter::-webkit-meter-optimum-value {
- background: linear-gradient(${clr2}, ${clr1} 20%, ${clr} 45%, ${clr} 55%, ${clr2})
- }
-
- ::-webkit-progress-value:active,
- meter::-webkit-meter-optimum-value:active {
- background: linear-gradient(${clr}, ${clr2} 20%, ${metersActiveColor} 45%, ${metersActiveColor} 55%, ${clr})
- }
- `;
- document.body.appendChild(node);
-};
-
-/** UTILITIES */
-
-/*
- Quick utility to lighten or darken a color (doesn't take color-drifting, etc. into account)
- Usage:
- fadeColor('#061261', 100); // will lighten the color
- fadeColor('#200867'), -100); // will darken the color
-*/
-function fadeColor(col, amt) {
- const min = Math.min, max = Math.max;
- const num = parseInt(col.replace(/#/g, ''), 16);
- const r = min(255, max((num >> 16) + amt, 0));
- const g = min(255, max((num & 0x0000FF) + amt, 0));
- const b = min(255, max(((num >> 8) & 0x00FF) + amt, 0));
- return '#' + (g | (b << 8) | (r << 16)).toString(16).padStart(6, 0);
-}
diff --git a/VoiceMeeter/PropertyInspector/Microphone.js b/VoiceMeeter/PropertyInspector/Microphone.js
deleted file mode 100644
index 1e590bb..0000000
--- a/VoiceMeeter/PropertyInspector/Microphone.js
+++ /dev/null
@@ -1,241 +0,0 @@
-var websocket = null,
- uuid = null,
- actionInfo = {},
- inInfo = {},
- runningApps = [],
- isQT = navigator.appVersion.includes('QtWebEngine');
-
-function connectSocket(inPort, inUUID, inRegisterEvent, inInfo, inActionInfo) {
- uuid = inUUID;
- actionInfo = JSON.parse(inActionInfo); // cache the info
- inInfo = JSON.parse(inInfo);
- websocket = new WebSocket('ws://localhost:' + inPort);
-
- addDynamicStyles(inInfo.colors);
-
- websocket.onopen = function () {
- var json = {
- event: inRegisterEvent,
- uuid: inUUID
- };
-
- websocket.send(JSON.stringify(json));
-
- // Notify the plugin that we are connected
- sendValueToPlugin('propertyInspectorConnected', 'property_inspector');
- };
-
- websocket.onmessage = function (evt) {
- // Received message from Stream Deck
- var jsonObj = JSON.parse(evt.data);
-
- if (jsonObj.event === 'sendToPropertyInspector') {
- var payload = jsonObj.payload;
-
- var micType = document.getElementById('micType');
- micType.value = payload['micType'];
-
- var strip = document.getElementById('strip');
- strip.value = payload['strip'];
-
- var stripNum = document.getElementById('stripNum');
- stripNum.value = payload['stripNum'];
-
- var imageType = document.getElementById('imageType');
- imageType.value = payload['imageType'];
-
- var singleValue = document.getElementById('singleValue');
- singleValue.value = payload['singleValue'];
-
- var userImage1_filename = document.getElementById('userImage1_filename');
- userImage1_filename.innerText = payload['userImage1'];
- if (!userImage1_filename.innerText) {
- userImage1_filename.innerText = "No file...";
- }
-
- var userImage2_filename = document.getElementById('userImage2_filename');
- userImage2_filename.innerText = payload['userImage2'];
- if (!userImage2_filename.innerText) {
- userImage2_filename.innerText = "No file...";
- }
- }
- };
-}
-
-function updateSettings() {
- var micType = document.getElementById('micType');
- var strip = document.getElementById('strip');
- var stripNum = document.getElementById('stripNum');
- var imageType = document.getElementById('imageType');
- var singleValue = document.getElementById('singleValue');
- var userImage1 = document.getElementById('userImage1');
- var userImage2 = document.getElementById('userImage2');
- var userImage1_filename = document.getElementById('userImage1_filename');
- var userImage2_filename = document.getElementById('userImage2_filename');
-
- var payload = {};
-
- payload.property_inspector = 'updateSettings';
- payload.micType = micType.value;
- payload.strip = strip.value;
- payload.stripNum = stripNum.value;
- payload.imageType = imageType.value;
- payload.singleValue = singleValue.value;
- payload.userImage1 = userImage1.value;
- if (!userImage1.value) {
- // Fetch innerText if file is empty (happens when we lose and regain focus to this key)
- payload.userImage1 = userImage1_filename.innerText;
- }
- else {
- // Set value on initial file selction
- userImage1_filename.innerText = userImage1.value;
- }
-
- payload.userImage2 = userImage2.value;
- if (!userImage2.value) {
- // Fetch innerText if file is empty (happens when we lose and regain focus to this key)
- payload.userImage2 = userImage2_filename.innerText;
- }
- else {
- // Set value on initial file selction
- userImage2_filename.innerText = userImage2.value;
- }
-
- sendPayloadToPlugin(payload);
-}
-
-function sendPayloadToPlugin(payload) {
- if (websocket && (websocket.readyState === 1)) {
- const json = {
- 'action': actionInfo['action'],
- 'event': 'sendToPlugin',
- 'context': uuid,
- 'payload': payload
- };
- websocket.send(JSON.stringify(json));
- }
-}
-
-// our method to pass values to the plugin
-function sendValueToPlugin(value, param) {
- if (websocket && (websocket.readyState === 1)) {
- const json = {
- 'action': actionInfo['action'],
- 'event': 'sendToPlugin',
- 'context': uuid,
- 'payload': {
- [param]: value
- }
- };
- websocket.send(JSON.stringify(json));
- }
-}
-
-function openWebsite() {
- if (websocket && (websocket.readyState === 1)) {
- const json = {
- 'event': 'openUrl',
- 'payload': {
- 'url': 'https://BarRaider.github.io'
- }
- };
- websocket.send(JSON.stringify(json));
- }
-}
-
-if (!isQT) {
- document.addEventListener('DOMContentLoaded', function () {
- initPropertyInspector();
- });
-}
-
-window.addEventListener('beforeunload', function (e) {
- e.preventDefault();
-
- // Notify the plugin we are about to leave
- sendValueToPlugin('propertyInspectorWillDisappear', 'property_inspector');
-
- // Don't set a returnValue to the event, otherwise Chromium with throw an error.
-});
-
-function initPropertyInspector() {
- // Place to add functions
-}
-
-
-function addDynamicStyles(clrs) {
- const node = document.getElementById('#sdpi-dynamic-styles') || document.createElement('style');
- if (!clrs.mouseDownColor) clrs.mouseDownColor = fadeColor(clrs.highlightColor, -100);
- const clr = clrs.highlightColor.slice(0, 7);
- const clr1 = fadeColor(clr, 100);
- const clr2 = fadeColor(clr, 60);
- const metersActiveColor = fadeColor(clr, -60);
-
- node.setAttribute('id', 'sdpi-dynamic-styles');
- node.innerHTML = `
-
- input[type="radio"]:checked + label span,
- input[type="checkbox"]:checked + label span {
- background-color: ${clrs.highlightColor};
- }
-
- input[type="radio"]:active:checked + label span,
- input[type="radio"]:active + label span,
- input[type="checkbox"]:active:checked + label span,
- input[type="checkbox"]:active + label span {
- background-color: ${clrs.mouseDownColor};
- }
-
- input[type="radio"]:active + label span,
- input[type="checkbox"]:active + label span {
- background-color: ${clrs.buttonPressedBorderColor};
- }
-
- td.selected,
- td.selected:hover,
- li.selected:hover,
- li.selected {
- color: white;
- background-color: ${clrs.highlightColor};
- }
-
- .sdpi-file-label > label:active,
- .sdpi-file-label.file:active,
- label.sdpi-file-label:active,
- label.sdpi-file-info:active,
- input[type="file"]::-webkit-file-upload-button:active,
- button:active {
- background-color: ${clrs.buttonPressedBackgroundColor};
- color: ${clrs.buttonPressedTextColor};
- border-color: ${clrs.buttonPressedBorderColor};
- }
-
- ::-webkit-progress-value,
- meter::-webkit-meter-optimum-value {
- background: linear-gradient(${clr2}, ${clr1} 20%, ${clr} 45%, ${clr} 55%, ${clr2})
- }
-
- ::-webkit-progress-value:active,
- meter::-webkit-meter-optimum-value:active {
- background: linear-gradient(${clr}, ${clr2} 20%, ${metersActiveColor} 45%, ${metersActiveColor} 55%, ${clr})
- }
- `;
- document.body.appendChild(node);
-};
-
-/** UTILITIES */
-
-/*
- Quick utility to lighten or darken a color (doesn't take color-drifting, etc. into account)
- Usage:
- fadeColor('#061261', 100); // will lighten the color
- fadeColor('#200867'), -100); // will darken the color
-*/
-function fadeColor(col, amt) {
- const min = Math.min, max = Math.max;
- const num = parseInt(col.replace(/#/g, ''), 16);
- const r = min(255, max((num >> 16) + amt, 0));
- const g = min(255, max((num & 0x0000FF) + amt, 0));
- const b = min(255, max(((num >> 8) & 0x00FF) + amt, 0));
- return '#' + (g | (b << 8) | (r << 16)).toString(16).padStart(6, 0);
-}
diff --git a/VoiceMeeter/PropertyInspector/Modify.js b/VoiceMeeter/PropertyInspector/Modify.js
deleted file mode 100644
index 9df8367..0000000
--- a/VoiceMeeter/PropertyInspector/Modify.js
+++ /dev/null
@@ -1,214 +0,0 @@
-var websocket = null,
- uuid = null,
- actionInfo = {},
- inInfo = {},
- runningApps = [],
- isQT = navigator.appVersion.includes('QtWebEngine');
-
-function connectSocket(inPort, inUUID, inRegisterEvent, inInfo, inActionInfo) {
- uuid = inUUID;
- actionInfo = JSON.parse(inActionInfo); // cache the info
- inInfo = JSON.parse(inInfo);
- websocket = new WebSocket('ws://localhost:' + inPort);
-
- addDynamicStyles(inInfo.colors);
-
- websocket.onopen = function () {
- var json = {
- event: inRegisterEvent,
- uuid: inUUID
- };
-
- websocket.send(JSON.stringify(json));
-
- // Notify the plugin that we are connected
- sendValueToPlugin('propertyInspectorConnected', 'property_inspector');
- };
-
- websocket.onmessage = function (evt) {
- // Received message from Stream Deck
- var jsonObj = JSON.parse(evt.data);
-
- if (jsonObj.event === 'sendToPropertyInspector') {
- var payload = jsonObj.payload;
-
- var paramType = document.getElementById('paramType');
- paramType.value = payload['paramType'];
-
- var strip = document.getElementById('strip');
- strip.value = payload['strip'];
-
- var stripNum = document.getElementById('stripNum');
- stripNum.value = payload['stripNum'];
-
- var setValue = document.getElementById('setValue');
- setValue.value = payload['setValue'];
-
- var longPressValue = document.getElementById('longPressValue');
- longPressValue.value = payload['longPressValue'];
-
- var titleType = document.getElementById('titleType');
- titleType.value = payload['titleType'];
-
-
- }
- };
-}
-
-function updateSettings() {
- var paramType = document.getElementById('paramType');
- var strip = document.getElementById('strip');
- var stripNum = document.getElementById('stripNum');
- var setValue = document.getElementById('setValue');
- var longPressValue = document.getElementById('longPressValue');
- var titleType = document.getElementById('titleType');
-
-
- var payload = {};
-
- payload.property_inspector = 'updateSettings';
- payload.paramType = paramType.value;
- payload.strip = strip.value;
- payload.stripNum = stripNum.value;
- payload.setValue = setValue.value;
- payload.longPressValue = longPressValue.value;
- payload.titleType = titleType.value;
-
- sendPayloadToPlugin(payload);
-}
-
-function sendPayloadToPlugin(payload) {
- if (websocket && (websocket.readyState === 1)) {
- const json = {
- 'action': actionInfo['action'],
- 'event': 'sendToPlugin',
- 'context': uuid,
- 'payload': payload
- };
- websocket.send(JSON.stringify(json));
- }
-}
-
-// our method to pass values to the plugin
-function sendValueToPlugin(value, param) {
- if (websocket && (websocket.readyState === 1)) {
- const json = {
- 'action': actionInfo['action'],
- 'event': 'sendToPlugin',
- 'context': uuid,
- 'payload': {
- [param]: value
- }
- };
- websocket.send(JSON.stringify(json));
- }
-}
-
-function openWebsite() {
- if (websocket && (websocket.readyState === 1)) {
- const json = {
- 'event': 'openUrl',
- 'payload': {
- 'url': 'https://BarRaider.github.io'
- }
- };
- websocket.send(JSON.stringify(json));
- }
-}
-
-if (!isQT) {
- document.addEventListener('DOMContentLoaded', function () {
- initPropertyInspector();
- });
-}
-
-window.addEventListener('beforeunload', function (e) {
- e.preventDefault();
-
- // Notify the plugin we are about to leave
- sendValueToPlugin('propertyInspectorWillDisappear', 'property_inspector');
-
- // Don't set a returnValue to the event, otherwise Chromium with throw an error.
-});
-
-function initPropertyInspector() {
- // Place to add functions
-}
-
-
-function addDynamicStyles(clrs) {
- const node = document.getElementById('#sdpi-dynamic-styles') || document.createElement('style');
- if (!clrs.mouseDownColor) clrs.mouseDownColor = fadeColor(clrs.highlightColor, -100);
- const clr = clrs.highlightColor.slice(0, 7);
- const clr1 = fadeColor(clr, 100);
- const clr2 = fadeColor(clr, 60);
- const metersActiveColor = fadeColor(clr, -60);
-
- node.setAttribute('id', 'sdpi-dynamic-styles');
- node.innerHTML = `
-
- input[type="radio"]:checked + label span,
- input[type="checkbox"]:checked + label span {
- background-color: ${clrs.highlightColor};
- }
-
- input[type="radio"]:active:checked + label span,
- input[type="radio"]:active + label span,
- input[type="checkbox"]:active:checked + label span,
- input[type="checkbox"]:active + label span {
- background-color: ${clrs.mouseDownColor};
- }
-
- input[type="radio"]:active + label span,
- input[type="checkbox"]:active + label span {
- background-color: ${clrs.buttonPressedBorderColor};
- }
-
- td.selected,
- td.selected:hover,
- li.selected:hover,
- li.selected {
- color: white;
- background-color: ${clrs.highlightColor};
- }
-
- .sdpi-file-label > label:active,
- .sdpi-file-label.file:active,
- label.sdpi-file-label:active,
- label.sdpi-file-info:active,
- input[type="file"]::-webkit-file-upload-button:active,
- button:active {
- background-color: ${clrs.buttonPressedBackgroundColor};
- color: ${clrs.buttonPressedTextColor};
- border-color: ${clrs.buttonPressedBorderColor};
- }
-
- ::-webkit-progress-value,
- meter::-webkit-meter-optimum-value {
- background: linear-gradient(${clr2}, ${clr1} 20%, ${clr} 45%, ${clr} 55%, ${clr2})
- }
-
- ::-webkit-progress-value:active,
- meter::-webkit-meter-optimum-value:active {
- background: linear-gradient(${clr}, ${clr2} 20%, ${metersActiveColor} 45%, ${metersActiveColor} 55%, ${clr})
- }
- `;
- document.body.appendChild(node);
-};
-
-/** UTILITIES */
-
-/*
- Quick utility to lighten or darken a color (doesn't take color-drifting, etc. into account)
- Usage:
- fadeColor('#061261', 100); // will lighten the color
- fadeColor('#200867'), -100); // will darken the color
-*/
-function fadeColor(col, amt) {
- const min = Math.min, max = Math.max;
- const num = parseInt(col.replace(/#/g, ''), 16);
- const r = min(255, max((num >> 16) + amt, 0));
- const g = min(255, max((num & 0x0000FF) + amt, 0));
- const b = min(255, max(((num >> 8) & 0x00FF) + amt, 0));
- return '#' + (g | (b << 8) | (r << 16)).toString(16).padStart(6, 0);
-}
diff --git a/VoiceMeeter/PropertyInspector/VoiceMeeter/Advanced.html b/VoiceMeeter/PropertyInspector/VoiceMeeter/Advanced.html
index fa3daa2..1ffd88b 100644
--- a/VoiceMeeter/PropertyInspector/VoiceMeeter/Advanced.html
+++ b/VoiceMeeter/PropertyInspector/VoiceMeeter/Advanced.html
@@ -5,7 +5,7 @@
- BarRaider's VM Modify Setting
+ BarRaider's VoiceMeeter Plugin
@@ -16,29 +16,34 @@
Example: "Strip[0].mono=1;Bus[2].Gain=-20;"
- For more information or feedback/suggestions contact me at https://BarRaider.github.io
+ For feedback/suggestions contact me at https://BarRaider.github.io
+