123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- #ifndef __PMP_H_
- #define __PMP_H_
- #define WIN32_LEAN_AND_MEAN
- #include <windows.h> // needed for HDC and stuff
- #include <stddef.h>
- #include "..\..\General\gen_ml/ml.h"
- #ifdef __cplusplus
- class api_service;
- #endif
- typedef intptr_t songid_t;
- typedef intptr_t pmpart_t;
- #define SUPPORTS_ARTIST 0x00000001
- #define SUPPORTS_ALBUM 0x00000002
- #define SUPPORTS_TITLE 0x00000004
- #define SUPPORTS_TRACKNUM 0x00000008
- #define SUPPORTS_DISCNUM 0x00000010
- #define SUPPORTS_GENRE 0x00000020
- #define SUPPORTS_YEAR 0x00000040
- #define SUPPORTS_SIZE 0x00000080
- #define SUPPORTS_LENGTH 0x00000100
- #define SUPPORTS_BITRATE 0x00000200
- #define SUPPORTS_PLAYCOUNT 0x00000400
- #define SUPPORTS_RATING 0x00000800
- #define SUPPORTS_LASTPLAYED 0x00001000
- #define SUPPORTS_LASTUPDATED 0x00002000
- #define SUPPORTS_ALBUMARTIST 0x00004000
- #define SUPPORTS_COMPOSER 0x00008000
- #define SUPPORTS_PUBLISHER 0x00010000
- #define SUPPORTS_ALBUMART 0x00020000
- #define SUPPORTS_MIMETYPE 0x00040000
- #define SUPPORTS_DATEADDED 0x00080000
- #define SORTBY_ARTIST 0
- #define SORTBY_ALBUM 1
- #define SORTBY_TITLE 2
- #define SORTBY_TRACKNUM 3
- #define SORTBY_DISCNUM 4
- #define SORTBY_GENRE 5
- #define SORTBY_RATING 6
- #define SORTBY_PLAYCOUNT 7
- #define SORTBY_LASTPLAYED 8
- #define SORTBY_DATEADDED 9
- #define FIELD_EXTENSION L"ext"
- class Device {
- protected:
- Device() {}
- ~Device() {}
- public:
- virtual __int64 getDeviceCapacityAvailable()=0;
- virtual __int64 getDeviceCapacityTotal()=0;
- virtual void Eject()=0;
- virtual void Close()=0;
-
- virtual int transferTrackToDevice(const itemRecordW * track,
- void * callbackContext,
- void (*callback)(void *callbackContext, wchar_t *status),
- songid_t * songid,
- int * killswitch
- )=0;
- virtual int trackAddedToTransferQueue(const itemRecordW *track)=0;
- virtual void trackRemovedFromTransferQueue(const itemRecordW *track)=0;
-
-
- virtual __int64 getTrackSizeOnDevice(const itemRecordW *track)=0;
- virtual void deleteTrack(songid_t songid)=0;
- virtual void commitChanges(){}
- virtual int getPlaylistCount()=0;
-
- virtual void getPlaylistName(int playlistnumber, wchar_t *buf, int len)=0;
- virtual int getPlaylistLength(int playlistnumber)=0;
- virtual songid_t getPlaylistTrack(int playlistnumber,int songnum)=0;
- virtual void setPlaylistName(int playlistnumber, const wchar_t *buf)=0;
- virtual void playlistSwapItems(int playlistnumber, int posA, int posB)=0;
- virtual void sortPlaylist(int playlistnumber, int sortBy)=0;
- virtual void addTrackToPlaylist(int playlistnumber, songid_t songid)=0;
- virtual void removeTrackFromPlaylist(int playlistnumber, int songnum)=0;
- virtual void deletePlaylist(int playlistnumber)=0;
- virtual int newPlaylist(const wchar_t *name)=0;
- virtual void getTrackArtist(songid_t songid, wchar_t *buf, int len)=0;
- virtual void getTrackAlbum(songid_t songid, wchar_t *buf, int len)=0;
- virtual void getTrackTitle(songid_t songid, wchar_t *buf, int len)=0;
- virtual int getTrackTrackNum(songid_t songid)=0;
- virtual int getTrackDiscNum(songid_t songid)=0;
- virtual void getTrackGenre(songid_t songid, wchar_t * buf, int len)=0;
- virtual int getTrackYear(songid_t songid)=0;
- virtual __int64 getTrackSize(songid_t songid)=0;
- virtual int getTrackLength(songid_t songid)=0;
- virtual int getTrackBitrate(songid_t songid)=0;
- virtual int getTrackPlayCount(songid_t songid)=0;
- virtual int getTrackRating(songid_t songid)=0;
- virtual __time64_t getTrackLastPlayed(songid_t songid)=0;
- virtual __time64_t getTrackLastUpdated(songid_t songid)=0;
- virtual void getTrackAlbumArtist(songid_t songid, wchar_t *buf, int len){};
- virtual void getTrackPublisher(songid_t songid, wchar_t *buf, int len){};
- virtual void getTrackComposer(songid_t songid, wchar_t *buf, int len){};
- virtual void getTrackMimeType(songid_t songid, wchar_t *buf, int len){};
- virtual __time64_t getTrackDateAdded(songid_t songid){ return -1; };
- virtual int getTrackType(songid_t songid) { return 0; }
- virtual void getTrackExtraInfo(songid_t songid, const wchar_t *field, wchar_t *buf, int len) {};
-
- virtual void setTrackArtist(songid_t songid, const wchar_t *value)=0;
- virtual void setTrackAlbum(songid_t songid, const wchar_t *value)=0;
- virtual void setTrackTitle(songid_t songid, const wchar_t *value)=0;
- virtual void setTrackTrackNum(songid_t songid, int value)=0;
- virtual void setTrackDiscNum(songid_t songid, int value)=0;
- virtual void setTrackGenre(songid_t songid, const wchar_t *value)=0;
- virtual void setTrackYear(songid_t songid, int year)=0;
- virtual void setTrackPlayCount(songid_t songid, int value)=0;
- virtual void setTrackRating(songid_t songid, int value)=0;
- virtual void setTrackLastPlayed(songid_t songid, __time64_t value)=0;
- virtual void setTrackLastUpdated(songid_t songid, __time64_t value)=0;
- virtual void setTrackAlbumArtist(songid_t songid, const wchar_t *value){};
- virtual void setTrackPublisher(songid_t songid, const wchar_t *value){};
- virtual void setTrackComposer(songid_t songid, const wchar_t *value){};
- virtual void setTrackExtraInfo(songid_t songid, const wchar_t *field, const wchar_t *value) {};
- virtual bool playTracks(songid_t * songidList, int listLength, int startPlaybackAt, bool enqueue)=0;
- virtual intptr_t extraActions(intptr_t param1, intptr_t param2, intptr_t param3,intptr_t param4){return 0;}
- virtual bool copyToHardDriveSupported() {return false;}
- virtual __int64 songSizeOnHardDrive(songid_t song) {return -1;}
- virtual int copyToHardDrive(songid_t song,
- wchar_t * path,
- void * callbackContext,
- void (*callback)(void * callbackContext, wchar_t * status),
- int * killswitch
- ) {return -1;}
-
- virtual void setArt(songid_t songid, void *buf, int w, int h){}
- virtual pmpart_t getArt(songid_t songid){return NULL;}
- virtual void releaseArt(pmpart_t art){}
- virtual int drawArt(pmpart_t art, HDC dc, int x, int y, int w, int h) {return 0;}
- virtual void getArtNaturalSize(pmpart_t art, int *w, int *h){*w=*h=0;}
- virtual void setArtNaturalSize(pmpart_t art, int w, int h){}
- virtual void getArtData(pmpart_t art, void* data){}
- virtual bool artIsEqual(pmpart_t a, pmpart_t b){return false;}
- };
- #define PMPHDR_VER 0x10
- #define PMP_DEVICECHANGE 0x100
- #define PMP_CONFIG 0x101
- #define PMP_NO_CONFIG 0x102
- #define WM_PMP_IPC WM_USER+10
- #define PMP_IPC_DEVICECONNECTED 0x100
- #define PMP_IPC_DEVICEDISCONNECTED 0x101
- #define PMP_IPC_DEVICELOADING 0x102
-
-
-
- #define PMP_IPC_DEVICENAMECHANGED 0x103
-
- #define PMP_IPC_DEVICECLOUDTRANSFER 0x104
-
- #define PMP_IPC_GETCLOUDTRANSFERS 0x105
-
- typedef struct {
- wchar_t filenames[MAX_PATH + 1];
- void * device_token;
- } cloudDeviceTransfer;
- typedef struct {
- Device * dev;
-
- void (*UpdateCaption)(wchar_t * caption, void * context);
- void * context;
- } pmpDeviceLoading;
- typedef struct {
- HWND parent;
- const char * dev_name;
- } pmpDevicePrefsView;
- #define PMP_IPC_GET_TRANSCODER 0x200
- #define PMP_IPC_RELEASE_TRANSCODER 0x201
- #define PMP_IPC_ENUM_ACTIVE_DRIVES 0x300
- typedef void (*ENUM_DRIVES_CALLBACK)(wchar_t, UINT);
- typedef void (*ENUMDRIVES)(ENUM_DRIVES_CALLBACK callback);
- #define PMP_IPC_GET_INI_FILE 0x301
- #define PMP_IPC_GET_PREFS_VIEW 0x302
- #define DEVICE_SET_ICON 0x0
- #define DEVICE_SUPPORTED_METADATA 0x1
- #define DEVICE_DOES_NOT_SUPPORT_EDITING_METADATA 0x3
- #define DEVICE_CAN_RENAME_DEVICE 0x4
- #define DEVICE_GET_INI_FILE 0x5
- #define DEVICE_GET_PREFS_DIALOG 0x6
- #define DEVICE_REFRESH 0x7
- #define DEVICE_ADDPODCASTGROUP 0x8
- #define DEVICE_ADDPODCASTGROUP_FINISH 0x9
- #define DEVICE_SUPPORTS_VIDEO 0xA
- #define DEVICE_DONE_SETTING 0xB
- #define DEVICE_VETO_ENCODER 0xC
- #define DEVICE_GET_ICON 0xD
- #define DEVICE_SUPPORTS_PODCASTS 0xE
- #define DEVICE_GET_CONNECTION_TYPE 0xF
- #define DEVICE_GET_UNIQUE_ID 0x10
- #define DEVICE_GET_MODEL 0x11
- #define DEVICE_SENDTO_UNSUPPORTED 0x12
- #define DEVICE_GET_DISPLAY_TYPE 0x13
- #define DEVICE_VETO_TRANSCODING 0x14
- #define DEVICE_GET_PREFS_PARENT 0x15
- #define DEVICE_GET_CLOUD_SOURCES_MENU 0x16
- #define DEVICE_DO_CLOUD_SOURCES_MENU 0x17
-
-
-
- #define DEVICE_IS_CLOUD_TX_DEVICE 0x18
- #define DEVICE_SYNC_UNSUPPORTED 0x19
- #define DEVICE_GET_CLOUD_DEVICE_ID 0x20
- #define DEVICE_NOT_READY_TO_VIEW 0x21
- #define DEVICE_GET_NODE_ICON_ID 0x22
- #define DEVICE_PLAYLISTS_UNSUPPORTED 0x23
- #define DEVICE_DOES_NOT_SUPPORT_REMOVE 0x24
- #define CLOUD_SOURCE_MENUS 60000
- #define CLOUD_SOURCE_MENUS_UPPER 60000 + 20
- #define CLOUD_SOURCE_MENUS_PL_UPPER 60000 + 200
- typedef struct {
- wchar_t title[98];
- int res_id;
- DLGPROC dlg_proc;
- HINSTANCE hinst;
- } pref_tab;
- typedef struct {
- HWND parent;
- Device * dev;
- void (*config_tab_init)(HWND tab,HWND m_hwndDlg);
- } prefsParam;
- typedef struct {
- int version;
- wchar_t *description;
- int ( __cdecl *init)();
- void ( __cdecl *quit)();
- INT_PTR ( __cdecl *MessageProc)(int msg, INT_PTR param1, INT_PTR param2, INT_PTR param3);
-
- HWND hwndWinampParent;
- HWND hwndLibraryParent;
- HWND hwndPortablesParent;
- HINSTANCE hDllInstance;
-
- #ifdef __cplusplus
- api_service *service;
- #else
- void * service;
- #endif
- } PMPDevicePlugin;
- #define PMP_INIT_SUCCESS 0
- #define PMP_INIT_FAILURE 1
- #define PMP_PLUGIN_UNINSTALL_NOW 0x0
- #define PMP_PLUGIN_UNINSTALL_REBOOT 0x1
- #endif
|