1
0

Wasabi.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef NULLSOFT_API_H
  2. #define NULLSOFT_API_H
  3. #include "api/service/api_service.h"
  4. extern api_service *serviceManager;
  5. #define WASABI_API_SVC serviceManager
  6. #include "api/service/waservicefactory.h"
  7. #include "Agave/Config/api_config.h"
  8. extern api_config *configApi;
  9. #define AGAVE_API_CONFIG configApi
  10. #include "api/memmgr/api_memmgr.h"
  11. extern api_memmgr *memmgr;
  12. #define WASABI_API_MEMMGR memmgr
  13. #include "Agave/Language/api_language.h"
  14. #include "Agave/AlbumArt/svc_albumArtProvider.h"
  15. template <class api_T>
  16. static void ServiceBuild(api_T *&api_t, GUID factoryGUID_t)
  17. {
  18. if (WASABI_API_SVC)
  19. {
  20. waServiceFactory *factory = WASABI_API_SVC->service_getServiceByGuid(factoryGUID_t);
  21. if (factory)
  22. api_t = (api_T *)factory->getInterface();
  23. }
  24. }
  25. template <class api_T>
  26. static void ServiceRelease(api_T *api_t, GUID factoryGUID_t)
  27. {
  28. if (WASABI_API_SVC)
  29. {
  30. waServiceFactory *factory = WASABI_API_SVC->service_getServiceByGuid(factoryGUID_t);
  31. if (factory)
  32. factory->releaseInterface(api_t);
  33. }
  34. }
  35. class AlbumArtFactory : public waServiceFactory
  36. {
  37. public:
  38. FOURCC GetServiceType();
  39. const char *GetServiceName();
  40. GUID GetGUID();
  41. void *GetInterface(int global_lock);
  42. int SupportNonLockingInterface();
  43. int ReleaseInterface(void *ifc);
  44. const char *GetTestString();
  45. int ServiceNotify(int msg, int param1, int param2);
  46. protected:
  47. RECVS_DISPATCH;
  48. };
  49. extern AlbumArtFactory albumArtFactory;
  50. // {B6CB4A7C-A8D0-4c55-8E60-9F7A7A23DA0F}
  51. static const GUID playbackConfigGroupGUID =
  52. { 0xb6cb4a7c, 0xa8d0, 0x4c55, { 0x8e, 0x60, 0x9f, 0x7a, 0x7a, 0x23, 0xda, 0xf } };
  53. #endif