aboutsummaryrefslogtreecommitdiff
path: root/Src/xspf/XSPFHandlerFactory.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/xspf/XSPFHandlerFactory.cpp
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/xspf/XSPFHandlerFactory.cpp')
-rw-r--r--Src/xspf/XSPFHandlerFactory.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/Src/xspf/XSPFHandlerFactory.cpp b/Src/xspf/XSPFHandlerFactory.cpp
new file mode 100644
index 00000000..f1a17d3a
--- /dev/null
+++ b/Src/xspf/XSPFHandlerFactory.cpp
@@ -0,0 +1,56 @@
+#include "XSPFHandlerFactory.h"
+#include "XSPFHandler.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 .NET 2003\Common7\Tools\Bin
+*/
+
+// {51D17273-566F-4fa9-AFE0-1345C65B8B1B}
+static const GUID XSPFHandlerGUID =
+{ 0x51d17273, 0x566f, 0x4fa9, { 0xaf, 0xe0, 0x13, 0x45, 0xc6, 0x5b, 0x8b, 0x1b } };
+
+
+// our playlist handler.
+static XSPFHandler xspfHandler;
+
+FOURCC XSPFHandlerFactory::GetServiceType()
+{
+ return svc_playlisthandler::getServiceType();
+}
+
+const char *XSPFHandlerFactory::GetServiceName()
+{
+ return "XSPF Playlist Loader";
+}
+
+GUID XSPFHandlerFactory::GetGuid()
+{
+ return XSPFHandlerGUID;
+}
+
+void *XSPFHandlerFactory::GetInterface(int global_lock)
+{
+ // xspfHandler 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 &xspfHandler;
+}
+
+int XSPFHandlerFactory::ReleaseInterface(void *ifc)
+{
+ // no-op because we returned a singleton (see above)
+ return 1;
+}
+
+// Define the dispatch table
+#define CBCLASS XSPFHandlerFactory
+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