summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/waveout/backend.cpp
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commit356978ecce23e076e1b622d5d41dd8c04bf7bcf8 (patch)
tree8e1874cc32750e30b84b2561387d48424e076ae3 /src/3rdparty/phonon/waveout/backend.cpp
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to 'src/3rdparty/phonon/waveout/backend.cpp')
-rw-r--r--src/3rdparty/phonon/waveout/backend.cpp131
1 files changed, 131 insertions, 0 deletions
diff --git a/src/3rdparty/phonon/waveout/backend.cpp b/src/3rdparty/phonon/waveout/backend.cpp
new file mode 100644
index 0000000..8faa26e
--- /dev/null
+++ b/src/3rdparty/phonon/waveout/backend.cpp
@@ -0,0 +1,131 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "backend.h"
+
+
+#include "audiooutput.h"
+#include "mediaobject.h"
+
+
+
+#include <QtCore/QSettings>
+#include <QtCore/QSet>
+#include <QtCore/QVariant>
+#include <QtCore/QStringList>
+
+#include <QtCore/QtPlugin>
+
+
+QT_BEGIN_NAMESPACE
+
+// export as Qt/KDE factory as required
+
+Q_EXPORT_PLUGIN2(phonon_waveout, Phonon::WaveOut::Backend);
+
+namespace Phonon
+{
+ namespace WaveOut
+ {
+
+ Backend::Backend(QObject *parent, const QVariantList &)
+ : QObject(parent)
+ {
+ }
+
+ Backend::~Backend()
+ {
+ }
+
+ QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList<QVariant> &args)
+ {
+ Q_UNUSED(args);
+ switch (c)
+ {
+ case MediaObjectClass:
+ return new MediaObject(parent);
+ case AudioOutputClass:
+ return new AudioOutput(this, parent);
+ default:
+ return 0;
+ }
+ }
+
+ bool Backend::supportsVideo() const
+ {
+ return false;
+ }
+
+ QStringList Backend::availableMimeTypes() const
+ {
+ QStringList ret;
+ return ret;
+ }
+
+
+ QList<int> Backend::objectDescriptionIndexes(Phonon::ObjectDescriptionType type) const
+ {
+ QList<int> r;
+ if (type == Phonon::AudioOutputDeviceType)
+ r.append(0);
+ return r;
+ }
+
+ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(Phonon::ObjectDescriptionType type, int index) const
+ {
+ Q_UNUSED(index);
+ QHash<QByteArray, QVariant> r;
+ if (type == Phonon::AudioOutputDeviceType)
+ r["name"] = QLatin1String("default audio device");
+ return r;
+ }
+
+
+ bool Backend::connectNodes(QObject *node1, QObject *node2)
+ {
+ MediaObject *mediaObject = qobject_cast<MediaObject*> (node1);
+ AudioOutput *audioOutput = qobject_cast<AudioOutput*> (node2);
+
+ if (mediaObject && audioOutput)
+ mediaObject->setAudioOutput(audioOutput);
+ return true;
+ }
+
+ bool Backend::disconnectNodes(QObject *node1, QObject *node2)
+ {
+ Q_UNUSED(node1);
+ Q_UNUSED(node2);
+ return true;
+ }
+
+ //transaction management
+ bool Backend::startConnectionChange(QSet<QObject *>)
+ {
+ return true;
+ }
+
+ bool Backend::endConnectionChange(QSet<QObject *>)
+ {
+ return true;
+ }
+
+ }
+}
+
+QT_END_NAMESPACE
+
+#include "moc_backend.cpp"