spirc.proto 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. syntax = "proto2";
  2. message Frame {
  3. optional uint32 version = 0x1;
  4. optional string ident = 0x2;
  5. optional string protocol_version = 0x3;
  6. optional uint32 seq_nr = 0x4;
  7. optional MessageType typ = 0x5;
  8. optional DeviceState device_state = 0x7;
  9. optional Goodbye goodbye = 0xb;
  10. optional State state = 0xc;
  11. optional uint32 position = 0xd;
  12. optional uint32 volume = 0xe;
  13. optional int64 state_update_id = 0x11;
  14. repeated string recipient = 0x12;
  15. optional bytes context_player_state = 0x13;
  16. optional string new_name = 0x14;
  17. optional Metadata metadata = 0x19;
  18. }
  19. enum MessageType {
  20. kMessageTypeHello = 0x1;
  21. kMessageTypeGoodbye = 0x2;
  22. kMessageTypeProbe = 0x3;
  23. kMessageTypeNotify = 0xa;
  24. kMessageTypeLoad = 0x14;
  25. kMessageTypePlay = 0x15;
  26. kMessageTypePause = 0x16;
  27. kMessageTypePlayPause = 0x17;
  28. kMessageTypeSeek = 0x18;
  29. kMessageTypePrev = 0x19;
  30. kMessageTypeNext = 0x1a;
  31. kMessageTypeVolume = 0x1b;
  32. kMessageTypeShuffle = 0x1c;
  33. kMessageTypeRepeat = 0x1d;
  34. kMessageTypeVolumeDown = 0x1f;
  35. kMessageTypeVolumeUp = 0x20;
  36. kMessageTypeReplace = 0x21;
  37. kMessageTypeLogout = 0x22;
  38. kMessageTypeAction = 0x23;
  39. kMessageTypeRename = 0x24;
  40. kMessageTypeUpdateMetadata = 0x80;
  41. }
  42. message DeviceState {
  43. optional string sw_version = 0x1;
  44. optional bool is_active = 0xa;
  45. optional bool can_play = 0xb;
  46. optional uint32 volume = 0xc;
  47. optional string name = 0xd;
  48. optional uint32 error_code = 0xe;
  49. optional int64 became_active_at = 0xf;
  50. optional string error_message = 0x10;
  51. repeated Capability capabilities = 0x11;
  52. optional string context_player_error = 0x14;
  53. repeated Metadata metadata = 0x19;
  54. }
  55. message Capability {
  56. optional CapabilityType typ = 0x1;
  57. repeated int64 intValue = 0x2;
  58. repeated string stringValue = 0x3;
  59. }
  60. enum CapabilityType {
  61. kSupportedContexts = 0x1;
  62. kCanBePlayer = 0x2;
  63. kRestrictToLocal = 0x3;
  64. kDeviceType = 0x4;
  65. kGaiaEqConnectId = 0x5;
  66. kSupportsLogout = 0x6;
  67. kIsObservable = 0x7;
  68. kVolumeSteps = 0x8;
  69. kSupportedTypes = 0x9;
  70. kCommandAcks = 0xa;
  71. kSupportsRename = 0xb;
  72. kHidden = 0xc;
  73. }
  74. message Goodbye {
  75. optional string reason = 0x1;
  76. }
  77. message State {
  78. optional string context_uri = 0x2;
  79. optional uint32 index = 0x3;
  80. optional uint32 position_ms = 0x4;
  81. optional PlayStatus status = 0x5;
  82. optional uint64 position_measured_at = 0x7;
  83. optional string context_description = 0x8;
  84. optional bool shuffle = 0xd;
  85. optional bool repeat = 0xe;
  86. optional string last_command_ident = 0x14;
  87. optional uint32 last_command_msgid = 0x15;
  88. optional bool playing_from_fallback = 0x18;
  89. optional uint32 row = 0x19;
  90. optional uint32 playing_track_index = 0x1a;
  91. repeated TrackRef track = 0x1b;
  92. optional Ad ad = 0x1c;
  93. }
  94. enum PlayStatus {
  95. kPlayStatusStop = 0x0;
  96. kPlayStatusPlay = 0x1;
  97. kPlayStatusPause = 0x2;
  98. kPlayStatusLoading = 0x3;
  99. }
  100. message TrackRef {
  101. optional bytes gid = 0x1;
  102. optional string uri = 0x2;
  103. optional bool queued = 0x3;
  104. optional string context = 0x4;
  105. }
  106. message Ad {
  107. optional int32 next = 0x1;
  108. optional bytes ogg_fid = 0x2;
  109. optional bytes image_fid = 0x3;
  110. optional int32 duration = 0x4;
  111. optional string click_url = 0x5;
  112. optional string impression_url = 0x6;
  113. optional string product = 0x7;
  114. optional string advertiser = 0x8;
  115. optional bytes gid = 0x9;
  116. }
  117. message Metadata {
  118. optional string type = 0x1;
  119. optional string metadata = 0x2;
  120. }