ml_local.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. #ifndef ML_LOCAL_HEADER
  2. #define ML_LOCAL_HEADER
  3. #include <windows.h>
  4. #include <commctrl.h>
  5. #include <iostream> // for std::wstring
  6. #include "..\..\General\gen_ml/gaystring.h"
  7. #include "..\..\General\gen_ml/config.h"
  8. #include <map>
  9. #include "../nde/nde_c.h"
  10. #include <vector>
  11. struct ExtendedFields
  12. {
  13. const wchar_t *ispodcast;
  14. const wchar_t *podcastchannel;
  15. const wchar_t *podcastpubdate;
  16. const wchar_t *GracenoteFileID;
  17. const wchar_t *GracenoteExtData;
  18. const wchar_t *lossless;
  19. const wchar_t *codec;
  20. const wchar_t *director;
  21. const wchar_t *producer;
  22. const wchar_t *width;
  23. const wchar_t *height;
  24. const wchar_t *mimetype;
  25. const wchar_t *realsize;
  26. const wchar_t *dateadded;
  27. const wchar_t *cloud;
  28. };
  29. extern const ExtendedFields extended_fields;
  30. extern const int NUM_EXTRA_COLSW;
  31. extern const unsigned char extra_idsW[]; // defined in view_media.cpp
  32. extern const wchar_t *extra_strsW[];
  33. extern HCURSOR hDragNDropCursor;
  34. wchar_t *getRecordExtendedItem_fast(const itemRecordW *item, const wchar_t *name);
  35. void setRecordExtendedItem_fast(itemRecordW *item, const wchar_t *name, const wchar_t *value);
  36. int OnLocalMediaItemClick(int action, int item, HWND parent);
  37. int OnLocalMediaClick(int action, HWND parent);
  38. BOOL IPC_HookExtInfo(INT_PTR param);
  39. BOOL IPC_HookExtInfoW(INT_PTR param);
  40. BOOL IPC_HookTitleInfo(INT_PTR param);
  41. #include "../winamp/wa_ipc.h"
  42. #define INT_ENTRY_MAX_NUM 20
  43. #define INT_ENTRY_MAX_PATHSIZE 512
  44. #define INT_ENTRY_MAX_TEXTSIZE 128
  45. #define TREE_IMAGE_LOCAL_AUDIO 101
  46. #define TREE_IMAGE_LOCAL_VIDEO 102
  47. #define TREE_IMAGE_LOCAL_MOSTPLAYED 103
  48. #define TREE_IMAGE_LOCAL_RECENTLYADDED 104
  49. #define TREE_IMAGE_LOCAL_RECENTLYPLAYED 105
  50. #define TREE_IMAGE_LOCAL_NEVERPLAYED 106
  51. #define TREE_IMAGE_LOCAL_TOPRATED 107
  52. #define TREE_IMAGE_LOCAL_PODCASTS 108
  53. #define TREE_IMAGE_LOCAL_RECENTLYMODIFIED 109
  54. #define MAINTABLE_ID_FILENAME 0
  55. #define MAINTABLE_ID_TITLE 1
  56. #define MAINTABLE_ID_ARTIST 2
  57. #define MAINTABLE_ID_ALBUM 3
  58. #define MAINTABLE_ID_YEAR 4
  59. #define MAINTABLE_ID_GENRE 5
  60. #define MAINTABLE_ID_COMMENT 6
  61. #define MAINTABLE_ID_TRACKNB 7
  62. #define MAINTABLE_ID_LENGTH 8 // in seconds
  63. #define MAINTABLE_ID_TYPE 9 // 0=audio, 1=video
  64. #define MAINTABLE_ID_LASTUPDTIME 10 // last time (seconds since 1970) of db update of this item
  65. #define MAINTABLE_ID_LASTPLAY 11 // last time (seconds since 1970) of last play
  66. #define MAINTABLE_ID_RATING 12
  67. #define MAINTABLE_ID_GRACENOTE_ID 14 // OLD Gracenote ID's. Don't use this anymore!!!
  68. #define MAINTABLE_ID_PLAYCOUNT 15 // play count
  69. #define MAINTABLE_ID_FILETIME 16 // file time
  70. #define MAINTABLE_ID_FILESIZE 17 // file size, bytes (was kilobytes until 5.7)
  71. #define MAINTABLE_ID_BITRATE 18 // file bitratea, kbps
  72. #define MAINTABLE_ID_DISC 19 // disc #
  73. #define MAINTABLE_ID_ALBUMARTIST 20 // album artist
  74. #define MAINTABLE_ID_ALBUMGAIN 21 // album gain (replaygain)
  75. #define MAINTABLE_ID_TRACKGAIN 22 // track gain (replaygain)
  76. #define MAINTABLE_ID_PUBLISHER 23 // publisher (record label)
  77. #define MAINTABLE_ID_COMPOSER 24 // composer
  78. #define MAINTABLE_ID_BPM 25 // beats per minute (tempo)
  79. #define MAINTABLE_ID_DISCS 26 // number of discs total
  80. #define MAINTABLE_ID_TRACKS 27 // number of tracks total
  81. #define MAINTABLE_ID_ISPODCAST 28
  82. #define MAINTABLE_ID_PODCASTCHANNEL 29
  83. #define MAINTABLE_ID_PODCASTPUBDATE 30
  84. #define MAINTABLE_ID_GRACENOTEFILEID 31
  85. #define MAINTABLE_ID_GRACENOTEEXTDATA 32
  86. #define MAINTABLE_ID_LOSSLESS 33
  87. #define MAINTABLE_ID_CATEGORY 34
  88. #define MAINTABLE_ID_CODEC 35
  89. #define MAINTABLE_ID_DIRECTOR 36
  90. #define MAINTABLE_ID_PRODUCER 37
  91. #define MAINTABLE_ID_WIDTH 38
  92. #define MAINTABLE_ID_HEIGHT 39
  93. #define MAINTABLE_ID_MIMETYPE 40
  94. #define MAINTABLE_ID_DATEADDED 41 // time file was added to the db
  95. // menu command id
  96. #define IDM_DOSHITMENU_ADDNEWVIEW 40030
  97. #define IDM_RESCANFOLDERSNOW 4066
  98. #define IDM_ADD_DIRS 4067
  99. #define IDM_REMOVE_UNUSED_FILES 4068
  100. #define IDM_ADD_PLEDIT 4069
  101. static const std::wstring _DB_FIELDNAME_tracknumber = L"tracknumber"; static const wchar_t *DB_FIELDNAME_tracknumber = _DB_FIELDNAME_tracknumber.c_str();
  102. static const std::wstring _DB_FIELDNAME_track = L"track"; static const wchar_t *DB_FIELDNAME_track = _DB_FIELDNAME_track.c_str();
  103. static const std::wstring _DB_FIELDNAME_filename = L"filename"; static const wchar_t *DB_FIELDNAME_filename = _DB_FIELDNAME_filename.c_str();
  104. static const std::wstring _DB_FIELDNAME_title = L"title"; static const wchar_t *DB_FIELDNAME_title = _DB_FIELDNAME_title.c_str();
  105. static const std::wstring _DB_FIELDNAME_artist = L"artist"; static const wchar_t *DB_FIELDNAME_artist = _DB_FIELDNAME_artist.c_str();
  106. static const std::wstring _DB_FIELDNAME_album = L"album"; static const wchar_t *DB_FIELDNAME_album = _DB_FIELDNAME_album.c_str();
  107. static const std::wstring _DB_FIELDNAME_year = L"year"; static const wchar_t *DB_FIELDNAME_year = _DB_FIELDNAME_year.c_str();
  108. static const std::wstring _DB_FIELDNAME_genre = L"genre"; static const wchar_t *DB_FIELDNAME_genre = _DB_FIELDNAME_genre.c_str();
  109. static const std::wstring _DB_FIELDNAME_comment = L"comment"; static const wchar_t *DB_FIELDNAME_comment = _DB_FIELDNAME_comment.c_str();
  110. static const std::wstring _DB_FIELDNAME_trackno = L"trackno"; static const wchar_t *DB_FIELDNAME_trackno = _DB_FIELDNAME_trackno.c_str();
  111. static const std::wstring _DB_FIELDNAME_length = L"length"; static const wchar_t *DB_FIELDNAME_length = _DB_FIELDNAME_length.c_str();
  112. static const std::wstring _DB_FIELDNAME_type = L"type"; static const wchar_t *DB_FIELDNAME_type = _DB_FIELDNAME_type.c_str();
  113. static const std::wstring _DB_FIELDNAME_lastupd = L"lastupd"; static const wchar_t *DB_FIELDNAME_lastupd = _DB_FIELDNAME_lastupd.c_str();
  114. static const std::wstring _DB_FIELDNAME_lastplay = L"lastplay"; static const wchar_t *DB_FIELDNAME_lastplay = _DB_FIELDNAME_lastplay.c_str();
  115. static const std::wstring _DB_FIELDNAME_rating = L"rating"; static const wchar_t *DB_FIELDNAME_rating = _DB_FIELDNAME_rating.c_str();
  116. static const std::wstring _DB_FIELDNAME_tuid2 = L"tuid2"; static const wchar_t *DB_FIELDNAME_tuid2 = _DB_FIELDNAME_tuid2.c_str();
  117. static const std::wstring _DB_FIELDNAME_playcount = L"playcount"; static const wchar_t *DB_FIELDNAME_playcount = _DB_FIELDNAME_playcount.c_str();
  118. static const std::wstring _DB_FIELDNAME_filetime = L"filetime"; static const wchar_t *DB_FIELDNAME_filetime = _DB_FIELDNAME_filetime.c_str();
  119. static const std::wstring _DB_FIELDNAME_filesize = L"filesize"; static const wchar_t *DB_FIELDNAME_filesize = _DB_FIELDNAME_filesize.c_str();
  120. static const std::wstring _DB_FIELDNAME_bitrate = L"bitrate"; static const wchar_t *DB_FIELDNAME_bitrate = _DB_FIELDNAME_bitrate.c_str();
  121. static const std::wstring _DB_FIELDNAME_disc = L"disc"; static const wchar_t *DB_FIELDNAME_disc = _DB_FIELDNAME_disc.c_str();
  122. static const std::wstring _DB_FIELDNAME_albumartist = L"albumartist"; static const wchar_t *DB_FIELDNAME_albumartist = _DB_FIELDNAME_albumartist.c_str();
  123. static const std::wstring _DB_FIELDNAME_replaygain_album_gain = L"replaygain_album_gain"; static const wchar_t *DB_FIELDNAME_replaygain_album_gain = _DB_FIELDNAME_replaygain_album_gain.c_str();
  124. static const std::wstring _DB_FIELDNAME_replaygain_track_gain = L"replaygain_track_gain"; static const wchar_t *DB_FIELDNAME_replaygain_track_gain = _DB_FIELDNAME_replaygain_track_gain.c_str();
  125. static const std::wstring _DB_FIELDNAME_publisher = L"publisher"; static const wchar_t *DB_FIELDNAME_publisher = _DB_FIELDNAME_publisher.c_str();
  126. static const std::wstring _DB_FIELDNAME_composer = L"composer"; static const wchar_t *DB_FIELDNAME_composer = _DB_FIELDNAME_composer.c_str();
  127. static const std::wstring _DB_FIELDNAME_bpm = L"bpm"; static const wchar_t *DB_FIELDNAME_bpm = _DB_FIELDNAME_bpm.c_str();
  128. static const std::wstring _DB_FIELDNAME_discs = L"discs"; static const wchar_t *DB_FIELDNAME_discs = _DB_FIELDNAME_discs.c_str();
  129. static const std::wstring _DB_FIELDNAME_tracks = L"tracks"; static const wchar_t *DB_FIELDNAME_tracks = _DB_FIELDNAME_tracks.c_str();
  130. static const std::wstring _DB_FIELDNAME_ispodcast = L"ispodcast"; static const wchar_t *DB_FIELDNAME_ispodcast = _DB_FIELDNAME_ispodcast.c_str();
  131. static const std::wstring _DB_FIELDNAME_podcastchannel = L"podcastchannel"; static const wchar_t *DB_FIELDNAME_podcastchannel = _DB_FIELDNAME_podcastchannel.c_str();
  132. static const std::wstring _DB_FIELDNAME_podcastpubdate = L"podcastpubdate"; static const wchar_t *DB_FIELDNAME_podcastpubdate = _DB_FIELDNAME_podcastpubdate.c_str();
  133. static const std::wstring _DB_FIELDNAME_GracenoteFileID = L"GracenoteFileID"; static const wchar_t *DB_FIELDNAME_GracenoteFileID = _DB_FIELDNAME_GracenoteFileID.c_str();
  134. static const std::wstring _DB_FIELDNAME_GracenoteExtData = L"GracenoteExtData"; static const wchar_t *DB_FIELDNAME_GracenoteExtData = _DB_FIELDNAME_GracenoteExtData.c_str();
  135. static const std::wstring _DB_FIELDNAME_lossless = L"lossless"; static const wchar_t *DB_FIELDNAME_lossless = _DB_FIELDNAME_lossless.c_str();
  136. static const std::wstring _DB_FIELDNAME_category = L"category"; static const wchar_t *DB_FIELDNAME_category = _DB_FIELDNAME_category.c_str();
  137. static const std::wstring _DB_FIELDNAME_codec = L"codec"; static const wchar_t *DB_FIELDNAME_codec = _DB_FIELDNAME_codec.c_str();
  138. static const std::wstring _DB_FIELDNAME_director = L"director"; static const wchar_t *DB_FIELDNAME_director = _DB_FIELDNAME_director.c_str();
  139. static const std::wstring _DB_FIELDNAME_producer = L"producer"; static const wchar_t *DB_FIELDNAME_producer = _DB_FIELDNAME_producer.c_str();
  140. static const std::wstring _DB_FIELDNAME_width = L"width"; static const wchar_t *DB_FIELDNAME_width = _DB_FIELDNAME_width.c_str();
  141. static const std::wstring _DB_FIELDNAME_height = L"height"; static const wchar_t *DB_FIELDNAME_height = _DB_FIELDNAME_height.c_str();
  142. static const std::wstring _DB_FIELDNAME_mimetype = L"mimetype"; static const wchar_t *DB_FIELDNAME_mimetype = _DB_FIELDNAME_mimetype.c_str();
  143. static const std::wstring _DB_FIELDNAME_dateadded = L"dateadded"; static const wchar_t *DB_FIELDNAME_dateadded = _DB_FIELDNAME_dateadded.c_str();
  144. extern BOOL myMenu;
  145. int init(void);
  146. void config(void);
  147. int treeGetParam(HTREEITEM h);
  148. class Table;
  149. class C_Config;
  150. extern CRITICAL_SECTION g_db_cs;
  151. extern nde_database_t g_db;
  152. extern nde_table_t g_table;
  153. extern int g_table_dirty;
  154. extern const wchar_t *WINAMP_INI;
  155. extern HWND m_curview_hwnd;
  156. extern wchar_t g_path[], g_tableDir[], g_viewsDir[];
  157. extern C_Config *g_config;
  158. extern HMENU g_context_menus, g_context_menus2;
  159. typedef struct
  160. {
  161. wchar_t *name;
  162. wchar_t *query;
  163. wchar_t *metafn; //filename, without path, of meta file
  164. int mode;
  165. int imgIndex;
  166. int index;
  167. } queryItem;
  168. typedef std::map <int, queryItem*> QueryList;
  169. extern QueryList m_query_list;
  170. extern C_Config *g_view_metaconf;
  171. extern int g_guessifany;
  172. extern int g_querydelay;
  173. extern int g_viewnotplay;
  174. void loadQueryTree();
  175. extern int m_query_tree;
  176. extern int m_query_mode;
  177. static wchar_t *m_query_metafile;
  178. HWND onTreeViewSelectChange(HWND hwnd);
  179. void db_setFieldStringW(nde_scanner_t s, unsigned char id, const wchar_t *data);
  180. void db_setFieldInt(nde_scanner_t s, unsigned char id, int data);
  181. void db_setFieldInt64(nde_scanner_t s, unsigned char id, __int64 data);
  182. int db_getFieldInt(nde_scanner_t s, unsigned char id, int defaultVal);
  183. void db_removeField(nde_scanner_t s, unsigned char id);
  184. void main_playQuery(C_Config *metaconf, const wchar_t *query, int enqueue, int startplaying=1); // enqueue =-1 sends it to the playlist
  185. void main_playItemRecordList (itemRecordListW *obj, int enqueue, int startplaying=1);
  186. int addQueryItem(const wchar_t *name, const wchar_t *val, int mode, int select, const wchar_t *metafn, int imageIndex, int num=-1);
  187. void replaceQueryItem(int n, const wchar_t *name, const wchar_t *val, int mode, int imageIndex);
  188. void saveQueryTree();
  189. int pluginHandleIpcMessage(int msg, int param);
  190. int openDb();
  191. void closeDb();
  192. void nukeLibrary(HWND hwndDlg);
  193. //add.cpp
  194. int addFileToDb(const wchar_t *filename, int onlyupdate, int use_metadata, int guess_mode, int playcnt=0, int lastplay=0, bool force=false); // adds a file to the db, gets info, etc.
  195. int RemoveFileFromDB(/*const Table *table, */const wchar_t *filename); // removes a file from the DB
  196. void makeFilename2(const char *filename, char *filename2, int filename2_len);
  197. void makeFilename2W(const wchar_t *filename, wchar_t *filename2, int filename2_len);
  198. //gracenote.cpp
  199. void gracenoteInit();
  200. int gracenoteQueryFile(const wchar_t *filename);
  201. void gracenoteCancelRequest();
  202. int gracenoteDoTimerStuff();
  203. void gracenoteSetValues(const wchar_t *artist, const wchar_t *album, const wchar_t *title);
  204. const wchar_t *gracenoteGetTuid();
  205. int gracenoteIsWorking();
  206. //guess.cpp
  207. wchar_t *guessTitles(const wchar_t *filename,
  208. int *tracknum,
  209. wchar_t **artist,
  210. wchar_t **album,
  211. wchar_t **title); // should free the result of this function after using artist/album/title
  212. //prefs.cpp
  213. INT_PTR CALLBACK PrefsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  214. int autoscan_add_directory(const wchar_t *path, int *guess, int *meta, int *recurse, int noaddjustcheck);// if we return 1, guess and meta will be filled in
  215. void refreshPrefs(int screen);
  216. //util.cpp
  217. extern "C" {
  218. void process_substantives(wchar_t* dest);
  219. void ConvertRatingMenuStar(HMENU menu, UINT menu_id);
  220. };
  221. //view_audio.cpp
  222. INT_PTR CALLBACK view_audioDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  223. //view_miniinfo.cpp
  224. INT_PTR CALLBACK view_miniinfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  225. //view_errorinfo.cpp
  226. INT_PTR CALLBACK view_errorinfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  227. /* bgscan.cpp */
  228. void Scan_ScanFolderBackground(const wchar_t *path, int guess, int meta, int recurse);
  229. void Scan_ScanFolder(HWND parent, const wchar_t *path, int guess, int meta, int recurse);
  230. // When you call Scan_ScanFolders, it will own the memory and release it with free()
  231. void Scan_ScanFolders(HWND parent, size_t count, wchar_t **paths, int *guess, int *meta, int *recurse);
  232. void Scan_BackgroundScan();
  233. void Scan_Cancel();
  234. void Scan_Kill();
  235. // remove missing files
  236. void Scan_RemoveFiles(HWND parent);
  237. //view_media.cpp
  238. void makeQueryStringFromText(GayStringW *query, wchar_t *text, int nf=8);
  239. inline BOOL WINAPI IsCharSpaceA(char c) { return (c == ' ' || c == '\t'); }
  240. inline BOOL WINAPI IsCharSpaceW(wchar_t c) { return (c == L' ' || c == L'\t'); }
  241. inline bool IsThe(const char *str) { if (str && (str[0] == 't' || str[0] == 'T') && (str[1] == 'h' || str[1] == 'H') && (str[2] == 'e' || str[2] == 'E') && (str[3] == ' ')) return true; else return false; }
  242. __forceinline static bool IsTheW(const wchar_t *str)
  243. {
  244. if ((str[0] & ~0x20) == L'T'
  245. && (str[1] & ~0x20) == L'H'
  246. && (str[2] & ~0x20) == L'E'
  247. && str[3] == L' ')
  248. return true;
  249. else
  250. return false;
  251. }
  252. #define SKIP_THE_AND_WHITESPACE(x) { char *save##x=(char*)x; while (IsCharSpaceA(*x) && *x) x++; if (IsThe(x)) x+=4; while (IsCharSpaceA(*x)) x++; if (!*x) x=save##x; }
  253. #define SKIP_THE_AND_WHITESPACEW(x) { wchar_t *save##x=(wchar_t*)x; while ((*x == L' ' || *x == L'\t') && *x) x++; if (IsTheW(x)) x+=4; while ((*x == L' ' || *x == L'\t')) x++; if (!*x) x=save##x; }
  254. //wherever this goes is fine
  255. #define UPDATE_QUERY_TIMER_ID 505
  256. #define UPDATE_RESULT_LIST_TIMER_ID 506
  257. INT_PTR CALLBACK view_mediaDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  258. int WCSCMP_NULLOK(const wchar_t *pa, const wchar_t *pb);
  259. typedef void (*resultsniff_funcW)(itemRecordW *items, int numitems, int user32, int *killswitch);
  260. void bgQuery_Stop();
  261. extern nde_scanner_t m_media_scanner;
  262. typedef std::vector<wchar_t*> CloudFiles;
  263. // returns length in seconds (high bit on means could be much more), or -1 if killed
  264. int saveQueryToListW(C_Config *viewconf, nde_scanner_t s, itemRecordListW *obj,
  265. CloudFiles *uploaded, CloudFiles *uploading,
  266. resultsniff_funcW cb=0, int user32=0, int *killswitch=0, __int64 *total_bytes=0);
  267. // queries.cpp
  268. void view_queryContextMenu(INT_PTR param1, HWND hHost, POINTS pts, int item);
  269. void queriesContextMenu(INT_PTR param1, HWND hHost, POINTS pts);
  270. void queryEditItem(int n);
  271. void addNewQuery(HWND parent);
  272. void queryDeleteItem(HWND parent, int n);
  273. BOOL windowOffScreen(HWND hwnd, POINT pt);
  274. // handleMessage.cpp
  275. INT_PTR HandleIpcMessage(INT_PTR msg, INT_PTR param);
  276. extern "C" extern int (*warand)(void);
  277. extern WNDPROC wa_oldWndProc;
  278. wchar_t *itemrecordWTagFunc(wchar_t * tag, void * p);
  279. wchar_t *fieldTagFunc(wchar_t * tag, void * p); //return 0 if not found
  280. void ndeTagFuncFree(wchar_t * tag, void * p); // for NDE strings
  281. DWORD doGuessProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
  282. void TAG_FMT_EXT(const wchar_t *filename, void *f, void *ff, void *p, wchar_t *out, int out_len, int extended);
  283. extern int asked_for_playcount;
  284. LRESULT APIENTRY wa_newWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  285. extern int m_calling_getfileinfo;
  286. extern HMENU wa_play_menu ;
  287. void add_pledit_to_library();
  288. void add_to_library(HWND wndparent);
  289. extern int g_bgscan_scanning, g_bgrescan_force, g_bgrescan_do, g_bgrescan_int;
  290. extern WNDPROC ml_oldWndProc;
  291. extern time_t g_bgscan_last_rescan;
  292. int runBGscan(int ms);
  293. void compactRecordList(itemRecordListW *obj);
  294. LRESULT APIENTRY ml_newWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  295. int FLOATCMP_NULLOK(const char *pa, const char *pb);
  296. int FLOATWCMP_NULLOK(const wchar_t *pa, const wchar_t *pb);
  297. void ClearTitleHookCache();
  298. int FindFileInDatabase(nde_scanner_t s, int fieldId, const wchar_t *filename, wchar_t alternate[MAX_PATH]);
  299. __int64 ScannerRefToObjCacheNFNW(nde_scanner_t s, itemRecordListW *obj, bool compat);
  300. __int64 ScannerRefToObjCacheNFNW(nde_scanner_t s, itemRecordW *obj, bool compat);
  301. int updateFileInfo(const wchar_t *filename, const wchar_t *metadata, wchar_t *data);
  302. void sortResults(C_Config *viewconf, itemRecordListW *obj);
  303. void queryStrEscape(const char *raw, GayString &str);
  304. void queryStrEscape(const wchar_t *raw, GayStringW &str);
  305. void ParseIntSlashInt(wchar_t *string, int *part, int *parts);
  306. HWND updateCurrentView(HWND hwndDlg);
  307. #define MEDIAVIEW_COL_ARTIST 0
  308. #define MEDIAVIEW_COL_TITLE 1
  309. #define MEDIAVIEW_COL_ALBUM 2
  310. #define MEDIAVIEW_COL_LENGTH 3
  311. #define MEDIAVIEW_COL_TRACK 4
  312. #define MEDIAVIEW_COL_GENRE 5
  313. #define MEDIAVIEW_COL_YEAR 6
  314. #define MEDIAVIEW_COL_FILENAME 7
  315. #define MEDIAVIEW_COL_RATING 8
  316. #define MEDIAVIEW_COL_PLAYCOUNT 9
  317. #define MEDIAVIEW_COL_LASTPLAY 10
  318. #define MEDIAVIEW_COL_LASTUPD 11
  319. #define MEDIAVIEW_COL_FILETIME 12
  320. #define MEDIAVIEW_COL_COMMENT 13
  321. #define MEDIAVIEW_COL_FILESIZE 14
  322. #define MEDIAVIEW_COL_BITRATE 15
  323. #define MEDIAVIEW_COL_TYPE 16
  324. #define MEDIAVIEW_COL_DISC 17
  325. #define MEDIAVIEW_COL_ALBUMARTIST 18
  326. #define MEDIAVIEW_COL_FULLPATH 19
  327. #define MEDIAVIEW_COL_ALBUMGAIN 20
  328. #define MEDIAVIEW_COL_TRACKGAIN 21
  329. #define MEDIAVIEW_COL_PUBLISHER 22
  330. #define MEDIAVIEW_COL_COMPOSER 23
  331. #define MEDIAVIEW_COL_EXTENSION 24
  332. #define MEDIAVIEW_COL_ISPODCAST 25
  333. #define MEDIAVIEW_COL_PODCASTCHANNEL 26
  334. #define MEDIAVIEW_COL_PODCASTPUBDATE 27
  335. #define MEDIAVIEW_COL_BPM 28
  336. #define MEDIAVIEW_COL_CATEGORY 29
  337. #define MEDIAVIEW_COL_DIRECTOR 30
  338. #define MEDIAVIEW_COL_PRODUCER 31
  339. #define MEDIAVIEW_COL_DIMENSION 32
  340. #define MEDIAVIEW_COL_DATEADDED 33
  341. #define MEDIAVIEW_COL_CLOUD 34
  342. #define MEDIAVIEW_COL_NUMS 35 // number of columns
  343. #endif // ML_LOCAL_HEADER