2 // C++ Interface: devicemanager
4 // Description: Controls device/medium object handling, providing
5 // helper functions for other objects
8 // Author: Jeff Mitchell <kde-dev@emailgoeshere.com>, (C) 2006
9 // Maximilian Kossick <maximilian.kossick@googlemail.com>, (C) 2006
11 // Copyright: See COPYING file that comes with this distribution
16 #ifndef AMAROK_DEVICE_MANAGER_H
17 #define AMAROK_DEVICE_MANAGER_H
24 typedef QMap
<QString
, Medium
*> MediumMap
;
26 //this class provides support for MountPointManager and MediaDeviceManager
27 //the latter is responsible for handling mediadevices (e.g. ipod)
28 //unless you have special requirements you should use either MountPointManager or
29 //MediaDeviceManager instead of this class.
30 class DeviceManager
: public QObject
37 static DeviceManager
*instance();
39 void mediumAdded( const QString name
);
40 void mediumChanged( const QString name
);
41 void mediumRemoved( const QString name
);
43 MediumMap
getMediumMap() { return m_mediumMap
; }
44 Medium
* getDevice( const QString name
);
45 // reconciles m_mediumMap to whatever kded has in it.
46 void reconcileMediumMap();
48 bool isValid() { return m_valid
; }
50 //only use getDeviceList to initialise clients
51 Medium::List
getDeviceList();
53 //public so can be called from DCOP...but don't use this, see the
54 //warning about getDeviceList()
55 QStringList
getDeviceStringList();
57 // Converts a media://media/hdc URL as provided by the KDE media
58 // manager on CD insert to /dev/hdc so amarok can play it.
59 // This method is safe to call with a device path, it returns it
61 QString
convertMediaUrlToDevice( QString url
);
64 void deviceAdded( const QString
&dui
);
65 void deviceRemoved( const QString
&udi
);
68 void deviceAdded( const QString
&udi
);
69 void deviceRemoved( const QString
&udi
);
74 MediumMap m_mediumMap
;