summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-01-19 17:22:37 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-01-19 17:22:37 +0000
commitb1632650fe8901cc2270e285172da3897526230c (patch)
tree7caf885971491ddf87c7b012d48ecf7e3ea5f967
parentb4b33384b4bce30863d9d01aa6e0b60f588d281d (diff)
reverted windows.h in resource for compiling in vc2010
button on frame toggle sound slider in frame and in options now syncing git-svn-id: http://svn.miranda-ng.org/main/trunk@3174 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/BASS_interface/res/Bass.rc1
-rw-r--r--plugins/BASS_interface/src/Main.cpp22
2 files changed, 19 insertions, 4 deletions
diff --git a/plugins/BASS_interface/res/Bass.rc b/plugins/BASS_interface/res/Bass.rc
index ee22c0313f..93532048f9 100644
--- a/plugins/BASS_interface/res/Bass.rc
+++ b/plugins/BASS_interface/res/Bass.rc
@@ -1,5 +1,6 @@
// Microsoft Visual C++ generated resource script.
//
+#include <windows.h>
#include <commctrl.h>
#include "..\src\resource.h"
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp
index 65d92c53bc..71580d983b 100644
--- a/plugins/BASS_interface/src/Main.cpp
+++ b/plugins/BASS_interface/src/Main.cpp
@@ -48,7 +48,7 @@ static int device = -1;
static int newBass = 0;
static HWND ClistHWND;
-HWND hwndSlider = NULL, hwndMute = NULL;
+HWND hwndSlider = NULL, hwndMute = NULL, hwndOptSlider = NULL;
static int OnPlaySnd(WPARAM wParam, LPARAM lParam)
{
@@ -119,6 +119,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
SendDlgItemMessage(hwndDlg, IDC_CURRPATH, WM_SETTEXT, 0, (LPARAM)CurrBassPath);
+ hwndOptSlider = GetDlgItem(hwndDlg, IDC_VOLUME);
SendDlgItemMessage(hwndDlg, IDC_VOLUME, TBM_SETRANGE, FALSE, MAKELONG(SLIDER_MIN,SLIDER_MAX));
SendDlgItemMessage(hwndDlg, IDC_VOLUME, TBM_SETPOS, TRUE, Volume);
SendDlgItemMessage(hwndDlg, IDC_VOLUME, TBM_SETPAGESIZE, 0, 5);
@@ -189,7 +190,9 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (hBass != NULL)
if (LOWORD(wParam) == SB_ENDSCROLL || LOWORD(wParam) == SB_THUMBTRACK)
{
- BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, SendDlgItemMessage(hwndDlg, IDC_VOLUME, TBM_GETPOS, 0, 0) * 100);
+ Volume = SendDlgItemMessage(hwndDlg, IDC_VOLUME, TBM_GETPOS, 0, 0);
+ BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume * 100);
+ SendMessage(hwndSlider, TBM_SETPOS, TRUE, Volume);
Preview = TRUE;
if (EnPreview) SkinPlaySound("AlertMsg");
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -375,16 +378,27 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
hwnd, (HMENU)0, (HINSTANCE) GetWindowLongPtr(hwnd, GWL_HINSTANCE), NULL);
SendMessage(hwndSlider, TBM_SETRANGE, FALSE, MAKELONG(SLIDER_MIN, SLIDER_MAX));
SendMessage(hwndSlider, TBM_SETPOS, TRUE, Volume);
- //SendMessage(hwndSlider, TBM_SETPAGESIZE, 0, 5);
+ SendMessage(hwndMute, BUTTONADDTOOLTIP, (WPARAM)Translate("Click to toggle all sounds"), 0);
break;
}
+ case WM_COMMAND:
+ if((HWND)lParam == hwndMute) {
+ int useSound = !db_get_b(NULL, "Skin", "UseSound", 1);
+ db_set_b(NULL, "Skin", "UseSound", useSound);
+ SendMessage(hwndMute, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(useSound ? iconList[0].hIcolib : iconList[1].hIcolib));
+ }
+ break;
+
case WM_HSCROLL:
{
if (hBass != NULL)
if (LOWORD(wParam) == SB_ENDSCROLL || LOWORD(wParam) == SB_THUMBTRACK)
{
- BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, SendMessage(hwndSlider, TBM_GETPOS, 0, 0) * 100);
+ Volume = (DWORD)SendMessage(hwndSlider, TBM_GETPOS, 0, 0);
+ db_set_b(NULL, ModuleName, OPT_VOLUME, Volume);
+ BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume * 100);
+ SendMessage(hwndOptSlider, TBM_SETPOS, TRUE, Volume);
}
break;
}