00001 /* This file is part of the KDE project 00002 Copyright (C) 2005-2006 Matthias Kretz <kretz@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Lesser General Public 00006 License as published by the Free Software Foundation; either 00007 version 2.1 of the License, or (at your option) version 3, or any 00008 later version accepted by the membership of KDE e.V. (or its 00009 successor approved by the membership of KDE e.V.), Nokia Corporation 00010 (or its successors, if any) and the KDE Free Qt Foundation, which shall 00011 act as a proxy defined in Section 6 of version 3 of the license. 00012 00013 This library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00020 00021 */ 00022 #ifndef Phonon_AUDIOOUTPUT_H 00023 #define Phonon_AUDIOOUTPUT_H 00024 00025 #include "phonon_export.h" 00026 #include "abstractaudiooutput.h" 00027 #include "phonondefs.h" 00028 #include "phononnamespace.h" 00029 #include "objectdescription.h" 00030 00031 QT_BEGIN_HEADER 00032 QT_BEGIN_NAMESPACE 00033 00034 class QString; 00035 00036 class AudioOutputAdaptor; 00037 namespace Phonon 00038 { 00039 class AudioOutputPrivate; 00040 00050 class PHONON_EXPORT AudioOutput : public AbstractAudioOutput 00051 { 00052 friend class FactoryPrivate; 00053 friend class ::AudioOutputAdaptor; 00054 Q_OBJECT 00055 K_DECLARE_PRIVATE(AudioOutput) 00062 Q_PROPERTY(QString name READ name WRITE setName) 00069 Q_PROPERTY(qreal volume READ volume WRITE setVolume NOTIFY volumeChanged) 00079 Q_PROPERTY(qreal volumeDecibel READ volumeDecibel WRITE setVolumeDecibel) 00091 Q_PROPERTY(AudioOutputDevice outputDevice READ outputDevice WRITE setOutputDevice) 00092 00098 Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) 00099 public: 00117 explicit AudioOutput(Phonon::Category category, QObject *parent = 0); 00118 explicit AudioOutput(QObject *parent = 0); 00119 00120 QString name() const; 00121 qreal volume() const; 00122 qreal volumeDecibel() const; 00123 00129 Phonon::Category category() const; 00130 AudioOutputDevice outputDevice() const; 00131 bool isMuted() const; 00132 00133 public Q_SLOTS: 00134 void setName(const QString &newName); 00135 void setVolume(qreal newVolume); 00136 void setVolumeDecibel(qreal newVolumeDecibel); 00137 bool setOutputDevice(const Phonon::AudioOutputDevice &newAudioOutputDevice); 00138 void setMuted(bool mute); 00139 00140 Q_SIGNALS: 00147 void volumeChanged(qreal newVolume); 00148 00154 void mutedChanged(bool); 00155 00165 void outputDeviceChanged(const Phonon::AudioOutputDevice &newAudioOutputDevice); 00166 00167 private: 00168 Q_PRIVATE_SLOT(k_func(), void _k_volumeChanged(qreal)) 00169 Q_PRIVATE_SLOT(k_func(), void _k_revertFallback()) 00170 Q_PRIVATE_SLOT(k_func(), void _k_audioDeviceFailed()) 00171 Q_PRIVATE_SLOT(k_func(), void _k_deviceListChanged()) 00172 Q_PRIVATE_SLOT(k_func(), void _k_deviceChanged(QString streamUuid, int device)) 00173 }; 00174 } //namespace Phonon 00175 00176 QT_END_NAMESPACE 00177 QT_END_HEADER 00178 00179 // vim: sw=4 ts=4 tw=80 00180 #endif // Phonon_AUDIOOUTPUT_H