Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
audiooutput.h
1 /* This file is part of the KDE project
2  Copyright (C) 2005-2006 Matthias Kretz <kretz@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) version 3, or any
8  later version accepted by the membership of KDE e.V. (or its
9  successor approved by the membership of KDE e.V.), Nokia Corporation
10  (or its successors, if any) and the KDE Free Qt Foundation, which shall
11  act as a proxy defined in Section 6 of version 3 of the license.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 
21 */
22 #ifndef Phonon_AUDIOOUTPUT_H
23 #define Phonon_AUDIOOUTPUT_H
24 
25 #include "phonon_export.h"
26 #include "abstractaudiooutput.h"
27 #include "phonondefs.h"
28 #include "phononnamespace.h"
29 #include "objectdescription.h"
30 
31 
32 class QString;
33 
34 class AudioOutputAdaptor;
35 namespace Phonon
36 {
37  class AudioOutputPrivate;
38 
48  class PHONON_EXPORT AudioOutput : public AbstractAudioOutput
49  {
50  friend class FactoryPrivate;
51  friend class ::AudioOutputAdaptor;
52  Q_OBJECT
53  P_DECLARE_PRIVATE(AudioOutput)
60  Q_PROPERTY(QString name READ name WRITE setName)
67  Q_PROPERTY(qreal volume READ volume WRITE setVolume NOTIFY volumeChanged)
77  Q_PROPERTY(qreal volumeDecibel READ volumeDecibel WRITE setVolumeDecibel)
89  Q_PROPERTY(AudioOutputDevice outputDevice READ outputDevice WRITE setOutputDevice)
90 
96  Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
97  public:
115  explicit AudioOutput(Phonon::Category category, QObject *parent = 0);
116  explicit AudioOutput(QObject *parent = 0);
117 
118  QString name() const;
119  qreal volume() const;
120  qreal volumeDecibel() const;
121 
127  Phonon::Category category() const;
128  AudioOutputDevice outputDevice() const;
129  bool isMuted() const;
130 
131  public Q_SLOTS:
132  void setName(const QString &newName);
133  void setVolume(qreal newVolume);
134  void setVolumeDecibel(qreal newVolumeDecibel);
135  bool setOutputDevice(const Phonon::AudioOutputDevice &newAudioOutputDevice);
136  void setMuted(bool mute);
137 
138  Q_SIGNALS:
145  void volumeChanged(qreal newVolume);
146 
152  void mutedChanged(bool);
153 
163  void outputDeviceChanged(const Phonon::AudioOutputDevice &newAudioOutputDevice);
164 
165  private:
166  Q_PRIVATE_SLOT(k_func(), void _k_volumeChanged(qreal))
167  Q_PRIVATE_SLOT(k_func(), void _k_mutedChanged(bool))
168  Q_PRIVATE_SLOT(k_func(), void _k_revertFallback())
169  Q_PRIVATE_SLOT(k_func(), void _k_audioDeviceFailed())
170  Q_PRIVATE_SLOT(k_func(), void _k_deviceListChanged())
171  Q_PRIVATE_SLOT(k_func(), void _k_deviceChanged(int device))
172  };
173 } //namespace Phonon
174 
175 
176 // vim: sw=4 ts=4 tw=80
177 #endif // Phonon_AUDIOOUTPUT_H