ramya
ramya

Reputation: 175

qt slider problem c++

the following code plays the song while a button is pressed (onclick). I have created a horizontalSlider UI but it is not sliding. I got the document from http://wiki.forum.nokia.com/index.php/Streaming_Audio_with_Qt

Please help me to make the slider work.

Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this);

Phonon::AudioOutput *audioOutput =
new Phonon::AudioOutput(Phonon::MusicCategory, this);

Phonon::createPath(mediaObject, audioOutput);

const QString url("c://example.mp3");

mediaObject->setCurrentSource(url);

mediaObject->play();

volumeSlider = new Phonon::VolumeSlider(ui->horizontalSlider);
volumeSlider->setAudioOutput(audioOutput);
volumeSlider->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);

Upvotes: 0

Views: 420

Answers (1)

Yippie-Ki-Yay
Yippie-Ki-Yay

Reputation: 22794

Probably you didn't bind the corresponding media object to the slider.

See a small example here.

Upvotes: 1

Related Questions