summaryrefslogtreecommitdiff
path: root/plugins/Watrack_MPD/src/init.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-17 17:09:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-17 17:09:50 +0300
commitbce8bc74daf1c5f510404c8bdf956b41fb1c10fc (patch)
tree9879ad5ce5f42087558601af6a6f2827d7df4c39 /plugins/Watrack_MPD/src/init.cpp
parentba1083b4da33ca44a5ae7d90eabbe3d6d340a81e (diff)
WinterSpeak, WhoUsesMyFiles, WhenWasIt, wbOSD, Watrack_MPD -> CMPlugin
Diffstat (limited to 'plugins/Watrack_MPD/src/init.cpp')
-rwxr-xr-xplugins/Watrack_MPD/src/init.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/plugins/Watrack_MPD/src/init.cpp b/plugins/Watrack_MPD/src/init.cpp
index 9d28c299ff..b764322a32 100755
--- a/plugins/Watrack_MPD/src/init.cpp
+++ b/plugins/Watrack_MPD/src/init.cpp
@@ -16,14 +16,18 @@
#include "stdafx.h"
-HINSTANCE hInst;
+int hLangpack;
+CMPlugin g_plugin;
+
BOOL bWatrackService = FALSE;
-int hLangpack = 0;
wchar_t *gbHost, *gbPassword;
WORD gbPort;
HNETLIBUSER ghNetlibUser;
-PLUGININFOEX pluginInfo={
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfo =
+{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -33,26 +37,15 @@ PLUGININFOEX pluginInfo={
__AUTHORWEB,
UNICODE_AWARE,
// 692E87D0-6C71-4CDC-9E36-2B69FBDC4C
- {0x692e87d0, 0x6c71, 0x4cdc, {0x9e, 0x36, 0x2b, 0x2d, 0x69, 0xfb, 0xdc, 0x4c}}
+ { 0x692e87d0, 0x6c71, 0x4cdc, {0x9e, 0x36, 0x2b, 0x2d, 0x69, 0xfb, 0xdc, 0x4c }}
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- hInst = hinstDLL;
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
-void InitVars()
-{
- gbPort = db_get_w(NULL, szModuleName, "Port", 6600);
- gbHost = UniGetContactSettingUtf(NULL, szModuleName, "Server", L"127.0.0.1");
- gbPassword = UniGetContactSettingUtf(NULL, szModuleName, "Password", L"");
-}
+/////////////////////////////////////////////////////////////////////////////////////////
static int OnModulesLoaded(WPARAM, LPARAM)
{
@@ -61,11 +54,15 @@ static int OnModulesLoaded(WPARAM, LPARAM)
nlu.szDescriptiveName.w = TranslateT("Watrack MPD connection");
nlu.szSettingsModule = __PLUGIN_NAME;
ghNetlibUser = Netlib_RegisterUser(&nlu);
- InitVars();
+
+ gbPort = db_get_w(NULL, szModuleName, "Port", 6600);
+ gbHost = UniGetContactSettingUtf(NULL, szModuleName, "Server", L"127.0.0.1");
+ gbPassword = UniGetContactSettingUtf(NULL, szModuleName, "Password", L"");
+
if (ServiceExists(MS_WAT_PLAYER))
bWatrackService = TRUE;
- RegisterPlayer();
+ RegisterPlayer();
return 0;
}
@@ -78,6 +75,8 @@ extern "C" __declspec(dllexport) int Load()
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
mir_free(gbHost);