]> git.sesse.net Git - vlc/blob - bindings/phonon/vlc/backend.h
Phonon: synchronise with KDE HEAD, part 1
[vlc] / bindings / phonon / vlc / backend.h
1 /*****************************************************************************
2  * VLC backend for the Phonon library                                        *
3  * Copyright (C) 2007-2008 Tanguy Krotoff <tkrotoff@gmail.com>               *
4  * Copyright (C) 2008 Lukas Durfina <lukas.durfina@gmail.com>                *
5  * Copyright (C) 2009 Fathi Boudra <fabo@kde.org>                            *
6  *                                                                           *
7  * This program is free software; you can redistribute it and/or             *
8  * modify it under the terms of the GNU Lesser General Public                *
9  * License as published by the Free Software Foundation; either              *
10  * version 3 of the License, or (at your option) any later version.          *
11  *                                                                           *
12  * This program is distributed in the hope that it will be useful,           *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
15  * Lesser General Public License for more details.                           *
16  *                                                                           *
17  * You should have received a copy of the GNU Lesser General Public          *
18  * License along with this package; if not, write to the Free Software       *
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA *
20  *****************************************************************************/
21
22 #ifndef Phonon_VLC_BACKEND_H
23 #define Phonon_VLC_BACKEND_H
24
25 #include "devicemanager.h"
26 #include "audiooutput.h"
27
28 #include <phonon/objectdescription.h>
29 #include <phonon/backendinterface.h>
30
31 #include <QtCore/QList>
32 #include <QtCore/QPointer>
33 #include <QtCore/QStringList>
34
35 namespace Phonon
36 {
37 namespace VLC {
38 class AudioOutput;
39 class EffectManager;
40
41 class Backend : public QObject, public BackendInterface
42 {
43     Q_OBJECT
44     Q_INTERFACES(Phonon::BackendInterface)
45
46 public:
47
48     enum DebugLevel {NoDebug, Warning, Info, Debug};
49     Backend(QObject *parent = 0, const QVariantList & = QVariantList());
50     virtual ~Backend();
51
52     DeviceManager* deviceManager() const;
53     EffectManager* effectManager() const;
54
55     QObject *createObject(BackendInterface::Class, QObject *parent, const QList<QVariant> &args);
56
57     bool supportsVideo() const;
58     bool supportsOSD() const;
59     bool supportsFourcc(quint32 fourcc) const;
60     bool supportsSubtitles() const;
61     QStringList availableMimeTypes() const;
62
63     QList<int> objectDescriptionIndexes(ObjectDescriptionType type) const;
64     QHash<QByteArray, QVariant> objectDescriptionProperties(ObjectDescriptionType type, int index) const;
65
66     bool startConnectionChange(QSet<QObject *>);
67     bool connectNodes(QObject *, QObject *);
68     bool disconnectNodes(QObject *, QObject *);
69     bool endConnectionChange(QSet<QObject *>);
70
71     DebugLevel debugLevel() const;
72
73     void logMessage(const QString &message, int priority = 2, QObject *obj = 0) const;
74
75 Q_SIGNALS:
76     void objectDescriptionChanged(ObjectDescriptionType);
77
78 private:
79     mutable QStringList m_supportedMimeTypes;
80     QList<QPointer<AudioOutput> > m_audioOutputs;
81
82     DeviceManager *m_deviceManager;
83     EffectManager *m_effectManager;
84     DebugLevel m_debugLevel;
85 };
86
87 }
88 } // namespace Phonon::VLC
89
90 #endif // Phonon_VLC_BACKEND_H