notificationsEnabled_ = enable;
}
-void MuteControl::RestoreVolume()
+void MuteControl::RestoreVolume(bool withDelay)
{
WMLog& log = WMLog::GetInstance();
if (!restoreVolume_) {
ShowNotification(
_T("Volume restored"),
_T("All endpoints have been restored to their previous configuration"));
+ if (withDelay) {
+ Sleep(2000);
+ }
winAudio_->RestoreMuteStatus();
}
}
return muteConfig_[MuteTypeShutdown].shouldMute;
}
-void MuteControl::NotifyRestoreCondition(int type, bool active)
+void MuteControl::NotifyRestoreCondition(int type, bool active, bool withDelay)
{
if (active) {
SaveMuteStatus();
if (muteConfig_[type].active) {
muteConfig_[type].active = false;
if (muteConfig_[type].shouldMute) {
- RestoreVolume();
+ RestoreVolume(withDelay);
}
}
}
const TrayIcon* trayIcon_;
- void NotifyRestoreCondition(int type, bool active);
+ void NotifyRestoreCondition(int type, bool active, bool withDelay);
void SaveMuteStatus();
- void RestoreVolume();
+ void RestoreVolume(bool withDelay = false);
void ShowNotification(const tstring& title, const tstring& text);
};