Skip to content

Commit

Permalink
Added new icons, command, and adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
oddbear committed Aug 4, 2022
1 parent 2068bda commit c18689c
Show file tree
Hide file tree
Showing 15 changed files with 355 additions and 279 deletions.
206 changes: 0 additions & 206 deletions .editorconfig

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,7 @@ testem.log
*.xcactivitylog

*.DotSettings

#Raw image resources
*.afphoto
*.afdesign
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Loupedeck.WaveLink.Plugin
Elgato Wave Link Plugin (unofficial) for the Loupedeck interface.

Right now higly experimental. Only Input Volume indicator working for the XLR Port on the Wave XLR device.
Right now Output switching, volume and mute works.

## Acknowledge

Build using the [ElgatoWaveLinkSDK](https://github.com/Professor-Melvin/ElgatoWaveLinkSDK), minimal changes (compatibility for .Net 4.7.2)
Build using the [ElgatoWaveLinkSDK](https://github.com/Professor-Melvin/ElgatoWaveLinkSDK), [minimal changes](https://github.com/oddbear/ElgatoWaveLinkSDK).
92 changes: 92 additions & 0 deletions WaveLinkPlugin/Adjustments/OutputMonitorMixAdjustment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
using ElgatoWaveSDK;
using ElgatoWaveSDK.Models;

namespace Loupedeck.WaveLinkPlugin.Adjustments
{
class OutputMonitorMixAdjustment : PluginDynamicAdjustment
{
private WaveLinkPlugin _plugin;
private ElgatoWaveClient _client;

private MonitoringState _state;

public OutputMonitorMixAdjustment()
: base("Monitor Mix Volume", "Adjustment for Monitor Mix Output Volume and Mute", "Outputs", true, DeviceType.All)
{
//
}

protected override bool OnLoad()
{
_plugin = (WaveLinkPlugin)base.Plugin;
_client = _plugin.Client;

_client.OutputMixerChanged += OutputMixerChanged;

return true;
}

protected override bool OnUnload()
{
_client.OutputMixerChanged -= OutputMixerChanged;

return true;
}

private void OutputMixerChanged(object sender, MonitoringState state)
{
_state = state;

base.AdjustmentValueChanged();
}

protected override void RunCommand(string actionParameter)
{
if (_state is null)
return;

_state.IsLocalOutMuted = !_state.IsLocalOutMuted;
_state.IsLocalOutMuted = _client.SetOutputMixer(_state)
.GetAwaiter().GetResult()
.IsLocalOutMuted;

base.ActionImageChanged(actionParameter);
}

protected override void ApplyAdjustment(string actionParameter, int diff)
{
if (_state is null)
return;

var volume = _state.LocalVolumeOut;

volume += diff;

if (volume < 0)
volume = 0;

if (volume > 100)
volume = 100;

_state.LocalVolumeOut = volume;
_state.LocalVolumeOut = _client.SetOutputMixer(_state)
.GetAwaiter().GetResult()
.LocalVolumeOut;

base.AdjustmentValueChanged(actionParameter);
}

protected override string GetAdjustmentValue(string actionParameter)
{
if (_state is null)
return "-";

if (_state.IsLocalOutMuted is true)
return "muted";

var volume = _state.LocalVolumeOut;

return $"{volume:0}";
}
}
}
Loading

0 comments on commit c18689c

Please sign in to comment.