aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/SDK/plLoadEx/SimpleHandlerFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Plugins/SDK/plLoadEx/SimpleHandlerFactory.cpp')
-rw-r--r--Src/Plugins/SDK/plLoadEx/SimpleHandlerFactory.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/Src/Plugins/SDK/plLoadEx/SimpleHandlerFactory.cpp b/Src/Plugins/SDK/plLoadEx/SimpleHandlerFactory.cpp
new file mode 100644
index 00000000..4f3ab316
--- /dev/null
+++ b/Src/Plugins/SDK/plLoadEx/SimpleHandlerFactory.cpp
@@ -0,0 +1,56 @@
+#include "SimpleHandlerFactory.h"
+#include "SimpleHandler.h"
+/*
+ This is the GUID for our service factory
+ don't re-use this.
+ make your own guid with guidgen.exe
+ lives somewhere like C:\Program Files\Microsoft Visual Studio\2019\Professional\Common7\Tools
+*/
+
+// {1CCF6445-A452-45e8-BE72-846991CBCAF6}
+static const GUID SimpleHandlerGUID =
+{ 0x1ccf6445, 0xa452, 0x45e8, { 0xbe, 0x72, 0x84, 0x69, 0x91, 0xcb, 0xca, 0xf6 } };
+
+
+// our playlist handler.
+static Cef_Handler simpleHandler;
+
+FOURCC SimpleHandlerFactory::GetServiceType()
+{
+ return svc_playlisthandler::getServiceType();
+}
+
+const char *SimpleHandlerFactory::GetServiceName()
+{
+ return "Simple Playlist Loader";
+}
+
+GUID SimpleHandlerFactory::GetGuid()
+{
+ return SimpleHandlerGUID;
+}
+
+void *SimpleHandlerFactory::GetInterface(int global_lock)
+{
+// simpleHandler is a singleton object, so we can just return a pointer to it
+ // depending on what kind of service you are making, you might have to
+ // 'new' an object and return that instead (and then free it in ReleaseInterface)
+ return &simpleHandler;
+}
+
+int SimpleHandlerFactory::ReleaseInterface(void *ifc)
+{
+ // no-op because we returned a singleton (see above)
+ return 1;
+}
+
+// Define the dispatch table
+#define CBCLASS SimpleHandlerFactory
+START_DISPATCH;
+CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
+CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
+CB(WASERVICEFACTORY_GETGUID, GetGuid)
+CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
+CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
+END_DISPATCH;
+#undef CBCLASS \ No newline at end of file