ifc_playlistloadercallbackT.h 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include "ifc_playlistloadercallback.h"
  3. template <class T>
  4. class ifc_playlistloadercallbackT : public ifc_playlistloadercallback
  5. {
  6. protected:
  7. ifc_playlistloadercallbackT() {}
  8. ~ifc_playlistloadercallbackT() {}
  9. protected:
  10. // return 0 to continue enumeration, or 1 to quit
  11. // title will be NULL if no title found, length will be -1
  12. int OnFile(const wchar_t *filename, const wchar_t *title, int lengthInMS, ifc_plentryinfo *info) { return LOAD_ABORT; }
  13. // numEntries is just a hint, there is no gaurantee. 0 means "don't know"
  14. int OnPlaylistInfo(const wchar_t *playlistName, size_t numEntries, ifc_plentryinfo *info) { return LOAD_ABORT; }
  15. // return 0 to use playlist file path as base (or just don't implement)
  16. const wchar_t *GetBasePath() { return 0; }
  17. #define CBCLASS T
  18. #define CBCLASST ifc_playlistloadercallbackT<T>
  19. START_DISPATCH_INLINE;
  20. CBT(IFC_PLAYLISTLOADERCALLBACK_ONFILE_RET, OnFile);
  21. CBT(IFC_PLAYLISTLOADERCALLBACK_ONPLAYLISTINFO_RET, OnPlaylistInfo);
  22. CBT(IFC_PLAYLISTLOADERCALLBACK_GETBASEPATH, GetBasePath);
  23. END_DISPATCH;
  24. #undef CBCLASS
  25. #undef CBCLASST
  26. };