mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
Skip audio change if same audio device
Only perform an audio device change if the audio device is a different one.
This commit is contained in:
parent
a7aa06f3e0
commit
41fc905e8c
@ -447,8 +447,12 @@ namespace DisplayMagician
|
|||||||
}
|
}
|
||||||
|
|
||||||
// record the old audio device
|
// record the old audio device
|
||||||
|
bool needToChangeAudio = false;
|
||||||
CoreAudioDevice rollbackAudioDevice = _audioController.DefaultPlaybackDevice;
|
CoreAudioDevice rollbackAudioDevice = _audioController.DefaultPlaybackDevice;
|
||||||
double rollbackAudioVolume = _audioController.DefaultPlaybackDevice.Volume;
|
double rollbackAudioVolume = _audioController.DefaultPlaybackDevice.Volume;
|
||||||
|
if (!rollbackAudioDevice.FullName.Equals(shortcutToUse.AudioDevice))
|
||||||
|
needToChangeAudio = true;
|
||||||
|
|
||||||
|
|
||||||
// Change Audio Device (if one specified)
|
// Change Audio Device (if one specified)
|
||||||
if (shortcutToUse.ChangeAudioDevice)
|
if (shortcutToUse.ChangeAudioDevice)
|
||||||
@ -835,7 +839,7 @@ namespace DisplayMagician
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Change Audio Device back (if one specified)
|
// Change Audio Device back (if one specified)
|
||||||
if (shortcutToUse.ChangeAudioDevice)
|
if (needToChangeAudio)
|
||||||
{
|
{
|
||||||
// use the Audio Device
|
// use the Audio Device
|
||||||
rollbackAudioDevice.SetAsDefault();
|
rollbackAudioDevice.SetAsDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user