Last change
on this file since 244 was 2, checked in by Dmitry A. Kuminov, 16 years ago |
Initially imported qt-all-opensource-src-4.5.1 from Trolltech.
|
File size:
1.2 KB
|
Line | |
---|
1 | #include <QtGui>
|
---|
2 |
|
---|
3 | #include <phonon/audiooutput.h>
|
---|
4 | #include <phonon/mediaobject.h>
|
---|
5 | #include <phonon/backendcapabilities.h>
|
---|
6 | #include <phonon/effect.h>
|
---|
7 | #include <phonon/effectwidget.h>
|
---|
8 |
|
---|
9 |
|
---|
10 | int main(int argv, char **args)
|
---|
11 | {
|
---|
12 | QApplication app(argv, args);
|
---|
13 | app.setApplicationName("Audio effect tester");
|
---|
14 |
|
---|
15 | Phonon::MediaObject *mediaObject = new Phonon::MediaObject;
|
---|
16 | mediaObject->setCurrentSource(QString("/home/gvatteka/Music/Lumme-Badloop.ogg"));
|
---|
17 |
|
---|
18 | Phonon::AudioOutput *audioOutput =
|
---|
19 | new Phonon::AudioOutput(Phonon::MusicCategory);
|
---|
20 |
|
---|
21 | //! [0]
|
---|
22 | QList<Phonon::EffectDescription> effectDescriptions =
|
---|
23 | Phonon::BackendCapabilities::availableAudioEffects();
|
---|
24 | Phonon::EffectDescription effectDescription = effectDescriptions.at(4);
|
---|
25 |
|
---|
26 | Phonon::Path path = Phonon::createPath(mediaObject, audioOutput);
|
---|
27 |
|
---|
28 | //! [1]
|
---|
29 | Phonon::Effect *effect = new Phonon::Effect(effectDescription);
|
---|
30 | path.insertEffect(effect);
|
---|
31 | //! [0]
|
---|
32 |
|
---|
33 | Phonon::EffectWidget *effectWidget = new Phonon::EffectWidget(effect);
|
---|
34 | effectWidget->show();
|
---|
35 | //! [1]
|
---|
36 |
|
---|
37 | mediaObject->play();
|
---|
38 |
|
---|
39 | effectWidget->setWindowTitle("Effect Name: " + effectDescription.name());
|
---|
40 |
|
---|
41 | app.exec();
|
---|
42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.