Make sure that canGoNext is accurate when changing anything in queue

This commit is contained in:
Bart De Vries 2021-04-16 21:42:27 +02:00
parent ecceb5c0fe
commit 23b6b68500

View File

@ -51,7 +51,10 @@ AudioManager::AudioManager(QObject *parent) : QObject(parent), d(std::make_uniqu
connect(&d->m_player, &QMediaPlayer::durationChanged, this, &AudioManager::durationChanged);
connect(&d->m_player, &QMediaPlayer::positionChanged, this, &AudioManager::positionChanged);
connect(&d->m_player, &QMediaPlayer::positionChanged, this, &AudioManager::savePlayPosition);
connect(&DataManager::instance(), &DataManager::queueEntryMoved, this, &AudioManager::canGoNextChanged);
connect(&DataManager::instance(), &DataManager::queueEntryAdded, this, &AudioManager::canGoNextChanged);
connect(&DataManager::instance(), &DataManager::queueEntryRemoved, this, &AudioManager::canGoNextChanged);
// we'll send custom seekableChanged signal to work around QMediaPlayer glitches
// Check if an entry was playing when the program was shut down and restore it