minor fixes

svn path=/trunk/; revision=18116
This commit is contained in:
Thomas Bluemel 2005-09-27 01:48:49 +00:00
parent 7c58d9be05
commit bfcd1fab3c

View file

@ -51,6 +51,8 @@ typedef struct _PREFERENCES_CONTEXT
DWORD PlaybackID; DWORD PlaybackID;
DWORD RecordingID; DWORD RecordingID;
UINT OtherLines; UINT OtherLines;
DWORD tmp;
} PREFERENCES_CONTEXT, *PPREFERENCES_CONTEXT; } PREFERENCES_CONTEXT, *PPREFERENCES_CONTEXT;
typedef struct _PREFERENCES_FILL_DEVICES typedef struct _PREFERENCES_FILL_DEVICES
@ -173,20 +175,34 @@ PrefDlgAddConnection(PSND_MIXER Mixer,
PVOID Context) PVOID Context)
{ {
PPREFERENCES_CONTEXT PrefContext = (PPREFERENCES_CONTEXT)Context; PPREFERENCES_CONTEXT PrefContext = (PPREFERENCES_CONTEXT)Context;
HWND hwndControls;
LVITEM lvi; LVITEM lvi;
UINT i;
lvi.mask = LVIF_TEXT | LVIF_PARAM; if (Line->cControls != 0)
lvi.iItem = 0; {
lvi.iSubItem = 0; hwndControls = GetDlgItem(PrefContext->hwndDlg,
lvi.pszText = Line->szName; IDC_CONTROLS);
lvi.lParam = (LPARAM)Line->dwSource;
SendMessage(GetDlgItem(PrefContext->hwndDlg,
IDC_CONTROLS),
LVM_INSERTITEM,
0,
(LPARAM)&lvi);
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.iItem = PrefContext->tmp++;
lvi.iSubItem = 0;
lvi.pszText = Line->szName;
lvi.lParam = (LPARAM)Line->dwSource;
i = SendMessage(hwndControls,
LVM_INSERTITEM,
0,
(LPARAM)&lvi);
if (i != (UINT)-1)
{
/* FIXME - read config from registry */
ListView_SetCheckState(hwndControls,
i,
FALSE);
}
}
return TRUE; return TRUE;
} }
@ -263,6 +279,9 @@ UpdatePrefDlgControls(PPREFERENCES_CONTEXT Context,
} }
EnableWindow(GetDlgItem(Context->hwndDlg, EnableWindow(GetDlgItem(Context->hwndDlg,
IDC_LINE), IDC_LINE),
FALSE);
EnableWindow(GetDlgItem(Context->hwndDlg,
IDC_OTHER),
Context->OtherLines != 0); Context->OtherLines != 0);
CheckDlgButton(Context->hwndDlg, CheckDlgButton(Context->hwndDlg,
IDC_LINE, IDC_LINE,
@ -289,6 +308,7 @@ UpdatePrefDlgControls(PPREFERENCES_CONTEXT Context,
ListView_DeleteAllItems(GetDlgItem(Context->hwndDlg, ListView_DeleteAllItems(GetDlgItem(Context->hwndDlg,
IDC_CONTROLS)); IDC_CONTROLS));
Context->tmp = 0;
SndMixerEnumConnections(Context->Mixer, SndMixerEnumConnections(Context->Mixer,
LineID, LineID,
PrefDlgAddConnection, PrefDlgAddConnection,
@ -326,8 +346,27 @@ DlgPreferencesProc(HWND hwndDlg,
{ {
if (HIWORD(wParam) == CBN_SELCHANGE) if (HIWORD(wParam) == CBN_SELCHANGE)
{ {
UpdatePrefDlgControls(Context, DWORD LineID;
(DWORD)-1); DWORD Index;
Index = SendMessage(GetDlgItem(hwndDlg,
IDC_LINE),
CB_GETCURSEL,
0,
0);
if (Index != CB_ERR)
{
LineID = SendMessage(GetDlgItem(hwndDlg,
IDC_LINE),
CB_GETITEMDATA,
Index,
0);
if (LineID != CB_ERR)
{
UpdatePrefDlgControls(Context,
LineID);
}
}
} }
break; break;
} }
@ -336,6 +375,9 @@ DlgPreferencesProc(HWND hwndDlg,
{ {
UpdatePrefDlgControls(Context, UpdatePrefDlgControls(Context,
Context->PlaybackID); Context->PlaybackID);
EnableWindow(GetDlgItem(hwndDlg,
IDC_LINE),
FALSE);
break; break;
} }
@ -343,6 +385,9 @@ DlgPreferencesProc(HWND hwndDlg,
{ {
UpdatePrefDlgControls(Context, UpdatePrefDlgControls(Context,
Context->RecordingID); Context->RecordingID);
EnableWindow(GetDlgItem(hwndDlg,
IDC_LINE),
FALSE);
break; break;
} }
@ -350,19 +395,23 @@ DlgPreferencesProc(HWND hwndDlg,
{ {
INT LineCbIndex; INT LineCbIndex;
DWORD LineID; DWORD LineID;
EnableWindow(GetDlgItem(hwndDlg,
IDC_LINE),
TRUE);
LineCbIndex = SendMessage(GetDlgItem(Context->hwndDlg, LineCbIndex = SendDlgItemMessage(hwndDlg,
IDC_MIXERDEVICE), IDC_LINE,
CB_GETCURSEL, CB_GETCURSEL,
0, 0,
0); 0);
if (LineCbIndex != CB_ERR) if (LineCbIndex != CB_ERR)
{ {
LineID = SendMessage(GetDlgItem(Context->hwndDlg, LineID = SendDlgItemMessage(hwndDlg,
IDC_MIXERDEVICE), IDC_LINE,
CB_GETITEMDATA, CB_GETITEMDATA,
LineCbIndex, LineCbIndex,
0); 0);
if (LineID != CB_ERR) if (LineID != CB_ERR)
{ {
UpdatePrefDlgControls(Context, UpdatePrefDlgControls(Context,