summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/volumeslider.cpp
blob: 960ca59c67974fa59a84ad01e17cdea2bce3e2c0 (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/audiooutput.h>
#include <phonon/mediaobject.h>
#include <phonon/volumeslider.h>

int main(int argv, char **args)
{
    QApplication app(argv, args);
    app.setApplicationName("Volume slider tester");

    Phonon::MediaObject *mediaObject = new Phonon::MediaObject;
    mediaObject->setCurrentSource(QString("/home/gvatteka/Music/Lumme-Badloop.ogg"));

//! [0]
    Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory);
    Phonon::createPath(mediaObject, audioOutput);

    Phonon::VolumeSlider *volumeSlider = new Phonon::VolumeSlider;
    volumeSlider->setAudioOutput(audioOutput);
//! [0]

    mediaObject->play();
    
    volumeSlider->show();

    return app.exec();
}