You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.2 KiB

// C++ Interface: devicemanager
// Description: Controls device/medium object handling, providing
// helper functions for other objects
// Author: Jeff Mitchell <>, (C) 2006
// Maximilian Kossick <>, (C) 2006
// Copyright: See COPYING file that comes with this distribution
#include "medium.h"
#include <tqmap.h>
#include <dcopobject.h>
typedef TQMap<TQString, Medium*> MediumMap;
//this class provides support for MountPointManager and MediaDeviceManager
//the latter is responsible for handling mediadevices (e.g. ipod)
//unless you have special requirements you should use either MountPointManager or
//MediaDeviceManager instead of this class.
class DeviceManager : public TQObject
static DeviceManager *instance();
void mediumAdded( const TQString name );
void mediumChanged( const TQString name);
void mediumRemoved( const TQString name);
MediumMap getMediumMap() { return m_mediumMap; }
Medium* getDevice( const TQString name );
// reconciles m_mediumMap to whatever kded has in it.
void reconcileMediumMap();
bool isValid() { return m_valid; }
//only use getDeviceList to initialise clients
Medium::List getDeviceList();
//public so can be called from DCOP...but don't use this, see the
//warning about getDeviceList()
TQStringList getDeviceStringList();
// Converts a media://media/hdc URL as provided by the KDE media
// manager on CD insert to /dev/hdc so amarok can play it.
// This method is safe to call with a device path, it returns it
// unchanged.
TQString convertMediaUrlToDevice( TQString url );
void mediumAdded( const Medium*, TQString );
void mediumChanged( const Medium*, TQString );
void mediumRemoved( const Medium*, TQString );
DCOPClient *m_dc;
bool m_valid;
MediumMap m_mediumMap;