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#ifndef Phonon_GSTREAMER_BACKEND_H
19#define Phonon_GSTREAMER_BACKEND_H
20
21#include <phonon/objectdescription.h>
22#include <phonon/backendinterface.h>
23
24#include <QtCore/QList>
25#include <QtCore/QStringList>
26
27namespace Phonon
28{
29namespace Gstreamer
30{
31
32class AudioOutput;
33class DeviceManager;
34class EffectManager;
35class MediaObject;
36
37class Backend : public QObject, public BackendInterface
38{
39 Q_OBJECT
40#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
41 Q_PLUGIN_METADATA(IID "org.kde.phonon.gstreamer" FILE "phonon-gstreamer.json")
42#endif
43 Q_INTERFACES(Phonon::BackendInterface)
44
45public:
46 explicit Backend(QObject *parent = 0, const QVariantList & = QVariantList());
47 virtual ~Backend();
48
49 DeviceManager* deviceManager() const;
50 EffectManager* effectManager() const;
51
52 QObject *createObject(BackendInterface::Class, QObject *parent, const QList<QVariant> &args);
53
54 QStringList availableMimeTypes() const;
55
56 QList<int> objectDescriptionIndexes(ObjectDescriptionType type) const;
57 QHash<QByteArray, QVariant> objectDescriptionProperties(ObjectDescriptionType type, int index) const;
58
59 bool startConnectionChange(QSet<QObject *>);
60 bool connectNodes(QObject *, QObject *);
61 bool disconnectNodes(QObject *, QObject *);
62 bool endConnectionChange(QSet<QObject *>);
63
64 // 'retry' indicates that we'd like to check the deps after a registry rebuild
65 bool checkDependencies(bool retry = false) const;
66
67Q_SIGNALS:
68 void objectDescriptionChanged(ObjectDescriptionType);
69
70private:
71 bool isValid() const;
72 bool supportsVideo() const;
73
74 DeviceManager *m_deviceManager;
75 EffectManager *m_effectManager;
76 bool m_isValid;
77};
78
79}
80} // namespace Phonon::Gstreamer
81
82#endif // Phonon_GSTREAMER_BACKEND_H
83