virtual__int64songSizeOnHardDrive(songid_tsong){return-1;}// how big a song will be when copied back. Return -1 for not supported.
virtualintcopyToHardDrive(songid_tsong,// the song to copy
wchar_t*path,// path to copy to, in the form "c:\directory\song". The directory will already be created, you must append ".mp3" or whatever to this string! (there is space for at least 10 new characters).
void*callbackContext,//pass this to the callback
void(*callback)(void*callbackContext,wchar_t*status),// call this every so often so the GUI can be updated. Including when finished!
int*killswitch// if this gets set to anything other than zero, the transfer has been cancelled by the user
){return-1;}// -1 for failed/not supported. 0 for success.
// art functions
virtualvoidsetArt(songid_tsongid,void*buf,intw,inth){}//buf is in format ARGB32*
// The MessageProc could recieve any of the following..
#define PMP_DEVICECHANGE 0x100 // param1=WPARAM, param2=LPARAM. See http://msdn.microsoft.com/library/en-us/devio/base/wm_devicechange.asp
#define PMP_CONFIG 0x101 // param1 will be the parent HWND. return 1 if you implement this
#define PMP_NO_CONFIG 0x102 // return TRUE to allow the plug-in config button to be disabled as applicable
// use SendMessage(hwndPortablesParent,WM_PMP_IPC,param,PMP_IPC_*); on any of the following
#define WM_PMP_IPC WM_USER+10
#define PMP_IPC_DEVICECONNECTED 0x100 // pass a Device *
#define PMP_IPC_DEVICEDISCONNECTED 0x101 // pass a Device *
#define PMP_IPC_DEVICELOADING 0x102 // pass a pmpDeviceLoading *.
// This is optional, call PMP_IPC_DEVICECONNECTED when loading is finished
// or PMP_IPC_DEVICEDISCONNECTED to cancel.
// while a device is being loaded, DEVICE_SET_ICON will be called, nothing else.
#define PMP_IPC_DEVICENAMECHANGED 0x103 // pass a Device *
// added 5.64+
#define PMP_IPC_DEVICECLOUDTRANSFER 0x104 // pass a cloudDeviceTransfer *
// added 5.64+
#define PMP_IPC_GETCLOUDTRANSFERS 0x105 // pass a Cloudfiles * (defined as typedef nu::PtrList<wchar_t>)
// added 5.64+
typedefstruct{
wchar_tfilenames[MAX_PATH+1];// list of filename(s) to transfer to the cloud device
void*device_token;// token identifier of the cloud device to transfer to
}cloudDeviceTransfer;// added 5.64+
typedefstruct{
Device*dev;
// filled in by ml_pmp
void(*UpdateCaption)(wchar_t*caption,void*context);// call this with the context to update the caption
void*context;
}pmpDeviceLoading;
typedefstruct{
HWNDparent;
constchar*dev_name;
}pmpDevicePrefsView;
#define PMP_IPC_GET_TRANSCODER 0x200 // returns a Transcoder*, pass your Device* (you must have previously called PMP_IPC_DEVICECONNECTED)
#define PMP_IPC_RELEASE_TRANSCODER 0x201 // pass your Transcoder*, no return value
#define PMP_IPC_ENUM_ACTIVE_DRIVES 0x300 // pass your function in wParam, or if you pass wParam = 0, it will return a function pointer (type ENUMDRIVES) you can call directly
#define PMP_IPC_GET_INI_FILE 0x301 // pass a Device*, returns a wchar_t*
#define PMP_IPC_GET_PREFS_VIEW 0x302 // pass a pmpDevicePrefsView*, returns a HWND
// The following may be recieved by Device::extraActions (as param1)
#define DEVICE_SET_ICON 0x0 // param2 is of type MLTREEIMAGE *, modify it to use your own icon for the device in the ML tree
#define DEVICE_SUPPORTED_METADATA 0x1 // return a load of SUPPORTS_* ORed together. If you return 0, all is assumed.
#define DEVICE_DOES_NOT_SUPPORT_EDITING_METADATA 0x3 // return 1 if metadata cannot be edited, 0 otherwise.
#define DEVICE_CAN_RENAME_DEVICE 0x4 // return 1 if the device can be renamed. setPlaylistName(0,name) will be used to rename the device
#define DEVICE_GET_INI_FILE 0x5 // param2 is wchar_t * of length MAX_PATH. Fill it with the location of the inifile that should be used.
#define DEVICE_GET_PREFS_DIALOG 0x6 // param2 is a pref_tab*, fill it in if you want to put your own config in. On WM_INITDIALOG lParam will be a prefsParam *
#define DEVICE_REFRESH 0x7 // F5 was pressed. return 1 to do an in-place update
#define DEVICE_ADDPODCASTGROUP_FINISH 0x9 // for ipod. param2=int playlistid
#define DEVICE_SUPPORTS_VIDEO 0xA // return 1 if you support video
#define DEVICE_DONE_SETTING 0xB // param2=songid_t, tells your plugin that a series of setTrack*() functions are done being called for a particular track
#define DEVICE_VETO_ENCODER 0xC // param2==fourcc. return 1 to remove the encoder from the transcoding preferences
#define DEVICE_GET_ICON 0xD // param2=width, param3=height, param4 = wchar_t[260] to put your path into (possibly res:// protocol)
#define DEVICE_SUPPORTS_PODCASTS 0xE // return 0 if you support podcasts. return 1 if you don't want them transferred
#define DEVICE_GET_CONNECTION_TYPE 0xF // return 1 if you support. param2 is a const char ** that you should set to a static connect type string.
#define DEVICE_GET_UNIQUE_ID 0x10 // return 1 if you support. copy a unique name into param2 (char *), param3 will be the allocated size (# of characters)
#define DEVICE_GET_MODEL 0x11 // return 1 if you support, param2 = (wchar_t*)buffer - model name; param3 = (unsigned int)bufferSize - buffer size; param4 - not used.
#define DEVICE_SENDTO_UNSUPPORTED 0x12 // return 1 if you don't support send-to
#define DEVICE_GET_DISPLAY_TYPE 0x13 // return 1 if you support, param2 = (wchar_t*)buffer - model name; param3 = (unsigned int)bufferSize - buffer size; param4 - not used.
#define DEVICE_VETO_TRANSCODING 0x14 // return 1 if you don't support transcoding and don't want to show the 'Transcoding' preference tab (also see DEVICE_VETO_ENCODER)
#define DEVICE_GET_PREFS_PARENT 0x15 // return prefsDlgRecW * of the parent preference page you want the device preference page to be a child off. return 0 for default placing
#define DEVICE_GET_CLOUD_SOURCES_MENU 0x16 // return HMENU if you support cloud source menus and have one to provide (only called as needed). param2=(int*)num_cloud_devices. param4=(int)songid i.e. clicked item or -1 for selection
#define DEVICE_DO_CLOUD_SOURCES_MENU 0x17 // a cloud sources menu item was clicked. param2=(int)menu_id from the menu provided via DEVICE_GET_CLOUD_SOURCES_MENU.
// param3=(int)mode where 0 is via submenu and 1 is the menu only i.e. single-selection.
// param4=(CItemList*) of songid_t so it is possible to do multiple selection handling
// return 1 if needing the item to be removed from the view