void PlaylistSequence::SetShuffleMode(ShuffleMode mode) { ui_->shuffle->setChecked(mode != Shuffle_Off); switch (mode) { case Shuffle_Off: ui_->action_shuffle_off->setChecked(true); break; case Shuffle_All: ui_->action_shuffle_all->setChecked(true); break; case Shuffle_InsideAlbum: ui_->action_shuffle_inside_album->setChecked(true); break; case Shuffle_Albums: ui_->action_shuffle_albums->setChecked(true); break; } if (mode != shuffle_mode_) { shuffle_mode_ = mode; emit ShuffleModeChanged(mode); } Save(); }
void NetworkRemote::AcceptConnection() { if (!signals_connected_) { signals_connected_ = true; // Setting up the signals, but only once connect(incoming_data_parser_.get(), SIGNAL(SendClementineInfo()), outgoing_data_creator_.get(), SLOT(SendClementineInfo())); connect(incoming_data_parser_.get(), SIGNAL(SendFirstData(bool)), outgoing_data_creator_.get(), SLOT(SendFirstData(bool))); connect(incoming_data_parser_.get(), SIGNAL(SendAllPlaylists()), outgoing_data_creator_.get(), SLOT(SendAllPlaylists())); connect(incoming_data_parser_.get(), SIGNAL(SendAllActivePlaylists()), outgoing_data_creator_.get(), SLOT(SendAllActivePlaylists())); connect(incoming_data_parser_.get(), SIGNAL(SendPlaylistSongs(int)), outgoing_data_creator_.get(), SLOT(SendPlaylistSongs(int))); connect(app_->playlist_manager(), SIGNAL(ActiveChanged(Playlist*)), outgoing_data_creator_.get(), SLOT(ActiveChanged(Playlist*))); connect(app_->playlist_manager(), SIGNAL(PlaylistChanged(Playlist*)), outgoing_data_creator_.get(), SLOT(PlaylistChanged(Playlist*))); connect(app_->playlist_manager(), SIGNAL(PlaylistAdded(int,QString,bool)), outgoing_data_creator_.get(), SLOT(PlaylistAdded(int,QString,bool))); connect(app_->playlist_manager(), SIGNAL(PlaylistRenamed(int,QString)), outgoing_data_creator_.get(), SLOT(PlaylistRenamed(int,QString))); connect(app_->playlist_manager(), SIGNAL(PlaylistClosed(int)), outgoing_data_creator_.get(), SLOT(PlaylistClosed(int))); connect(app_->playlist_manager(), SIGNAL(PlaylistDeleted(int)), outgoing_data_creator_.get(), SLOT(PlaylistDeleted(int))); connect(app_->player(), SIGNAL(VolumeChanged(int)), outgoing_data_creator_.get(), SLOT(VolumeChanged(int))); connect(app_->player()->engine(), SIGNAL(StateChanged(Engine::State)), outgoing_data_creator_.get(), SLOT(StateChanged(Engine::State))); connect(app_->playlist_manager()->sequence(), SIGNAL(RepeatModeChanged(PlaylistSequence::RepeatMode)), outgoing_data_creator_.get(), SLOT(SendRepeatMode(PlaylistSequence::RepeatMode))); connect(app_->playlist_manager()->sequence(), SIGNAL(ShuffleModeChanged(PlaylistSequence::ShuffleMode)), outgoing_data_creator_.get(), SLOT(SendShuffleMode(PlaylistSequence::ShuffleMode))); connect(incoming_data_parser_.get(), SIGNAL(GetLyrics()), outgoing_data_creator_.get(), SLOT(GetLyrics())); connect(incoming_data_parser_.get(), SIGNAL(SendSongs(pb::remote::RequestDownloadSongs,RemoteClient*)), outgoing_data_creator_.get(), SLOT(SendSongs(pb::remote::RequestDownloadSongs,RemoteClient*))); connect(incoming_data_parser_.get(), SIGNAL(ResponseSongOffer(RemoteClient*, bool)), outgoing_data_creator_.get(), SLOT(ResponseSongOffer(RemoteClient*, bool))); connect(incoming_data_parser_.get(), SIGNAL(SendLibrary(RemoteClient*)), outgoing_data_creator_.get(), SLOT(SendLibrary(RemoteClient*))); }
// when PlaylistManager gets it ready, we connect PlaylistSequence with this void Mpris2::PlaylistManagerInitialized() { connect(app_->playlist_manager()->sequence(), SIGNAL(ShuffleModeChanged(PlaylistSequence::ShuffleMode)), SLOT(ShuffleModeChanged())); connect(app_->playlist_manager()->sequence(), SIGNAL(RepeatModeChanged(PlaylistSequence::RepeatMode)), SLOT(RepeatModeChanged())); }