diff --git a/src/devices/wmdmdevice.cpp b/src/devices/wmdmdevice.cpp index 81b262966..ad6aecaff 100644 --- a/src/devices/wmdmdevice.cpp +++ b/src/devices/wmdmdevice.cpp @@ -212,3 +212,47 @@ bool WmdmDevice::DeleteFromStorage(const DeleteJob& job) { void WmdmDevice::FinishDelete(bool success) { FinishCopy(success); } + +QList WmdmDevice::SupportedFiletypes() { + QList ret; + WmdmThread thread; + + // Get the device + WmdmLister* wmdm_lister = static_cast(lister()); + QString canonical_name = wmdm_lister->DeviceCanonicalName(unique_id()); + IWMDMDevice* device = thread.GetDeviceByCanonicalName(canonical_name); + + // Get a list of supported formats + uint32_t format_count = 0; + uint32_t mime_count = 0; + _WAVEFORMATEX* formats; + wchar_t** mime_types; + + if (device->GetFormatSupport( + &formats, &format_count, &mime_types, &mime_count)) { + qWarning() << "Unable to get a list of supported formats for device" << canonical_name; + device->Release(); + return ret; + } + device->Release(); + + // Find known mime types + for (int i=0 ; i SupportedFiletypes(); + void StartCopy(); bool CopyToStorage(const CopyJob& job); void FinishCopy(bool success);