factory_Handler.cpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #include "main.h"
  2. #include "api.h"
  3. #include "factory_Handler.h"
  4. #include "PlaylistHandler.h"
  5. #include <api/service/services.h>
  6. WPLHandler wplHandler;
  7. ASXHandler asxHandler;
  8. #define DEFINE_HANDLER_FACTORY(CLASSNAME, className) const char *CLASSNAME ## HandlerFactory::GetServiceName() { return #CLASSNAME ## "Playlist Handler"; }\
  9. GUID CLASSNAME ## HandlerFactory::GetGUID(){ return className ## HandlerGUID;}\
  10. void *CLASSNAME ## HandlerFactory::GetInterface(int global_lock){ return &className ## Handler;}
  11. DEFINE_HANDLER_FACTORY(WPL, wpl);
  12. DEFINE_HANDLER_FACTORY(ASX, asx);
  13. /* --------------------------------------------------------------------- */
  14. FOURCC CommonHandlerFactory::GetServiceType()
  15. {
  16. return WaSvc::PLAYLISTHANDLER;
  17. }
  18. int CommonHandlerFactory::SupportNonLockingInterface()
  19. {
  20. return 1;
  21. }
  22. int CommonHandlerFactory::ReleaseInterface(void *ifc)
  23. {
  24. return 1;
  25. }
  26. const char *CommonHandlerFactory::GetTestString()
  27. {
  28. return NULL;
  29. }
  30. int CommonHandlerFactory::ServiceNotify(int msg, int param1, int param2)
  31. {
  32. return 1;
  33. }
  34. #undef CBCLASS
  35. #define CBCLASS WPLHandlerFactory
  36. START_DISPATCH;
  37. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  38. CB(WASERVICEFACTORY_GETGUID, GetGUID)
  39. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  40. #undef CBCLASS
  41. #define CBCLASS CommonHandlerFactory
  42. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  43. CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
  44. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  45. CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
  46. CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
  47. END_DISPATCH;
  48. #undef CBCLASS
  49. #define CBCLASS ASXHandlerFactory
  50. START_DISPATCH;
  51. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  52. CB(WASERVICEFACTORY_GETGUID, GetGUID)
  53. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  54. #undef CBCLASS
  55. #define CBCLASS CommonHandlerFactory
  56. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  57. CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
  58. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  59. CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
  60. CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
  61. END_DISPATCH;