1
0

api__playlist.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef NULLSOFT_PLAYLIST_API_H
  2. #define NULLSOFT_PLAYLIST_API_H
  3. #include <api/service/api_service.h>
  4. #include <api/application/api_application.h>
  5. #define WASABI_API_APP applicationApi
  6. #include <api/syscb/api_syscb.h>
  7. #define WASABI_API_SYSCB sysCallbackApi
  8. #ifndef ML_PLG_EXPORTS
  9. #include "../Agave/Config/api_config.h"
  10. #endif
  11. #include <api/script/api_maki.h>
  12. #define WASABI_API_MAKI makiApi
  13. #include "../Winamp/JSAPI2_api_security.h"
  14. extern JSAPI2::api_security *jsapi2_security;
  15. #define AGAVE_API_JSAPI2_SECURITY jsapi2_security
  16. #include "../Winamp/api_stats.h"
  17. extern api_stats *statsApi;
  18. #define AGAVE_API_STATS statsApi
  19. #include <api/service/waservicefactory.h>
  20. template <class api_t>
  21. class QuickService
  22. {
  23. public:
  24. QuickService( GUID p_serviceGUID )
  25. {
  26. _sf = WASABI_API_SVC->service_getServiceByGuid( p_serviceGUID );
  27. if ( _sf )
  28. _api = (api_t *)_sf->getInterface();
  29. }
  30. ~QuickService()
  31. {
  32. _sf->releaseInterface( _api );
  33. _api = 0;
  34. }
  35. bool OK()
  36. {
  37. return _api != 0;
  38. }
  39. api_t *operator ->()
  40. {
  41. return _api;
  42. }
  43. waServiceFactory *_sf = NULL;
  44. api_t *_api = 0;
  45. };
  46. #include "../Agave/Language/api_language.h"
  47. #endif // !NULLSOFT_PLAYLIST_API_H