author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 12 Mar 2010 15:46:37 +0200 | |
branch | RCL_3 |
changeset 5 | d3bac044e0f0 |
parent 3 | 41300fa6a67c |
permissions | -rw-r--r-- |
0 | 1 |
/* This file is part of the KDE project |
2 |
Copyright (C) 2004-2007 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 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
9 |
successor approved by the membership of KDE e.V.), Nokia Corporation |
0 | 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 |
||
23 |
#ifndef PHONON_FACTORY_P_H |
|
24 |
#define PHONON_FACTORY_P_H |
|
25 |
||
26 |
#include "phonon_export.h" |
|
27 |
||
28 |
#include <QtCore/QObject> |
|
29 |
#include <QtCore/QStringList> |
|
30 |
||
31 |
QT_BEGIN_HEADER |
|
32 |
QT_BEGIN_NAMESPACE |
|
33 |
||
34 |
class QUrl; |
|
35 |
class QIcon; |
|
36 |
||
37 |
namespace Phonon |
|
38 |
{ |
|
39 |
class PlatformPlugin; |
|
40 |
class MediaNodePrivate; |
|
41 |
class AbstractMediaStream; |
|
42 |
||
43 |
/** |
|
44 |
* \internal |
|
45 |
* \brief Factory to access the preferred Backend. |
|
46 |
* |
|
47 |
* This class is used internally to get the backend's implementation. |
|
48 |
* It keeps track of the objects that were created. When a |
|
49 |
* request for a backend change comes, it asks all frontend objects to delete |
|
50 |
* their backend objects and then checks whether they were all deleted. Only |
|
51 |
* then the old backend is unloaded and the new backend is loaded. |
|
52 |
* |
|
53 |
* \author Matthias Kretz <kretz@kde.org> |
|
54 |
*/ |
|
55 |
namespace Factory |
|
56 |
{ |
|
57 |
/** |
|
58 |
* Emits signals for Phonon::Factory. |
|
59 |
*/ |
|
60 |
class Sender : public QObject |
|
61 |
{ |
|
62 |
Q_OBJECT |
|
63 |
Q_SIGNALS: |
|
64 |
/** |
|
65 |
* Emitted after the backend has successfully been changed. |
|
66 |
*/ |
|
67 |
void backendChanged(); |
|
68 |
||
69 |
/** |
|
70 |
* \copydoc BackendCapabilities::Notifier::availableAudioOutputDevicesChanged |
|
71 |
*/ |
|
72 |
void availableAudioOutputDevicesChanged(); |
|
73 |
||
74 |
/** |
|
75 |
* \copydoc BackendCapabilities::Notifier::availableAudioCaptureDevicesChanged |
|
76 |
*/ |
|
77 |
void availableAudioCaptureDevicesChanged(); |
|
78 |
}; |
|
79 |
||
80 |
/** |
|
81 |
* Returns a pointer to the object emitting the signals. |
|
82 |
* |
|
83 |
* \see Sender::backendChanged() |
|
84 |
*/ |
|
85 |
PHONON_EXPORT Sender *sender(); |
|
86 |
||
87 |
/** |
|
88 |
* Create a new backend object for a MediaObject. |
|
89 |
* |
|
90 |
* \return a pointer to the MediaObject the backend provides. |
|
91 |
*/ |
|
92 |
QObject *createMediaObject(QObject *parent = 0); |
|
93 |
/** |
|
94 |
* Create a new backend object for a Effect. |
|
95 |
* |
|
96 |
* \return a pointer to the Effect the backend provides. |
|
97 |
*/ |
|
98 |
#ifndef QT_NO_PHONON_EFFECT |
|
99 |
QObject *createEffect(int effectId, QObject *parent = 0); |
|
100 |
#endif //QT_NO_PHONON_EFFECT |
|
101 |
/** |
|
102 |
* Create a new backend object for a VolumeFaderEffect. |
|
103 |
* |
|
104 |
* \return a pointer to the VolumeFaderEffect the backend provides. |
|
105 |
*/ |
|
106 |
#ifndef QT_NO_PHONON_VOLUMEFADEREFFECT |
|
107 |
QObject *createVolumeFaderEffect(QObject *parent = 0); |
|
108 |
#endif //QT_NO_PHONON_VOLUMEFADEREFFECT |
|
109 |
/** |
|
110 |
* Create a new backend object for a AudioOutput. |
|
111 |
* |
|
112 |
* \return a pointer to the AudioOutput the backend provides. |
|
113 |
*/ |
|
114 |
QObject *createAudioOutput(QObject *parent = 0); |
|
115 |
/** |
|
116 |
* Create a new backend object for a VideoWidget. |
|
117 |
* |
|
118 |
* \return a pointer to the VideoWidget the backend provides. |
|
119 |
*/ |
|
120 |
#ifndef QT_NO_PHONON_VIDEO |
|
121 |
QObject *createVideoWidget(QObject *parent = 0); |
|
122 |
#endif //QT_NO_PHONON_VIDEO |
|
123 |
||
124 |
/** |
|
125 |
* \return a pointer to the backend interface. |
|
126 |
*/ |
|
127 |
PHONON_EXPORT QObject *backend(bool createWhenNull = true); |
|
128 |
||
129 |
/** |
|
130 |
* Unique identifier for the Backend. Can be used in configuration files |
|
131 |
* for example. |
|
132 |
*/ |
|
133 |
QString identifier(); |
|
134 |
||
135 |
/** |
|
136 |
* Get the name of the Backend. It's the name from the .desktop file. |
|
137 |
*/ |
|
138 |
PHONON_EXPORT QString backendName(); |
|
139 |
||
140 |
/** |
|
141 |
* Get the comment of the Backend. It's the comment from the .desktop file. |
|
142 |
*/ |
|
143 |
QString backendComment(); |
|
144 |
||
145 |
/** |
|
146 |
* Get the version of the Backend. It's the version from the .desktop file. |
|
147 |
* |
|
148 |
* The version is especially interesting if there are several versions |
|
149 |
* available for binary incompatible versions of the backend's media |
|
150 |
* framework. |
|
151 |
*/ |
|
152 |
QString backendVersion(); |
|
153 |
||
154 |
/** |
|
155 |
* Get the icon (name) of the Backend. It's the icon from the .desktop file. |
|
156 |
*/ |
|
157 |
QString backendIcon(); |
|
158 |
||
159 |
/** |
|
160 |
* Get the website of the Backend. It's the website from the .desktop file. |
|
161 |
*/ |
|
162 |
QString backendWebsite(); |
|
163 |
||
164 |
/** |
|
165 |
* registers the backend object |
|
166 |
*/ |
|
167 |
PHONON_EXPORT QObject *registerQObject(QObject *o); |
|
168 |
||
169 |
bool isMimeTypeAvailable(const QString &mimeType); |
|
170 |
||
171 |
PHONON_EXPORT void registerFrontendObject(MediaNodePrivate *); |
|
172 |
PHONON_EXPORT void deregisterFrontendObject(MediaNodePrivate *); |
|
173 |
||
174 |
PHONON_EXPORT void setBackend(QObject *); |
|
175 |
//PHONON_EXPORT void createBackend(const QString &library, const QString &version = QString()); |
|
176 |
||
177 |
PHONON_EXPORT PlatformPlugin *platformPlugin(); |
|
178 |
||
179 |
//X It is probably better if we can get away with internal handling of |
|
180 |
//X freeing the soundcard device when it's not needed anymore and |
|
181 |
//X providing an IPC method to stop all MediaObjects -> free all |
|
182 |
//X devices |
|
183 |
//X /** |
|
184 |
//X * \internal |
|
185 |
//X * This is called when the application needs to free the soundcard |
|
186 |
//X * device(s). |
|
187 |
//X */ |
|
188 |
//X void freeSoundcardDevices(); |
|
189 |
} // namespace Factory |
|
190 |
} // namespace Phonon |
|
191 |
||
192 |
QT_END_NAMESPACE |
|
193 |
QT_END_HEADER |
|
194 |
||
195 |
#endif // PHONON_FACTORY_P_H |
|
196 |
// vim: sw=4 ts=4 |