1
0

MetadataFactory.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include "MetadataFactory.h"
  2. #include "api__in_mp3.h"
  3. #include "WasabiMetadata.h"
  4. static const char serviceName[] = "MP3 Stream Metadata Provider";
  5. FOURCC MetadataFactory::GetServiceType()
  6. {
  7. return MP3StreamMetadata::getServiceType();
  8. }
  9. const char *MetadataFactory::GetServiceName()
  10. {
  11. return serviceName;
  12. }
  13. GUID MetadataFactory::GetGUID()
  14. {
  15. return MP3StreamMetadataGUID;
  16. }
  17. void *MetadataFactory::GetInterface(int global_lock)
  18. {
  19. return new MP3StreamMetadata;
  20. }
  21. int MetadataFactory::SupportNonLockingInterface()
  22. {
  23. return 1;
  24. }
  25. int MetadataFactory::ReleaseInterface(void *ifc)
  26. {
  27. //plugin.service->service_unlock(ifc);
  28. svc_metaTag *metadata = static_cast<svc_metaTag *>(ifc);
  29. MP3StreamMetadata *mp3metadata = static_cast<MP3StreamMetadata *>(metadata);
  30. delete mp3metadata;
  31. return 1;
  32. }
  33. const char *MetadataFactory::GetTestString()
  34. {
  35. return 0;
  36. }
  37. int MetadataFactory::ServiceNotify(int msg, int param1, int param2)
  38. {
  39. return 1;
  40. }
  41. #define CBCLASS MetadataFactory
  42. START_DISPATCH;
  43. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  44. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  45. CB(WASERVICEFACTORY_GETGUID, GetGUID)
  46. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  47. CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
  48. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  49. CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
  50. CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
  51. END_DISPATCH;
  52. #undef CBCLASS