Skip to content

Commit

Permalink
Fixed issue with change from index to string (in sd and forgot wpf).
Browse files Browse the repository at this point in the history
  • Loading branch information
oddbear committed Feb 9, 2022
1 parent 57fa519 commit 0f01e94
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions Revelator.io24.Wpf/Models/MicrophoneMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,9 @@ public MicrophoneMapper(Microphones microphones)
}

private string GetPreset(MicrophoneChannel channel)
{
var presetIndex = _microphones.GetPreset(channel);
var presets = _microphones.GetPresets(channel);
if (presets is null)
return null;

return presets[presetIndex];
}
=>_microphones.GetPreset(channel);

private void SetPreset(MicrophoneChannel channel, string presetName)
{
var presets = _microphones.GetPresets(channel);
for (int i = 0; i < presets.Length; i++)
{
if (presets[i] == presetName)
{
_microphones.SetPreset(channel, i);
return;
}
}
}
=> _microphones.SetPreset(channel, presetName);
}
}

0 comments on commit 0f01e94

Please sign in to comment.