Skip to content

Commit

Permalink
Fix the session mess - also number starting with 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ho0ber committed Feb 4, 2019
1 parent 13a3a41 commit c7bbe40
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
14 changes: 10 additions & 4 deletions NK2Tray/AudioDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,8 @@ public List<MixerSession> GetMixerSessions()
var process = FindLivingProcess(identSessions);
string label = (process != null) ? process.ProcessName : ident;

if (identSessions.First().IsSystemSoundsSession && WindowTools.ProcessExists(identSessions.First().GetProcessID))
{
if (HasSystemSoundsSession(identSessions))
label = "System Sounds";
sessionType = SessionType.SystemSounds;
}

var mixerSession = new MixerSession(this, label, ident, identSessions, sessionType);
mixerSessions.Add(mixerSession);
Expand All @@ -123,6 +120,15 @@ public Process FindLivingProcess(List<AudioSessionControl> sessions)
return process;
}

public bool HasSystemSoundsSession(List<AudioSessionControl> sessions)
{
foreach (var session in sessions)
if (session.IsSystemSoundsSession)
return true;

return false;
}

public MixerSession FindMixerSessions(string sessionIdentifier)
{
var mixerSessions = GetMixerSessions();
Expand Down
2 changes: 1 addition & 1 deletion NK2Tray/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void OnPopup(object sender, EventArgs e)

foreach (var fader in midiDevice.faders)
{
MenuItem faderMenu = new MenuItem($@"Fader {fader.faderNumber} - {(fader.assigned ? fader.assignment.label : "")}");
MenuItem faderMenu = new MenuItem($@"Fader {fader.faderNumber + 1} - {(fader.assigned ? fader.assignment.label : "")}");
trayMenu.MenuItems.Add(faderMenu);

// Add master mixerSession to menu
Expand Down
4 changes: 2 additions & 2 deletions NK2Tray/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.14.0")]
[assembly: AssemblyFileVersion("0.0.14.0")]
[assembly: AssemblyVersion("0.0.15.0")]
[assembly: AssemblyFileVersion("0.0.15.0")]

0 comments on commit c7bbe40

Please sign in to comment.