Minor changes

This commit is contained in:
Birunthan Mohanathas 2012-05-05 19:37:55 +03:00
parent 4c9133d28f
commit f62377d5dc
3 changed files with 5 additions and 8 deletions

View File

@ -67,8 +67,6 @@ private:
void ModifyTrayIcon(double value); void ModifyTrayIcon(double value);
HICON CreateTrayIcon(double value); HICON CreateTrayIcon(double value);
HICON LoadResourceIcon(LPCWSTR name, bool large = false);
void ShowNotification(TRAY_NOTIFICATION id, const WCHAR* title, const WCHAR* text); void ShowNotification(TRAY_NOTIFICATION id, const WCHAR* title, const WCHAR* text);
HICON m_Icon; HICON m_Icon;

View File

@ -28,7 +28,7 @@
#include "PlayerWMP.h" #include "PlayerWMP.h"
static std::vector<ParentMeasure*> g_ParentMeasures; static std::vector<ParentMeasure*> g_ParentMeasures;
std::wstring g_SettingsFile; bool g_Initialized = false;
HINSTANCE g_Instance = NULL; HINSTANCE g_Instance = NULL;
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
@ -51,10 +51,10 @@ PLUGIN_EXPORT void Initialize(void** data, void* rm)
Measure* measure = new Measure; Measure* measure = new Measure;
*data = measure; *data = measure;
if (g_SettingsFile.empty()) if (!g_Initialized)
{ {
g_SettingsFile = RmGetSettingsFile();
CInternet::Initialize(); CInternet::Initialize();
g_Initialized = true;
} }
} }

View File

@ -21,7 +21,6 @@
#include "CAD/cad_sdk.h" #include "CAD/cad_sdk.h"
CPlayer* CPlayerCAD::c_Player = NULL; CPlayer* CPlayerCAD::c_Player = NULL;
extern std::wstring g_SettingsFile;
extern HINSTANCE g_Instance; extern HINSTANCE g_Instance;
// This player emulates the CD Art Display IPC interface, which is supported by // This player emulates the CD Art Display IPC interface, which is supported by
@ -117,7 +116,7 @@ void CPlayerCAD::Initialize()
} }
WCHAR buffer[MAX_PATH]; WCHAR buffer[MAX_PATH];
LPCTSTR file = g_SettingsFile.c_str(); LPCTSTR file = RmGetSettingsFile();
// Read saved settings // Read saved settings
GetPrivateProfileString(L"NowPlaying.dll", L"ClassName", NULL, buffer, MAX_PATH, file); GetPrivateProfileString(L"NowPlaying.dll", L"ClassName", NULL, buffer, MAX_PATH, file);
@ -363,7 +362,7 @@ LRESULT CALLBACK CPlayerCAD::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
LPCTSTR classSz = className.empty() ? NULL : className.c_str(); LPCTSTR classSz = className.empty() ? NULL : className.c_str();
LPCTSTR windowSz = windowName.empty() ? NULL : windowName.c_str(); LPCTSTR windowSz = windowName.empty() ? NULL : windowName.c_str();
LPCTSTR file = g_SettingsFile.c_str(); LPCTSTR file = RmGetSettingsFile();
WritePrivateProfileString(L"NowPlaying.dll", L"ClassName", classSz, file); WritePrivateProfileString(L"NowPlaying.dll", L"ClassName", classSz, file);
WritePrivateProfileString(L"NowPlaying.dll", L"WindowName", windowSz, file); WritePrivateProfileString(L"NowPlaying.dll", L"WindowName", windowSz, file);