Skip to content

Commit

Permalink
Updated to latest patched SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
oddbear committed Aug 7, 2022
1 parent 5efe652 commit a7f873e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
9 changes: 4 additions & 5 deletions WaveLinkPlugin/Adjustments/InputMonitorMixAdjustment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,23 @@ public InputMonitorMixAdjustment()
protected override bool OnLoad()
{
_plugin = (WaveLinkPlugin)base.Plugin;
_plugin.AllChannelInfoFetched += PluginOnAllChannelInfoFetched;

_client = _plugin.Client;
_client.InputMixerChanged += InputMixerChanged;
_client.ChannelsChanged += ChannelsChanged;

return true;
}

protected override bool OnUnload()
{
_plugin.AllChannelInfoFetched -= PluginOnAllChannelInfoFetched;

_client.InputMixerChanged -= InputMixerChanged;
_client.ChannelsChanged -= ChannelsChanged;

return true;
}

private void PluginOnAllChannelInfoFetched(object sender, IEnumerable<ChannelInfo> channels)
private void ChannelsChanged(object sender, List<ChannelInfo> channels)
{
if (channels is null)
return;
Expand Down
9 changes: 4 additions & 5 deletions WaveLinkPlugin/Adjustments/InputStreamMixAdjustment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,23 @@ public InputStreamMixAdjustment()
protected override bool OnLoad()
{
_plugin = (WaveLinkPlugin)base.Plugin;
_plugin.AllChannelInfoFetched += PluginOnAllChannelInfoFetched;

_client = _plugin.Client;
_client.InputMixerChanged += InputMixerChanged;
_client.ChannelsChanged += ChannelsChanged;

return true;
}

protected override bool OnUnload()
{
_plugin.AllChannelInfoFetched -= PluginOnAllChannelInfoFetched;

_client.InputMixerChanged -= InputMixerChanged;
_client.ChannelsChanged -= ChannelsChanged;

return true;
}

private void PluginOnAllChannelInfoFetched(object sender, IEnumerable<ChannelInfo> channels)
private void ChannelsChanged(object sender, List<ChannelInfo> channels)
{
if (channels is null)
return;
Expand Down Expand Up @@ -67,7 +66,7 @@ private void PluginOnAllChannelInfoFetched(object sender, IEnumerable<ChannelInf
base.AddParameter(channelInfo.MixId, channelInfo.MixerName, "Input Volume (Stream)");
}
}

private void InputMixerChanged(object sender, ChannelInfo channelInfo)
{
if (channelInfo?.MixId is null)
Expand Down
5 changes: 2 additions & 3 deletions WaveLinkPlugin/WaveLinkPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class WaveLinkPlugin : Plugin
private CancellationTokenSource _cancellationTokenSource;

public event EventHandler<IEnumerable<MonitorMixList>> LocalMonitorOutputFetched;
public event EventHandler<IEnumerable<ChannelInfo>> AllChannelInfoFetched;

public WaveLinkPlugin()
{
Expand Down Expand Up @@ -98,8 +97,8 @@ private async Task UpdateStatesAsync()
LocalMonitorOutputFetched?.Invoke(this, mixOutputList?.MonitorMixList);
Client.LocalMonitorOutputChanged?.Invoke(this, mixOutputList?.MonitorMix);

var inputMixes = await Client.GetAllChannelInfo();
AllChannelInfoFetched?.Invoke(this, inputMixes);
var channels = await Client.GetAllChannelInfo();
Client.ChannelsChanged?.Invoke(this, channels);
}
}
}

0 comments on commit a7f873e

Please sign in to comment.