예제 #1
0
void MediaPlaylist::skipBackward()
{
	if (playbackMode() == Random) {
		_idx--;
		if (_idx < 0) {
			_idx = this->mediaCount() - 1;
		}
		this->setCurrentIndex(_randomIndexes[_idx]);
	} else {
		this->previous();
	}
}
예제 #2
0
void MediaPlaylist::skipForward()
{
	if (playbackMode() == Random) {
		if (_idx + 1 == this->mediaCount()) {
			_idx = 0;
		} else {
			_idx++;
		}
		this->setCurrentIndex(_randomIndexes[_idx]);
	} else {
		this->next();
	}
}
예제 #3
0
void MediaPlaylist::next()
{
	qDebug() << Q_FUNC_INFO;
	if (playbackMode() == Random) {
		qDebug() << Q_FUNC_INFO;
		for (int i = 0; i < mediaCount(); i++) {
			qDebug() << "index" << i << _randomIndexes[i];
		}
		qDebug() << "_randomIndexes 1" << _randomIndexes[currentIndex()];
		this->setCurrentIndex(_randomIndexes[QMediaPlaylist::currentIndex() + 1]);
		qDebug() << "_randomIndexes 2" << _randomIndexes[currentIndex()];
	} else {
		qDebug() << "currentIndex 1" << currentIndex();
		QMediaPlaylist::next();
		qDebug() << "currentIndex 2" << currentIndex();
	}
}