1
0

w5s.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* copyright 2008 Ben Allison */
  2. #include "../Agave/Component/ifc_wa5component.h"
  3. #include "factory_f263.h"
  4. #include "flv_f263_decoder.h"
  5. #include "mkv_f263_decoder.h"
  6. #include "../nu/Singleton.h"
  7. class WA5_F263 : public ifc_wa5component
  8. {
  9. public:
  10. void RegisterServices(api_service *service);
  11. int RegisterServicesSafeModeOk();
  12. void DeregisterServices(api_service *service);
  13. protected:
  14. RECVS_DISPATCH;
  15. };
  16. api_service *serviceManager=0;
  17. WA5_F263 wa5_f263;
  18. F263Factory f263Factory;
  19. static FLVDecoderCreator flvCreator;
  20. static SingletonServiceFactory<svc_flvdecoder, FLVDecoderCreator> flvFactory;
  21. static MKVDecoderCreator mkvCreator;
  22. static SingletonServiceFactory<svc_mkvdecoder, MKVDecoderCreator> mkvFactory;
  23. void WA5_F263::RegisterServices(api_service *service)
  24. {
  25. WASABI_API_SVC = service;
  26. WASABI_API_SVC->service_register(&f263Factory);
  27. flvFactory.Register(WASABI_API_SVC, &flvCreator);
  28. mkvFactory.Register(WASABI_API_SVC, &mkvCreator);
  29. }
  30. int WA5_F263::RegisterServicesSafeModeOk()
  31. {
  32. return 1;
  33. }
  34. void WA5_F263::DeregisterServices(api_service *service)
  35. {
  36. service->service_deregister(&f263Factory);
  37. flvFactory.Deregister(WASABI_API_SVC);
  38. mkvFactory.Deregister(WASABI_API_SVC);
  39. }
  40. extern "C" __declspec(dllexport) ifc_wa5component *GetWinamp5SystemComponent()
  41. {
  42. return &wa5_f263;
  43. }
  44. #define CBCLASS WA5_F263
  45. START_DISPATCH;
  46. VCB(API_WA5COMPONENT_REGISTERSERVICES, RegisterServices)
  47. CB(15, RegisterServicesSafeModeOk)
  48. VCB(API_WA5COMPONENT_DEREEGISTERSERVICES, DeregisterServices)
  49. END_DISPATCH;
  50. #undef CBCLASS