author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Thu, 08 Apr 2010 14:19:33 +0300 | |
branch | RCL_3 |
changeset 8 | 3f74d0d4af4c |
parent 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/* This file is part of the KDE project. |
2 |
||
3 |
Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 |
||
5 |
This library is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Lesser General Public License as published by |
|
7 |
the Free Software Foundation, either version 2.1 or 3 of the License. |
|
8 |
||
9 |
This library is distributed in the hope that it will be useful, |
|
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
GNU Lesser General Public License for more details. |
|
13 |
||
14 |
You should have received a copy of the GNU Lesser General Public License |
|
15 |
along 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 |
||
27 |
QT_BEGIN_NAMESPACE |
|
28 |
||
29 |
namespace Phonon |
|
30 |
{ |
|
31 |
namespace MMF |
|
32 |
{ |
|
33 |
class Backend; |
|
34 |
||
35 |
/** |
|
36 |
* @short AudioOutputInterface implementation for MMF. |
|
37 |
* |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
38 |
* Forwards volume commands to the MediaObject instance, |
0 | 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 |
*/ |
|
51 |
class AudioOutput : public MediaNode |
|
52 |
, public AudioOutputInterface |
|
53 |
{ |
|
54 |
Q_OBJECT |
|
55 |
Q_INTERFACES(Phonon::AudioOutputInterface) |
|
56 |
||
57 |
public: |
|
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 |
||
76 |
protected: |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
77 |
// MediaNode |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
78 |
void connectMediaObject(MediaObject *mediaObject); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
79 |
void disconnectMediaObject(MediaObject *mediaObject); |
0 | 80 |
|
81 |
Q_SIGNALS: |
|
82 |
void volumeChanged(qreal volume); |
|
83 |
void audioDeviceFailed(); |
|
84 |
||
85 |
private: |
|
86 |
qreal m_volume; |
|
87 |
||
88 |
}; |
|
89 |
} |
|
90 |
} |
|
91 |
||
92 |
QT_END_NAMESPACE |
|
93 |
||
94 |
#endif |