]> git.sesse.net Git - vlc/blob - bindings/phonon/vlc/backend.h
4cb5c91c4fa5ebc60b1ef0f3be5e960dff415b43
[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 #ifdef MAKE_PHONON_VLC_LIB // We are building this library
36 # define PHONON_VLC_EXPORT Q_DECL_EXPORT
37 #else // We are using this library
38 # define PHONON_VLC_EXPORT Q_DECL_IMPORT
39 #endif
40
41 namespace Phonon
42 {
43 namespace VLC {
44 class AudioOutput;
45 class EffectManager;
46
47 class Backend : public QObject, public BackendInterface
48 {
49     Q_OBJECT
50     Q_INTERFACES(Phonon::BackendInterface)
51
52 public:
53
54     enum DebugLevel {NoDebug, Warning, Info, Debug};
55     Backend(QObject *parent = 0, const QVariantList & = QVariantList());
56     virtual ~Backend();
57
58     DeviceManager* deviceManager() const;
59     EffectManager* effectManager() const;
60
61     QObject *createObject(BackendInterface::Class, QObject *parent, const QList<QVariant> &args);
62
63     bool supportsVideo() const;
64     bool supportsOSD() const;
65     bool supportsFourcc(quint32 fourcc) const;
66     bool supportsSubtitles() const;
67     QStringList availableMimeTypes() const;
68
69     QList<int> objectDescriptionIndexes(ObjectDescriptionType type) const;
70     QHash<QByteArray, QVariant> objectDescriptionProperties(ObjectDescriptionType type, int index) const;
71
72     bool startConnectionChange(QSet<QObject *>);
73     bool connectNodes(QObject *, QObject *);
74     bool disconnectNodes(QObject *, QObject *);
75     bool endConnectionChange(QSet<QObject *>);
76
77     DebugLevel debugLevel() const;
78
79     void logMessage(const QString &message, int priority = 2, QObject *obj = 0) const;
80
81 Q_SIGNALS:
82     void objectDescriptionChanged(ObjectDescriptionType);
83
84 private:
85     mutable QStringList m_supportedMimeTypes;
86     QList<QPointer<AudioOutput> > m_audioOutputs;
87
88     DeviceManager *m_deviceManager;
89     EffectManager *m_effectManager;
90     DebugLevel m_debugLevel;
91 };
92
93 }
94 } // namespace Phonon::VLC
95
96 #endif // Phonon_VLC_BACKEND_H