1
0

factory_isoburner.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #include "api.h"
  2. #include "factory_isoburner.h"
  3. #include "isoburner.h"
  4. static const char serviceName[] = "ISO Burner";
  5. FOURCC ISOBurnerFactory::GetServiceType()
  6. {
  7. return WaSvc::OBJECT;
  8. }
  9. const char *ISOBurnerFactory::GetServiceName()
  10. {
  11. return serviceName;
  12. }
  13. GUID ISOBurnerFactory::GetGUID()
  14. {
  15. return obj_isoburnerGUID;
  16. }
  17. void *ISOBurnerFactory::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. ISOBurner *creator = new ISOBurner(primo);
  25. obj_isoburner *ifc= static_cast<obj_isoburner *>(creator);
  26. // if (global_lock)
  27. // WASABI_API_SVC->service_lock(this, (void *)ifc);
  28. return ifc;
  29. }
  30. int ISOBurnerFactory::SupportNonLockingInterface()
  31. {
  32. return 1;
  33. }
  34. int ISOBurnerFactory::ReleaseInterface(void *ifc)
  35. {
  36. //WASABI_API_SVC->service_unlock(ifc);
  37. obj_isoburner *creatorIFC = static_cast<obj_isoburner *>(ifc);
  38. ISOBurner *creator = static_cast<ISOBurner *>(creatorIFC);
  39. delete creator;
  40. return 1;
  41. }
  42. const char *ISOBurnerFactory::GetTestString()
  43. {
  44. return NULL;
  45. }
  46. int ISOBurnerFactory::ServiceNotify(int msg, int param1, int param2)
  47. {
  48. return 1;
  49. }
  50. #define CBCLASS ISOBurnerFactory
  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