From 79398905451ff8a236bdee7554cfbfd6a978aace Mon Sep 17 00:00:00 2001 From: Andreas Date: Thu, 21 Mar 2013 16:14:13 +0100 Subject: [PATCH] - Send the playlisttracks from the currenly active one in SendFirstData(). - New proto type FIRST_DATA_SENT_COMPLETE: Is send, when the method SendFirstData() finishes. --- ext/libclementine-remote/remotecontrolmessages.proto | 1 + src/networkremote/outgoingdatacreator.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/ext/libclementine-remote/remotecontrolmessages.proto b/ext/libclementine-remote/remotecontrolmessages.proto index 6200ca1ab..e02c60a3f 100644 --- a/ext/libclementine-remote/remotecontrolmessages.proto +++ b/ext/libclementine-remote/remotecontrolmessages.proto @@ -34,6 +34,7 @@ enum MsgType { KEEP_ALIVE = 45; UPDATE_TRACK_POSITION = 46; ACTIVE_PLAYLIST_CHANGED = 47; + FIRST_DATA_SENT_COMPLETE = 48; } // Valid Engine states diff --git a/src/networkremote/outgoingdatacreator.cpp b/src/networkremote/outgoingdatacreator.cpp index a6099a978..d6d8ab845 100644 --- a/src/networkremote/outgoingdatacreator.cpp +++ b/src/networkremote/outgoingdatacreator.cpp @@ -165,9 +165,17 @@ void OutgoingDataCreator::SendFirstData() { // And the current playlists SendAllPlaylists(); + // Send the tracks of the active playlist + SendPlaylistSongs(app_->playlist_manager()->active_id()); + // Send the current random and repeat mode SendShuffleMode(app_->playlist_manager()->sequence()->shuffle_mode()); SendRepeatMode(app_->playlist_manager()->sequence()->repeat_mode()); + + // We send all first data + pb::remote::Message msg; + msg.set_type(pb::remote::FIRST_DATA_SENT_COMPLETE); + SendDataToClients(&msg); } void OutgoingDataCreator::CurrentSongChanged(const Song& song, const QString& uri, const QImage& img) {