syntax = "proto3"; package player; service MusicPlayer { rpc TogglePause (TogglePauseRequest) returns (TogglePauseResponse); rpc SkipNext (SkipNextRequest) returns (SkipNextResponse); rpc GetProgress (GetProgressRequest) returns (GetProgressResponse); rpc VolumeUp (VolumeUpRequest) returns (VolumeReply); rpc VolumeDown (VolumeDownRequest) returns (VolumeReply); rpc CycleLoop (CycleLoopRequest) returns (CycleLoopReply); rpc SpeedUp (SpeedUpRequest) returns (SpeedReply); rpc SpeedDown (SpeedDownRequest) returns (SpeedReply); rpc ToggleGapless (ToggleGaplessRequest) returns (ToggleGaplessReply); rpc SeekForward (SeekForwardRequest) returns (PlayerTime); rpc SeekBackward (SeekBackwardRequest) returns (PlayerTime); rpc ReloadConfig (ReloadConfigRequest) returns (EmptyReply); rpc ReloadPlaylist (ReloadPlaylistRequest) returns (EmptyReply); rpc PlaySelected (PlaySelectedRequest) returns (EmptyReply); rpc SkipPrevious(SkipPreviousRequest) returns (EmptyReply); } message TogglePauseRequest {} message TogglePauseResponse { uint32 status = 1; } message SkipNextRequest {} message SkipNextResponse{} message PlayerTime { Duration position = 1; Duration total_duration = 2; } message GetProgressRequest {} message GetProgressResponse{ PlayerTime progress = 1; uint32 current_track_index = 3; uint32 status = 4; // actually a u16, but protobuf does not support types lower than 32 bits uint32 volume = 5; int32 speed = 6; bool gapless = 7; bool current_track_updated = 8; string radio_title = 9; } message VolumeUpRequest {} message VolumeDownRequest {} message VolumeReply { // actually a u16, but protobuf does not support types lower than 32 bits uint32 volume = 1; } message CycleLoopRequest {} message CycleLoopReply {} message SpeedUpRequest {} message SpeedDownRequest {} message SpeedReply { int32 speed = 1; } message ToggleGaplessRequest {} message ToggleGaplessReply { bool gapless = 1; } message SeekForwardRequest {} message SeekBackwardRequest {} // old usage for the Seek*Request, but completely covered by PlayerTime // message SeekReply { // uint32 position = 1; // uint32 duration = 2; // } message ReloadConfigRequest {} message ReloadPlaylistRequest {} message EmptyReply {} message PlaySelectedRequest {} message SkipPreviousRequest {} // using a custom Duration that matches rust's definition, as rust's may not fit into google's well-known Duration message Duration { uint64 secs = 1; uint32 nanos = 2; }