Playlist.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef NULLSOFT_ML_PLAYLISTS_PLAYLIST_H
  2. #define NULLSOFT_ML_PLAYLISTS_PLAYLIST_H
  3. #include "ifc_playlist.h"
  4. #include <windows.h> // for MAX_PATH
  5. #include "pl_entry.h"
  6. #include "ifc_playlistT.h"
  7. #include "ifc_playlistloadercallbackT.h"
  8. #include <vector>
  9. class Playlist : public ifc_playlistloadercallbackT<Playlist>, public ifc_playlistT<Playlist>
  10. {
  11. public:
  12. virtual ~Playlist();
  13. void Clear();
  14. int OnFile( const wchar_t *p_filename, const wchar_t *p_title, int p_lengthInMS, ifc_plentryinfo *p_info );
  15. void AppendWithInfo( const wchar_t *p_filename, const wchar_t *p_title, int p_lengthInMS );
  16. void Insert( size_t p_index, const wchar_t *p_filename, const wchar_t *p_title, int p_lengthInMS );
  17. size_t GetNumItems();
  18. size_t GetItem( size_t item, wchar_t *filename, size_t filenameCch );
  19. size_t GetItemTitle( size_t item, wchar_t *title, size_t titleCch );
  20. const wchar_t *ItemTitle( size_t item );
  21. const wchar_t *ItemName( size_t item );
  22. int GetItemLengthMilliseconds( size_t item ); // TODO: maybe microsecond for better resolution?
  23. size_t GetItemExtendedInfo( size_t item, const wchar_t *metadata, wchar_t *info, size_t infoCch );
  24. void SetItemFilename( size_t item, const wchar_t *filename );
  25. void SetItemTitle( size_t item, const wchar_t *title );
  26. void SetItemLengthMilliseconds( size_t item, int length );
  27. int Reverse();
  28. int Swap( size_t item1, size_t item2 );
  29. int Randomize( int ( *generator )( ) );
  30. void Remove( size_t item );
  31. int SortByTitle();
  32. int SortByFilename();
  33. int SortByDirectory(); //sorts by directory and then by filename
  34. private:
  35. typedef std::vector<pl_entry*> PlaylistEntries;
  36. PlaylistEntries entries;
  37. };
  38. #endif