76 lines
1.5 KiB
Protocol Buffer
76 lines
1.5 KiB
Protocol Buffer
package pb.remote;
|
|
|
|
enum MsgType {
|
|
UNKNOWN = 0;
|
|
// Messages generally send from client to server
|
|
CONNECT = 1;
|
|
DISCONNECT = 2;
|
|
REQUEST_PLAYLISTS = 3;
|
|
REQUEST_PLAYLIST_SONGS = 4;
|
|
CHANGE_SONG = 5;
|
|
SET_VOLUME = 6;
|
|
|
|
// Messages send by both
|
|
PLAY = 20;
|
|
PLAYPAUSE = 21;
|
|
PAUSE = 22;
|
|
STOP = 23;
|
|
NEXT = 24;
|
|
PREV = 25;
|
|
TOGGLE_SHUFFLE = 26;
|
|
|
|
// Messages send from server to client
|
|
INFOS = 40;
|
|
CURRENT_METAINFOS = 41;
|
|
PLAYLISTS = 42;
|
|
PLAYLIST_SONGS = 43;
|
|
KEEP_ALIVE = 44;
|
|
}
|
|
|
|
enum EngineState {
|
|
Empty = 0;
|
|
Idle = 1;
|
|
Playing = 2;
|
|
Paused = 3;
|
|
}
|
|
|
|
message Message {
|
|
required int32 version = 1 [default=1];
|
|
required MsgType msgType = 2 [default=UNKNOWN];
|
|
|
|
optional EngineState state = 3;
|
|
optional ClementineInfo info = 4;
|
|
optional SongMetadata currentSong = 5;
|
|
optional int32 volume = 6;
|
|
repeated Playlist playlists = 7;
|
|
}
|
|
|
|
message ClementineInfo {
|
|
optional string version = 1;
|
|
}
|
|
|
|
message SongMetadata {
|
|
optional int32 id = 1;
|
|
optional int32 index = 2;
|
|
optional string title = 3;
|
|
optional string album = 4;
|
|
optional string artist = 5;
|
|
optional string albumartist = 6;
|
|
optional int32 track = 7;
|
|
optional int32 disc = 8;
|
|
optional string pretty_year = 9;
|
|
optional string genre = 10;
|
|
optional int32 playcount = 11;
|
|
optional string pretty_length = 12;
|
|
optional bytes art = 13;
|
|
}
|
|
|
|
message Playlist {
|
|
optional int32 id = 1;
|
|
optional string name = 2;
|
|
optional bool active = 3;
|
|
|
|
repeated SongMetadata songs = 10;
|
|
}
|
|
|