aboutsummaryrefslogtreecommitdiff
path: root/Src/playlist/PlaylistCounter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Src/playlist/PlaylistCounter.cpp')
-rw-r--r--Src/playlist/PlaylistCounter.cpp18
1 files changed, 18 insertions, 0 deletions
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