Hi,
I have trouble to clear the queue of a Phonon::MediaObject definitely. I have a "global":
Phonon::MediaObject *phononSound;
phononSound = Phonon::createPlayer(Phonon::MusicCategory);
Phonon::MediaObject *phononSound;
phononSound = Phonon::createPlayer(Phonon::MusicCategory);
To copy to clipboard, switch view to plain text mode
and a function which can be triggered by the user.
phononSound->clearQueue();
QList<Phonon::MediaSource> soundfiles;
// here soundfiles are filed with 0 to 3 wav files.
if (!soundfiles.isEmpty())
{
phononSound->setCurrentSource(soundfiles.takeFirst());
phononSound->enqueue(soundfiles);
phononSound->play();
}
else
phononSound->stop();
phononSound->clearQueue();
QList<Phonon::MediaSource> soundfiles;
// here soundfiles are filed with 0 to 3 wav files.
if (!soundfiles.isEmpty())
{
phononSound->setCurrentSource(soundfiles.takeFirst());
phononSound->enqueue(soundfiles);
phononSound->play();
}
else
phononSound->stop();
To copy to clipboard, switch view to plain text mode
Now following output occurs:
function called 1st: 2 wav files
-> played 1st wav of 1st call
function called again: 1 wav file
-> played (1st) wav of 2nd call (debug at the end of the 2nd call says that the queue is empty)
-> played 2nd wav of the 1st function call. ???
Why the queue isn't cleared correctly? What's wrong? Various placed phononSound->stop() on different places wont change anything.
Thanks
Lykurg
Bookmarks