diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-01-16 18:38:18 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-01-16 18:38:18 +0000 |
commit | 13757ca8746dd25c01edde8f1a299500a3a3bfea (patch) | |
tree | 599de8d738a0aefb9453e598707e5c98b3da26fc /plugins | |
parent | 2e91bcd93a07427adbf3dd666708702611ac5c3e (diff) |
started frame creation (not working yet)
git-svn-id: http://svn.miranda-ng.org/main/trunk@3119 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/BASS_interface/src/Bass_interface.h | 16 | ||||
-rw-r--r-- | plugins/BASS_interface/src/Main.cpp | 38 |
2 files changed, 43 insertions, 11 deletions
diff --git a/plugins/BASS_interface/src/Bass_interface.h b/plugins/BASS_interface/src/Bass_interface.h index 61c3f367fd..07c60e8c1e 100644 --- a/plugins/BASS_interface/src/Bass_interface.h +++ b/plugins/BASS_interface/src/Bass_interface.h @@ -5,18 +5,18 @@ Copyright (C) 2010, 2011 tico-tico #ifndef __BASS_INTERFACE_H__
#define __BASS_INTERFACE_H__
-#define MIRANDA_VER 0x0A00
-
#include <windows.h>
+#include <commctrl.h>
+
#include <newpluginapi.h>
#include <m_langpack.h>
#include <m_skin.h>
#include <m_database.h>
#include <m_options.h>
-#include <m_clist.h>
#include <win2k.h>
-#include <m_icolib.h>
-#include <commctrl.h>
+//#include <m_icolib.h>
+#include <m_cluiframes.h>
+#include <m_clui.h>
#include "m_toptoolbar.h"
@@ -26,11 +26,7 @@ Copyright (C) 2010, 2011 tico-tico #define BASSDEF(f) (WINAPI *f)
#include "bass.h"
-#if defined( _UNICODE )
- #define BASS_TCHAR BASS_UNICODE
-#else
- #define BASS_TCHAR 0
-#endif
+#define BASS_TCHAR BASS_UNICODE
#define LOADBASSFUNCTION(f) (*((void**)&f)=(void*)GetProcAddress(hBass,#f))
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index da170979b1..66926e36f4 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -17,7 +17,7 @@ PLUGININFOEX pluginInfo = { __COPYRIGHT,
__AUTHORWEB,
UNICODE_AWARE,
- //2f07ea05-05b5-4ff0-875d-c590da2ddac1
+ // 2f07ea05-05b5-4ff0-875d-c590da2ddac1
{0x2f07ea05, 0x05b5, 0x4ff0, {0x87, 0x5d, 0xc5, 0x90, 0xda, 0x2d, 0xda, 0xc1}}
};
@@ -358,6 +358,41 @@ int OnToolbarLoaded(WPARAM wParam, LPARAM lParam) return 0;
}
+LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ return TRUE;
+}
+
+void CreateFrame()
+{
+ if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
+ return;
+
+ WNDCLASS wndclass;
+ wndclass.style = 0;
+ wndclass.lpfnWndProc = FrameWindowProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = hInst;
+ wndclass.hIcon = NULL;
+ wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndclass.hbrBackground = 0;
+ wndclass.lpszMenuName = NULL;
+ wndclass.lpszClassName = _T("BassInterfaceFrame");
+ RegisterClass(&wndclass);
+
+ HWND hwnd_plugin = CreateWindow(_T("BassInterfaceFrame"), TranslateT("Bass Interface"),
+ WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, (HWND)CallService(MS_CLUI_GETHWND, 0, 0), NULL, hInst, NULL);
+
+ CLISTFrame Frame = { sizeof(CLISTFrame) };
+ Frame.tname = TranslateT("Bass Interface");
+ Frame.hWnd = hwnd_plugin;
+ Frame.align = alBottom;
+ Frame.Flags = F_TCHAR | F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
+ Frame.height = 30;
+ DWORD frame_id = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+}
+
int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv = {0};
@@ -414,6 +449,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) Volume = DBGetContactSettingByte(NULL, ModuleName, OPT_VOLUME, 33);
BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume * 100 );
HookEvent(ME_SKIN_PLAYINGSOUND, OnPlaySnd);
+ CreateFrame();
}
else
{
|