summaryrefslogtreecommitdiff
path: root/plugins/Watrack_MPD/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Watrack_MPD/src')
-rw-r--r--plugins/Watrack_MPD/src/Version.h14
-rwxr-xr-xplugins/Watrack_MPD/src/commonheaders.h23
-rwxr-xr-xplugins/Watrack_MPD/src/constants.h4
-rwxr-xr-xplugins/Watrack_MPD/src/init.cpp28
-rwxr-xr-xplugins/Watrack_MPD/src/main.h24
-rwxr-xr-xplugins/Watrack_MPD/src/resource.h5
-rw-r--r--plugins/Watrack_MPD/src/stdafx.cpp18
-rwxr-xr-xplugins/Watrack_MPD/src/utilities.h2
8 files changed, 54 insertions, 64 deletions
diff --git a/plugins/Watrack_MPD/src/Version.h b/plugins/Watrack_MPD/src/Version.h
new file mode 100644
index 0000000000..c23589187c
--- /dev/null
+++ b/plugins/Watrack_MPD/src/Version.h
@@ -0,0 +1,14 @@
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 0
+#define __RELEASE_NUM 0
+#define __BUILD_NUM 4
+
+#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+
+#define __PLUGIN_NAME "Watrack MPD"
+#define __FILENAME "Watrack_MPD.dll"
+#define __DESCRIPTION "Music Player Daemon support for Watrack."
+#define __AUTHOR "sss"
+#define __AUTHOREMAIL "sss123next@list.ru"
+#define __AUTHORWEB "http://miranda-ng.org/"
+#define __COPYRIGHT "© 2009 sss"
diff --git a/plugins/Watrack_MPD/src/commonheaders.h b/plugins/Watrack_MPD/src/commonheaders.h
index c71f36b977..ebf41e6819 100755
--- a/plugins/Watrack_MPD/src/commonheaders.h
+++ b/plugins/Watrack_MPD/src/commonheaders.h
@@ -19,38 +19,29 @@
#define _CRT_SECURE_NO_WARNINGS
#include <windows.h>
-#include <tchar.h>
-#include <malloc.h>
-#include <time.h>
-#include <uxtheme.h>
-
#include <newpluginapi.h>
#include <m_netlib.h>
-//#include <m_clist.h>
-//#include <m_skin.h>
#include <m_database.h>
-//#include <m_protosvc.h>
-//#include <m_protocols.h>
-//#include <m_system.h>
#include <m_options.h>
#include <m_langpack.h>
-#include "resource.h"
+#include <m_music.h>
-#include "constants.h"
-#include "main.h"
-#include "m_music.h"
+#include "resource.h"
#include "utilities.h"
+#include "Version.h"
+
+#define szModuleName "Watrack_MPD"
extern HINSTANCE hInst;
extern HANDLE ghNetlibUser;
extern BOOL bWatrackService;
extern TCHAR *gbHost, *gbPassword;
extern WORD gbPort;
-
extern char *date();
-extern int WaMpdOptInit(WPARAM wParam,LPARAM lParam);
+
+extern int WaMpdOptInit(WPARAM wParam, LPARAM lParam);
extern void RegisterPlayer();
#endif
diff --git a/plugins/Watrack_MPD/src/constants.h b/plugins/Watrack_MPD/src/constants.h
deleted file mode 100755
index 2ac58a4d43..0000000000
--- a/plugins/Watrack_MPD/src/constants.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef CONSTANTS_H
-#define CONSTANTS_H
-#define szModuleName "Watrack_MPD"
-#endif
diff --git a/plugins/Watrack_MPD/src/init.cpp b/plugins/Watrack_MPD/src/init.cpp
index 13e0b85351..b01745c4dd 100755
--- a/plugins/Watrack_MPD/src/init.cpp
+++ b/plugins/Watrack_MPD/src/init.cpp
@@ -16,8 +16,6 @@
#include "commonheaders.h"
-#define PLUGIN_NAME "Watrack_MPD"
-
HINSTANCE hInst;
BOOL bWatrackService = FALSE;
int hLangpack = 0;
@@ -27,13 +25,13 @@ HANDLE ghNetlibUser;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
- PLUGIN_NAME,
- PLUGIN_MAKE_VERSION(0,0,0,4),
- "Music Player Daemon support for Watrack.",
- "sss, others..",
- "sss123next@list.ru",
- "© 2009 sss, others...",
- "http://sss.chaoslab.ru:81/tracker/mim_plugs/",
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
UNICODE_AWARE,
// 692E87D0-6C71-4CDC-9E36-2B69FBDC4C
{0x692e87d0, 0x6c71, 0x4cdc, {0x9e, 0x36, 0x2b, 0x2d, 0x69, 0xfb, 0xdc, 0x4c}}
@@ -45,7 +43,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return TRUE;
}
-__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfo;
}
@@ -61,15 +59,13 @@ void InitVars()
static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- HANDLE hHookOptionInit;
NETLIBUSER nlu = {0};
nlu.cbSize = sizeof(nlu);
nlu.flags = (NUF_OUTGOING | NUF_HTTPCONNS);
nlu.szDescriptiveName = "Watrack MPD connection";
- nlu.szSettingsModule = PLUGIN_NAME;
+ nlu.szSettingsModule = __PLUGIN_NAME;
ghNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
InitVars();
- hHookOptionInit = HookEvent(ME_OPT_INITIALISE, WaMpdOptInit);
if (ServiceExists("WATrack/Player"))
bWatrackService = TRUE;
RegisterPlayer();
@@ -77,14 +73,16 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
return 0;
}
-int __declspec(dllexport) Load()
+extern "C" __declspec(dllexport) int Load()
{
mir_getLP(&pluginInfo);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ HookEvent(ME_OPT_INITIALISE, WaMpdOptInit);
+
return 0;
}
-int __declspec(dllexport) Unload(void)
+extern "C" __declspec(dllexport) int Unload(void)
{
free(gbHost);
free(gbPassword);
diff --git a/plugins/Watrack_MPD/src/main.h b/plugins/Watrack_MPD/src/main.h
deleted file mode 100755
index 4dcd949c11..0000000000
--- a/plugins/Watrack_MPD/src/main.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright © 2008 sss, chaos.persei
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#ifndef MAIN_H
-#define MAIN_H
-
-//TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, TCHAR* szDef);
-//const TCHAR *stristr( const TCHAR *str, const TCHAR *substr);
-
-#endif
-
-
diff --git a/plugins/Watrack_MPD/src/resource.h b/plugins/Watrack_MPD/src/resource.h
index 15f3d472f1..4999f6c88e 100755
--- a/plugins/Watrack_MPD/src/resource.h
+++ b/plugins/Watrack_MPD/src/resource.h
@@ -2,22 +2,17 @@
// Microsoft Visual C++ generated include file.
// Used by watrack_mpd.rc
//
-#define IDD_OPT_DOS 104
#define IDD_OPT_WA_MPD 104
#define IDC_FOR_ONLINE 1003
#define IDC_MSG_NUMBER 1004
#define IDC_MSG_TEXT 1005
#define IDC_MSG_RATE 1006
#define IDC_ENABLE_CUSTOM_MESSAGE 1007
-#define IDC_FOR_ONLINE2 1008
#define IDC_CLIENT_BASED 1008
-#define IDC_MESSAGE_SIZE 1009
#define IDC_MSG_SIZE 1009
-#define IDC_MSG_SIZE2 1010
#define IDC_CHAR_COUNT 1010
#define IDC_SERVER 1011
#define IDC_PORT 1012
-#define IDC_EDIT3 1013
#define IDC_PASSWORD 1013
// Next default values for new objects
diff --git a/plugins/Watrack_MPD/src/stdafx.cpp b/plugins/Watrack_MPD/src/stdafx.cpp
new file mode 100644
index 0000000000..e7e41dae3c
--- /dev/null
+++ b/plugins/Watrack_MPD/src/stdafx.cpp
@@ -0,0 +1,18 @@
+/*
+Copyright (C) 2012-13 Miranda NG Project (http://miranda-ng.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "commonheaders.h" \ No newline at end of file
diff --git a/plugins/Watrack_MPD/src/utilities.h b/plugins/Watrack_MPD/src/utilities.h
index 8cef30fb25..7bd9dd0830 100755
--- a/plugins/Watrack_MPD/src/utilities.h
+++ b/plugins/Watrack_MPD/src/utilities.h
@@ -1,6 +1,8 @@
#ifndef UTILITIES_H
#define UTILITIES_H
+
HANDLE NetLib_CreateConnection(HANDLE hUser, NETLIBOPENCONNECTION* nloc);
HANDLE CreateThreadEx(pThreadFuncEx AFunc, void* arg, DWORD* pThreadID);
TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, TCHAR* szDef);
+
#endif