aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/SDK/ml_xmlex/main.cpp
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/SDK/ml_xmlex/main.cpp
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Plugins/SDK/ml_xmlex/main.cpp')
-rw-r--r--Src/Plugins/SDK/ml_xmlex/main.cpp69
1 files changed, 69 insertions, 0 deletions
diff --git a/Src/Plugins/SDK/ml_xmlex/main.cpp b/Src/Plugins/SDK/ml_xmlex/main.cpp
new file mode 100644
index 00000000..bc0f69e4
--- /dev/null
+++ b/Src/Plugins/SDK/ml_xmlex/main.cpp
@@ -0,0 +1,69 @@
+#include "main.h"
+#include "../Winamp/wa_ipc.h"
+#include "resource.h"
+#include "api.h"
+#include "../nu/AutoWide.h"
+#include "../nu/AutoChar.h"
+#include <strsafe.h>
+#include "..\..\General\gen_ml\menu.h"
+#include "..\..\General\gen_ml\ml_ipc_0313.h"
+
+#define PLUGIN_VERSION L"1.1"
+
+int Init();
+void Quit();
+UINT_PTR xmlex_treeItem = 0;
+api_service *serviceManager = 0;
+
+EXTERN_C winampMediaLibraryPlugin plugin =
+{
+ MLHDR_VER,
+ "Nullsoft XML Reader",
+ Init,
+ Quit,
+ xmlex_pluginMessageProc,
+ 0,
+ 0,
+ 0,
+};
+
+int Init()
+{
+ //starting point for wasabi, where services are shared
+ WASABI_API_SVC = (api_service *)SendMessage(plugin.hwndWinampParent, WM_WA_IPC, 0, IPC_GET_API_SERVICE);
+
+ // waServiceFactory *sf = plugin.service->service_getServiceByGuid(languageApiGUID);
+ // if (sf) WASABI_API_LNG = reinterpret_cast<api_language*>(sf->getInterface());
+
+ // wasabi based services for localisation support
+ // api_language* WASABI_API_LNG = 0;
+ // HINSTANCE WASABI_API_LNG_HINST = 0, WASABI_API_ORIG_HINST = 0;
+
+ // need to have this initialised before we try to do anything with localisation features
+ // WASABI_API_START_LANG(plugin.hDllInstance,MlImpexLangGUID);
+
+ // static wchar_t szDescription[256];
+ // StringCchPrintf(szDescription, ARRAYSIZE(szDescription),
+ // WASABI_API_LNGSTRINGW(IDS_NULLSOFT_XMLEX), PLUGIN_VERSION);
+ // plugin.description = (char*)szDescription;
+
+ //set up tree item, gen_ml will call xmlex_pluginMessageProc if/when the treeview item gets selected
+ MLTREEITEMW newTree;
+ newTree.size = sizeof(MLTREEITEMW);
+ newTree.parentId = 0;
+ newTree.title = L"XML Example";
+ newTree.hasChildren = 0;
+ newTree.id = 0;
+ SendMessage(plugin.hwndLibraryParent, WM_ML_IPC, (WPARAM) &newTree, ML_IPC_TREEITEM_ADDW);
+ xmlex_treeItem = newTree.id;
+ return 0; // 0 for success. returning non-zero will cause gen_ml to abort loading your plugin
+}
+
+void Quit()
+{
+}
+
+extern "C" __declspec(dllexport) winampMediaLibraryPlugin *winampGetMediaLibraryPlugin()
+{
+ return &plugin;
+} \ No newline at end of file