the title and artist of the currently playing song are now the title of Clementine's window (Fixes issue #779)

better unmute behavior if Clementine was muted before it was closed (Fixes issue #983)
This commit is contained in:
Paweł Bara 2010-11-23 19:38:15 +00:00
parent e4a3a12a83
commit eb41dea464
3 changed files with 9 additions and 1 deletions

View File

@ -85,7 +85,7 @@ Player::Player(MainWindow* main_window, PlaylistManager* playlists,
stream_change_type_(Engine::First),
rain_stream_(-1),
toad_stream_(-1),
volume_before_mute_(0)
volume_before_mute_(50)
{
#ifdef Q_WS_X11
// MPRIS DBus interface.

View File

@ -357,6 +357,7 @@ MainWindow::MainWindow(Engine::Type engine, QWidget *parent)
connect(player_, SIGNAL(VolumeChanged(int)), osd_, SLOT(VolumeChanged(int)));
connect(player_, SIGNAL(VolumeChanged(int)), ui_->volume, SLOT(setValue(int)));
connect(player_, SIGNAL(ForceShowOSD(Song)), SLOT(ForceShowOSD(Song)));
connect(playlists_, SIGNAL(CurrentSongChanged(Song)), SLOT(SongChanged(Song)));
connect(playlists_, SIGNAL(CurrentSongChanged(Song)), osd_, SLOT(SongChanged(Song)));
connect(playlists_, SIGNAL(CurrentSongChanged(Song)), player_, SLOT(CurrentMetadataChanged(Song)));
connect(playlists_, SIGNAL(PlaylistChanged()), player_, SLOT(PlaylistChanged()));
@ -715,6 +716,8 @@ void MainWindow::AddDeviceSongsToPlaylist(bool clear_first, const SongList &song
}
void MainWindow::MediaStopped() {
setWindowTitle(QCoreApplication::applicationName());
ui_->action_stop->setEnabled(false);
ui_->action_stop_after_this_track->setEnabled(false);
ui_->action_play_pause->setIcon(IconLoader::Load("media-playback-start"));
@ -771,6 +774,10 @@ void MainWindow::VolumeChanged(int volume) {
ui_->action_mute->setChecked(!volume);
}
void MainWindow::SongChanged(const Song& song) {
setWindowTitle(song.PrettyTitleWithArtist());
}
void MainWindow::TrackSkipped(PlaylistItemPtr item) {
// If it was a library item then we have to increment its skipped count in
// the database.

View File

@ -130,6 +130,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
void PlayIndex(const QModelIndex& index);
void StopAfterCurrent();
void SongChanged(const Song& song);
void VolumeChanged(int volume);
void LoadLibraryItemToPlaylist(const QModelIndexList& indexes);