123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- #include "main.h"
- #include "../Winamp/wa_ipc.h"
- #include "api__ml_iso.h"
- #include <api/service/waservicefactory.h>
- api_service *WASABI_API_SVC = 0;
- api_application *WASABI_API_APP = 0;
- api_playlistmanager *AGAVE_API_PLAYLISTMANAGER = 0;
- int Init()
- {
-
- if (SendMessage(plugin.hwndWinampParent, WM_WA_IPC, 0, IPC_GETVERSION) < 0x5054)
- return 1;
-
- WASABI_API_SVC = (api_service *)SendMessage(plugin.hwndWinampParent, WM_WA_IPC, 0, IPC_GET_API_SERVICE);
-
-
- waServiceFactory *factory = WASABI_API_SVC->service_getServiceByGuid(applicationApiServiceGuid);
- if (factory)
- WASABI_API_APP = (api_application *)factory->getInterface();
-
-
- factory = WASABI_API_SVC->service_getServiceByGuid(api_playlistmanagerGUID);
- if (factory)
- AGAVE_API_PLAYLISTMANAGER = (api_playlistmanager *)factory->getInterface();
-
-
-
- return 0;
- }
- void Quit()
- {
- }
- INT_PTR MessageProc(int message_type, INT_PTR param1, INT_PTR param2, INT_PTR param3)
- {
- switch(message_type)
- {
-
-
- case ML_MSG_ONSENDTOBUILD:
- {
- INT_PTR source_type = param1;
- INT_PTR context = param2;
-
-
-
- switch(source_type)
- {
- case ML_TYPE_ITEMRECORDLIST:
- case ML_TYPE_FILENAMES:
- case ML_TYPE_PLAYLIST:
- case ML_TYPE_PLAYLISTS:
- case ML_TYPE_ITEMRECORDLISTW:
- case ML_TYPE_FILENAMESW:
- {
-
- mlAddToSendToStructW s;
- s.context = context;
- s.desc = L"Create new ISO image";
- s.user32 = (INT_PTR)MessageProc;
-
- SendMessage(plugin.hwndLibraryParent, WM_ML_IPC, (WPARAM)&s, ML_IPC_ADDTOSENDTOW);
- }
-
-
- return 0;
- case ML_TYPE_STREAMNAMES:
- case ML_TYPE_CDTRACKS:
- case ML_TYPE_QUERYSTRING:
- case ML_TYPE_STREAMNAMESW:
- case ML_TYPE_TREEITEM:
-
-
- return 0;
- }
-
- return 0;
- }
-
- case ML_MSG_ONSENDTOSELECT:
- {
-
- INT_PTR unique = param3;
- if (unique != (INT_PTR)MessageProc)
- return 0;
- INT_PTR type = param1;
- INT_PTR data = param2;
- switch(type)
- {
- case ML_TYPE_ITEMRECORDLIST:
- ConvertItemRecordListToISO((const itemRecordList *)data);
- return 1;
- case ML_TYPE_FILENAMES:
- ConvertFilenamesToISO((const char *)data);
- return 1;
- case ML_TYPE_PLAYLIST:
- ConvertPlaylistToISO((const mlPlaylist *)data);
- return 1;
- case ML_TYPE_PLAYLISTS:
- ConvertPlaylistsToISO((const mlPlaylist **)data);
- return 1;
- case ML_TYPE_ITEMRECORDLISTW:
- ConvertUnicodeItemRecordListToISO((const itemRecordListW *)data);
- return 1;
- case ML_TYPE_FILENAMESW:
- ConvertUnicodeFilenamesToISO((const wchar_t *)data);
- return 1;
- default:
- return 0;
- }
- }
- }
- return 0;
- }
- winampMediaLibraryPlugin plugin =
- {
- MLHDR_VER,
- "ISO Creator",
- Init,
- Quit,
- MessageProc,
- 0,
- 0,
- 0,
- };
- extern "C" __declspec(dllexport) winampMediaLibraryPlugin *winampGetMediaLibraryPlugin()
- {
- return &plugin;
- }
|