androidplaylist.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include <vector>
  3. #include "../playlist/ifc_playlistloadercallback.h"
  4. #include "../nu/AutoLock.h"
  5. class AndroidDevice;
  6. class AndroidSong;
  7. class AndroidPlaylist: public ifc_playlistloadercallback
  8. {
  9. public:
  10. AndroidPlaylist(AndroidDevice& d, LPCTSTR pszPlaylist, BOOL master);
  11. ~AndroidPlaylist();
  12. public:
  13. /*** ifc_playlistloadercallback ***/
  14. void OnFile(const wchar_t *filename, const wchar_t *title, int lengthInMS, ifc_plentryinfo *info);
  15. public:
  16. // utility
  17. BOOL isMaster() { return master; }
  18. wchar_t* getFilename() { return filename; }
  19. size_t size();
  20. AndroidSong *&at(size_t index);
  21. void push_back(AndroidSong *callback);
  22. void RemoveSong(AndroidSong *song);
  23. void swap(size_t index1, size_t index2);
  24. void eraseAt(size_t index);
  25. AndroidSong *FindSong(const wchar_t *filename);
  26. protected:
  27. RECVS_DISPATCH;
  28. private:
  29. AndroidDevice &device;
  30. typedef std::vector<AndroidSong*> SongList;
  31. SongList songs;
  32. public:
  33. //Nullsoft::Utility::LockGuard songs_guard;
  34. wchar_t playlistName[MAX_PATH];
  35. wchar_t playlistPath[MAX_PATH];
  36. wchar_t filename[MAX_PATH];
  37. BOOL master;
  38. BOOL dirty;
  39. };