mldbApiFactory.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #include "api__ml_local.h"
  2. #include "mldbApiFactory.h"
  3. #include "mldbApi.h"
  4. MLDBAPI mldbApi;
  5. static const char serviceName[] = "Media Library Database API";
  6. FOURCC MLDBAPIFactory::GetServiceType()
  7. {
  8. return WaSvc::UNIQUE;
  9. }
  10. const char *MLDBAPIFactory::GetServiceName()
  11. {
  12. return serviceName;
  13. }
  14. GUID MLDBAPIFactory::GetGUID()
  15. {
  16. return mldbApiGuid;
  17. }
  18. void *MLDBAPIFactory::GetInterface(int global_lock)
  19. {
  20. return &mldbApi;
  21. // if (global_lock)
  22. // plugin.service->service_lock(this, (void *)ifc);
  23. }
  24. int MLDBAPIFactory::SupportNonLockingInterface()
  25. {
  26. return 1;
  27. }
  28. int MLDBAPIFactory::ReleaseInterface(void *ifc)
  29. {
  30. //plugin.service->service_unlock(ifc);
  31. return 1;
  32. }
  33. const char *MLDBAPIFactory::GetTestString()
  34. {
  35. return NULL;
  36. }
  37. int MLDBAPIFactory::ServiceNotify(int msg, int param1, int param2)
  38. {
  39. return 1;
  40. }
  41. #define CBCLASS MLDBAPIFactory
  42. START_DISPATCH;
  43. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  44. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  45. CB(WASERVICEFACTORY_GETGUID, GetGUID)
  46. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  47. CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
  48. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  49. CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
  50. CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
  51. END_DISPATCH;
  52. #undef CBCLASS