Only automatically start playing songs if we are replacing the playqueue, or the song is the first song added via the commandline.

BUG:13
This commit is contained in:
craig.p.drummond@gmail.com
2012-05-12 19:39:36 +00:00
committed by craig.p.drummond@gmail.com
parent c3b9ce9ce0
commit da2b114c80
3 changed files with 10 additions and 4 deletions

View File

@@ -5,6 +5,8 @@
2. Attempt to fix errors in cache where the displayed name was saved.
3. Fix tag-editor's 'Various Artists' workaround when all tracks is selected.
4. Set minimum font size for info page.
5. Only automatically start playing songs if we are replacing the playqueue, or
the song is the first song added via the commandline.
0.7.0
-----

View File

@@ -1170,10 +1170,11 @@ void MainWindow::setControlButtonsSize(bool small)
void MainWindow::songLoaded()
{
if (MPDState_Stopped==MPDStatus::self()->state() ||
(-1==playQueueModel.currentSong() && MPDState_Inactive==lastState && MPDState_Inactive==MPDStatus::self()->state()) ) { // song was loaded from commandline when empty...
// was song was loaded from commandline when empty...
bool isInitial=-1==playQueueModel.currentSong() && MPDState_Inactive==lastState && MPDState_Inactive==MPDStatus::self()->state();
if (MPDState_Stopped==MPDStatus::self()->state() || isInitial) {
stopVolumeFade();
if (0==playQueueModel.rowCount() || -1==playQueueModel.currentSong()) {
if (isInitial) {
emit play();
}
}

View File

@@ -411,7 +411,10 @@ void MPDConnection::add(const QStringList &files, bool replace)
}
send += "command_list_end";
if (sendCommand(send).ok){
if (sendCommand(send).ok) {
if (replace && !files.isEmpty()) {
startPlayingSong();
}
emit added(files);
}
}