audiooutputinterface.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2007-2008 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 
00023 #ifndef PHONON_AUDIOOUTPUTINTERFACE_H
00024 #define PHONON_AUDIOOUTPUTINTERFACE_H
00025 
00026 #include "phononnamespace.h"
00027 #include "objectdescription.h"
00028 #include "phonondefs.h"
00029 #include <QtCore/QtGlobal>
00030 
00031 QT_BEGIN_HEADER
00032 QT_BEGIN_NAMESPACE
00033 
00034 namespace Phonon
00035 {
00049 class AudioOutputInterface40
00050 {
00051     public:
00052         virtual ~AudioOutputInterface40() {}
00053 
00060         virtual qreal volume() const = 0;
00070         virtual void setVolume(qreal) = 0;
00071 
00076         virtual int outputDevice() const = 0;
00088         virtual bool setOutputDevice(int) = 0;
00089 };
00090 
00091 class AudioOutputInterface42 : public AudioOutputInterface40
00092 {
00093     public:
00100         virtual bool setOutputDevice(const Phonon::AudioOutputDevice &) = 0;
00101 
00102         using AudioOutputInterface40::setOutputDevice;
00103 
00133         PHONON_EXPORT QList<QPair<QByteArray, QString> > deviceAccessListFor(const Phonon::AudioOutputDevice &) const;
00134 };
00135 
00136 } // namespace Phonon
00137 
00138 #ifdef PHONON_BACKEND_VERSION_4_2
00139 namespace Phonon { typedef AudioOutputInterface42 AudioOutputInterface; }
00140 Q_DECLARE_INTERFACE(Phonon::AudioOutputInterface40, "AudioOutputInterface2.phonon.kde.org")
00141 Q_DECLARE_INTERFACE(Phonon::AudioOutputInterface,   "3AudioOutputInterface.phonon.kde.org")
00142 #else
00143 namespace Phonon { typedef AudioOutputInterface40 AudioOutputInterface; }
00144 Q_DECLARE_INTERFACE(Phonon::AudioOutputInterface,   "AudioOutputInterface2.phonon.kde.org")
00145 Q_DECLARE_INTERFACE(Phonon::AudioOutputInterface42, "3AudioOutputInterface.phonon.kde.org")
00146 #endif
00147 
00148 QT_END_NAMESPACE
00149 QT_END_HEADER
00150 
00151 #endif // PHONON_AUDIOOUTPUTINTERFACE_H