]> repos.lx-s.de Git - winmute.git/commitdiff
New settings tab.
authorAlexander Steinhöfer <kontakt@lx-s.de>
Tue, 12 Apr 2022 09:36:20 +0000 (11:36 +0200)
committerAlexander Steinhöfer <kontakt@lx-s.de>
Tue, 12 Apr 2022 09:36:20 +0000 (11:36 +0200)
14 files changed:
WinMute/MuteControl.cpp
WinMute/SettingsDlg.cpp
WinMute/Settings_GeneralDlg.cpp
WinMute/Settings_MuteDlg.cpp [new file with mode: 0644]
WinMute/Settings_QuietHoursDlg.cpp
WinMute/Utility.cpp
WinMute/WMSettings.cpp
WinMute/WMSettings.h
WinMute/WinMute.cpp
WinMute/WinMute.h
WinMute/WinMute.rc
WinMute/WinMute.vcxproj
WinMute/WinMute.vcxproj.filters
WinMute/resource.h

index 3bc0bd8ac28b8f718558e9be14085109bdf254b4..489a69458d9427383d24d8f43819abcff435196c 100644 (file)
@@ -47,8 +47,11 @@ enum MuteType {
    MuteTypeCount // Meta
 };
 
-MuteControl::MuteControl()
-   : trayIcon_(nullptr), notificationsEnabled_(false), displayWasOffOnce_(false)
+MuteControl::MuteControl() :
+   restoreVolume_(false),
+   notificationsEnabled_(false),
+   displayWasOffOnce_(false),
+   trayIcon_(nullptr)
 {
    MuteConfig initMuteConf;
    initMuteConf.active = false;
index 6ccd061ec048c02ee5cc2ba21234515109f8a544..0d13d19cdb3ed0942b2183b0c63a875598e7d4f4 100644 (file)
@@ -35,6 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 enum SettingsTabsIDs {
    SETTINGS_TAB_GENERAL = 0,
+   SETTINGS_TAB_MUTE,
    SETTINGS_TAB_QUIETHOURS,
    SETTINGS_TAB_COUNT
 };
@@ -55,6 +56,7 @@ struct SettingsDlgData {
 
 extern INT_PTR CALLBACK Settings_QuietHoursDlgProc(HWND, UINT, WPARAM, LPARAM);
 extern INT_PTR CALLBACK Settings_GeneralDlgProc(HWND, UINT, WPARAM, LPARAM);
+extern INT_PTR CALLBACK Settings_MuteDlgProc(HWND, UINT, WPARAM, LPARAM);
 
 static void InsertTabItem(HWND hTabCtrl, UINT id, const TCHAR* itemName)
 {
@@ -101,6 +103,7 @@ INT_PTR CALLBACK SettingsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar
       dlgData->hTabCtrl = GetDlgItem(hDlg, IDC_SETTINGS_TAB);
 
       InsertTabItem(dlgData->hTabCtrl, SETTINGS_TAB_GENERAL, _T("General"));
+      InsertTabItem(dlgData->hTabCtrl, SETTINGS_TAB_MUTE, _T("Mute"));
       InsertTabItem(dlgData->hTabCtrl, SETTINGS_TAB_QUIETHOURS, _T("Quiet Hours"));
 
       dlgData->hTabs[SETTINGS_TAB_GENERAL] = CreateDialogParam(
@@ -109,6 +112,12 @@ INT_PTR CALLBACK SettingsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar
          dlgData->hTabCtrl,
          Settings_GeneralDlgProc,
          reinterpret_cast<LPARAM>(settings));
+      dlgData->hTabs[SETTINGS_TAB_MUTE] = CreateDialogParam(
+         nullptr,
+         MAKEINTRESOURCE(IDD_SETTINGS_MUTE),
+         dlgData->hTabCtrl,
+         Settings_MuteDlgProc,
+         reinterpret_cast<LPARAM>(settings));
       dlgData->hTabs[SETTINGS_TAB_QUIETHOURS] = CreateDialogParam(
          nullptr,
          MAKEINTRESOURCE(IDD_SETTINGS_QUIETHOURS),
@@ -135,10 +144,14 @@ INT_PTR CALLBACK SettingsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar
       if (LOWORD(wParam) == IDOK) {
          for (int i = 0; i < SETTINGS_TAB_COUNT; ++i) {
             SendMessage(dlgData->hTabs[i], WM_SAVESETTINGS, 0, 0);
+            EndDialog(dlgData->hTabs[i], 0);
          }
          EndDialog(hDlg, 0); 
       } else if (LOWORD(wParam) == IDCANCEL) {
-         EndDialog(hDlg, 0);
+         for (int i = 0; i < SETTINGS_TAB_COUNT; ++i) {
+            EndDialog(dlgData->hTabs[i], 0);
+         }
+         EndDialog(hDlg, 1);
       }
       return 0;
    case WM_NOTIFY: {
@@ -153,7 +166,7 @@ INT_PTR CALLBACK SettingsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar
       return 0;
    }
    case WM_CLOSE:
-      EndDialog(hDlg, 0);
+      EndDialog(hDlg, 1);
       return TRUE;
    case WM_DESTROY:
       delete dlgData;
index 6822601d5823a59ff1d12a1de6c3d3a5dba7bc8c..84c73ecda2e84aec31767b26e49878a6926c445a 100644 (file)
@@ -53,10 +53,10 @@ INT_PTR CALLBACK Settings_GeneralDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
       DWORD enabled = settings->IsAutostartEnabled();
       Button_SetCheck(hAutostart, enabled ? BST_CHECKED : BST_UNCHECKED);
 
-      enabled = !!settings->QueryValue(SettingsKey::NOTIFICATIONS_ENABLED, FALSE);
+      enabled = !!settings->QueryValue(SettingsKey::NOTIFICATIONS_ENABLED);
       Button_SetCheck(hNotify, enabled ? BST_CHECKED : BST_UNCHECKED);
 
-      enabled = !!settings->QueryValue(SettingsKey::LOGGING_ENABLED, FALSE);
+      enabled = !!settings->QueryValue(SettingsKey::LOGGING_ENABLED);
       Button_SetCheck(hLogging, enabled ? BST_CHECKED : BST_UNCHECKED);
       Button_Enable(hOpenLog, enabled);
 
diff --git a/WinMute/Settings_MuteDlg.cpp b/WinMute/Settings_MuteDlg.cpp
new file mode 100644 (file)
index 0000000..6b3734b
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ WinMute
+           Copyright (c) 2022, Alexander Steinhoefer
+
+-----------------------------------------------------------------------------
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+
+    * Neither the name of the author nor the names of its contributors may
+      be used to endorse or promote products derived from this software
+      without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+-----------------------------------------------------------------------------
+*/
+
+#include "common.h"
+
+static void SetCheckButton(HWND hBtn, const WMSettings& settings, SettingsKey key)
+{
+   DWORD enabled = !!settings.QueryValue(key);
+   Button_SetCheck(hBtn, enabled ? BST_CHECKED : BST_UNCHECKED);
+}
+
+static void SetOption(HWND hBtn, WMSettings& settings, SettingsKey key)
+{
+   int enable = Button_GetCheck(hBtn) == BST_CHECKED;
+   settings.SetValue(key, enable);
+}
+
+INT_PTR CALLBACK Settings_MuteDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+   UNREFERENCED_PARAMETER(wParam);
+
+   switch (msg) {
+   case WM_INITDIALOG:
+   {
+      if (IsAppThemed()) {
+         EnableThemeDialogTexture(hDlg, ETDT_ENABLETAB);
+      }
+
+      HWND hMuteOnLock = GetDlgItem(hDlg, IDC_MUTE_WHEN_WS_LOCKED);
+      HWND hMuteOnScreensaver = GetDlgItem(hDlg, IDC_MUTE_WHEN_SCREENSAVER_STARTS);
+      HWND hMuteOnScreenOff = GetDlgItem(hDlg, IDC_MUTE_WHEN_SCREEN_OFF);
+      HWND hMuteOnRDP = GetDlgItem(hDlg, IDC_MUTE_WHEN_RDP_SESSION);
+      HWND hRestoreVolume = GetDlgItem(hDlg, IDC_RESTOREVOLUME);
+
+      HWND hMuteOnShutdown = GetDlgItem(hDlg, IDC_MUTE_WHEN_SHUTDOWN);
+      HWND hMuteOnSleep = GetDlgItem(hDlg, IDC_MUTE_WHEN_SLEEP);
+      HWND hMuteOnLogout = GetDlgItem(hDlg, IDC_MUTE_WHEN_LOGOUT);
+
+      WMSettings* settings = reinterpret_cast<WMSettings*>(lParam);
+      assert(settings != NULL);
+      SetWindowLongPtr(hDlg, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(settings));
+
+      // With restore
+      SetCheckButton(hMuteOnLock, *settings, SettingsKey::MUTE_ON_LOCK);
+      SetCheckButton(hMuteOnScreensaver, *settings, SettingsKey::MUTE_ON_SCREENSAVER);
+      SetCheckButton(hMuteOnScreenOff, *settings, SettingsKey::MUTE_ON_DISPLAYSTANDBY);
+      SetCheckButton(hMuteOnRDP, *settings, SettingsKey::MUTE_ON_RDP);
+      SetCheckButton(hRestoreVolume, *settings, SettingsKey::RESTORE_AUDIO);
+
+      // Without restore
+      SetCheckButton(hMuteOnShutdown, *settings, SettingsKey::MUTE_ON_SHUTDOWN);
+      SetCheckButton(hMuteOnSleep, *settings, SettingsKey::MUTE_ON_SUSPEND);
+      SetCheckButton(hMuteOnLogout, *settings, SettingsKey::MUTE_ON_LOGOUT);
+
+      return TRUE;
+   }
+   case WM_SAVESETTINGS:
+   {
+      WMSettings* settings = reinterpret_cast<WMSettings*>(GetWindowLongPtr(hDlg, GWLP_USERDATA));
+
+      HWND hMuteOnLock = GetDlgItem(hDlg, IDC_MUTE_WHEN_WS_LOCKED);
+      HWND hMuteOnScreensaver = GetDlgItem(hDlg, IDC_MUTE_WHEN_SCREENSAVER_STARTS);
+      HWND hMuteOnScreenOff = GetDlgItem(hDlg, IDC_MUTE_WHEN_SCREEN_OFF);
+      HWND hMuteOnRDP = GetDlgItem(hDlg, IDC_MUTE_WHEN_RDP_SESSION);
+      HWND hRestoreVolume = GetDlgItem(hDlg, IDC_RESTOREVOLUME);
+
+      HWND hMuteOnShutdown = GetDlgItem(hDlg, IDC_MUTE_WHEN_SHUTDOWN);
+      HWND hMuteOnSleep = GetDlgItem(hDlg, IDC_MUTE_WHEN_SLEEP);
+      HWND hMuteOnLogout = GetDlgItem(hDlg, IDC_MUTE_WHEN_LOGOUT);
+
+      // With restore
+      SetOption(hMuteOnLock, *settings, SettingsKey::MUTE_ON_LOCK);
+      SetOption(hMuteOnScreensaver, *settings, SettingsKey::MUTE_ON_SCREENSAVER);
+      SetOption(hMuteOnScreenOff, *settings, SettingsKey::MUTE_ON_DISPLAYSTANDBY);
+      SetOption(hMuteOnRDP, *settings, SettingsKey::MUTE_ON_RDP);
+      SetOption(hRestoreVolume, *settings, SettingsKey::RESTORE_AUDIO);
+
+      // Without restore
+      SetOption(hMuteOnShutdown, *settings, SettingsKey::MUTE_ON_SHUTDOWN);
+      SetOption(hMuteOnSleep, *settings, SettingsKey::MUTE_ON_SUSPEND);
+      SetOption(hMuteOnLogout, *settings, SettingsKey::MUTE_ON_LOGOUT);
+
+      return 0;
+   }
+   default:
+      break;
+   }
+   return FALSE;
+}
index 4e789e7899124e1a6a516a644b5d1c4b65b5f91d..c57cea8a4b5581a87085ef804de403593dd14275 100644 (file)
@@ -73,11 +73,11 @@ static bool SaveQuietHours(
    int setStart = start->wHour * 3600 + start->wMinute * 60 + start->wSecond;
    int setEnd = end->wHour * 3600 + end->wMinute * 60 + end->wSecond;
 
-   if (!settings->SetValue(SettingsKey::QUIETHOURS_ENABLE, enabled) ||
-      !settings->SetValue(SettingsKey::QUIETHOURS_FORCEUNMUTE, forceUnmute) ||
-      !settings->SetValue(SettingsKey::QUIETHOURS_NOTIFICATIONS, showNotifications) ||
-      !settings->SetValue(SettingsKey::QUIETHOURS_START, setStart) ||
-      !settings->SetValue(SettingsKey::QUIETHOURS_END, setEnd)) {
+   if (!settings->SetValue(SettingsKey::QUIETHOURS_ENABLE, enabled)
+       || !settings->SetValue(SettingsKey::QUIETHOURS_FORCEUNMUTE, forceUnmute)
+       || !settings->SetValue(SettingsKey::QUIETHOURS_NOTIFICATIONS, showNotifications)
+       || !settings->SetValue(SettingsKey::QUIETHOURS_START, setStart)
+       || !settings->SetValue(SettingsKey::QUIETHOURS_END, setEnd)) {
       TaskDialog(
          nullptr,
          nullptr,
@@ -113,13 +113,13 @@ INT_PTR CALLBACK Settings_QuietHoursDlgProc(HWND hDlg, UINT msg, WPARAM wParam,
          EnableThemeDialogTexture(hDlg, ETDT_ENABLETAB);
       }
 
-      DWORD qhEnabled = !!settings->QueryValue(SettingsKey::QUIETHOURS_ENABLE, FALSE);
+      DWORD qhEnabled = !!settings->QueryValue(SettingsKey::QUIETHOURS_ENABLE);
       Button_SetCheck(hEnable, qhEnabled ? BST_CHECKED : BST_UNCHECKED);
 
-      DWORD qhForceUnmute = !!settings->QueryValue(SettingsKey::QUIETHOURS_FORCEUNMUTE, FALSE);
+      DWORD qhForceUnmute = !!settings->QueryValue(SettingsKey::QUIETHOURS_FORCEUNMUTE);
       Button_SetCheck(hForce, qhForceUnmute ? BST_CHECKED : BST_UNCHECKED);
 
-      DWORD qhNotifications = !!settings->QueryValue(SettingsKey::QUIETHOURS_NOTIFICATIONS, FALSE);
+      DWORD qhNotifications = !!settings->QueryValue(SettingsKey::QUIETHOURS_NOTIFICATIONS);
       Button_SetCheck(hNotify, qhNotifications ? BST_CHECKED : BST_UNCHECKED);
 
       EnableWindow(hForce, qhEnabled);
@@ -127,8 +127,8 @@ INT_PTR CALLBACK Settings_QuietHoursDlgProc(HWND hDlg, UINT msg, WPARAM wParam,
       EnableWindow(hStart, qhEnabled);
       EnableWindow(hEnd, qhEnabled);
 
-      int setStart = settings->QueryValue(SettingsKey::QUIETHOURS_START, 0);
-      int setEnd = settings->QueryValue(SettingsKey::QUIETHOURS_END, 0);
+      int setStart = settings->QueryValue(SettingsKey::QUIETHOURS_START);
+      int setEnd = settings->QueryValue(SettingsKey::QUIETHOURS_END);
 
       SYSTEMTIME start;
       GetLocalTime(&start);
@@ -154,14 +154,14 @@ INT_PTR CALLBACK Settings_QuietHoursDlgProc(HWND hDlg, UINT msg, WPARAM wParam,
    {
       SYSTEMTIME start;
       SYSTEMTIME end;
-      HWND hEnable = GetDlgItem(hDlg, IDC_ENABLEQUIETHOURS);
-      HWND hForce = GetDlgItem(hDlg, IDC_FORCEUNMUTE);
+      HWND hEnable  = GetDlgItem(hDlg, IDC_ENABLEQUIETHOURS);
+      HWND hForce  = GetDlgItem(hDlg, IDC_FORCEUNMUTE);
       HWND hNotify = GetDlgItem(hDlg, IDC_SHOWNOTIFICATIONS);
-      HWND hStart = GetDlgItem(hDlg, IDC_QUIETHOURS_START);
-      HWND hEnd = GetDlgItem(hDlg, IDC_QUIETHOURS_END);
+      HWND hStart  = GetDlgItem(hDlg, IDC_QUIETHOURS_START);
+      HWND hEnd    = GetDlgItem(hDlg, IDC_QUIETHOURS_END);
       WMSettings* settings = reinterpret_cast<WMSettings*>(GetWindowLongPtr(hDlg, GWLP_USERDATA));
-      int qhEnabled = Button_GetCheck(hEnable) == BST_CHECKED;
-      int qhForceUnmute = Button_GetCheck(hForce) == BST_CHECKED;
+      int qhEnabled       = Button_GetCheck(hEnable) == BST_CHECKED;
+      int qhForceUnmute   = Button_GetCheck(hForce)  == BST_CHECKED;
       int qhNotifications = Button_GetCheck(hNotify) == BST_CHECKED;
       DateTime_GetSystemtime(hStart, &start);
       DateTime_GetSystemtime(hEnd, &end);
@@ -175,10 +175,10 @@ INT_PTR CALLBACK Settings_QuietHoursDlgProc(HWND hDlg, UINT msg, WPARAM wParam,
    case WM_COMMAND:
    {
       HWND hEnable = GetDlgItem(hDlg, IDC_ENABLEQUIETHOURS);
-      HWND hForce = GetDlgItem(hDlg, IDC_FORCEUNMUTE);
+      HWND hForce  = GetDlgItem(hDlg, IDC_FORCEUNMUTE);
       HWND hNotify = GetDlgItem(hDlg, IDC_SHOWNOTIFICATIONS);
-      HWND hStart = GetDlgItem(hDlg, IDC_QUIETHOURS_START);
-      HWND hEnd = GetDlgItem(hDlg, IDC_QUIETHOURS_END);
+      HWND hStart  = GetDlgItem(hDlg, IDC_QUIETHOURS_START);
+      HWND hEnd    = GetDlgItem(hDlg, IDC_QUIETHOURS_END);
       if (LOWORD(wParam) == IDC_ENABLEQUIETHOURS) {
          int qhEnabled = Button_GetCheck(hEnable) == BST_CHECKED;
          EnableWindow(hStart, qhEnabled);
index b8eeaa5a55b07fd18ec749d3d53d1adc49347b82..db61db2782c77aa58934c85547ff783bb3881bb7 100644 (file)
@@ -61,7 +61,8 @@ void PrintWindowsError(LPCWSTR lpszFunction, DWORD lastError)
             lpszFunction,
             lastError,
             reinterpret_cast<TCHAR*>(lpMsgBuf));
-         TaskDialog(nullptr,
+         TaskDialog(
+            nullptr,
             nullptr,
             PROGRAM_NAME,
             static_cast<LPCTSTR>(lpDisplayBuf),
index aa957223898bc727eabe6a9128d08782abf91943..742bca5f06330cb385e2196702f922610338c529 100644 (file)
@@ -49,6 +49,9 @@ static LPCWSTR KeyToStr(SettingsKey key)
    case SettingsKey::MUTE_ON_DISPLAYSTANDBY:
       keyStr = _T("MuteOnDisplayStandby");
       break;
+   case SettingsKey::MUTE_ON_RDP:
+      keyStr = _T("MuteOnRDP");
+      break;
    case SettingsKey::RESTORE_AUDIO:
       keyStr = _T("RestoreAudio");
       break;
@@ -86,6 +89,43 @@ static LPCWSTR KeyToStr(SettingsKey key)
    return keyStr;
 }
 
+static DWORD GetDefaultSetting(SettingsKey key)
+{
+   switch (key) {
+   case SettingsKey::MUTE_ON_LOCK:
+      return 1;
+   case SettingsKey::MUTE_ON_SCREENSAVER:
+      return 1;
+   case SettingsKey::MUTE_ON_DISPLAYSTANDBY:
+      return 1;
+   case SettingsKey::MUTE_ON_RDP:
+      return 0;
+   case SettingsKey::RESTORE_AUDIO:
+      return 1;
+   case SettingsKey::MUTE_ON_SUSPEND:
+      return 0;
+   case SettingsKey::MUTE_ON_SHUTDOWN:
+      return 0;
+   case SettingsKey::MUTE_ON_LOGOUT:
+      return 0;
+   case SettingsKey::QUIETHOURS_ENABLE:
+      return 0;
+   case SettingsKey::QUIETHOURS_FORCEUNMUTE:
+      return 0;
+   case SettingsKey::QUIETHOURS_NOTIFICATIONS:
+      return 0;
+   case SettingsKey::QUIETHOURS_START:
+      return 0;
+   case SettingsKey::QUIETHOURS_END:
+      return 0;
+   case SettingsKey::LOGGING_ENABLED:
+      return 0;
+   case SettingsKey::NOTIFICATIONS_ENABLED:
+      return 0;
+   }
+   return 0;
+}
+
 static bool ReadStringFromRegistry(HKEY hKey, const TCHAR* subKey, tstring& val)
 {
    bool success = false;
@@ -221,12 +261,12 @@ void WMSettings::EnableAutostart(bool enable)
    }
 }
 
-DWORD WMSettings::QueryValue(SettingsKey key, DWORD defValue)
+DWORD WMSettings::QueryValue(SettingsKey key) const
 {
    auto keyStr = KeyToStr(key);
    assert(keyStr != nullptr);
 
-   DWORD value;
+   DWORD value = 0;
    DWORD size = sizeof(DWORD);
    DWORD regError = RegQueryValueEx(
       hRegSettingsKey_,
@@ -235,11 +275,11 @@ DWORD WMSettings::QueryValue(SettingsKey key, DWORD defValue)
       nullptr,
       reinterpret_cast<LPBYTE>(&value),
       &size);
-   if (regError == ERROR_FILE_NOT_FOUND) {
-      return defValue;
-   } else if (regError != ERROR_SUCCESS) {
-      PrintWindowsError(_T("RegCreateKeyEx"), regError);
-      return defValue;
+   if (regError != ERROR_SUCCESS) {
+      if (regError != ERROR_FILE_NOT_FOUND) {
+         PrintWindowsError(_T("RegCreateKeyEx"), regError);
+      }
+      return GetDefaultSetting(key);
    }
 
    return value;
index dd590064b97dd51ab5583293d7d01158dbac0f7b..bd718ddb171769c5cc646e89faf1036cc22f3993 100644 (file)
@@ -39,6 +39,7 @@ enum class SettingsKey {
      MUTE_ON_LOCK
    , MUTE_ON_SCREENSAVER
    , MUTE_ON_DISPLAYSTANDBY
+   , MUTE_ON_RDP
    , RESTORE_AUDIO
    , MUTE_ON_SUSPEND
    , MUTE_ON_SHUTDOWN
@@ -66,8 +67,8 @@ public:
    bool IsAutostartEnabled();
    void EnableAutostart(bool enable);
 
-   DWORD QueryValue(SettingsKey key, DWORD defValue);
-   bool SetValue(SettingsKey key, DWORD value);
+   DWORD QueryValue(SettingsKey key) const;
+   bool  SetValue(SettingsKey key, DWORD value);
 
 private:
    HKEY hRegSettingsKey_;
index d5371e71c004be13e0218676a71aac0fff0a550a..fb294fb259a8d51bc525dab72f61d2c19f81796e 100644 (file)
@@ -95,6 +95,7 @@ static int IsDarkMode(bool& isDarkMode)
 }
 
 WinMute::MuteConfig::MuteConfig()
+   : showNotifications(false)
 {
    this->quietHours.enabled = false;
    this->quietHours.forceUnmute = false;
@@ -168,17 +169,20 @@ bool WinMute::InitAudio()
                   (cond) ? MF_CHECKED : MF_UNCHECKED) != -1)
 bool WinMute::InitTrayMenu()
 {
-   hTrayMenu_ = LoadMenu(hglobInstance, MAKEINTRESOURCE(IDR_TRAYMENU));
-   if (!hTrayMenu_) {
-      PrintWindowsError(_T("LoadMenu"));
-      return false;
-   } else if (
-      !CHECK_MENU_ITEM(MUTEONLOCK, muteCtrl_.GetMuteOnWorkstationLock()) ||
-      !CHECK_MENU_ITEM(MUTEONSCREENSAVER, muteCtrl_.GetMuteOnScreensaverActivation()) ||
-      !CHECK_MENU_ITEM(RESTOREAUDIO, muteCtrl_.GetRestoreVolume()) ||
-      !CHECK_MENU_ITEM(MUTEONSUSPEND, muteCtrl_.GetMuteOnSuspend()) ||
-      !CHECK_MENU_ITEM(MUTEONSHUTDOWN, muteCtrl_.GetMuteOnShutdown()) ||
-      !CHECK_MENU_ITEM(MUTEONLOGOUT, muteCtrl_.GetMuteOnLogout())) {
+   if (hTrayMenu_ == NULL) {
+      hTrayMenu_ = LoadMenu(hglobInstance, MAKEINTRESOURCE(IDR_TRAYMENU));
+      if (hTrayMenu_ == NULL) {
+         PrintWindowsError(_T("LoadMenu"));
+         return false;
+      }
+   }
+
+   if (!CHECK_MENU_ITEM(MUTEONLOCK, muteCtrl_.GetMuteOnWorkstationLock()) ||
+       !CHECK_MENU_ITEM(MUTEONSCREENSAVER, muteCtrl_.GetMuteOnScreensaverActivation()) ||
+       !CHECK_MENU_ITEM(RESTOREAUDIO, muteCtrl_.GetRestoreVolume()) ||
+       !CHECK_MENU_ITEM(MUTEONSUSPEND, muteCtrl_.GetMuteOnSuspend()) ||
+       !CHECK_MENU_ITEM(MUTEONSHUTDOWN, muteCtrl_.GetMuteOnShutdown()) ||
+       !CHECK_MENU_ITEM(MUTEONLOGOUT, muteCtrl_.GetMuteOnLogout())) {
       return false;
    }
    return true;
@@ -206,7 +210,7 @@ bool WinMute::Init()
       return false;
    }
 
-   if (!LoadDefaults()) {
+   if (!LoadSettings()) {
       return false;
    }
 
@@ -255,30 +259,24 @@ bool WinMute::Init()
    return true;
 }
 
-bool WinMute::LoadDefaults()
+bool WinMute::LoadSettings()
 {
-   muteCtrl_.SetRestoreVolume(!!settings_.QueryValue(SettingsKey::RESTORE_AUDIO, 1));
-   muteCtrl_.SetMuteOnWorkstationLock(!!settings_.QueryValue(SettingsKey::MUTE_ON_LOCK, 1));
-   muteCtrl_.SetMuteOnScreensaverActivation(!!settings_.QueryValue(SettingsKey::MUTE_ON_SCREENSAVER, 1));
-   muteCtrl_.SetMuteOnDisplayStandby(!!settings_.QueryValue(SettingsKey::MUTE_ON_DISPLAYSTANDBY, 1));
-   muteCtrl_.SetMuteOnLogout(!!settings_.QueryValue(SettingsKey::MUTE_ON_LOGOUT, 0));
-   muteCtrl_.SetMuteOnSuspend(!!settings_.QueryValue(SettingsKey::MUTE_ON_SUSPEND, 0));
-   muteCtrl_.SetMuteOnShutdown(!!settings_.QueryValue(SettingsKey::MUTE_ON_SHUTDOWN, 0));
-
-   muteCtrl_.SetNotifications(settings_.QueryValue(SettingsKey::NOTIFICATIONS_ENABLED, 0) != 0);
-
-   muteConfig_.showNotifications =
-      settings_.QueryValue(SettingsKey::NOTIFICATIONS_ENABLED, 0) != 0;
-   muteConfig_.quietHours.enabled =
-      settings_.QueryValue(SettingsKey::QUIETHOURS_ENABLE, 0) != 0;
-   muteConfig_.quietHours.forceUnmute =
-      settings_.QueryValue(SettingsKey::QUIETHOURS_FORCEUNMUTE, 0) != 0;
-   muteConfig_.quietHours.notifications =
-      settings_.QueryValue(SettingsKey::QUIETHOURS_NOTIFICATIONS, 0) != 0;
-   muteConfig_.quietHours.start =
-      settings_.QueryValue(SettingsKey::QUIETHOURS_START, 0);
-   muteConfig_.quietHours.end =
-      settings_.QueryValue(SettingsKey::QUIETHOURS_END, 0);
+   muteCtrl_.SetRestoreVolume(!!settings_.QueryValue(SettingsKey::RESTORE_AUDIO));
+   muteCtrl_.SetMuteOnWorkstationLock(!!settings_.QueryValue(SettingsKey::MUTE_ON_LOCK));
+   muteCtrl_.SetMuteOnScreensaverActivation(!!settings_.QueryValue(SettingsKey::MUTE_ON_SCREENSAVER));
+   muteCtrl_.SetMuteOnDisplayStandby(!!settings_.QueryValue(SettingsKey::MUTE_ON_DISPLAYSTANDBY));
+   muteCtrl_.SetMuteOnLogout(!!settings_.QueryValue(SettingsKey::MUTE_ON_LOGOUT));
+   muteCtrl_.SetMuteOnSuspend(!!settings_.QueryValue(SettingsKey::MUTE_ON_SUSPEND));
+   muteCtrl_.SetMuteOnShutdown(!!settings_.QueryValue(SettingsKey::MUTE_ON_SHUTDOWN));
+
+   muteCtrl_.SetNotifications(!!settings_.QueryValue(SettingsKey::NOTIFICATIONS_ENABLED));
+
+   muteConfig_.showNotifications = !!settings_.QueryValue(SettingsKey::NOTIFICATIONS_ENABLED);
+   muteConfig_.quietHours.enabled = !!settings_.QueryValue(SettingsKey::QUIETHOURS_ENABLE);
+   muteConfig_.quietHours.forceUnmute = !!settings_.QueryValue(SettingsKey::QUIETHOURS_FORCEUNMUTE);
+   muteConfig_.quietHours.notifications = !!settings_.QueryValue(SettingsKey::QUIETHOURS_NOTIFICATIONS);
+   muteConfig_.quietHours.start = settings_.QueryValue(SettingsKey::QUIETHOURS_START);
+   muteConfig_.quietHours.end = settings_.QueryValue(SettingsKey::QUIETHOURS_END);
 
    return true;
 }
@@ -320,15 +318,15 @@ LRESULT CALLBACK WinMute::WindowProc(
          SendMessage(hWnd, WM_CLOSE, 0, 0);
          break;
       case ID_TRAYMENU_SETTINGS: {
-         DialogBoxParam(
-            hglobInstance,
-            MAKEINTRESOURCE(IDD_SETTINGS),
-            hWnd_,
-            SettingsDlgProc,
-            reinterpret_cast<LPARAM>(&settings_));
-         bool notifications = settings_.QueryValue(SettingsKey::NOTIFICATIONS_ENABLED, 0) != 0;
-         muteConfig_.showNotifications = notifications;
-         muteCtrl_.SetNotifications(notifications);
+         if (DialogBoxParam(
+               hglobInstance,
+               MAKEINTRESOURCE(IDD_SETTINGS),
+               hWnd_,
+               SettingsDlgProc,
+               reinterpret_cast<LPARAM>(&settings_)) == 0) {
+            LoadSettings();
+            InitTrayMenu();
+         }
          break;
       }
       case ID_TRAYMENU_MUTE: {
@@ -471,14 +469,11 @@ LRESULT CALLBACK WinMute::WindowProc(
       return 0;
    case WM_WINMUTE_QUIETHOURS_CHANGE: {
       muteConfig_.quietHours.enabled = settings_.QueryValue(
-         SettingsKey::QUIETHOURS_ENABLE,
-         0);
+         SettingsKey::QUIETHOURS_ENABLE);
       muteConfig_.quietHours.forceUnmute = settings_.QueryValue(
-         SettingsKey::QUIETHOURS_FORCEUNMUTE,
-         0);
+         SettingsKey::QUIETHOURS_FORCEUNMUTE);
       muteConfig_.quietHours.notifications = settings_.QueryValue(
-         SettingsKey::QUIETHOURS_NOTIFICATIONS,
-         0);
+         SettingsKey::QUIETHOURS_NOTIFICATIONS);
       CheckMenuItem(
          hTrayMenu_,
          ID_TRAYMENU_CONFIGUREQUIETHOURS,
@@ -486,11 +481,9 @@ LRESULT CALLBACK WinMute::WindowProc(
 
       if (muteConfig_.quietHours.enabled) {
          muteConfig_.quietHours.start = settings_.QueryValue(
-            SettingsKey::QUIETHOURS_START,
-            0);
+            SettingsKey::QUIETHOURS_START);
          muteConfig_.quietHours.end = settings_.QueryValue(
-            SettingsKey::QUIETHOURS_END,
-            0);
+            SettingsKey::QUIETHOURS_END);
       }
       ResetQuietHours();
 
@@ -620,13 +613,39 @@ void WinMute::ResetQuietHours()
          int timerQhEnd = GetDiffMillseconds(&end, &now);
          WMLog::GetInstance().Write(L"Mute: On | Quiet hours have already started");
          muteCtrl_.NotifyQuietHours(true);
-         if (SetTimer(hWnd_, QUIETHOURS_TIMER_END_ID, timerQhEnd, QuietHoursTimer) == 0) {
-            MessageBox(hWnd_, L"Failed to create Timer", PROGRAM_NAME, MB_OK);
+         if (SetCoalescableTimer(
+               hWnd_,
+               QUIETHOURS_TIMER_END_ID,
+               timerQhEnd,
+               QuietHoursTimer,
+               TIMERV_DEFAULT_COALESCING) == 0) {
+            TaskDialog(
+               hWnd_,
+               hglobInstance,
+               PROGRAM_NAME,
+               _T("Quiet Hours Stop"),
+               _T("Failed to register end of quiet hours with windows timer system"),
+               TDCBF_OK_BUTTON,
+               TD_ERROR_ICON,
+               nullptr);
          }
       } else {
          int timerQhStart = GetDiffMillseconds(&start, &now);
-         if (SetTimer(hWnd_, QUIETHOURS_TIMER_START_ID, timerQhStart, QuietHoursTimer) == 0) {
-            MessageBox(hWnd_, L"Failed to create Timer", PROGRAM_NAME, MB_OK);
+         if (SetCoalescableTimer(
+               hWnd_,
+               QUIETHOURS_TIMER_START_ID,
+               timerQhStart,
+               QuietHoursTimer,
+               TIMERV_DEFAULT_COALESCING) == 0) {
+            TaskDialog(
+               hWnd_,
+               hglobInstance,
+               PROGRAM_NAME,
+               _T("Quiet Hours Start"),
+               _T("Failed to register quiet hours start with windows timer system"),
+               TDCBF_OK_BUTTON,
+               TD_ERROR_ICON,
+               nullptr);
          }
       }
    }
@@ -645,8 +664,21 @@ void WinMute::SetQuietHoursStart()
    start.wHour = static_cast<WORD>((muteConfig_.quietHours.start - start.wMinute - start.wSecond) / 3600);
 
    int timerQhStart = GetDiffMillseconds(&start, &now);
-   if (SetTimer(hWnd_, QUIETHOURS_TIMER_START_ID, timerQhStart, QuietHoursTimer) == 0) {
-      MessageBox(hWnd_, L"Failed to create Timer", PROGRAM_NAME, MB_OK);
+   if (SetCoalescableTimer(
+         hWnd_,
+         QUIETHOURS_TIMER_START_ID,
+         timerQhStart,
+         QuietHoursTimer,
+         TIMERV_DEFAULT_COALESCING) == 0) {
+      TaskDialog(
+         hWnd_,
+         hglobInstance,
+         PROGRAM_NAME,
+         _T("Quiet Hours Start"),
+         _T("Failed to register quiet hours start with windows timer system"),
+         TDCBF_OK_BUTTON,
+         TD_ERROR_ICON,
+         nullptr);
    }
 }
 
@@ -665,8 +697,21 @@ void WinMute::SetQuietHoursEnd()
    int timerQhEnd = GetDiffMillseconds(&end, &now);
    if (timerQhEnd <= 0) {
       SendMessage(hWnd_, WM_WINMUTE_QUIETHOURS_END, 0, 0);
-   } else if (SetTimer(hWnd_, QUIETHOURS_TIMER_END_ID, timerQhEnd, QuietHoursTimer) == 0) {
-      MessageBox(hWnd_, L"Failed to create Timer", PROGRAM_NAME, MB_OK);
+   } else if (SetCoalescableTimer(
+         hWnd_,
+         QUIETHOURS_TIMER_END_ID,
+         timerQhEnd,
+         QuietHoursTimer,
+         TIMERV_DEFAULT_COALESCING) == 0) {
+      TaskDialog(
+         hWnd_,
+         hglobInstance,
+         PROGRAM_NAME,
+         _T("Quiet Hours Stop"),
+         _T("Failed to register end of quiet hours with windows timer system"),
+         TDCBF_OK_BUTTON,
+         TD_ERROR_ICON,
+         nullptr);
    }
 }
 
index 03f85f94397dc5d0ef394bc47fd5a082a41d708f..88b2a72209d15c904e84a70cf9799f7f9fcd7e4a 100644 (file)
@@ -80,8 +80,7 @@ private:
    bool InitWindow();
    bool InitAudio();
    bool InitTrayMenu();
-   void InitMuteSettings();
-   bool LoadDefaults();
+   bool LoadSettings();
 
    void ResetQuietHours();
    void SetQuietHoursStart();
index ccc510a40891808cec60f44c188e4c9e5db38d14..f251a36f7f703937c9223f90eba9301fac982859 100644 (file)
@@ -71,29 +71,29 @@ BEGIN
     CONTROL         "",IDC_SETTINGS_TAB,"SysTabControl32",0x0,7,7,255,223
 END
 
-IDD_SETTINGS_GENERAL DIALOGEX 0, 0, 201, 179
+IDD_SETTINGS_GENERAL DIALOGEX 0, 0, 233, 179
 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
 FONT 8, "MS Shell Dlg", 400, 0, 0x1
 BEGIN
     CONTROL         "Start WinMute on system startup",IDC_RUNONSTARTUP,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,15,187,26
-    CONTROL         "Enable Logging",IDC_ENABLELOGGING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,61,187,21
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,3,219,26
+    CONTROL         "Enable Logging",IDC_ENABLELOGGING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,48,219,21
     CONTROL         "Show mute event notifications",IDC_SHOWNOTIFICATIONS,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,39,187,21
-    PUSHBUTTON      "Open Log File...",IDC_OPENLOG,22,82,58,15
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,27,219,21
+    PUSHBUTTON      "Open Log File...",IDC_OPENLOG,22,69,58,15
 END
 
-IDD_SETTINGS_QUIETHOURS DIALOGEX 0, 0, 234, 177
+IDD_SETTINGS_QUIETHOURS DIALOGEX 0, 0, 246, 198
 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
 FONT 8, "MS Shell Dlg", 400, 0, 0x1
 BEGIN
-    LTEXT           "During Quiet Hours WinMute automatically mutes your PC volumes and unmutes it afterwards.",IDC_STATIC,7,7,220,22
+    LTEXT           "During Quiet Hours WinMute automatically mutes your PC volumes and unmutes it afterwards.",IDC_STATIC,7,9,232,22
     CONTROL         "Enable Quiet Hours",IDC_ENABLEQUIETHOURS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,31,120,15
     CONTROL         "",IDC_QUIETHOURS_START,"SysDateTimePick32",DTS_RIGHTALIGN | DTS_UPDOWN | WS_TABSTOP | 0x8,73,47,65,18
     CONTROL         "",IDC_QUIETHOURS_END,"SysDateTimePick32",DTS_RIGHTALIGN | DTS_UPDOWN | WS_TABSTOP | 0x8,72,71,67,19
     CONTROL         "Force unmute",IDC_FORCEUNMUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,94,86,16
     CONTROL         "Show notifications",IDC_SHOWNOTIFICATIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,146,81,21
-    LTEXT           "If force unmute is enabled, WinMute will unmute your workstation when quiet hours end and not take into account if your workstation was already muted before quiet hours started.",IDC_STATIC,23,111,204,37
+    LTEXT           "If force unmute is enabled, WinMute will unmute your workstation when quiet hours end and not take into account if your workstation was already muted before quiet hours started.",IDC_STATIC,33,111,204,37
     LTEXT           "Start time:",IDC_STATIC,23,50,43,13
     LTEXT           "End time:",IDC_STATIC,24,73,32,16
 END
@@ -118,6 +118,29 @@ BEGIN
                     "SysLink",WS_TABSTOP,197,49,94,14
 END
 
+IDD_SETTINGS_MUTE DIALOGEX 0, 0, 242, 205
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    GROUPBOX        "Mute with volume restore, when...",IDC_STATIC,7,33,228,104
+    CONTROL         "... the workstation is locked",IDC_MUTE_WHEN_WS_LOCKED,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,48,105,10
+    CONTROL         "... the screensaver starts",IDC_MUTE_WHEN_SCREENSAVER_STARTS,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,62,99,10
+    CONTROL         "... the screen turns off",IDC_MUTE_WHEN_SCREEN_OFF,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,76,90,10
+    CONTROL         "... a remote session is started",IDC_MUTE_WHEN_RDP_SESSION,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,90,112,10
+    CONTROL         "Restore volume afterwards",IDC_RESTOREVOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,105,103,10
+    GROUPBOX        "Mute without volume restore, when...",IDC_STATIC,7,139,228,59
+    CONTROL         "... the computer shuts down",IDC_MUTE_WHEN_SHUTDOWN,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,153,107,10
+    CONTROL         "... you log out",IDC_MUTE_WHEN_LOGOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,181,62,10
+    CONTROL         "... the computer goes into sleep/hibernate.",IDC_MUTE_WHEN_SLEEP,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,167,155,10
+    LTEXT           "Here you can configure the various mute conditions and variations that WinMute supports.",IDC_STATIC,7,8,228,17
+END
+
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -146,7 +169,7 @@ BEGIN
     IDD_SETTINGS_GENERAL, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 194
+        RIGHTMARGIN, 226
         TOPMARGIN, 7
         BOTTOMMARGIN, 172
     END
@@ -154,9 +177,9 @@ BEGIN
     IDD_SETTINGS_QUIETHOURS, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 227
+        RIGHTMARGIN, 239
         TOPMARGIN, 7
-        BOTTOMMARGIN, 170
+        BOTTOMMARGIN, 191
     END
 
     IDD_ABOUT_LICENSE, DIALOG
@@ -174,6 +197,14 @@ BEGIN
         TOPMARGIN, 7
         BOTTOMMARGIN, 169
     END
+
+    IDD_SETTINGS_MUTE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 235
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 198
+    END
 END
 #endif    // APSTUDIO_INVOKED
 
@@ -214,6 +245,11 @@ BEGIN
     0
 END
 
+IDD_SETTINGS_MUTE AFX_DIALOG_LAYOUT
+BEGIN
+    0
+END
+
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -246,8 +282,7 @@ BEGIN
         MENUITEM "... Workstation is locked",   ID_TRAYMENU_MUTEONLOCK, CHECKED
         MENUITEM "... Screensaver starts",      ID_TRAYMENU_MUTEONSCREENSAVER, CHECKED
         MENUITEM "... Screen turns off",        ID_TRAYMENU_SCREENSUSPEND, CHECKED
-        MENUITEM SEPARATOR
-        MENUITEM "Restore previous volume afterwards", ID_TRAYMENU_RESTOREAUDIO, CHECKED
+        MENUITEM "Restore volume afterwards",   ID_TRAYMENU_RESTOREAUDIO, CHECKED
         MENUITEM SEPARATOR
         MENUITEM "Mute on (no volume restore)", ID_TRAYMENU_AFTERWARDS, INACTIVE
         MENUITEM "... Shutdown",                ID_TRAYMENU_MUTEONSHUTDOWN
index b23e2cf57f63f6feb232c5fa2218d1fc4bab48a1..3ef9618289b23695950a09ae298b3d62815ebc5c 100644 (file)
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
     </ClCompile>
+    <ClCompile Include="Settings_MuteDlg.cpp" />
     <ClCompile Include="WMLog.cpp" />
     <ClCompile Include="MMNotificationClient.cpp" />
     <ClCompile Include="MuteControl.cpp" />
index 257cdbba09ff32dfe562c05a67f25d65dbf3c2cc..427e71c4bcf521c7f0688b146d495264c5d9a02e 100644 (file)
     <ClCompile Include="AboutDlg.cpp">
       <Filter>Source Files\UI\Dialogs</Filter>
     </ClCompile>
+    <ClCompile Include="Settings_MuteDlg.cpp">
+      <Filter>Source Files\UI\Dialogs\Settings</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
index 8e77249bd5a0a4db213b65fe0d5ba8a549bc2907..fd5d380550ca38c9fd1efb5449af86419fb7a694 100644 (file)
@@ -14,6 +14,7 @@
 #define IDD_ABOUT_WINMUTE               120
 #define IDI_ICON1                       122
 #define IDI_SETTINGS                    122
+#define IDD_SETTINGS_MUTE               123
 #define IDC_LINK_HOMEPAGE               1001
 #define IDC_LINK_SUPPORT                1002
 #define IDC_LINK_PROJECT                1002
 #define IDC_SETTINGS_TAB                1010
 #define IDC_CHECK1                      1011
 #define IDC_RUNONSTARTUP                1011
+#define IDC_MUTE_WHEN_WS_LOCKED         1011
 #define IDC_ENABLELOGGING               1012
 #define IDC_CHECK3                      1013
+#define IDC_ENABLESTOPPLAYBACK          1013
 #define IDC_OPENLOG                     1014
 #define IDC_LICENSETEXT                 1015
 #define IDC_ABOUT_TAB                   1016
 #define IDC_ABOUTTEXT                   1019
 #define IDC_TITLE                       1020
 #define IDC_ABOUT_TITLE                 1020
+#define IDC_MUTE_WHEN_SCREENSAVER_STARTS 1021
+#define IDC_MUTE_WHEN_SCREEN_OFF        1022
+#define IDC_MUTE_WHEN_RDP_SESSION       1023
+#define IDC_RESTOREVOLUME               1024
+#define IDC_MUTE_WHEN_SHUTDOWN          1025
+#define IDC_MUTE_WHEN_RDP_SESSION3      1026
+#define IDC_MUTE_WHEN_LOGOUT            1026
+#define IDC_MUTE_WHEN_SLEEP             1027
 #define ID_TRAYMENU_INFO                40001
 #define ID_TRAYMENU_                    40002
 #define ID_TRAYMENU_MUTEON              40003
@@ -68,9 +79,9 @@
 // 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        123
+#define _APS_NEXT_RESOURCE_VALUE        125
 #define _APS_NEXT_COMMAND_VALUE         40028
-#define _APS_NEXT_CONTROL_VALUE         1021
+#define _APS_NEXT_CONTROL_VALUE         1022
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif