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/Winamp/MergePlaylist.h | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Src/Winamp/MergePlaylist.h (limited to 'Src/Winamp/MergePlaylist.h') diff --git a/Src/Winamp/MergePlaylist.h b/Src/Winamp/MergePlaylist.h new file mode 100644 index 00000000..5d9be4f1 --- /dev/null +++ b/Src/Winamp/MergePlaylist.h @@ -0,0 +1,70 @@ +#pragma once +#include "../playlist/ifc_playlist.h" +#include +#include // for MAX_PATH +#include +#include "../playlist/ifc_playlistloadercallback.h" + +class merge_pl_entry +{ +public: + merge_pl_entry() {} + merge_pl_entry( const wchar_t *p_filename, const wchar_t *p_title, int p_length_ms ); + ~merge_pl_entry(); + + size_t GetFilename( wchar_t *p_filename, size_t filenameCch ); + size_t GetTitle( wchar_t *p_title, size_t titleCch ); + int GetLengthInMilliseconds(); + size_t GetExtendedInfo( const wchar_t *metadata, wchar_t *info, size_t infoCch ); + + void SetFilename( const wchar_t *p_filename ); + void SetTitle( const wchar_t *p_title ); + void SetLengthMilliseconds( int p_length_ms ); + + + wchar_t *filename = 0; + wchar_t *filetitle = 0; + int length = -1; + bool cached = false; +}; + +enum { patch_playlist, patch_playlistloadercallback }; + +class MergePlaylist : public MultiPatch, public MultiPatch +{ +public: + MergePlaylist(); + ~MergePlaylist(); + + void Clear(); + void OnFile( const wchar_t *p_filename, const wchar_t *p_title, int lengthInMS, ifc_plentryinfo *info ); + void AppendWithInfo( const wchar_t *p_filename, const wchar_t *p_title, int lengthInMS ); + + size_t GetNumItems(); + + size_t GetItem( size_t item, wchar_t *p_filename, size_t filenameCch ); + size_t GetItemTitle( size_t item, wchar_t *p_title, size_t titleCch ); + const wchar_t *ItemTitle( size_t item ); + const wchar_t *ItemName( size_t item ); + int GetItemLengthMilliseconds( size_t item ); + size_t GetItemExtendedInfo( size_t item, const wchar_t *metadata, wchar_t *info, size_t infoCch ); + + void SetItemFilename( size_t item, const wchar_t *p_filename ); + void SetItemTitle( size_t item, const wchar_t *p_title ); + void SetItemLengthMilliseconds( size_t item, int p_length_ms ); + + void AppendPlaylist( MergePlaylist © ); + + bool HasFilename( const wchar_t *p_filename ); + + uint64_t total_time; + + +protected: + RECVS_MULTIPATCH; + +public: + //private: + typedef std::vector PlaylistEntries; + PlaylistEntries entries; +}; -- cgit