From 944634aed3d3f7849a207b5007c6f8c4d6c2c975 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 27 Jun 2015 20:42:38 +0000 Subject: people are dumb git-svn-id: http://svn.miranda-ng.org/main/trunk@14421 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/BASS_interface/src/Main.cpp | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) (limited to 'plugins/BASS_interface') diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index b9fac56ad3..1c3dbe883b 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -64,7 +64,6 @@ static BOOL QuietTime, Preview, EnPreview; static int Volume; static int device = -1; static int newBass = 0; -static HWND ClistHWND; HWND hwndSlider = NULL, hwndMute = NULL, hwndOptSlider = NULL, hwnd_plugin = NULL; COLORREF clBack = 0; @@ -249,8 +248,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara db_set_b(NULL, ModuleName, OPT_PREVIEW, EnPreview); StatMask = 0; - for (int i = IDC_CHECKBOX10; i > IDC_CHECKBOX1 - 1; i--) - { + for (int i = IDC_CHECKBOX10; i > IDC_CHECKBOX1 - 1; i--) { StatMask <<= 1; if (IsDlgButtonChecked(hwndDlg, i) == BST_CHECKED) StatMask |= 1; @@ -280,11 +278,11 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_QUIETTIME: - { - BOOL b = IsDlgButtonChecked(hwndDlg, IDC_QUIETTIME) == BST_CHECKED; - EnableWindow(GetDlgItem(hwndDlg, IDC_TIME1), b); - EnableWindow(GetDlgItem(hwndDlg, IDC_TIME2), b); - } + { + BOOL b = IsDlgButtonChecked(hwndDlg, IDC_QUIETTIME) == BST_CHECKED; + EnableWindow(GetDlgItem(hwndDlg, IDC_TIME1), b); + EnableWindow(GetDlgItem(hwndDlg, IDC_TIME2), b); + } case IDC_MAXCHANNEL: case IDC_OUTDEVICE: case IDC_CHECKBOX1: @@ -354,6 +352,8 @@ static LRESULT CALLBACK SliderWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM static LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { + RECT rc; + switch (msg) { case WM_CREATE: hwndMute = CreateWindow(MIRANDABUTTONCLASS, _T(""), WS_CHILD | WS_VISIBLE, 1, 1, 16, 16, hwnd, @@ -392,23 +392,17 @@ static LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR break; case WM_SIZE: - { - RECT rect; - GetClientRect(hwnd, &rect); + GetClientRect(hwnd, &rc); if (hwndMute) - MoveWindow(hwndMute, rect.right - 20, 2, 16, 16, FALSE); - SetWindowPos(hwndSlider, 0, 1, rect.top + 1 + (20 - 18) / 2, rect.right - rect.left - 1 - 20, 18, SWP_NOZORDER); - InvalidateRect(hwnd, &rect, FALSE); + MoveWindow(hwndMute, rc.right - 20, 2, 16, 16, FALSE); + SetWindowPos(hwndSlider, 0, 1, rc.top + 1 + (20 - 18) / 2, rc.right - rc.left - 1 - 20, 18, SWP_NOZORDER); + InvalidateRect(hwnd, &rc, FALSE); return 0; - } case WM_ERASEBKGND: - { - RECT rc; GetClientRect(hwnd, &rc); FillRect((HDC)wParam, &rc, hBkgBrush); return TRUE; - } case WM_CTLCOLORSTATIC: if ((HWND)lParam == hwndSlider) { @@ -513,15 +507,14 @@ void LoadBassLibrary(TCHAR CurrBassPath[MAX_PATH]) sndLimSnd = db_get_b(NULL, ModuleName, OPT_MAXCHAN, MAXCHAN); if (sndLimSnd > MAXCHAN) sndLimSnd = MAXCHAN; + TimeWrd1 = db_get_w(NULL, ModuleName, OPT_TIME1, 0); TimeWrd2 = db_get_w(NULL, ModuleName, OPT_TIME2, 0); QuietTime = db_get_b(NULL, ModuleName, OPT_QUIETTIME, 0); EnPreview = db_get_b(NULL, ModuleName, OPT_PREVIEW, 0); - StatMask = db_get_w(NULL, ModuleName, OPT_STATUS, 0x3ff); - ClistHWND = (HWND)CallService("CLUI/GetHwnd", 0, 0); - BASS_Init(device, 44100, 0, ClistHWND, NULL); + BASS_Init(device, 44100, 0, pcli->hwndContactList, NULL); Volume = db_get_b(NULL, ModuleName, OPT_VOLUME, 33); BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume * 100); -- cgit v1.2.3