ArtistAlbumLists.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef _ARTISTALBUMLISTS_H_
  2. #define _ARTISTALBUMLISTS_H_
  3. #include <windows.h>
  4. #include <windowsx.h>
  5. #include <stdio.h>
  6. #include <shlobj.h>
  7. #include <time.h>
  8. #include "..\..\General\gen_ml/ml.h"
  9. #include "../nu/listview.h"
  10. #include "..\..\General\gen_ml/itemlist.h"
  11. #include "..\..\General\gen_ml/childwnd.h"
  12. #include "../winamp/wa_ipc.h"
  13. #include "../winamp/wa_dlg.h"
  14. #include "pmp.h"
  15. #include "SkinnedListView.h"
  16. #include "config.h"
  17. class Filter;
  18. class FilterList;
  19. class TracksList;
  20. #define MAX_FILTERS 3
  21. extern int thread_killed;
  22. class ArtistAlbumLists {
  23. protected:
  24. Device * dev;
  25. int playlistId;
  26. C_ItemList * searchedTracks;
  27. C_ItemList * unrefinedTracks;
  28. C_ItemList * trackList;
  29. C_ItemList * CompilePrimaryList(const C_ItemList * songs);
  30. C_ItemList * CompileSecondaryList(const C_ItemList * selectedArtists, int level, bool updateTopArtist);
  31. C_ItemList * FilterSongs(const wchar_t * filter, const C_ItemList * songs);
  32. int numFilters;
  33. FilterList *filters[MAX_FILTERS];
  34. Filter * firstFilter;
  35. TracksList *tracksLC;
  36. int type;
  37. wchar_t * lastSearch;
  38. wchar_t * lastRefine;
  39. public:
  40. ArtistAlbumLists(Device * dev, int playlistId, C_Config * config, wchar_t ** filterNames, int numFilters, int type=-1, bool async=false);
  41. ~ArtistAlbumLists();
  42. void SetRefine(const wchar_t * str, bool async=false);
  43. void SetSearch(const wchar_t * str, bool async=false);
  44. void SelectionChanged(int filterNum, SkinnedListView **listview);
  45. ListContents * GetFilterList(int i);
  46. PrimaryListContents * GetTracksList();
  47. void RemoveTrack(songid_t song); // removes song from all relevant lists
  48. // used for threaded background scans (mainly aimed for cloud support but could be used for other devices if needed)
  49. DWORD WINAPI bgLoadThreadProc(void *tmp);
  50. DWORD WINAPI bgSearchThreadProc(void *tmp);
  51. DWORD WINAPI bgRefineThreadProc(void *tmp);
  52. void bgQuery_Stop();
  53. int bgThread_Kill;
  54. HANDLE bgThread_Handle;
  55. bool async;
  56. void bgQuery(int mode=0);
  57. };
  58. #endif //_ARTISTALBUMLISTS_H_