impl_playlist.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef NULLSOFT_ML_PLG_IMPL_PLAYLIST_H
  2. #define NULLSOFT_ML_PLG_IMPL_PLAYLIST_H
  3. #include "../playlist/ifc_playlist.h"
  4. #include <vector>
  5. #include <windows.h> // for MAX_PATH
  6. #include "../playlist/pl_entry.h"
  7. #include <bfc/multipatch.h>
  8. #include <bfc/platform/types.h>
  9. #include "../playlist/ifc_playlistloadercallback.h"
  10. enum
  11. {
  12. patch_playlist,
  13. patch_playlistloadercallback
  14. };
  15. class Playlist : public MultiPatch<patch_playlist, ifc_playlist>, public MultiPatch<patch_playlistloadercallback, ifc_playlistloadercallback>
  16. {
  17. public:
  18. ~Playlist();
  19. void Clear();
  20. void OnFile( const wchar_t *filename, const wchar_t *title, int lengthInMS, int sizeInKB, ifc_plentryinfo *info );
  21. void AppendWithInfo( const wchar_t *filename, const wchar_t *title, int lengthInMS, int sizeInBytes );
  22. size_t GetNumItems();
  23. size_t GetItem( size_t item, wchar_t *filename, size_t filenameCch );
  24. size_t GetItemTitle( size_t item, wchar_t *title, size_t titleCch );
  25. const wchar_t *ItemTitle( size_t item );
  26. const wchar_t *ItemName( size_t item );
  27. int GetItemLengthMilliseconds( size_t item );
  28. int GetItemSizeBytes( size_t item );
  29. size_t GetItemExtendedInfo( size_t item, const wchar_t *metadata, wchar_t *info, size_t infoCch );
  30. uint64_t GetPlaylistSizeBytes( void );
  31. uint64_t GetPlaylistLengthMilliseconds( void );
  32. bool IsCached( size_t item );
  33. void ClearCache( size_t item );
  34. void SetItemFilename( size_t item, const wchar_t *filename );
  35. void SetItemTitle( size_t item, const wchar_t *title );
  36. void SetItemLengthMilliseconds( size_t item, int length );
  37. void SetItemSizeBytes( size_t item, int size );
  38. int Reverse();
  39. int Swap( size_t item1, size_t item2 );
  40. int Randomize( int ( *generator )( ) );
  41. void Remove( size_t item );
  42. int SortByTitle();
  43. int SortByFilename();
  44. int SortByDirectory(); //sorts by directory and then by filename
  45. void InsertPlaylist( Playlist &copy, size_t index );
  46. void AppendPlaylist( Playlist &copy );
  47. typedef std::vector<pl_entry*> PlaylistEntries;
  48. PlaylistEntries entries;
  49. protected:
  50. RECVS_MULTIPATCH;
  51. };
  52. #endif