1
0

XSPFHandlerFactory.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #include "XSPFHandlerFactory.h"
  2. #include "XSPFHandler.h"
  3. /*
  4. This is the GUID for our service factory
  5. don't re-use this.
  6. make your own guid with guidgen.exe
  7. lives somewhere like C:\program files\Microsoft Visual Studio .NET 2003\Common7\Tools\Bin
  8. */
  9. // {51D17273-566F-4fa9-AFE0-1345C65B8B1B}
  10. static const GUID XSPFHandlerGUID =
  11. { 0x51d17273, 0x566f, 0x4fa9, { 0xaf, 0xe0, 0x13, 0x45, 0xc6, 0x5b, 0x8b, 0x1b } };
  12. // our playlist handler.
  13. static XSPFHandler xspfHandler;
  14. FOURCC XSPFHandlerFactory::GetServiceType()
  15. {
  16. return svc_playlisthandler::getServiceType();
  17. }
  18. const char *XSPFHandlerFactory::GetServiceName()
  19. {
  20. return "XSPF Playlist Loader";
  21. }
  22. GUID XSPFHandlerFactory::GetGuid()
  23. {
  24. return XSPFHandlerGUID;
  25. }
  26. void *XSPFHandlerFactory::GetInterface(int global_lock)
  27. {
  28. // xspfHandler is a singleton object, so we can just return a pointer to it
  29. // depending on what kind of service you are making, you might have to
  30. // 'new' an object and return that instead (and then free it in ReleaseInterface)
  31. return &xspfHandler;
  32. }
  33. int XSPFHandlerFactory::ReleaseInterface(void *ifc)
  34. {
  35. // no-op because we returned a singleton (see above)
  36. return 1;
  37. }
  38. // Define the dispatch table
  39. #define CBCLASS XSPFHandlerFactory
  40. START_DISPATCH;
  41. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  42. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  43. CB(WASERVICEFACTORY_GETGUID, GetGuid)
  44. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  45. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  46. END_DISPATCH;
  47. #undef CBCLASS