factory_isocreator.cpp 1.7 KB

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