https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03c3dd5ab08ce66d6df1d…
commit 03c3dd5ab08ce66d6df1de3c2aa10ee98ee6fc96
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Thu Feb 21 22:26:58 2019 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Thu Feb 21 22:27:44 2019 +0100
[SNDVOL32] Move the advanced controls dialog to a separate file and update its title
on creation.
---
base/applications/sndvol32/CMakeLists.txt | 1 +
base/applications/sndvol32/advanced.c | 100 ++++++++++++++++++++++++++++++
base/applications/sndvol32/lang/bg-BG.rc | 4 ++
base/applications/sndvol32/lang/cs-CZ.rc | 4 ++
base/applications/sndvol32/lang/de-DE.rc | 4 ++
base/applications/sndvol32/lang/el-GR.rc | 4 ++
base/applications/sndvol32/lang/en-US.rc | 4 ++
base/applications/sndvol32/lang/es-ES.rc | 4 ++
base/applications/sndvol32/lang/fr-FR.rc | 4 ++
base/applications/sndvol32/lang/he-IL.rc | 4 ++
base/applications/sndvol32/lang/hu-HU.rc | 4 ++
base/applications/sndvol32/lang/id-ID.rc | 4 ++
base/applications/sndvol32/lang/it-IT.rc | 4 ++
base/applications/sndvol32/lang/ja-JP.rc | 4 ++
base/applications/sndvol32/lang/ko-KR.rc | 4 ++
base/applications/sndvol32/lang/lt-LT.rc | 4 ++
base/applications/sndvol32/lang/nl-NL.rc | 4 ++
base/applications/sndvol32/lang/no-NO.rc | 4 ++
base/applications/sndvol32/lang/pl-PL.rc | 4 ++
base/applications/sndvol32/lang/pt-BR.rc | 4 ++
base/applications/sndvol32/lang/ro-RO.rc | 4 ++
base/applications/sndvol32/lang/ru-RU.rc | 4 ++
base/applications/sndvol32/lang/sk-SK.rc | 4 ++
base/applications/sndvol32/lang/sq-AL.rc | 4 ++
base/applications/sndvol32/lang/sv-SE.rc | 4 ++
base/applications/sndvol32/lang/th-TH.rc | 4 ++
base/applications/sndvol32/lang/tr-TR.rc | 4 ++
base/applications/sndvol32/lang/uk-UA.rc | 4 ++
base/applications/sndvol32/lang/zh-CN.rc | 4 ++
base/applications/sndvol32/lang/zh-TW.rc | 4 ++
base/applications/sndvol32/mixer.c | 38 ++++++++++++
base/applications/sndvol32/resources.h | 8 ++-
base/applications/sndvol32/sndvol32.c | 78 +++++++----------------
base/applications/sndvol32/sndvol32.h | 21 +++++++
34 files changed, 300 insertions(+), 58 deletions(-)
diff --git a/base/applications/sndvol32/CMakeLists.txt
b/base/applications/sndvol32/CMakeLists.txt
index dd1827368a..c6c757a0f4 100644
--- a/base/applications/sndvol32/CMakeLists.txt
+++ b/base/applications/sndvol32/CMakeLists.txt
@@ -1,5 +1,6 @@
list(APPEND SOURCE
+ advanced.c
dialog.c
misc.c
mixer.c
diff --git a/base/applications/sndvol32/advanced.c
b/base/applications/sndvol32/advanced.c
new file mode 100644
index 0000000000..34d1d62093
--- /dev/null
+++ b/base/applications/sndvol32/advanced.c
@@ -0,0 +1,100 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Sound Volume Control
+ * FILE: base/applications/sndvol32/advanced.c
+ * PROGRAMMERS: Eric Kohl <eric.kohl(a)reactos.org>
+ */
+
+#include "sndvol32.h"
+
+static
+VOID
+OnInitDialog(
+ HWND hwndDlg,
+ PADVANCED_CONTEXT Context)
+{
+ WCHAR szRawTitle[256], szCookedTitle[256];
+ LPMIXERCONTROL Control = NULL;
+ UINT ControlCount = 0, Index, i;
+
+ /* Set the dialog title */
+ LoadStringW(hAppInstance, IDS_ADVANCED_CONTROLS, szRawTitle, ARRAYSIZE(szRawTitle));
+// swprintf(szCookedTitle, szRawTitle, Context->LineName);
+ StringCchPrintfW(szCookedTitle, ARRAYSIZE(szCookedTitle), szRawTitle,
Context->LineName);
+ SetWindowTextW(hwndDlg, szCookedTitle);
+
+ /* Disable the tone controls */
+ for (i = IDC_ADV_BASS_LOW; i<= IDC_ADV_TREBLE_SLIDER; i++)
+ EnableWindow(GetDlgItem(hwndDlg, i), FALSE);
+
+ /* Hide the other controls */
+ for (i = IDC_ADV_OTHER_CONTROLS; i<= IDC_ADV_OTHER_CHECK2; i++)
+ ShowWindow(GetDlgItem(hwndDlg, i), SW_HIDE);
+
+ if (SndMixerQueryControls(Context->Mixer, &ControlCount, Context->Line,
&Control))
+ {
+ for (Index = 0; Index < ControlCount; Index++)
+ {
+ if (Control[Index].dwControlType == MIXERCONTROL_CONTROLTYPE_BASS)
+ {
+ for (i = IDC_ADV_BASS_LOW; i<= IDC_ADV_BASS_SLIDER; i++)
+ EnableWindow(GetDlgItem(hwndDlg, i), TRUE);
+
+ }
+ else if (Control[Index].dwControlType == MIXERCONTROL_CONTROLTYPE_TREBLE)
+ {
+ for (i = IDC_ADV_TREBLE_LOW; i<= IDC_ADV_TREBLE_SLIDER; i++)
+ EnableWindow(GetDlgItem(hwndDlg, i), TRUE);
+
+ }
+ else if (Control[Index].dwControlType != MIXERCONTROL_CONTROLTYPE_VOLUME
&&
+ Control[Index].dwControlType != MIXERCONTROL_CONTROLTYPE_MUTE)
+ {
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ADV_OTHER_CONTROLS), SW_SHOWNORMAL);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ADV_OTHER_TEXT), SW_SHOWNORMAL);
+
+ }
+ }
+
+ /* free controls */
+ HeapFree(GetProcessHeap(), 0, Control);
+ }
+}
+
+
+INT_PTR
+CALLBACK
+AdvancedDlgProc(
+ HWND hwndDlg,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ PADVANCED_CONTEXT Context;
+
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam);
+ Context = (PADVANCED_CONTEXT)((LONG_PTR)lParam);
+ OnInitDialog(hwndDlg, Context);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDOK:
+ EndDialog(hwndDlg, IDOK);
+ break;
+ }
+ break;
+
+ case WM_CLOSE:
+ EndDialog(hwndDlg, IDCANCEL);
+ break;
+ }
+
+ return FALSE;
+}
+
+/* EOF */
diff --git a/base/applications/sndvol32/lang/bg-BG.rc
b/base/applications/sndvol32/lang/bg-BG.rc
index 0d835b0b70..2dbe8d98ec 100644
--- a/base/applications/sndvol32/lang/bg-BG.rc
+++ b/base/applications/sndvol32/lang/bg-BG.rc
@@ -25,6 +25,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Сила на звука"
IDS_NOMIXERDEVICES "Не са открити работещи смесителни устройства! Приложението
ще се затвори."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/cs-CZ.rc
b/base/applications/sndvol32/lang/cs-CZ.rc
index 12aaf2bc08..db619d7bde 100644
--- a/base/applications/sndvol32/lang/cs-CZ.rc
+++ b/base/applications/sndvol32/lang/cs-CZ.rc
@@ -27,6 +27,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Ovládání hlasitosti"
IDS_NOMIXERDEVICES "Nejsou dostupná žádná směšovací zařízení! Aplikace se nyní
ukončí."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/de-DE.rc
b/base/applications/sndvol32/lang/de-DE.rc
index b6897febfc..8e03fd2f8e 100644
--- a/base/applications/sndvol32/lang/de-DE.rc
+++ b/base/applications/sndvol32/lang/de-DE.rc
@@ -21,6 +21,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Lautstärke-Einstellungen"
IDS_NOMIXERDEVICES "Es sind keine aktiven Mixer vorhanden! Die Anwendung wird
jetzt beendet."
+ IDS_SELECT "&Auswählen"
+ IDS_ADVANCED_CONTROLS "Erweiterte Einstellungen für %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/el-GR.rc
b/base/applications/sndvol32/lang/el-GR.rc
index e10c9abc20..31d62ec445 100644
--- a/base/applications/sndvol32/lang/el-GR.rc
+++ b/base/applications/sndvol32/lang/el-GR.rc
@@ -21,6 +21,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Έλεγχος έντασης"
IDS_NOMIXERDEVICES "There are no active mixer devices available! The application
will now exit."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/en-US.rc
b/base/applications/sndvol32/lang/en-US.rc
index 05ebf89e0a..136684d476 100644
--- a/base/applications/sndvol32/lang/en-US.rc
+++ b/base/applications/sndvol32/lang/en-US.rc
@@ -21,6 +21,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Volume Control"
IDS_NOMIXERDEVICES "There are no active mixer devices available! The application
will now exit."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/es-ES.rc
b/base/applications/sndvol32/lang/es-ES.rc
index 2480eef1be..fa9de20175 100644
--- a/base/applications/sndvol32/lang/es-ES.rc
+++ b/base/applications/sndvol32/lang/es-ES.rc
@@ -24,6 +24,10 @@ BEGIN
IDS_SNDVOL32 "Control de volumen"
IDS_NOMIXERDEVICES "¡No hay dispositivos mezcladores activos en este momento!
\n\
La aplicación se cerrará ahora."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/fr-FR.rc
b/base/applications/sndvol32/lang/fr-FR.rc
index c0e7ec46a7..afd60f5d8d 100644
--- a/base/applications/sndvol32/lang/fr-FR.rc
+++ b/base/applications/sndvol32/lang/fr-FR.rc
@@ -21,6 +21,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Contrôle du volume"
IDS_NOMIXERDEVICES "Il n'y a pas de périphérique de mixage disponible !
L'application va se terminer."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/he-IL.rc
b/base/applications/sndvol32/lang/he-IL.rc
index d892921828..0d9509730e 100644
--- a/base/applications/sndvol32/lang/he-IL.rc
+++ b/base/applications/sndvol32/lang/he-IL.rc
@@ -21,6 +21,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "בקרת עוצמה"
IDS_NOMIXERDEVICES "אין התקני ערבול פעילים זמינים! היישום יצא עכשיו"
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/hu-HU.rc
b/base/applications/sndvol32/lang/hu-HU.rc
index dfc2ae7f43..6de5aebc7f 100644
--- a/base/applications/sndvol32/lang/hu-HU.rc
+++ b/base/applications/sndvol32/lang/hu-HU.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Hangerõ szabályozó"
IDS_NOMIXERDEVICES "Nincsenek elérhetõ keverõ eszközök. A program kilép."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/id-ID.rc
b/base/applications/sndvol32/lang/id-ID.rc
index 11d52cab74..466e5b7201 100644
--- a/base/applications/sndvol32/lang/id-ID.rc
+++ b/base/applications/sndvol32/lang/id-ID.rc
@@ -21,6 +21,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Kontrol Volume"
IDS_NOMIXERDEVICES "Tidak ada device mixer yang aktif yang tersedia! Aplikasi
akan keluar sekarang."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/it-IT.rc
b/base/applications/sndvol32/lang/it-IT.rc
index 7e97dab9fe..2db5896c26 100644
--- a/base/applications/sndvol32/lang/it-IT.rc
+++ b/base/applications/sndvol32/lang/it-IT.rc
@@ -21,6 +21,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Controllo Volume"
IDS_NOMIXERDEVICES "Non ci sono dispositivi mixer disponibili! Il programma si
chiuderà."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/ja-JP.rc
b/base/applications/sndvol32/lang/ja-JP.rc
index 2e6753a0bc..cf0eb203b0 100644
--- a/base/applications/sndvol32/lang/ja-JP.rc
+++ b/base/applications/sndvol32/lang/ja-JP.rc
@@ -21,6 +21,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "ボリューム コントロール"
IDS_NOMIXERDEVICES "アクティブなミキサーが利用できません ! アプリケーションを終了します。"
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/ko-KR.rc
b/base/applications/sndvol32/lang/ko-KR.rc
index ee8173a18d..cc4a57b5ae 100644
--- a/base/applications/sndvol32/lang/ko-KR.rc
+++ b/base/applications/sndvol32/lang/ko-KR.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "볼륨 컨트롤"
IDS_NOMIXERDEVICES "사용 가능한 믹서 장치가 없습니다! 이 프로그램은 종료됩니다."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/lt-LT.rc
b/base/applications/sndvol32/lang/lt-LT.rc
index a660ec336b..84eec680ef 100644
--- a/base/applications/sndvol32/lang/lt-LT.rc
+++ b/base/applications/sndvol32/lang/lt-LT.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Garso valdiklis"
IDS_NOMIXERDEVICES "Šiuo metu nėra aktyvių garso maišymo įrenginių! Programa
darbą baigė."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/nl-NL.rc
b/base/applications/sndvol32/lang/nl-NL.rc
index f6ac02af3b..d355838904 100644
--- a/base/applications/sndvol32/lang/nl-NL.rc
+++ b/base/applications/sndvol32/lang/nl-NL.rc
@@ -21,6 +21,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Volume Control"
IDS_NOMIXERDEVICES "Er zijn geen actieve mixerapparaten beschikbaar! Deze
toepassing wordt nu afgesloten."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/no-NO.rc
b/base/applications/sndvol32/lang/no-NO.rc
index 4f4ae532cd..27f53cede7 100644
--- a/base/applications/sndvol32/lang/no-NO.rc
+++ b/base/applications/sndvol32/lang/no-NO.rc
@@ -21,6 +21,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Volumkontroll"
IDS_NOMIXERDEVICES "Det er ingen aktive mikser enheter tilgjengelig! Programmet
vil nå avsluttes."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/pl-PL.rc
b/base/applications/sndvol32/lang/pl-PL.rc
index 11ec96ad8d..7a668740aa 100644
--- a/base/applications/sndvol32/lang/pl-PL.rc
+++ b/base/applications/sndvol32/lang/pl-PL.rc
@@ -29,6 +29,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Regulacja głośności"
IDS_NOMIXERDEVICES "Nie jest dostępne żadne aktywne urządzenie miksujące!
Program zostanie zamknięty."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/pt-BR.rc
b/base/applications/sndvol32/lang/pt-BR.rc
index e95b05e486..08ca3743a3 100644
--- a/base/applications/sndvol32/lang/pt-BR.rc
+++ b/base/applications/sndvol32/lang/pt-BR.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Controle de Volume"
IDS_NOMIXERDEVICES "Não há dispositivos de mixagem disponíveis! O aplicativo irá
sair agora."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/ro-RO.rc
b/base/applications/sndvol32/lang/ro-RO.rc
index 12467c79ad..d0973e5dce 100644
--- a/base/applications/sndvol32/lang/ro-RO.rc
+++ b/base/applications/sndvol32/lang/ro-RO.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Reglaj de volum"
IDS_NOMIXERDEVICES "Nu există dispozitive active de mixaj! Aplicația va fi
închisă."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/ru-RU.rc
b/base/applications/sndvol32/lang/ru-RU.rc
index 7effc43f32..c7f05d2d85 100644
--- a/base/applications/sndvol32/lang/ru-RU.rc
+++ b/base/applications/sndvol32/lang/ru-RU.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Управление громкостью"
IDS_NOMIXERDEVICES "Нет доступных микшерных устройств! Приложение будет
завершено."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/sk-SK.rc
b/base/applications/sndvol32/lang/sk-SK.rc
index d4dcafa489..643de2db7f 100644
--- a/base/applications/sndvol32/lang/sk-SK.rc
+++ b/base/applications/sndvol32/lang/sk-SK.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Ovládanie hlasitosti"
IDS_NOMIXERDEVICES "Nie sú dostupné žiadne zariadenie zmiešavača! Program sa
teraz ukončí."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/sq-AL.rc
b/base/applications/sndvol32/lang/sq-AL.rc
index 5affa0ffa3..f0fbba6994 100644
--- a/base/applications/sndvol32/lang/sq-AL.rc
+++ b/base/applications/sndvol32/lang/sq-AL.rc
@@ -25,6 +25,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Kontroll Volumi"
IDS_NOMIXERDEVICES "Nuk ka pajisje aktive mikseri ne dispozicion! Programi tani
do te dale."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/sv-SE.rc
b/base/applications/sndvol32/lang/sv-SE.rc
index d7af170874..c91e57a47d 100644
--- a/base/applications/sndvol32/lang/sv-SE.rc
+++ b/base/applications/sndvol32/lang/sv-SE.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Volymkontroll"
IDS_NOMIXERDEVICES "Det finns inga ljudmixningsenheter tillgängliga! Programmet
kommer nu att avslutas."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/th-TH.rc
b/base/applications/sndvol32/lang/th-TH.rc
index 956fc6f002..3aab609547 100644
--- a/base/applications/sndvol32/lang/th-TH.rc
+++ b/base/applications/sndvol32/lang/th-TH.rc
@@ -29,6 +29,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "แผงควบคุมระบบเสียง"
IDS_NOMIXERDEVICES "ไม่พบอุปกรณ์ผสมเสียงใดๆเหลืออยู่เลย!
โปรแกรมนี้จะถูกปิดทันที"
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/tr-TR.rc
b/base/applications/sndvol32/lang/tr-TR.rc
index a516c104b6..a1ffaa4a88 100644
--- a/base/applications/sndvol32/lang/tr-TR.rc
+++ b/base/applications/sndvol32/lang/tr-TR.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Ses Düzeyi Denetimi"
IDS_NOMIXERDEVICES "Burada etkin karıştırıcı aygıt yok. Uygulama şimdi
çıkacak."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/uk-UA.rc
b/base/applications/sndvol32/lang/uk-UA.rc
index 6e3d029471..b887b77e28 100644
--- a/base/applications/sndvol32/lang/uk-UA.rc
+++ b/base/applications/sndvol32/lang/uk-UA.rc
@@ -29,6 +29,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "Регулятор гучності"
IDS_NOMIXERDEVICES "Активні пристрої-мікшери недоступні! Додаток закінчує
роботу."
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/zh-CN.rc
b/base/applications/sndvol32/lang/zh-CN.rc
index bdf7864c98..da632544fa 100644
--- a/base/applications/sndvol32/lang/zh-CN.rc
+++ b/base/applications/sndvol32/lang/zh-CN.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "音量控制"
IDS_NOMIXERDEVICES "没有可用的混音器设备!程序即将退出。"
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/lang/zh-TW.rc
b/base/applications/sndvol32/lang/zh-TW.rc
index c91d7c89fa..5f0e3b1d7a 100644
--- a/base/applications/sndvol32/lang/zh-TW.rc
+++ b/base/applications/sndvol32/lang/zh-TW.rc
@@ -23,6 +23,10 @@ STRINGTABLE
BEGIN
IDS_SNDVOL32 "音量控制"
IDS_NOMIXERDEVICES "沒有可用的混音器設備!這個程式即將結束。"
+ IDS_SELECT "&Select"
+ IDS_ADVANCED_CONTROLS "Advanced Controls for %s"
+ IDS_OTHER_CONTROLS1 "&1 %s"
+ IDS_OTHER_CONTROLS2 "&2 %s"
END
IDD_PREFERENCES DIALOGEX 0, 0, 224, 250
diff --git a/base/applications/sndvol32/mixer.c b/base/applications/sndvol32/mixer.c
index 147d3c4f58..cd1dcc1bf3 100644
--- a/base/applications/sndvol32/mixer.c
+++ b/base/applications/sndvol32/mixer.c
@@ -610,3 +610,41 @@ SndMixerIsDisplayControl(PSND_MIXER Mixer,
return FALSE;
}
+
+LPMIXERLINE
+SndMixerGetLineByName(PSND_MIXER Mixer,
+ DWORD LineID,
+ LPWSTR LineName)
+{
+ PSND_MIXER_DESTINATION Line;
+ PSND_MIXER_CONNECTION Connection;
+
+ if (Mixer->hmx == 0)
+ return NULL;
+
+ for (Line = Mixer->Lines; Line != NULL; Line = Line->Next)
+ {
+ if (Line->Info.dwLineID == LineID)
+ {
+ if (Line->DisplayControls != 0)
+ {
+ if (wcsicmp(Line->Info.szName, LineName) == 0)
+ {
+ return &Line->Info;
+ }
+ }
+
+ for (Connection = Line->Connections; Connection != NULL; Connection =
Connection->Next)
+ {
+ if (wcsicmp(Connection->Info.szName, LineName) == 0)
+ {
+ return &Connection->Info;
+ }
+ }
+
+ return NULL;
+ }
+ }
+
+ return NULL;
+}
\ No newline at end of file
diff --git a/base/applications/sndvol32/resources.h
b/base/applications/sndvol32/resources.h
index eaa0585221..952e19b885 100644
--- a/base/applications/sndvol32/resources.h
+++ b/base/applications/sndvol32/resources.h
@@ -38,8 +38,12 @@
#define IDC_ADV_OTHER_CHECK1 1029
#define IDC_ADV_OTHER_CHECK2 1030
-#define IDS_SNDVOL32 100
-#define IDS_NOMIXERDEVICES 101
+#define IDS_SNDVOL32 100
+#define IDS_NOMIXERDEVICES 101
+#define IDS_SELECT 102
+#define IDS_ADVANCED_CONTROLS 103
+#define IDS_OTHER_CONTROLS1 104
+#define IDS_OTHER_CONTROLS2 105
#define IDD_NORMAL_MASTER 200
#define IDD_NORMAL_LINE 201
diff --git a/base/applications/sndvol32/sndvol32.c
b/base/applications/sndvol32/sndvol32.c
index ada7debff4..8398151ed0 100644
--- a/base/applications/sndvol32/sndvol32.c
+++ b/base/applications/sndvol32/sndvol32.c
@@ -591,56 +591,6 @@ DlgPreferencesProc(HWND hwndDlg,
return 0;
}
-
-static
-INT_PTR
-CALLBACK
-AdvancedDlgProc(
- HWND hwndDlg,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam)
-{
- switch (uMsg)
- {
- case WM_INITDIALOG:
- /* FIXME: Update the dialog title */
-
- /* Disable the tone controls */
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADV_BASS_LOW), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADV_BASS_HIGH), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADV_BASS_SLIDER), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADV_TREBLE_LOW), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADV_TREBLE_HIGH), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADV_TREBLE_SLIDER), FALSE);
-
- /* Hide the other controls */
- ShowWindow(GetDlgItem(hwndDlg, IDC_ADV_OTHER_CONTROLS), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg, IDC_ADV_OTHER_TEXT), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg, IDC_ADV_OTHER_CHECK1), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg, IDC_ADV_OTHER_CHECK2), SW_HIDE);
-
- /* FIXME */
- return TRUE;
-
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDOK:
- EndDialog(hwndDlg, IDOK);
- break;
- }
- break;
-
- case WM_CLOSE:
- EndDialog(hwndDlg, IDCANCEL);
- break;
- }
-
- return FALSE;
-}
-
-
/******************************************************************************/
static VOID
@@ -1064,13 +1014,29 @@ MainWindowProc(HWND hwnd,
}
else if (CtrlID % IDC_LINE_ADVANCED == 0)
{
- if (DialogBoxParam(hAppInstance,
- MAKEINTRESOURCE(IDD_ADVANCED),
- hwnd,
- AdvancedDlgProc,
- (LPARAM)NULL) == IDOK)
- {
+ ADVANCED_CONTEXT AdvancedContext;
+
+ /* compute line offset */
+ LineOffset = CtrlID / IDC_LINE_ADVANCED;
+
+ /* compute window id of line name static control */
+ CtrlID = LineOffset * IDC_LINE_NAME;
+ /* get line name */
+ if (GetDlgItemTextW(hwnd, CtrlID, AdvancedContext.LineName,
MIXER_LONG_NAME_CHARS) != 0)
+ {
+ AdvancedContext.Mixer =
Preferences.MixerWindow->Mixer;
+ AdvancedContext.Line =
SndMixerGetLineByName(Preferences.MixerWindow->Mixer,
+
Preferences.SelectedLine,
+
AdvancedContext.LineName);
+ if (AdvancedContext.Line)
+ {
+ DialogBoxParam(hAppInstance,
+ MAKEINTRESOURCE(IDD_ADVANCED),
+ hwnd,
+ AdvancedDlgProc,
+ (LPARAM)&AdvancedContext);
+ }
}
}
}
diff --git a/base/applications/sndvol32/sndvol32.h
b/base/applications/sndvol32/sndvol32.h
index 201e4f0e18..e324584bc4 100644
--- a/base/applications/sndvol32/sndvol32.h
+++ b/base/applications/sndvol32/sndvol32.h
@@ -10,6 +10,7 @@
#include <mmsystem.h>
#include <commctrl.h>
#include <tchar.h>
+#include <strsafe.h>
#include <assert.h>
#include "resources.h"
@@ -123,6 +124,14 @@ typedef struct _SET_VOLUME_CONTEXT
BOOL bSwitch;
} SET_VOLUME_CONTEXT, *PSET_VOLUME_CONTEXT;
+typedef struct _ADVANCED_CONTEXT
+{
+ WCHAR LineName[MIXER_LONG_NAME_CHARS];
+ PSND_MIXER Mixer;
+ LPMIXERLINE Line;
+} ADVANCED_CONTEXT, *PADVANCED_CONTEXT;
+
+
/* NOTE: do NOT modify SNDVOL_REG_LINESTATE for binary compatibility with XP! */
typedef struct _SNDVOL_REG_LINESTATE
{
@@ -150,6 +159,18 @@ BOOL SndMixerEnumLines(PSND_MIXER Mixer, PFNSNDMIXENUMLINES EnumProc,
PVOID Cont
BOOL SndMixerEnumConnections(PSND_MIXER Mixer, DWORD LineID, PFNSNDMIXENUMCONNECTIONS
EnumProc, PVOID Context);
BOOL SndMixerIsDisplayControl(PSND_MIXER Mixer, LPMIXERCONTROL Control);
BOOL SndMixerQueryControls(PSND_MIXER Mixer, PUINT DisplayControls, LPMIXERLINE LineInfo,
LPMIXERCONTROL *Controls);
+LPMIXERLINE SndMixerGetLineByName(PSND_MIXER Mixer, DWORD LineID, LPWSTR LineName);
+
+/* advanced.c */
+
+INT_PTR
+CALLBACK
+AdvancedDlgProc(
+ HWND hwndDlg,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam);
+
/*
* dialog.c