From 617c575ef4dd91889d652195cefc38851ae92ab4 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sat, 2 Feb 2013 16:51:48 +0100 Subject: [PATCH 1/3] Send all playlist on connect. --- src/networkremote/outgoingdatacreator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/networkremote/outgoingdatacreator.cpp b/src/networkremote/outgoingdatacreator.cpp index 133513957..14d3b98ab 100644 --- a/src/networkremote/outgoingdatacreator.cpp +++ b/src/networkremote/outgoingdatacreator.cpp @@ -140,6 +140,9 @@ void OutgoingDataCreator::SendFirstData() { // And the current track position UpdateTrackPosition(); + + // And the current playlists + SendAllPlaylists(); } void OutgoingDataCreator::CurrentSongChanged(const Song& song, const QString& uri, const QImage& img) { From 8a97e317a60820fdc86557dbc05f5c8cc628be01 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 3 Feb 2013 20:24:36 +0100 Subject: [PATCH 2/3] Send Random and Repeat Mode on connection. --- src/networkremote/outgoingdatacreator.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/networkremote/outgoingdatacreator.cpp b/src/networkremote/outgoingdatacreator.cpp index 14d3b98ab..2bdbae66b 100644 --- a/src/networkremote/outgoingdatacreator.cpp +++ b/src/networkremote/outgoingdatacreator.cpp @@ -143,6 +143,10 @@ void OutgoingDataCreator::SendFirstData() { // And the current playlists SendAllPlaylists(); + + // Send the current random and repeat mode + SendShuffleMode(app_->playlist_manager()->sequence()->shuffle_mode()); + SendRepeatMode(app_->playlist_manager()->sequence()->repeat_mode()); } void OutgoingDataCreator::CurrentSongChanged(const Song& song, const QString& uri, const QImage& img) { From f779e14df7baba9dadf25c289e34bfd0d485962a Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 3 Feb 2013 21:09:48 +0100 Subject: [PATCH 3/3] Fix connects for Repeat and Shuffle. They were never reached. --- src/core/metatypes.cpp | 2 ++ src/networkremote/incomingdataparser.cpp | 7 ------- src/networkremote/incomingdataparser.h | 2 -- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/core/metatypes.cpp b/src/core/metatypes.cpp index b3975824d..cea408152 100644 --- a/src/core/metatypes.cpp +++ b/src/core/metatypes.cpp @@ -48,6 +48,8 @@ void RegisterMetaTypes() { qRegisterMetaType("PodcastList"); qRegisterMetaType >("QList"); qRegisterMetaType >("QList"); + qRegisterMetaType("PlaylistSequence::RepeatMode"); + qRegisterMetaType("PlaylistSequence::ShuffleMode"); qRegisterMetaType >("QList"); qRegisterMetaType >("QList"); qRegisterMetaType >("QList"); diff --git a/src/networkremote/incomingdataparser.cpp b/src/networkremote/incomingdataparser.cpp index b02e8d13b..e3aae3cc5 100644 --- a/src/networkremote/incomingdataparser.cpp +++ b/src/networkremote/incomingdataparser.cpp @@ -45,13 +45,6 @@ IncomingDataParser::IncomingDataParser(Application* app) connect(this, SIGNAL(SeekTo(int)), app_->player(), SLOT(SeekTo(int))); - // For some connects we have to wait for the playlistmanager - // to be initialized - connect(app_->playlist_manager(), SIGNAL(PlaylistManagerInitialized()), - this, SLOT(PlaylistManagerInitialized())); -} - -void IncomingDataParser::PlaylistManagerInitialized() { connect(this, SIGNAL(SetActivePlaylist(int)), app_->playlist_manager(), SLOT(SetActivePlaylist(int))); connect(this, SIGNAL(ShuffleCurrent()), diff --git a/src/networkremote/incomingdataparser.h b/src/networkremote/incomingdataparser.h index bea80d3b3..7c13c4a0f 100644 --- a/src/networkremote/incomingdataparser.h +++ b/src/networkremote/incomingdataparser.h @@ -36,8 +36,6 @@ signals: void SetShuffleMode(PlaylistSequence::ShuffleMode mode); void SeekTo(int seconds); -private slots: - void PlaylistManagerInitialized(); private: Application* app_;