Skip to content

Commit

Permalink
v1.9 - MacroButton support + Hotkey sending in Mute/Unmute action
Browse files Browse the repository at this point in the history
- 🆕 **MacroButton support!** Toggle VoiceMeeter Macro Buttons from the Stream Deck
    - Supports both "Toggle" mode and "PTT" mode.
- `Mute/Unmute` action now supports sending hotkeys
- Core improvements and bug fixes
  • Loading branch information
BarRaider committed Nov 29, 2020
1 parent de5c3b3 commit 465fa12
Show file tree
Hide file tree
Showing 26 changed files with 647 additions and 1,869 deletions.
60 changes: 47 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@ VoiceMeeter integration and live feedback for the Elgato Stream Deck device.

**Author's website and contact information:** [https://barraider.com](https://barraider.com)

## What's new in v1.8
- `AND/OR` support on the Mode1 Check in the `Advanced Toggle`! You can now do things like `Strip[0].Mute AND Strip[1].B2` or `Strip[0].Solo OR Strip[0].B2 OR Strip[1].B1`
- Customizable `Long Press` length on the Press/Long-Press action
- **Hotkey Support** :star_struck: - All advanced actions now support sending hotkeys to integrate with the :voicemeeter: Macros
- **Midi Support** :star_struck: :star_struck: - All advanced actions now support the :voicemeeter: `SendMidi` commands
- Support for `\n` (new line) in the Enabled/Disabled Texts

## What's new in 1.7
- VM Advanced actions now support renaming values that show 1 / 0 to a user-defined text (On/Off or Enabled/Disabled, etc.)
- Bugfix in which the second image was not stored correctly in the VM Advanced Toggle action
- Moved actions to a "VoiceMeeter" category in the Stream Deck app
## New in v1.9
- :new: **MacroButton support!** Toggle VoiceMeeter Macro Buttons from the Stream Deck
- Supports both "Toggle" mode and "PTT" mode.
- `Mute/Unmute` action now supports sending hotkeys
- Core improvements and bug fixes

### Download:
https://github.com/BarRaider/streamdeck-voicemeeter/releases/

## Current functionality
### 5 Plugins built into one:
### 6 Plugins built into one:
#### VoiceMeeter Mute/Unmute
- Allows you to easily connect to one of VoiceMeeter's Strips or Buses
- 3 different modes: Toggle/Push-To-Talk/Single Setting (on/off)
Expand Down Expand Up @@ -62,6 +56,9 @@ https://github.com/BarRaider/streamdeck-voicemeeter/releases/
#### VoiceMeeter Advanced PTT
The `Advanced PTT` action allows you to set a bunch of settings until you release the key.

#### MacroButton Toggle
Allows running VoiceMeeter macros from the Stream Deck. Supports both Toggle and Push modes. The `Logical ID` number is shown at the top-center of every VoiceMeeter macro.

### 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.
Expand All @@ -73,6 +70,24 @@ The `Advanced PTT` action allows you to set a bunch of settings until you releas
- 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.


### Midi Usage
You can trigger Midi functions using the SendMidi command from the Advanced Actions.
Syntax: `SendMidi(DEVICE_NAME, COMMAND, CHANNEL, KEY_ID, VALUE);`

**DEVICE_NAME:** Name of your device. Start of the name is good too (i.e. nano instead of nanoKORG).
Name can be found in VoiceMeeter Macro under `MIDI OUT1 device:
<IMG>

**COMMAND:** One of 3 options:
- note-on
- note-of
- ctrl-change

**CHANNEL:** Integer value between 1 to 16

**KEY_ID:** The id of the Midi key to turn on/off. This can be found using the LEARN feature inside VoiceMeeter Macro:
<IMG>

### FAQ
Q: Can I use this plugin to Restart VoiceMeeter?
A: Yes! Choose one of the "VoiceMeeter Advanced" plugins and use the following command: `Command.Restart = 1;`
Expand All @@ -86,6 +101,11 @@ A: Valid values can be found starting on page 9 of VoiceMeeter API PDF: https://
Q: Can I make the title multi-line?
A: Yes, write `\n` in the `Title Prefix` parameter to add lines

Q: Is there AND/OR support for Mode1 Check?
A: Yes, there is now `AND/OR` support on the Mode1 Check in the `Advanced Toggle`! You can now do things like `Strip[0].Mute AND Strip[1].B2` or `Strip[0].Solo OR Strip[0].B2 OR Strip[1].B1`

Q: Where can I find the Macro `Logical ID`?
A: The `Logical ID` number is shown at the top-center of every VoiceMeeter macro.
### Download

* [Download plugin](https://github.com/BarRaider/streamdeck-voicemeeter/releases/)
Expand All @@ -98,4 +118,18 @@ Please contact the developer. Contact information is available at https://barrai

## Dependencies
* Uses StreamDeck-Tools by BarRaider: [![NuGet](https://img.shields.io/nuget/v/streamdeck-tools.svg?style=flat)](https://www.nuget.org/packages/streamdeck-tools)
* Uses [Easy-PI](https://github.com/BarRaider/streamdeck-easypi) by BarRaider - Provides seamless integration with the Stream Deck PI (Property Inspector)
* Uses [Easy-PI](https://github.com/BarRaider/streamdeck-easypi) by BarRaider - Provides seamless integration with the Stream Deck PI (Property Inspector)

## Change Log

## What's new in v1.8
- `AND/OR` support on the Mode1 Check in the `Advanced Toggle`! You can now do things like `Strip[0].Mute AND Strip[1].B2` or `Strip[0].Solo OR Strip[0].B2 OR Strip[1].B1`
- Customizable `Long Press` length on the Press/Long-Press action
- **Hotkey Support** :new: - All advanced actions now support sending hotkeys to integrate with the :voicemeeter: Macros
- **Midi Support** :new: - All advanced actions now support the :voicemeeter: `SendMidi` commands
- Support for `\n` (new line) in the Enabled/Disabled Texts

## What's new in 1.7
- VM Advanced actions now support renaming values that show 1 / 0 to a user-defined text (On/Off or Enabled/Disabled, etc.)
- Bugfix in which the second image was not stored correctly in the VM Advanced Toggle action
- Moved actions to a "VoiceMeeter" category in the Stream Deck app
10 changes: 9 additions & 1 deletion VoiceMeeter/Actions/VMAdvancedPTTAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public static PluginSettings CreateDefaultSettings()
#region Private members

private readonly PluginSettings settings;
private bool didSetNotConnected = false;

#endregion

Expand All @@ -90,8 +91,10 @@ public VMAdvancedPTTAction(SDConnection connection, InitialPayload payload) : ba

public async override void KeyPressed(KeyPayload payload)
{
Logger.Instance.LogMessage(TracingLevel.INFO, $"{this.GetType()} KeyPressed");
if (!VMManager.Instance.IsConnected)
{
Logger.Instance.LogMessage(TracingLevel.ERROR, $"Key pressed but VM is not connected!");
await Connection.ShowAlert();
return;
}
Expand Down Expand Up @@ -126,9 +129,15 @@ public async override void OnTick()
{
if (!VMManager.Instance.IsConnected)
{
didSetNotConnected = true;
await Connection.SetImageAsync(Properties.Plugin.Default.VMNotRunning);
return;
}
else if (didSetNotConnected)
{
didSetNotConnected = false;
await Connection.SetImageAsync((String)null);
}

if (settings.TitleType == TitleTypeEnum.VMLive && !String.IsNullOrEmpty(settings.TitleParam))
{
Expand Down Expand Up @@ -156,7 +165,6 @@ public override void ReceivedSettings(ReceivedSettingsPayload payload)
{
Tools.AutoPopulateSettings(settings, payload.Settings);
InitializeSettings();
Logger.Instance.LogMessage(TracingLevel.INFO, $"Settings loaded: {payload.Settings}");
}

public override void ReceivedGlobalSettings(ReceivedGlobalSettingsPayload payload) { }
Expand Down
20 changes: 14 additions & 6 deletions VoiceMeeter/Actions/VMAdvancedPressAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@ public static PluginSettings CreateDefaultSettings()
private const int LONG_KEYPRESS_LENGTH_MS = 600;

private readonly PluginSettings settings;
private bool keyPressed = false;
private bool longKeyPressed = false;
private DateTime keyPressStart;
private int longKeypressTime = LONG_KEYPRESS_LENGTH_MS;
private readonly System.Timers.Timer tmrRunLongPress = new System.Timers.Timer();
private bool didSetNotConnected = false;

#endregion

Expand Down Expand Up @@ -113,6 +112,7 @@ private void TmrRunLongPress_Elapsed(object sender, System.Timers.ElapsedEventAr
public void LongKeyPressed()
{
longKeyPressed = true;
Logger.Instance.LogMessage(TracingLevel.INFO, $"Long keypress");
if (!String.IsNullOrEmpty(settings.LongPressValue))
{
VMManager.Instance.SetParameters(settings.LongPressValue);
Expand All @@ -133,18 +133,18 @@ public override void ReceivedSettings(ReceivedSettingsPayload payload)
{
Tools.AutoPopulateSettings(settings, payload.Settings);
InitializeSettings();
Logger.Instance.LogMessage(TracingLevel.INFO, $"Settings loaded: {payload.Settings}");
}

public async override void KeyPressed(KeyPayload payload)
{
Logger.Instance.LogMessage(TracingLevel.INFO, $"{this.GetType()} KeyPressed");

// Used for long press
keyPressed = true;
longKeyPressed = false;
keyPressStart = DateTime.Now;

if (!VMManager.Instance.IsConnected)
{
Logger.Instance.LogMessage(TracingLevel.ERROR, $"Key pressed but VM is not connected!");
await Connection.ShowAlert();
return;
}
Expand All @@ -155,11 +155,11 @@ public async override void KeyPressed(KeyPayload payload)

public override void KeyReleased(KeyPayload payload)
{
keyPressed = false;
tmrRunLongPress.Stop();

if (!longKeyPressed && !String.IsNullOrEmpty(settings.SetValue))
{
Logger.Instance.LogMessage(TracingLevel.INFO, $"Short keypress");
VMManager.Instance.SetParameters(settings.SetValue);
MidiCommandHandler.HandleMidiParameters(settings.KeypressMidi);
if (!String.IsNullOrEmpty(settings.KeypressHotkey))
Expand All @@ -173,9 +173,15 @@ public async override void OnTick()
{
if (!VMManager.Instance.IsConnected)
{
didSetNotConnected = true;
await Connection.SetImageAsync(Properties.Plugin.Default.VMNotRunning);
return;
}
else if (didSetNotConnected)
{
didSetNotConnected = false;
await Connection.SetImageAsync((String)null);
}

if (settings.TitleType == TitleTypeEnum.VMLive && !String.IsNullOrEmpty(settings.TitleParam))
{
Expand All @@ -202,6 +208,8 @@ public async override void OnTick()
public override void Dispose()
{
Logger.Instance.LogMessage(TracingLevel.INFO, "Destructor called");
tmrRunLongPress.Stop();
tmrRunLongPress.Elapsed -= TmrRunLongPress_Elapsed;
}

public override void ReceivedGlobalSettings(ReceivedGlobalSettingsPayload payload) { }
Expand Down
11 changes: 9 additions & 2 deletions VoiceMeeter/Actions/VMAdvancedToggle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public static PluginSettings CreateDefaultSettings()
private const string LOGICAL_OR = " OR ";

private readonly PluginSettings settings;
private bool didSetNotConnected = false;

#endregion

Expand All @@ -127,8 +128,10 @@ public VMAdvancedToggleAction(SDConnection connection, InitialPayload payload) :

public async override void KeyPressed(KeyPayload payload)
{
Logger.Instance.LogMessage(TracingLevel.INFO, $"{this.GetType()} KeyPressed");
if (!VMManager.Instance.IsConnected)
{
Logger.Instance.LogMessage(TracingLevel.ERROR, $"Key pressed but VM is not connected!");
await Connection.ShowAlert();
return;
}
Expand Down Expand Up @@ -168,9 +171,15 @@ public async override void OnTick()
{
if (!VMManager.Instance.IsConnected)
{
didSetNotConnected = true;
await Connection.SetImageAsync(Properties.Plugin.Default.VMNotRunning);
return;
}
else if (didSetNotConnected)
{
didSetNotConnected = false;
await Connection.SetImageAsync((String)null);
}

// Set the image
if (!String.IsNullOrEmpty(settings.UserImage1) && IsMode1(false))
Expand Down Expand Up @@ -213,8 +222,6 @@ public override void Dispose()
public async override void ReceivedSettings(ReceivedSettingsPayload payload)
{
Tools.AutoPopulateSettings(settings, payload.Settings);
Logger.Instance.LogMessage(TracingLevel.INFO, $"Settings loaded: {payload.Settings}");

InitializeSettings();
// Used to return the correct filename back to the Property Inspector
await SaveSettings();
Expand Down
Loading

0 comments on commit 465fa12

Please sign in to comment.