summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/medianodesnippet.cpp
blob: 8b74111edf6c7760c597a7845273bae81472fc15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <QtGui>

#include <phonon/mediaobject.h>
#include <phonon/audiooutput.h>
#include <phonon/videowidget.h>
#include <phonon/medianode.h>
#include <phonon/path.h>


int main(int argv, char **args)
{
    QApplication app(argv, args);

//![0]
    Phonon::MediaObject *mediaObject = new Phonon::MediaObject;
    Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput;
    Phonon::VideoWidget *videoWidget = new Phonon::VideoWidget;

    Phonon::createPath(mediaObject, audioOutput);
    Phonon::createPath(mediaObject, videoWidget);

    QList<Phonon::Path> inputPaths =
        audioOutput->inputPaths();   // inputPaths = [ mediaObject ]
    QList<Phonon::Path> outputPaths =
        mediaObject->outputPaths(); // outputPaths = [ audioOutput, videoWidget ]
//![0]

    return app.exec();
}