1
0

main.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. #ifndef NULLSOFT_MAINH
  2. #define NULLSOFT_MAINH
  3. #include "..\..\General\gen_ml/ml.h"
  4. #include "..\..\General\gen_ml/ml_ipc_0313.h"
  5. #include "./config.h"
  6. #include "./drivemngr.h"
  7. #include "./drive.h"
  8. #include "./medium.h"
  9. #include "api__ml_disc.h"
  10. #include "..\..\General\gen_ml/menu.h"
  11. #include "./copyfiles.h"
  12. #include "./copyinternal.h"
  13. #include <shlobj.h>
  14. #include <windows.h>
  15. #include <commctrl.h>
  16. #ifndef LONGX86
  17. #ifdef _WIN64
  18. #define LONGX86 LONG_PTR
  19. #else /*_WIN64*/
  20. #define LONGX86 LONG
  21. #endif /*_WIN64*/
  22. #endif // LONGX86
  23. #define OLD_AAC_CODEC mmioFOURCC('A','A','C',' ')
  24. #define BN_EX_GETTEXT 0x0FFF
  25. #define WM_EXTRACTDISC (WM_APP + 0x010)
  26. #define WM_SHOWFILEINFO (WM_APP + 0x11) // (wParam)(UINT)WISF_, (lParam)(LPCWSTR)file(track)name (can be NULL to reset)
  27. #define WM_QUERYFILEINFO (WM_APP + 0x12)
  28. #define WM_TAGUPDATED (WM_APP + 0x13) // wParam = 0, lParam = (LPCWSTR)pszFileName
  29. #define VCM_CREATECOMMANDBAR (WM_APP + 0x20)
  30. #define VCM_DESTROYCOMMANDBAR (WM_APP + 0x21)
  31. #define VCM_GETCOMMANDBAR (WM_APP + 0x22)
  32. #define VCM_GETMININFOENABLED (WM_APP + 0x23)
  33. #define VCM_GETMININFOVISIBLE (WM_APP + 0x24)
  34. typedef struct __CMDBARCREATESTRUCT
  35. {
  36. HWND hwndOwner;
  37. UINT resourceId;
  38. DLGPROC fnDialogProc;
  39. ULONG_PTR uData;
  40. } CMDBARCREATESTRUCT;
  41. #define MSGRESULT(__hwnd, __result) { SetWindowLongPtrW((__hwnd), DWLP_MSGRESULT, ((LONGX86)(LONG_PTR)(__result))); return TRUE; }
  42. #define ViewContainer_CreateCmdBar(/*HWND*/ __hwndViewContainer, /*HWND*/ __hwndOwner, /*INT_PTR*/ __resourceId, /*DLGPROC*/ __fnDialogProc, /*ULONG_PTR*/ __uData)\
  43. {CMDBARCREATESTRUCT cs; cs.hwndOwner = (__hwndOwner); cs.resourceId = (__resourceId); cs.fnDialogProc = (__fnDialogProc); cs.uData = (__uData);\
  44. ((HWND)SNDMSG((__hwndViewContainer), VCM_CREATECOMMANDBAR, 0, (LPARAM)(&cs)));}
  45. #define ViewContainer_DestroyCmdBar(/*HWND*/ __hwndViewContainer)\
  46. ((BOOL)SNDMSG((__hwndViewContainer), VCM_DESTROYCOMMANDBAR, 0, 0L))
  47. #define ViewContainer_GetCmdBar(/*HWND*/ __hwndViewContainer)\
  48. ((HWND)SNDMSG((__hwndViewContainer), VCM_GETCOMMANDBAR, 0, 0L))
  49. #define ViewContainer_GetMiniInfoEnabled(/*HWND*/ __hwndViewContainer)\
  50. ((HWND)SNDMSG((__hwndViewContainer), VCM_GETMININFOENABLED, 0, 0L))
  51. #define ViewContainer_GetMiniInfoVisible(/*HWND*/ __hwndViewContainer)\
  52. ((HWND)SNDMSG((__hwndViewContainer), VCM_GETMININFOVISIBLE, 0, 0L))
  53. extern winampMediaLibraryPlugin plugin;
  54. extern LARGE_INTEGER freq;
  55. void CleanupDirectoryString(LPTSTR pszDirectory);
  56. LPWSTR GetExtensionString(LPWSTR pszBuffer, INT cchBufferMax, DWORD fourcc);
  57. HRESULT FormatFileName(LPTSTR pszTextOut, INT cchTextMax, LPCTSTR pszFormat,
  58. INT nTrackNo, LPCTSTR pszArtist,
  59. LPCTSTR pszAlbum, LPCTSTR pszTitle,
  60. LPCTSTR pszGenre, LPCTSTR pszYear,
  61. LPCTSTR pszTrackArtist,
  62. LPCTSTR pszFileName, LPCTSTR pszDisc);
  63. bool RegisteredEncoder(DWORD fourcc);
  64. extern C_Config *g_config;
  65. extern HMENU g_context_menus;
  66. extern C_Config *g_view_metaconf;
  67. #define DSF_CANRECORD 0x00010000
  68. #define DSF_PLAYING 0x00000001
  69. #define DSF_RIPPING 0x00000002
  70. #define DSF_BURNING 0x00000004
  71. #define DSF_GETTINGINFO 0x00000008
  72. typedef struct _DRIVE
  73. {
  74. CHAR cLetter;
  75. CHAR cMode;
  76. WCHAR szTitle[64];
  77. DWORD textSize;
  78. BOOL textOrigWidth;
  79. WORD itemWidth;
  80. BYTE nBtnState;
  81. BOOL bEjectVisible;
  82. UINT_PTR timerId;
  83. } DRIVE;
  84. typedef BOOL (CALLBACK *NAVITEMENUMPROC)(HNAVITEM hItem, DRIVE *pDrive, LPARAM param);
  85. DRIVE *Plugin_GetDriveFromNavItem(HNAVITEM hItem);
  86. HNAVITEM Plugin_GetNavItemFromLetter(CHAR cLetter);
  87. BOOL Plugin_EnumerateNavItems(NAVITEMENUMPROC callback, LPARAM param);
  88. void Plugin_RegisterListener(HWND hwnd, UINT uMsg, CHAR cLetter); // active view can register itself to be notified about drive/medium changes if cLetter = 0 you will be notifed for all drives
  89. void Plugin_UnregisterListener(HWND hwnd);
  90. void Plugin_ShowRippingPreferences(void);
  91. BOOL Plugin_IsExtractScheduled(CHAR cLetter);
  92. int getFileInfo(const char *filename, const char *metadata, char *dest, int len);
  93. int getFileInfoW(const wchar_t *filename, const wchar_t *metadata, wchar_t *dest, int len);
  94. #define HF_DOMODAL 0x0001
  95. #define HF_ALLOWRESIZE 0x0010
  96. HWND MLDisc_ShowHelp(HWND hParent, LPCWSTR pszWindowTitle, LPCWSTR pszCaption, LPCWSTR pszText, UINT uFlags); // returns hwnd only if not HF_DOMODAL
  97. #define QBF_SHOW_CHECKBOX 0x00000001L
  98. #define QBF_SHOW_EXTRA_BUTTON 0x00000002L
  99. #define QBF_TOPMOST 0x00000100L
  100. #define QBF_SETFOREGROUND 0x00000200L
  101. #define QBF_BEEP 0x00000400L
  102. #define QBF_FLASH 0x00000800L
  103. #define QBF_DEFAULT_OK 0x00000000L
  104. #define QBF_DEFAULT_CANCEL 0x00001000L
  105. #define QBF_DEFAULT_EXTRA1 0x00002000L
  106. typedef struct _QUESTIONBOX
  107. {
  108. HWND hParent; // [in]
  109. LPCTSTR pszIcon; // [in]
  110. UINT uBeepType; // [in]
  111. LPCTSTR pszTitle; // [in] accepts MAKEINTRESOURCE() as parameters.
  112. LPCTSTR pszMessage; // [in] accepts MAKEINTRESOURCE() as parameters.
  113. UINT uFlags; // [in]
  114. LPCTSTR pszBtnOkText; // [in] accepts MAKEINTRESOURCE() as parameters.
  115. LPCTSTR pszBtnCancelText; // [in] accepts MAKEINTRESOURCE() as parameters.
  116. LPCTSTR pszCheckboxText; // [in] accepts MAKEINTRESOURCE() as parameters.
  117. LPCTSTR pszBtnExtraText; // [in] accepts MAKEINTRESOURCE() as parameters.
  118. BOOL checkboxChecked; // [in][out]
  119. } QUESTIONBOX;
  120. INT_PTR MLDisc_ShowQuestionBox(QUESTIONBOX *pQuestionBox); // returns pressed button id;
  121. // cdrip.cpp
  122. BOOL CALLBACK CDRipPrefsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  123. typedef struct
  124. {
  125. char drive_letter;
  126. wchar_t *album;
  127. wchar_t *artist;
  128. wchar_t *genre;
  129. wchar_t *year;
  130. wchar_t *publisher; // record label
  131. wchar_t *disc; // disc ##/##
  132. wchar_t *comment; // notes from CDDB
  133. wchar_t **composers;
  134. wchar_t **conductors;
  135. wchar_t **gracenoteFileIDs;
  136. wchar_t **gracenoteExtData;
  137. int total_length_bytes;
  138. int ntracks; // total number of tracks
  139. wchar_t **tracks; // set these to NULL to not rip em
  140. wchar_t **trackArtists;
  141. int *lengths; // lengths, in seconds
  142. wchar_t **filenames; // can be used internally to override output filenames
  143. // (should always allocate, but leave NULL ptrs in the array)
  144. wchar_t **tempFilenames; //where we are ripping to, we'll move at the end
  145. } cdrip_params;
  146. void cdrip_extractFiles(cdrip_params *parms);
  147. int cdrip_isextracting(char drive);
  148. void cdrip_stop_all_extracts();
  149. //gracenote.cpp
  150. void gracenoteInit();
  151. int gracenoteQueryFile(const char *filename);
  152. void gracenoteCancelRequest();
  153. int gracenoteDoTimerStuff();
  154. void gracenoteSetValues(char *artist, char *album, char *title);
  155. char *gracenoteGetTuid();
  156. int gracenoteIsWorking();
  157. //view_ripburn.cpp
  158. INT_PTR CALLBACK view_ripburnDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  159. // view_cdrom.cpp
  160. void saveCDToItemRecordList(CHAR cLetter, itemRecordList *obj, char *album);
  161. int cdrom_contextMenu(HWND parent, CHAR cLetter, HNAVITEM hItem);
  162. void cdburn_appendItemRecord(itemRecordList *obj, char driveletter);
  163. HWND CreateContainerWindow(HWND hwndParent, CHAR cLetter, BOOL bQueryInfo);
  164. HWND CreateWaitWindow(HWND hwndParent, CHAR cLetter);
  165. HWND CreateInfoWindow(HWND hwndParent, CHAR cLetter);
  166. HWND CreateCDViewWindow(HWND hwndParent, DM_NOTIFY_PARAM *phdr);
  167. HWND CreateCDBurnWindow(HWND hwndParent, CHAR cLetter);
  168. HWND CreateCDRipWindow(HWND hwndParent, CHAR cLetter);
  169. HWND CreateCdDataViewWindow(HWND hwndParent, CHAR cLetter);
  170. BOOL CALLBACK browseEnumProc(HWND hwnd, LPARAM lParam);
  171. #endif