I've attached the define of the portable drive interface. You would need to create an IPortableDrive and expose it with a DLL function CreatePortableDrive(...). This is much like several of the other plugin types.
The IDispatch pointers are MJFilesAutomation pointers.
I know an example plugin would be helpful, but I don't think we will have time to provide one any time soon. Getting Media Center to load a custom plugin will also require some coding on our side, but for now, you could replace / hijack the existing handheld plugin.
#pragma once
// current interface version
#define HH_INTERFACE_VERSION 7
// device types
#define DEVICETYPE_UNKNOWN -1
#define DEVICETYPE_PORTABLEDRIVE 0
#define DEVICETYPE_SPECIFIC 1
#define DEVICETYPE_WMDM 2
#define DEVICETYPE_IPOD 3
#define DEVICETYPE_PROXY 4
// playlist formats
#define PLAYLIST_FORMAT_M3U_RELATIVE 0
#define PLAYLIST_FORMAT_M3U_FULL 1
#define PLAYLIST_FORMAT_M3U_FULL_NO_DRIVE 2
#define PLAYLIST_FORMAT_ASX_RELATIVE 3
#define PLAYLIST_FORMAT_ASX_FULL 4
#define PLAYLIST_FORMAT_ASX_FULL_NO_DRIVE 5
#define PLAYLIST_FORMAT_PLP_FULL_NO_DRIVE 6
#define PLAYLIST_FORMAT_M3U_FULL_NO_DRIVE_WITH_COMMENTS 7
// plugin names
#define PLUGINNAME_PORTABLEDRIVES _T("Portable Drives")
// no playlists
#define NO_PLAYLISTS _T("NO_PLAYLISTS")
// general defines
#define PDT_LIST_DELIMITER _T(";")
#define WMDM_E_PERMISSION -1003
#define WM_DRM_PROGRESS (WM_USER + 300)
// action defines
#define HH_MENU_ACTION_BUILD 0
#define HH_MENU_ACTION_PROCESS 1
// menu items
#define IDM_HH_MENU_ITEM 1
#define IDM_HH_MENU_ITEM_DELETE IDM_HH_MENU_ITEM
// commands
#define IDM_HH_UPLOAD (WM_USER + 1)
#define IDM_HH_SEND_PLAYLISTINFO (WM_USER + 2)
#define IDM_HH_PREPARE_TO_SYNC (WM_USER + 3)
#define IDM_HH_CLEANUP_SYNC (WM_USER + 4)
#define IDM_HH_RESET_PLAYCOUNTS (WM_USER + 5)
#define IDM_HH_UPDATE_DEVICE_INFO (WM_USER + 6)
#define IDM_HH_SET_MJ_AUTOMATION (WM_USER + 7)
#define IDM_HH_PREPARE_FOR_UPLOAD (WM_USER + 8)
#define IDM_HH_EJECT (WM_USER + 9)
#define IDM_HH_EDIT_DVD_INFO (WM_USER + 10)
// plugin callback
class IPortableDriveCallback
{
public:
virtual void PortableDrive_RefreshUI() = 0;
virtual void PortableDrive_GetRootFiles() = 0;
virtual void PortableDrive_Progress(int nCurrent, int nTotal, BOOL * pbCancel) = 0;
virtual void PortableDrive_CloseDevice() = 0;
virtual void PortableDrive_EnumerateDevices() = 0;
};
// plugin interface
class IPortableDrive
{
public:
virtual ~IPortableDrive() { }
virtual HRESULT Initialize(BSTR * bstrDeviceInfo) = 0;
virtual HRESULT GetMemoryInfo(BSTR bstrPath, LONGLONG * pTotalSize, LONGLONG * pAvailableSize, LONG * pError) = 0;
virtual HRESULT GetFiles(BSTR bstrPath, IDispatch * pdispFiles, LONG * pError) = 0;
virtual HRESULT GetTreeItem(BSTR bstrPath, BSTR * pItem, LONG * pHasChildren, LONG * pError) = 0;
virtual HRESULT GetDeviceIcon(LONGLONG * phIcon) = 0;
virtual HRESULT GetLastError(BSTR * pError) = 0;
virtual HRESULT Menu(BSTR bstrPath, LONG nAction, LONG nParam, LONG * pError) = 0;
virtual HRESULT ProcessCommand(BSTR bstrInfo, LONG lCommand, IDispatch * pDispatch, BSTR * pItem, LONG * pError) = 0;
virtual HRESULT Cancel() = 0;
};
typedef IPortableDrive * (* CreatePortableDriveFunc)(IPortableDriveCallback * pCallback);