Player::Player() { curIndex = -1; prevIndex = -1; listSync = false; setState(Player::STOPED); autoNext = false; obCreated = false; sMusic = false; queueSize = -1; shuffle = false; repeat = false; bufferOff = false; mediaObject = new Phonon::MediaObject(this); audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); Phonon::createPath(mediaObject, audioOutput); connect(mediaObject, SIGNAL(finished()), this, SLOT(playFinished())); connect(mediaObject, SIGNAL(tick(qint64)), this, SIGNAL(tick(qint64))); connect(mediaObject, SIGNAL(totalTimeChanged(qint64)), this, SIGNAL(totalTimeChanged(qint64))); ba = new QByteArray(); buffer = new QBuffer(); }
void KAudio::checkFinished() { if ( StatChunk->sync_id == currentId ) { // There is no point in emitting a signal now. // Either we played no sound after setSignals(true) or we signalled already return; } if ( StatChunk->sync_id == KeysChunk->sync_id ) { emit playFinished(); // Copy the sync_id, so we see, that we have signalled the id already currentId = KeysChunk->sync_id; } }
void Audio::onFinished() { emit playFinished(); setPosition(0); }