aboutsummaryrefslogtreecommitdiff
path: root/Src/filereader/ResourceReaderFactory.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/filereader/ResourceReaderFactory.cpp
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/filereader/ResourceReaderFactory.cpp')
-rw-r--r--Src/filereader/ResourceReaderFactory.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/Src/filereader/ResourceReaderFactory.cpp b/Src/filereader/ResourceReaderFactory.cpp
new file mode 100644
index 00000000..ca76c740
--- /dev/null
+++ b/Src/filereader/ResourceReaderFactory.cpp
@@ -0,0 +1,75 @@
+#include "api__filereader.h"
+#include "ResourceReaderFactory.h"
+#include "ResourceReader.h"
+
+static const char serviceName[] = "Resource reader";
+
+// {C975969A-5DFD-4f2b-B767-4EDC6C7D6484}
+static const GUID ResourceReaderGUID =
+{ 0xc975969a, 0x5dfd, 0x4f2b, { 0xb7, 0x67, 0x4e, 0xdc, 0x6c, 0x7d, 0x64, 0x84 } };
+
+
+FOURCC ResourceReaderFactory::GetServiceType()
+{
+ return WaSvc::FILEREADER;
+}
+
+const char *ResourceReaderFactory::GetServiceName()
+{
+ return serviceName;
+}
+
+GUID ResourceReaderFactory::GetGUID()
+{
+ return ResourceReaderGUID;
+}
+
+void *ResourceReaderFactory::GetInterface( int global_lock )
+{
+ ResourceReader *ifc = new ResourceReader;
+
+ if ( global_lock )
+ WASABI_API_SVC->service_lock( this, (void *)ifc );
+
+ return ifc;
+}
+
+int ResourceReaderFactory::SupportNonLockingInterface()
+{
+ return 1;
+}
+
+int ResourceReaderFactory::ReleaseInterface(void *ifc)
+{
+ //WASABI_API_SVC->service_unlock(ifc);
+ svc_fileReader *reader = static_cast<svc_fileReader *>(ifc);
+ ResourceReader *resourceReader = static_cast<ResourceReader *>(reader);
+ delete resourceReader;
+ return 1;
+}
+
+const char *ResourceReaderFactory::GetTestString()
+{
+ return 0;
+}
+
+int ResourceReaderFactory::ServiceNotify(int msg, int param1, int param2)
+{
+ return 1;
+}
+
+#ifdef CBCLASS
+#undef CBCLASS
+#endif
+
+#define CBCLASS ResourceReaderFactory
+START_DISPATCH;
+CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
+CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
+CB(WASERVICEFACTORY_GETGUID, GetGUID)
+CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
+CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
+CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
+CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
+CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
+END_DISPATCH;