- New protocol buffer type: ACTIVE_PLAYLIST_CHANGED. This type is sent when the currenly active playlist changes instead of sending all playlists to the clients.
This commit is contained in:
parent
329a91c265
commit
ed86c7b09b
|
@ -33,6 +33,7 @@ enum MsgType {
|
||||||
ENGINE_STATE_CHANGED = 44;
|
ENGINE_STATE_CHANGED = 44;
|
||||||
KEEP_ALIVE = 45;
|
KEEP_ALIVE = 45;
|
||||||
UPDATE_TRACK_POSITION = 46;
|
UPDATE_TRACK_POSITION = 46;
|
||||||
|
ACTIVE_PLAYLIST_CHANGED = 47;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valid Engine states
|
// Valid Engine states
|
||||||
|
@ -161,6 +162,10 @@ message ResponseDisconnect {
|
||||||
optional ReasonDisconnect reason_disconnect = 1;
|
optional ReasonDisconnect reason_disconnect = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message ResponseActiveChanged {
|
||||||
|
optional int32 id = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// A client requests a new track position
|
// A client requests a new track position
|
||||||
// position in seconds!
|
// position in seconds!
|
||||||
message RequestSetTrackPosition {
|
message RequestSetTrackPosition {
|
||||||
|
@ -169,7 +174,7 @@ message RequestSetTrackPosition {
|
||||||
|
|
||||||
// The message itself
|
// The message itself
|
||||||
message Message {
|
message Message {
|
||||||
optional int32 version = 1 [default=3];
|
optional int32 version = 1 [default=4];
|
||||||
optional MsgType type = 2 [default=UNKNOWN]; // What data is in the message?
|
optional MsgType type = 2 [default=UNKNOWN]; // What data is in the message?
|
||||||
|
|
||||||
optional RequestConnect request_connect = 21;
|
optional RequestConnect request_connect = 21;
|
||||||
|
@ -188,4 +193,5 @@ message Message {
|
||||||
optional ResponseEngineStateChanged response_engine_state_changed = 19;
|
optional ResponseEngineStateChanged response_engine_state_changed = 19;
|
||||||
optional ResponseUpdateTrackPosition response_update_track_position = 20;
|
optional ResponseUpdateTrackPosition response_update_track_position = 20;
|
||||||
optional ResponseDisconnect response_disconnect = 22;
|
optional ResponseDisconnect response_disconnect = 22;
|
||||||
|
optional ResponseActiveChanged response_active_changed = 24;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,9 +124,11 @@ void OutgoingDataCreator::SendAllPlaylists() {
|
||||||
SendDataToClients(&msg);
|
SendDataToClients(&msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutgoingDataCreator::ActiveChanged(Playlist*) {
|
void OutgoingDataCreator::ActiveChanged(Playlist* playlist) {
|
||||||
// When a playlist was changed, send the new list
|
pb::remote::Message msg;
|
||||||
SendAllPlaylists();
|
msg.set_type(pb::remote::ACTIVE_PLAYLIST_CHANGED);
|
||||||
|
msg.mutable_response_active_changed()->set_id(playlist->id());
|
||||||
|
SendDataToClients(&msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutgoingDataCreator::PlaylistAdded(int id, const QString& name) {
|
void OutgoingDataCreator::PlaylistAdded(int id, const QString& name) {
|
||||||
|
|
Loading…
Reference in New Issue