summaryrefslogtreecommitdiff
path: root/plugins/BASS_interface/src
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-01-19 15:44:14 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-01-19 15:44:14 +0000
commit757be86f9884f7f6e35ebfcd2f1e6be163348eef (patch)
treeb2f54002dd262eb5779d0f7bc924b36acabdacda /plugins/BASS_interface/src
parent9aabfddcc0f179ffbbd3f9b45164cefa5cce18c6 (diff)
added slider
git-svn-id: http://svn.miranda-ng.org/main/trunk@3172 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BASS_interface/src')
-rw-r--r--plugins/BASS_interface/src/Bass_interface.h1
-rw-r--r--plugins/BASS_interface/src/Main.cpp43
2 files changed, 43 insertions, 1 deletions
diff --git a/plugins/BASS_interface/src/Bass_interface.h b/plugins/BASS_interface/src/Bass_interface.h
index 0d76a9d9d4..677dc95a69 100644
--- a/plugins/BASS_interface/src/Bass_interface.h
+++ b/plugins/BASS_interface/src/Bass_interface.h
@@ -17,6 +17,7 @@ Copyright (C) 2010, 2011 tico-tico
#include <m_cluiframes.h>
#include <m_clui.h>
#include <m_fontservice.h>
+#include <m_button.h>
#include "m_toptoolbar.h"
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp
index 30c9fe2910..65d92c53bc 100644
--- a/plugins/BASS_interface/src/Main.cpp
+++ b/plugins/BASS_interface/src/Main.cpp
@@ -48,6 +48,8 @@ static int device = -1;
static int newBass = 0;
static HWND ClistHWND;
+HWND hwndSlider = NULL, hwndMute = NULL;
+
static int OnPlaySnd(WPARAM wParam, LPARAM lParam)
{
TCHAR* ptszFile = (TCHAR*) lParam; SYSTEMTIME systime; WORD currtime, currstat; BOOL doPlay = TRUE;
@@ -362,6 +364,45 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
{
switch(msg)
{
+ case WM_CREATE:
+ {
+ hwndMute = CreateWindow(MIRANDABUTTONCLASS, _T(""), WS_CHILD | WS_VISIBLE, 1, 1,
+ 20, 20, hwnd, (HMENU)0, (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), NULL);
+ SendMessage(hwndMute, BUTTONSETASFLATBTN,0,0);
+ SendMessage(hwndMute, BM_SETIMAGE,IMAGE_ICON,(LPARAM)iconList[0].hIcolib);
+
+ hwndSlider = CreateWindow(TRACKBAR_CLASS, _T(""), WS_CHILD | WS_VISIBLE | TBS_NOTICKS | TBS_TOOLTIPS, 21, 1, 100, 20,
+ 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);
+ 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);
+ }
+ break;
+ }
+
+ case WM_SIZE:
+ {
+ RECT rect;
+
+ GetClientRect(hwnd,&rect);
+ if(hwndMute)
+ MoveWindow(hwndMute, 1, 1, 20, 20, FALSE);
+ SetWindowPos(hwndSlider, 0,
+ rect.left+20+1, rect.top+1+ (20-18)/2, rect.right-rect.left-3-20, 18,
+ SWP_NOZORDER);
+ InvalidateRect(hwnd, &rect, FALSE);
+ return 0;
+ }
+
case WM_PAINT:
{
RECT r;
@@ -416,7 +457,7 @@ void CreateFrame()
Frame.hWnd = hwnd_plugin;
Frame.align = alBottom;
Frame.Flags = F_TCHAR | F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
- Frame.height = 30;
+ Frame.height = 22;
DWORD frame_id = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
ColourIDT colourid = {0};