~neon/juk/master

« back to all changes in this revision

Viewing changes to playermanager.cpp

  • Committer: Michael Pyne
  • Date: 2018-02-03 21:20:56 UTC
  • Revision ID: git-v1:0dd849eced35be989c2251567505ec1e37ec8196
Bring back a visual indication of the playing item.

Turned out to be surprisingly more difficult than I thought, so
hopefully no additional bugs.

In particular some Phonon backends seem to insert a trip to a
StoppedState when changing the MediaObject's current source, so I had to
find a way around that to be able to call Playlist::stop() from
PlaylistCollection (which is what actually clears the visual indication
when playback stops).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
 * Copyright (C) 2004 Scott Wheeler <wheeler@kde.org>
3
3
 * Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
4
 
 * Copyright (C) 2008, 2009 Michael Pyne <mpyne@kde.org>
 
4
 * Copyright (C) 2008, 2009, 2018 Michael Pyne <mpyne@kde.org>
5
5
 *
6
6
 * This program is free software; you can redistribute it and/or modify it under
7
7
 * the terms of the GNU General Public License as published by the Free Software
281
281
    action("forward")->setEnabled(false);
282
282
    action("forwardAlbum")->setEnabled(false);
283
283
 
284
 
    m_media->stop();
285
 
 
286
284
    if(!m_file.isNull()) {
287
285
        m_file = FileHandle();
288
286
        emit signalItemChanged(m_file);
289
287
    }
 
288
 
 
289
    m_media->stop();
290
290
}
291
291
 
292
292
void PlayerManager::setVolume(float volume)
446
446
    }
447
447
 
448
448
    // "normal" path
449
 
    if(newstate == Phonon::StoppedState) {
 
449
    if(newstate == Phonon::StoppedState && m_file.isNull()) {
450
450
        JuK::JuKInstance()->setWindowTitle(i18n("JuK"));
451
451
        emit signalStop();
452
452
    }