1
0

factory_databurner.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #include "api.h"
  2. #include "factory_databurner.h"
  3. #include "DataBurner.h"
  4. static const char serviceName[] = "Data Burner";
  5. FOURCC DataBurnerFactory::GetServiceType()
  6. {
  7. return WaSvc::OBJECT;
  8. }
  9. const char *DataBurnerFactory::GetServiceName()
  10. {
  11. return serviceName;
  12. }
  13. GUID DataBurnerFactory::GetGUID()
  14. {
  15. return obj_databurnerGUID;
  16. }
  17. void *DataBurnerFactory::GetInterface(int global_lock)
  18. {
  19. obj_primo *primo=0;
  20. waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(obj_primo::getServiceGuid());
  21. if (sf) primo = reinterpret_cast<obj_primo *>(sf->getInterface());
  22. if (!primo)
  23. return 0;
  24. DataBurner *creator = new DataBurner(primo);
  25. obj_databurner *ifc= static_cast<obj_databurner *>(creator);
  26. // if (global_lock)
  27. // WASABI_API_SVC->service_lock(this, (void *)ifc);
  28. return ifc;
  29. }
  30. int DataBurnerFactory::SupportNonLockingInterface()
  31. {
  32. return 1;
  33. }
  34. int DataBurnerFactory::ReleaseInterface(void *ifc)
  35. {
  36. //WASABI_API_SVC->service_unlock(ifc);
  37. obj_databurner *creatorIFC = static_cast<obj_databurner *>(ifc);
  38. DataBurner *creator = static_cast<DataBurner *>(creatorIFC);
  39. delete creator;
  40. return 1;
  41. }
  42. const char *DataBurnerFactory::GetTestString()
  43. {
  44. return NULL;
  45. }
  46. int DataBurnerFactory::ServiceNotify(int msg, int param1, int param2)
  47. {
  48. return 1;
  49. }
  50. #define CBCLASS DataBurnerFactory
  51. START_DISPATCH;
  52. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  53. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  54. CB(WASERVICEFACTORY_GETGUID, GetGUID)
  55. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  56. CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
  57. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  58. CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
  59. CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
  60. END_DISPATCH;
  61. #undef CBCLASS