1
0

main.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef NULLSOFT_ML_PLG_MAIN_H
  2. #define NULLSOFT_ML_PLG_MAIN_H
  3. #include <windows.h>
  4. #include "playlist.h"
  5. #include "../../General/gen_ml/ml.h"
  6. #include "IDScanner.h"
  7. #include "api__ml_plg.h"
  8. #include "../winamp/wa_ipc.h"
  9. #include "../Agave/Language/api_language.h"
  10. #include "../nu/threadpool/api_threadpool.h"
  11. #include <api/service/waservicefactory.h>
  12. #include "impl_playlist.h"
  13. #define DEFAULT_ML_QUERY "playcount = \"0\" OR lastplay < [1 month ago] AND rating != \"1\" AND rating != \"2\""
  14. #define MAX_ML_QUERY_SIZE 8192
  15. #define MAX_TITLE_SIZE 512
  16. extern winampMediaLibraryPlugin plugin;
  17. //extern int plLength;
  18. extern int plItems;
  19. extern int plMinutes;
  20. extern int plMegabytes;
  21. extern int plLengthType;
  22. extern int multipleArtists;
  23. extern int multipleAlbums;
  24. extern int useSeed;
  25. extern int useMLQuery;
  26. //extern wchar_t *customMLQuery;
  27. extern wchar_t mlQuery[];
  28. extern Playlist seedPlaylist;
  29. extern bool isGenerating;
  30. extern IDScanner scanner;
  31. extern ThreadID *plg_thread;
  32. extern bool reset_db_flag;
  33. extern bool run_full_scan_flag;
  34. extern volatile bool run_pass2_flag;
  35. extern HWND hwndDlgCurrent;
  36. INT_PTR CALLBACK PrefsProcedure(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  37. INT_PTR CALLBACK GenerateProcedure(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  38. INT_PTR CALLBACK ViewProcedure(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  39. INT_PTR CALLBACK BGScanProcedure(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  40. INT_PTR CALLBACK AddPlaylistDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  41. // util.cpp
  42. int GetFileInfo(const wchar_t *filename, wchar_t *metadata, wchar_t *dest, int len);
  43. int updateFileInfo(const wchar_t *filename, wchar_t *metadata, wchar_t *data);
  44. void WriteFileInfo(const wchar_t *filename);
  45. void Pass1(int *killswitch);
  46. void Pass2(int *killswitch);
  47. bool StartScan();
  48. void StopScan();
  49. int ShutdownScanner(HANDLE handle, void *user_data, intptr_t id);
  50. int ResetDBOnThread(bool silent); // Goes onto the plg dedicated thread when called
  51. int ResetDB(bool silent); // For calling functions that are already on the plg dedicated thread
  52. int NukeDB(void); // For nuking the DB old skool (deleting all the files by force)
  53. // ml_plg.cpp
  54. //void SongSelected(const wchar_t * fn, HWND parent);
  55. void MultipleInstancesWarning(void);
  56. HWND SongsSelected(void);
  57. void WriteSettingsToIni(HWND hwndDlg);
  58. // Dialog manipulation methods
  59. // prefs.cpp & generate.cpp
  60. void ShowErrorDlg(HWND parent);
  61. void SetPlLengthTypeComboToItems(HWND hwndDlg, int value);
  62. void SetPlLengthTypeComboToMinutes(HWND hwndDlg, int value);
  63. void SetPlLengthTypeComboToMegabytes(HWND hwndDlg, int value);
  64. int SetRadioControlsState(HWND hwndDlg);
  65. void BoldStatusText(HWND hwndDlg);
  66. void PopulateResults(Playlist *playlist);
  67. void CantPopulateResults(void);
  68. void SetMarqueeProgress(bool isMarquee);
  69. void SetButtonsEnabledState(bool enabled_flag);
  70. BOOL windowOffScreen(HWND hwnd, POINT pt);
  71. #endif