diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/playlist/ifc_playlistloadercallbackT.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/playlist/ifc_playlistloadercallbackT.h')
-rw-r--r-- | Src/playlist/ifc_playlistloadercallbackT.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Src/playlist/ifc_playlistloadercallbackT.h b/Src/playlist/ifc_playlistloadercallbackT.h new file mode 100644 index 00000000..7ee6366f --- /dev/null +++ b/Src/playlist/ifc_playlistloadercallbackT.h @@ -0,0 +1,29 @@ +#pragma once +#include "ifc_playlistloadercallback.h" + +template <class T> +class ifc_playlistloadercallbackT : public ifc_playlistloadercallback +{ +protected: + ifc_playlistloadercallbackT() {} + ~ifc_playlistloadercallbackT() {} +protected: + // return 0 to continue enumeration, or 1 to quit + + // title will be NULL if no title found, length will be -1 + int OnFile(const wchar_t *filename, const wchar_t *title, int lengthInMS, ifc_plentryinfo *info) { return LOAD_ABORT; } + // numEntries is just a hint, there is no gaurantee. 0 means "don't know" + int OnPlaylistInfo(const wchar_t *playlistName, size_t numEntries, ifc_plentryinfo *info) { return LOAD_ABORT; } + // return 0 to use playlist file path as base (or just don't implement) + const wchar_t *GetBasePath() { return 0; } + +#define CBCLASS T +#define CBCLASST ifc_playlistloadercallbackT<T> + START_DISPATCH_INLINE; + CBT(IFC_PLAYLISTLOADERCALLBACK_ONFILE_RET, OnFile); + CBT(IFC_PLAYLISTLOADERCALLBACK_ONPLAYLISTINFO_RET, OnPlaylistInfo); + CBT(IFC_PLAYLISTLOADERCALLBACK_GETBASEPATH, GetBasePath); + END_DISPATCH; +#undef CBCLASS +#undef CBCLASST +}; |