aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Library/ml_plg/main.h
blob: 6a47e5d41009e8a29a367346a809c4e38f4d33ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#ifndef NULLSOFT_ML_PLG_MAIN_H
#define NULLSOFT_ML_PLG_MAIN_H
#include <windows.h>
#include "playlist.h"
#include "../../General/gen_ml/ml.h"
#include "IDScanner.h"
#include "api__ml_plg.h"
#include "../winamp/wa_ipc.h"
#include "../Agave/Language/api_language.h"
#include "../nu/threadpool/api_threadpool.h"
#include <api/service/waservicefactory.h>
#include "impl_playlist.h"

#define DEFAULT_ML_QUERY "playcount = \"0\" OR lastplay < [1 month ago] AND rating != \"1\" AND rating != \"2\""
#define MAX_ML_QUERY_SIZE 8192
#define MAX_TITLE_SIZE 512

extern winampMediaLibraryPlugin plugin;

//extern int plLength;
extern int plItems;		
extern int plMinutes;		
extern int plMegabytes;
extern int plLengthType;
extern int multipleArtists;
extern int multipleAlbums;
extern int useSeed;

extern int useMLQuery;
//extern wchar_t *customMLQuery;
extern wchar_t mlQuery[];
extern Playlist seedPlaylist;
extern bool isGenerating;

extern IDScanner scanner;

extern ThreadID *plg_thread;
extern bool reset_db_flag;
extern bool run_full_scan_flag;
extern volatile bool run_pass2_flag;

extern HWND hwndDlgCurrent;

INT_PTR CALLBACK PrefsProcedure(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK GenerateProcedure(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ViewProcedure(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK BGScanProcedure(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK AddPlaylistDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);

// util.cpp
int GetFileInfo(const wchar_t *filename, wchar_t *metadata, wchar_t *dest, int len);
int updateFileInfo(const wchar_t *filename, wchar_t *metadata, wchar_t *data);
void WriteFileInfo(const wchar_t *filename);

void Pass1(int *killswitch);
void Pass2(int *killswitch);

bool StartScan();
void StopScan();

int ShutdownScanner(HANDLE handle, void *user_data, intptr_t id);
int ResetDBOnThread(bool silent);		// Goes onto the plg dedicated thread when called
int ResetDB(bool silent);				// For calling functions that are already on the plg dedicated thread
int NukeDB(void);						// For nuking the DB old skool (deleting all the files by force)


// ml_plg.cpp
//void SongSelected(const wchar_t * fn, HWND parent);
void MultipleInstancesWarning(void);
HWND SongsSelected(void);
void WriteSettingsToIni(HWND hwndDlg);

// Dialog manipulation methods
// prefs.cpp & generate.cpp
void ShowErrorDlg(HWND parent);
void SetPlLengthTypeComboToItems(HWND hwndDlg, int value);
void SetPlLengthTypeComboToMinutes(HWND hwndDlg, int value);
void SetPlLengthTypeComboToMegabytes(HWND hwndDlg, int value);
int SetRadioControlsState(HWND hwndDlg);
void BoldStatusText(HWND hwndDlg);
void PopulateResults(Playlist *playlist);
void CantPopulateResults(void);
void SetMarqueeProgress(bool isMarquee);
void SetButtonsEnabledState(bool enabled_flag);
BOOL windowOffScreen(HWND hwnd, POINT pt);

#endif