Clementine-audio-player-Mac.../ext/libclementine-remote/remotecontrolmessages.proto

199 lines
4.5 KiB
Protocol Buffer
Raw Normal View History

2013-01-03 21:40:47 +01:00
package pb.remote;
2013-01-14 19:07:34 +01:00
// The supported message types
2013-01-03 21:40:47 +01:00
enum MsgType {
2013-01-14 19:07:34 +01:00
UNKNOWN = 0;
2013-01-03 21:40:47 +01:00
// Messages generally send from client to server
2013-01-14 19:07:34 +01:00
CONNECT = 1;
DISCONNECT = 2;
REQUEST_PLAYLISTS = 3;
REQUEST_PLAYLIST_SONGS = 4;
CHANGE_SONG = 5;
SET_VOLUME = 6;
2013-01-03 21:40:47 +01:00
// Messages send by both
PLAY = 20;
PLAYPAUSE = 21;
PAUSE = 22;
STOP = 23;
NEXT = 24;
2013-01-14 19:07:34 +01:00
PREVIOUS = 25;
SHUFFLE_PLAYLIST = 26;
// Messages that contain the repeat or random mode
// Either set by client or clementine
REPEAT = 27;
RANDOM = 28;
2013-01-03 21:40:47 +01:00
// Messages send from server to client
INFOS = 40;
CURRENT_METAINFOS = 41;
PLAYLISTS = 42;
PLAYLIST_SONGS = 43;
2013-01-14 19:07:34 +01:00
ENGINE_STATE_CHANGED = 44;
KEEP_ALIVE = 45;
2013-01-03 21:40:47 +01:00
}
2013-01-14 19:07:34 +01:00
// Valid Engine states
2013-01-03 21:40:47 +01:00
enum EngineState {
Empty = 0;
Idle = 1;
Playing = 2;
Paused = 3;
}
2013-01-14 19:07:34 +01:00
// Song Metadata
2013-01-03 21:40:47 +01:00
message SongMetadata {
2013-01-14 19:07:34 +01:00
optional int32 id = 1; // unique id of the song
optional int32 index = 2; // Index of the current row of the active playlist
2013-01-03 21:40:47 +01:00
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;
2013-01-12 17:22:40 +01:00
optional bytes art = 13;
2013-01-03 21:40:47 +01:00
}
2013-01-14 19:07:34 +01:00
// Playlist informations
2013-01-03 21:40:47 +01:00
message Playlist {
optional int32 id = 1;
optional string name = 2;
optional int32 item_count = 3;
optional bool active = 4;
2013-01-14 19:07:34 +01:00
// The songs are only sent when the client requests them.
// See src/remotecontrol/outgoingdatacreator.cpp for more info
2013-01-03 21:40:47 +01:00
repeated SongMetadata songs = 10;
}
2013-01-14 19:07:34 +01:00
// Valid Repeatmodes
enum RepeatMode {
Repeat_Off = 0;
Repeat_Track = 1;
Repeat_Album = 2;
Repeat_Playlist = 3;
}
// Valid Shuffle modes
enum ShuffleMode {
Shuffle_Off = 0;
Shuffle_All = 1;
Shuffle_InsideAlbum = 2;
Shuffle_Albums = 3;
}
// Message with unknown content
// Shouldn't be used anywhere
message Unknown {
}
// This message is sent when a client connects to clementine
message Connect {
}
// This message is sent when a client disconnects from clementine
message Disconnect {
}
// Client requests all playlists
message RequestPlaylists {
}
// A Client requests songs from a specific playlist
message RequestPlaylistSongs {
optional int32 id = 1;
}
// Client want to change track
message RequestChangeSong {
// In which playlist is the song?
optional int32 playlist_id = 1;
// And on which position?
optional int32 song_index = 2;
}
// Set the volume
message RequestSetVolume {
optional int32 volume = 1;
}
// Controlmessages
message Play {}
message PlayPause {}
message Pause {}
message Stop {}
message Next {}
message Previous {}
message ShufflePlaylist {}
// Repeat and Random messages
message Repeat {
optional RepeatMode repeat_mode = 1;
}
message Shuffle {
optional ShuffleMode shuffle_mode = 1;
}
// Response from server
// General infos
message ResponseClementineInfo {
optional string version = 1;
}
// The current song played
message ResponseCurrentMetadata {
optional SongMetadata song_metadata = 1;
}
// The playlists in clementine
message ResponsePlaylists {
repeated Playlist playlist = 1;
}
// A list of songs in a playlist
message ResponsePlaylistSongs {
optional Playlist requested_playlist = 1;
repeated SongMetadata song = 2;
}
// The current state of the play engine
message ResponseEngineStateChanged {
optional EngineState state = 1;
}
// Empty Keep Alive telegram
message KeepAlive {}
// The message itself
message Message {
2013-01-14 22:00:56 +01:00
optional int32 version = 1 [default=1];
optional MsgType msgType = 2 [default=UNKNOWN]; // What data is in the message?
2013-01-14 19:07:34 +01:00
optional Unknown unknown = 10;
optional Connect connect = 11;
optional Disconnect disconnect = 12;
optional RequestPlaylists request_playlist = 13;
optional RequestPlaylistSongs request_playlist_songs = 14;
optional RequestChangeSong request_change_song = 15;
optional RequestSetVolume request_set_volume = 16;
optional Play play = 17;
optional PlayPause play_pause = 18;
optional Pause pause = 19;
optional Stop stop = 20;
optional Next next = 21;
optional Previous previous = 22;
optional ShufflePlaylist shuffle_playlist = 23;
optional Repeat repeat = 24;
optional Shuffle shuffle = 25;
optional ResponseClementineInfo response_clementine_info = 26;
optional ResponseCurrentMetadata response_current_metadata = 27;
optional ResponsePlaylists response_playlists = 28;
optional ResponsePlaylistSongs response_playlist_songs = 29;
optional ResponseEngineStateChanged response_engine_state_changed = 30;
}