/* * Cantata * * Copyright (c) 2011-2012 Craig Drummond * */ /**************************************************************************************** * Copyright (c) 2007 Jeff Mitchell * * * * This program is free software; you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free Software * * Foundation; either version 2 of the License, or (at your option) any later * * version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License along with * * this program. If not, see . * ****************************************************************************************/ #ifndef MEDIADEVICECACHE_H #define MEDIADEVICECACHE_H #include #include #include #include class MediaDeviceCache : public QObject { Q_OBJECT public: enum DeviceType { PMPType, VolumeType, ManualType, AudioCdType, GenericType, InvalidType }; static MediaDeviceCache* self() { return s_instance ? s_instance : new MediaDeviceCache(); } /** * Creates a new MediaDeviceCache. * */ MediaDeviceCache(); ~MediaDeviceCache(); void refreshCache(); const QStringList getAll() const { return m_type.keys(); } MediaDeviceCache::DeviceType deviceType( const QString &udi ) const; const QString deviceName( const QString &udi ) const; Q_SIGNALS: void deviceAdded( const QString &udi ); void deviceRemoved( const QString &udi ); void accessibilityChanged( bool accessible, const QString &udi ); public Q_SLOTS: void slotAddDevice( const QString &udi ); void slotRemoveDevice( const QString &udi ); void slotAccessibilityChanged( bool accessible, const QString &udi ); private: QMap m_type; QMap m_name; QMap m_accessibility; QStringList m_volumes; static MediaDeviceCache* s_instance; }; #endif /* AMAROK_MEDIADEVICECACHE_H */