source: trunk/src/3rdparty/phonon/mmf/audiooutput.h

Last change on this file was 561, checked in by Dmitry A. Kuminov, 16 years ago

trunk: Merged in qt 4.6.1 sources.

  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1/* This file is part of the KDE project.
2
3Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4
5This library is free software: you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation, either version 2.1 or 3 of the License.
8
9This library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU Lesser General Public License for more details.
13
14You should have received a copy of the GNU Lesser General Public License
15along with this library. If not, see <http://www.gnu.org/licenses/>.
16
17*/
18
19#ifndef PHONON_MMF_AUDIOOUTPUT_H
20#define PHONON_MMF_AUDIOOUTPUT_H
21
22#include <QHash>
23
24#include "mmf_medianode.h"
25#include <phonon/audiooutputinterface.h>
26
27QT_BEGIN_NAMESPACE
28
29namespace Phonon
30{
31namespace MMF
32{
33class Backend;
34
35/**
36 * @short AudioOutputInterface implementation for MMF.
37 *
38 * Forwards volume commands to the MediaObject instance,
39 * which is provided by the backend when MediaNode objects are
40 * connected.
41 *
42 * \section volume Volume
43 *
44 * Phonon's concept on volume is from 0.0 to 1.0, and from 1< it does
45 * voltage multiplication. CDrmPlayerUtility goes from 1 to
46 * CDrmPlayerUtility::MaxVolume(). We apply some basic math to convert
47 * between the two.
48 *
49 * @author Frans Englich<frans.englich@nokia.com>
50 */
51class AudioOutput : public MediaNode
52 , public AudioOutputInterface
53{
54 Q_OBJECT
55 Q_INTERFACES(Phonon::AudioOutputInterface)
56
57public:
58 AudioOutput(Backend *backend, QObject *parent);
59 virtual qreal volume() const;
60 virtual void setVolume(qreal volume);
61
62 virtual int outputDevice() const;
63
64 /**
65 * Has no effect.
66 */
67 virtual bool setOutputDevice(int);
68
69 static QHash<QByteArray, QVariant> audioOutputDescription(int index);
70
71 enum Constants
72 {
73 AudioOutputDeviceID = 0
74 };
75
76protected:
77 // MediaNode
78 void connectMediaObject(MediaObject *mediaObject);
79 void disconnectMediaObject(MediaObject *mediaObject);
80
81Q_SIGNALS:
82 void volumeChanged(qreal volume);
83 void audioDeviceFailed();
84
85private:
86 qreal m_volume;
87
88};
89}
90}
91
92QT_END_NAMESPACE
93
94#endif
Note: See TracBrowser for help on using the repository browser.