main.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #ifndef NULLSOFT_ML_PLAYLISTS_MAIN_H
  2. #define NULLSOFT_ML_PLAYLISTS_MAIN_H
  3. #include <windows.h>
  4. #include <shlwapi.h>
  5. #include "resource.h"
  6. #include "../../Plugins/General/gen_ml/ml.h"
  7. #include "../../Plugins/General/gen_ml/ml_ipc.h"
  8. #include "../../Plugins/General/gen_ml/ml_ipc_0313.h"
  9. #include "Winamp/wa_ipc.h"
  10. #include "../../Plugins/General/gen_ml/config.h"
  11. #include "PlaylistInfo.h"
  12. #include "nu/MediaLibraryInterface.h"
  13. #include "../../Plugins/General/gen_ml/menu.h"
  14. #include "replicant/nu/AutoWide.h"
  15. #include "replicant/nu/AutoChar.h"
  16. #include "nu/DialogSkinner.h"
  17. #include "api__ml_playlists.h"
  18. #include "..\..\..\nu\AutoLock.h"
  19. #include "ml_downloads/DownloadStatus.h"
  20. #include "ml_downloads/DownloadsDialog.h"
  21. #include "ml_downloads/Downloaded.h"
  22. #include <map>
  23. #define WINAMP_MANAGEPLAYLISTS 40385
  24. #define ID_DOSHITMENU_ADDNEWPLAYLIST 40031
  25. #ifndef FILENAME_SIZE
  26. #define FILENAME_SIZE (MAX_PATH * 4)
  27. #endif
  28. INT_PTR pluginMessageProc(int message_type, INT_PTR param1, INT_PTR param2, INT_PTR param3);
  29. extern INT_PTR playlistsTreeId, playlistsCloudTreeId;
  30. extern HNAVITEM playlistItem;
  31. extern int imgPL, imgCloudPL;
  32. extern wchar_t current_playing[FILENAME_SIZE];
  33. INT_PTR LoadPlaylist(INT_PTR treeId);
  34. void Playlists_ReplaceBadPathChars(LPWSTR pszPath);
  35. extern HMENU wa_playlists_cmdmenu;
  36. void HookPlaylistEditor();
  37. void UnhookPlaylistEditor();
  38. void UpdateMenuItems(HWND hwndDlg, HMENU menu);
  39. INT_PTR CALLBACK view_playlistsDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  40. INT_PTR CALLBACK AddPlaylistDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  41. INT_PTR CALLBACK view_playlistDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  42. extern winampMediaLibraryPlugin plugin;
  43. extern HMENU g_context_menus, g_context_menus2, g_context_menus3;
  44. extern wchar_t g_path[MAX_PATH];
  45. static const bool ADD_TO_TREE = true;
  46. extern HINSTANCE cloud_hinst;
  47. extern int IPC_GET_CLOUD_HINST, IPC_GET_CLOUD_ACTIVE;
  48. extern int cloud_avail, normalimage, cloudImage, groupBtn, customAllowed, enqueuedef;
  49. extern HWND currentView;
  50. void AddPlaylist( int callback, const wchar_t *title, const wchar_t *filename, bool makeTree, int cloud, size_t numItems = 0, uint64_t length = 0 );
  51. void LoadPlaylists();
  52. void UpdatePlaylists();
  53. int AddToCloud();
  54. void playlists_Add(HWND parent, bool callback = true);
  55. void playlists_AddToCloudPrompt(HWND hwndDlg);
  56. enum { SORT_TITLE_ASCENDING, SORT_TITLE_DESCENDING, SORT_NUMBER_ASCENDING, SORT_NUMBER_DESCENDING };
  57. void playlists_Sort(size_t sort_type);
  58. wchar_t *createPlayListDBFileName(wchar_t *filename); // filename is ignored but used for temp space, make sure it's 1024+256 chars =)
  59. void Playlist_importFromWinamp();
  60. void Playlist_importFromFile(HWND dlgparent);
  61. void Playlist_importFromFolders(HWND dlgparent);
  62. bool FindTreeItem(INT_PTR treeId);
  63. void RenamePlaylist(GUID _guid, HWND parent);
  64. void DeletePlaylist(GUID _guid, HWND parent, bool confirm);
  65. void RefreshPlaylistsList();
  66. void HookMediaLibrary();
  67. void UnhookMediaLibrary();
  68. void playlist_ContextMenu(HWND hwndDlg, POINT p);
  69. extern C_Config *g_config;
  70. extern int (*warand)(void);
  71. void MakeTree(PlaylistInfo &playlist);
  72. void UpdateTree(PlaylistInfo &playlist, int tree_id);
  73. LRESULT pluginHandleIpcMessage(int msg, WPARAM param);
  74. extern HCURSOR hDragNDropCursor;
  75. void FormatLength(wchar_t *str, int length, int buf_len);
  76. extern int IPC_LIBRARY_SENDTOMENU;
  77. void Hook(HWND winamp);
  78. extern INT_PTR sendToIgnoreID;
  79. extern INT_PTR lastActiveID;
  80. void playlist_Reload(bool forced = false);
  81. void playlist_Save(HWND hwndDlg);
  82. void playlist_SaveGUID(GUID _guid);
  83. void playlist_ReloadGUID(GUID _guid);
  84. extern HWND activeHWND; // active playlist view
  85. int CALLBACK WINAPI _bcp( HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
  86. INT_PTR PlayPlaylist(INT_PTR treeId);
  87. INT_PTR playlists_OnClick(INT_PTR treeId, int clickType, HWND wnd);
  88. int playlists_OnKeyDown(int treeId, NMTVKEYDOWN *p, HWND hwndDlg);
  89. int playlists_OnDrag(int treeId, POINT *pt, int *type);
  90. int playlists_OnDrop(int treeId, POINT *pt, int destTreeId);
  91. int playlists_CloudAvailable();
  92. int playlists_CloudInstalled();
  93. /* SendTo.cpp */
  94. int playlists_BuildSendTo(int sourceType, INT_PTR context);
  95. void AddPlaylistFromFilenames(const char *filenames, const wchar_t *playlistTitle, int makeTree, const wchar_t *filename=0);
  96. void AddPlaylistFromFilenamesW(const wchar_t *filenames, const wchar_t *playlistTitle, int makeTree, const wchar_t *filename=0);
  97. void AddPlaylistFromItemRecordList(itemRecordList *obj, const wchar_t *playlistTitle, int makeTree, const wchar_t *filename=0);
  98. void AddPlaylistFromItemRecordListW(itemRecordListW *obj, const wchar_t *playlistTitle, int makeTree, const wchar_t *filename=0);
  99. int playlists_OnDropTarget(int id, int type, INT_PTR data);
  100. int playlists_OnSendTo(int sourceType, INT_PTR data, int id);
  101. void SwapPlayEnqueueInMenu(HMENU listMenu);
  102. void SyncMenuWithAccelerators(HWND hwndDlg, HMENU menu);
  103. BOOL CALLBACK browseEnumProc(HWND hwnd, LPARAM lParam);
  104. extern int uniqueAddress;
  105. typedef std::map<INT_PTR, GUID> TREE_TO_GUID_MAP;
  106. extern TREE_TO_GUID_MAP tree_to_guid_map;
  107. extern viewButtons view;
  108. #define DEFAULT_PL_SEND_TO 1
  109. #endif