1
0

RGFactory.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #include "main.h"
  2. #include "RGFactory.h"
  3. #include "Process.h"
  4. static const char serviceName[] = "Replay Gain Processor";
  5. FOURCC RGFactory::GetServiceType()
  6. {
  7. return WaSvc::OBJECT;
  8. }
  9. const char *RGFactory::GetServiceName()
  10. {
  11. return serviceName;
  12. }
  13. GUID RGFactory::GetGUID()
  14. {
  15. return RGGUID;
  16. }
  17. void *RGFactory::GetInterface(int global_lock)
  18. {
  19. obj_replaygain *ifc=new ProcessReplayGain;
  20. // if (global_lock)
  21. // plugin.service->service_lock(this, (void *)ifc);
  22. return ifc;
  23. }
  24. int RGFactory::SupportNonLockingInterface()
  25. {
  26. return 1;
  27. }
  28. int RGFactory::ReleaseInterface(void *ifc)
  29. {
  30. //plugin.service->service_unlock(ifc);
  31. obj_replaygain *api_ = static_cast<obj_replaygain *>(ifc);
  32. ProcessReplayGain *svc_ = static_cast<ProcessReplayGain *>(api_);
  33. delete svc_;
  34. return 1;
  35. }
  36. const char *RGFactory::GetTestString()
  37. {
  38. return 0;
  39. }
  40. int RGFactory::ServiceNotify(int msg, int param1, int param2)
  41. {
  42. return 1;
  43. }
  44. #ifdef CBCLASS
  45. #undef CBCLASS
  46. #endif
  47. #define CBCLASS RGFactory
  48. START_DISPATCH;
  49. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  50. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  51. CB(WASERVICEFACTORY_GETGUID, GetGUID)
  52. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  53. CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
  54. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  55. CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
  56. CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
  57. END_DISPATCH;