Skip to content

Commit

Permalink
Heavier handed solution to the discord problem
Browse files Browse the repository at this point in the history
Just reload the whole config every time a new session happens. It might be very briefly wrong, but should be fine.
  • Loading branch information
ho0ber committed Jan 18, 2019
1 parent b120404 commit 7d36132
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion NK2Tray/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public SysTrayApp()

private void OnSessionCreated(object sender, IAudioSessionControl newSession)
{
LoadAssignments();
/*
Console.WriteLine("OnSessionCreated");
AudioSessionControl newAudioSession = new AudioSessionControl(newSession);
var matchingAssignments = new List<Assignment>();
Expand All @@ -82,7 +84,7 @@ private void OnSessionCreated(object sender, IAudioSessionControl newSession)
//NAudioEventCallbacks callbacks = new NAudioEventCallbacks();
//AudioSessionEventsCallback notifications = new AudioSessionEventsCallback(callbacks);
//audioSession.RegisterEventClient(callbacks);

*/
}

public void SaveAssignments()
Expand Down Expand Up @@ -126,6 +128,7 @@ public void LoadAssignments()
Console.WriteLine(String.Format("Fader {0} is {1} (master)", i, ident));
assignments[i] = new Assignment("Master Volume", "", -1, AssignmentType.Master, "", "", null);
NanoKontrol2.Respond(ref midiOut, new ControlSurfaceDisplay(ControlSurfaceDisplayType.AssignedState, i, true));
NanoKontrol2.Respond(ref midiOut, new ControlSurfaceDisplay(ControlSurfaceDisplayType.ErrorState, i, false));
Console.WriteLine("Assigned!");
}
else if (ident.Length > 0)
Expand All @@ -136,6 +139,7 @@ public void LoadAssignments()
{
assignments[i] = new Assignment(matchingSession, i);
NanoKontrol2.Respond(ref midiOut, new ControlSurfaceDisplay(ControlSurfaceDisplayType.AssignedState, i, true));
NanoKontrol2.Respond(ref midiOut, new ControlSurfaceDisplay(ControlSurfaceDisplayType.ErrorState, i, false));
Console.WriteLine("Assigned!");
}
else
Expand Down

0 comments on commit 7d36132

Please sign in to comment.