diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/timer/Factory.cpp | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/timer/Factory.cpp')
-rw-r--r-- | Src/timer/Factory.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Src/timer/Factory.cpp b/Src/timer/Factory.cpp new file mode 100644 index 00000000..104f844f --- /dev/null +++ b/Src/timer/Factory.cpp @@ -0,0 +1,69 @@ +#include "Factory.h" +#include "api.h" +#include "timerapi.h" + +TimerApi *timer_svc = 0; +static const char serviceName[] = "Timer Service"; + +void Factory::Stop() +{ + delete timer_svc; + timer_svc=0; +} +FOURCC Factory::GetServiceType() +{ + return WaSvc::UNIQUE; +} + +const char *Factory::GetServiceName() +{ + return serviceName; +} + +GUID Factory::GetGUID() +{ + return timerApiServiceGuid; +} + +void *Factory::GetInterface(int global_lock) +{ + if (!timer_svc) + timer_svc = new TimerApi; +// if (global_lock) +// WASABI_API_SVC->service_lock(this, (void *)ifc); + return timer_svc; +} + +int Factory::SupportNonLockingInterface() +{ + return 1; +} + +int Factory::ReleaseInterface(void *ifc) +{ + //WASABI_API_SVC->service_unlock(ifc); + return 1; +} + +const char *Factory::GetTestString() +{ + return 0; +} + +int Factory::ServiceNotify(int msg, int param1, int param2) +{ + return 1; +} + +#define CBCLASS Factory +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; +#undef CBCLASS
\ No newline at end of file |