From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/playlist/PlaylistCounter.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Src/playlist/PlaylistCounter.cpp (limited to 'Src/playlist/PlaylistCounter.cpp') diff --git a/Src/playlist/PlaylistCounter.cpp b/Src/playlist/PlaylistCounter.cpp new file mode 100644 index 00000000..413c133b --- /dev/null +++ b/Src/playlist/PlaylistCounter.cpp @@ -0,0 +1,18 @@ +#include "PlaylistCounter.h" + +int PlaylistCounter::OnFile( const wchar_t *filename, const wchar_t *title, int lengthInMS, ifc_plentryinfo *info ) +{ + // TODO: recursive load? + ++count; + if ( lengthInMS > 0 ) + length += lengthInMS; + + return LOAD_CONTINUE; +} + + +#define CBCLASS PlaylistCounter +START_DISPATCH; +CB( IFC_PLAYLISTLOADERCALLBACK_ONFILE_RET, OnFile ) +END_DISPATCH; +#undef CBCLASS \ No newline at end of file -- cgit