diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/SDK/plLoadEx/SimpleHandlerFactory.cpp | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/Plugins/SDK/plLoadEx/SimpleHandlerFactory.cpp')
-rw-r--r-- | Src/Plugins/SDK/plLoadEx/SimpleHandlerFactory.cpp | 56 |
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 |