source: trunk/src/3rdparty/phonon/mmf/mmf_medianode.h

Last change on this file was 651, checked in by Dmitry A. Kuminov, 16 years ago

trunk: Merged in qt 4.6.2 sources.

  • Property svn:eol-style set to native
File size: 3.1 KB
Line 
1/* This file is part of the KDE project.
2
3Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4
5This library is free software: you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation, either version 2.1 or 3 of the License.
8
9This library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU Lesser General Public License for more details.
13
14You should have received a copy of the GNU Lesser General Public License
15along with this library. If not, see <http://www.gnu.org/licenses/>.
16
17*/
18
19#ifndef PHONON_MMF_MEDIANODE_H
20#define PHONON_MMF_MEDIANODE_H
21
22#include <QObject>
23#include <phonon/effectinterface.h>
24#include "audioplayer.h"
25
26QT_BEGIN_NAMESPACE
27
28/**
29 * @file mmf_medianode.h mmf_medianode.cpp
30 *
31 * This file starts with mmf_ in order to avoid clash with Phonon's
32 * medianode.h. The GStreamer backend has a file named medianode.h, but it
33 * isn't compiled with ABLD build system, which have problems with separating
34 * user and system include paths.
35 */
36
37namespace Phonon
38{
39namespace MMF
40{
41class MediaObject;
42
43/**
44 * @short Base class for all nodes in the MMF backend.
45 *
46 * MediaNode is the base class for all nodes created by the MMF
47 * backend.
48 *
49 * These nodes may be one of the following types:
50 *
51 * - MediaObject
52 * This represents the source of media data. It encapsulates the
53 * appropriate MMF client API for playing audio or video.
54 * - AudioOutput
55 * This represents the audio output device. Since the MMF client API
56 * does not expose the output device directly, this backend node
57 * simply forwards volume control commands to the MediaObject.
58 * - VideoWidget
59 * A native widget on which video will be rendered.
60 * - An audio effect, derived form AbstractAudioEffect
61 *
62 * Because the MMF API does not support the concept of a media filter graph,
63 * this class must ensure the following:
64 *
65 * - Each media graph contains at most one MediaObject instance.
66 * - Every non-MediaObject node holds a reference to the MediaObject. This
67 * allows commands to be sent through the graph to the encapsulated MMF client
68 * API.
69 */
70class MediaNode : public QObject
71{
72 Q_OBJECT
73public:
74 MediaNode(QObject *parent);
75 ~MediaNode();
76
77 bool connectOutput(MediaNode *output);
78 bool disconnectOutput(MediaNode *output);
79
80 virtual void connectMediaObject(MediaObject *mediaObject) = 0;
81 virtual void disconnectMediaObject(MediaObject *mediaObject) = 0;
82
83private:
84 bool isMediaObject() const;
85
86 void updateMediaObject();
87 void setMediaObject(MediaObject *mediaObject);
88
89 typedef QList<const MediaNode *> NodeList;
90 void visit(QList<MediaNode *>& visited, MediaObject*& mediaObject);
91
92private:
93 MediaObject * m_mediaObject;
94
95 // All nodes except MediaObject may have an input
96 MediaNode * m_input;
97
98 // Only MediaObject can have more than one output
99 QList<MediaNode *> m_outputs;
100};
101
102}
103}
104
105QT_END_NAMESPACE
106
107#endif
108
Note: See TracBrowser for help on using the repository browser.