main.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include "api.h"
  2. #include "../Agave/Component/ifc_wa5component.h"
  3. #include "factory_isocreator.h"
  4. #include "factory_isoburner.h"
  5. #include "factory_databurner.h"
  6. #include <bfc/platform/export.h>
  7. class WA5_Burner : 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. ISOCreatorFactory creatorFactory;
  17. ISOBurnerFactory isoBurnerFactory;
  18. DataBurnerFactory dataBurnerFactory;
  19. api_service *WASABI_API_SVC = 0;
  20. void WA5_Burner::RegisterServices(api_service *service)
  21. {
  22. WASABI_API_SVC = service;
  23. WASABI_API_SVC->service_register(&creatorFactory);
  24. WASABI_API_SVC->service_register(&isoBurnerFactory);
  25. WASABI_API_SVC->service_register(&dataBurnerFactory);
  26. }
  27. int WA5_Burner::RegisterServicesSafeModeOk()
  28. {
  29. return 1;
  30. }
  31. void WA5_Burner::DeregisterServices(api_service *service)
  32. {
  33. service->service_deregister(&creatorFactory);
  34. service->service_deregister(&isoBurnerFactory);
  35. service->service_deregister(&dataBurnerFactory);
  36. }
  37. static WA5_Burner wa5_burner;
  38. extern "C" DLLEXPORT ifc_wa5component *GetWinamp5SystemComponent()
  39. {
  40. return &wa5_burner;
  41. }
  42. #define CBCLASS WA5_Burner
  43. START_DISPATCH;
  44. VCB(API_WA5COMPONENT_REGISTERSERVICES, RegisterServices)
  45. CB(15, RegisterServicesSafeModeOk)
  46. VCB(API_WA5COMPONENT_DEREEGISTERSERVICES, DeregisterServices)
  47. END_DISPATCH;
  48. #undef CBCLASS