Skip to content

Commit 0a8e685

Browse files
committed
Updated some proto definitions + updated client version
There's a couple of new interesting capabilities (supports_lossless_audio and supports_hifi) as well as the playback_quality field.
1 parent a51716b commit 0a8e685

File tree

4 files changed

+73
-1
lines changed

4 files changed

+73
-1
lines changed

lib/src/main/java/xyz/gianlu/librespot/Version.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static BuildInfo standardBuildInfo() {
6969
.setProduct(Product.PRODUCT_CLIENT)
7070
.addProductFlags(ProductFlags.PRODUCT_FLAG_NONE)
7171
.setPlatform(Version.platform())
72-
.setVersion(115100382)
72+
.setVersion(115800820)
7373
.build();
7474
}
7575
}

lib/src/main/proto/connect.proto

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ message Device {
1818
DeviceInfo device_info = 1;
1919
PlayerState player_state = 2;
2020
PrivateDeviceInfo private_device_info = 3;
21+
bytes transfer_data = 4; // TransferState
2122
}
2223

2324
message Cluster {
@@ -26,6 +27,10 @@ message Cluster {
2627
PlayerState player_state = 3;
2728
map<string, DeviceInfo> device = 4;
2829
bytes transfer_data = 5;
30+
uint64 transfer_data_timestamp = 6;
31+
int64 not_playing_since_timestamp = 7;
32+
bool need_full_player_state = 8;
33+
int64 server_timestamp_ms = 9;
2934
}
3035

3136
message PutStateRequest {
@@ -52,6 +57,10 @@ message SubscribeRequest {
5257
}
5358

5459
message DeviceInfo {
60+
message DeviceAliasesEntry {
61+
uint32 key = 1;
62+
DeviceAlias value = 2;
63+
}
5564
bool can_play = 1;
5665
uint32 volume = 2;
5766
string name = 3;
@@ -66,6 +75,19 @@ message DeviceInfo {
6675
string brand = 14;
6776
string model = 15;
6877
map<string, string> metadata_map = 16;
78+
string product_id = 17;
79+
string deduplication_id = 18;
80+
uint32 selected_alias_id = 19;
81+
repeated DeviceAliasesEntry device_aliases = 20;
82+
bool is_offline = 21;
83+
string public_ip = 22;
84+
string license = 23;
85+
}
86+
87+
message DeviceAlias {
88+
uint32 id = 1;
89+
string name = 2;
90+
bool is_group = 3;
6991
}
7092

7193
message Capabilities {
@@ -90,9 +112,18 @@ message Capabilities {
90112
bool is_voice_enabled = 21;
91113
bool needs_full_player_state = 22;
92114
bool supports_gzip_pushes = 23;
115+
bool supports_lossless_audio = 24;
116+
bool supports_set_options_command = 25;
117+
CapabilitySupportDetails supports_hifi = 26;
93118
// reserved 1, "supported_contexts";
94119
}
95120

121+
message CapabilitySupportDetails {
122+
bool fully_supported = 1;
123+
bool user_eligible = 2;
124+
bool device_supported = 3;
125+
}
126+
96127
message ConnectCommandOptions {
97128
int32 message_id = 1;
98129
}
@@ -135,19 +166,25 @@ enum PutStateReason {
135166
VOLUME_CHANGED = 5;
136167
PICKER_OPENED = 6;
137168
BECAME_INACTIVE = 7;
169+
ALIAS_CHANGED = 8;
138170
}
139171

140172
enum MemberType {
141173
SPIRC_V2 = 0;
142174
SPIRC_V3 = 1;
143175
CONNECT_STATE = 2;
176+
CONNECT_STATE_EXTENDED = 5;
177+
ACTIVE_DEVICE_TRACKER = 6;
178+
PLAY_TOKEN = 7;
144179
}
145180

146181
enum ClusterUpdateReason {
147182
UNKNOWN_CLUSTER_UPDATE_REASON = 0;
148183
DEVICES_DISAPPEARED = 1;
149184
DEVICE_STATE_CHANGED = 2;
150185
NEW_DEVICE_APPEARED = 3;
186+
DEVICE_VOLUME_CHANGED = 4;
187+
DEVICE_ALIAS_CHANGED = 5;
151188
}
152189

153190
enum DeviceType {

lib/src/main/proto/player.proto

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ message PlayerState {
3434
string entity_uri = 26;
3535
repeated ProvidedTrack reverse = 27;
3636
repeated ProvidedTrack future = 28;
37+
PlaybackQuality playback_quality = 32;
3738
}
3839

3940
message ProvidedTrack {
@@ -100,3 +101,35 @@ message ContextPlayerOptions {
100101
message Suppressions {
101102
repeated string providers = 1;
102103
}
104+
105+
enum BitrateLevel {
106+
unknown = 0;
107+
low = 1;
108+
normal = 2;
109+
high = 3;
110+
veryhigh = 4;
111+
normalized = 5;
112+
}
113+
114+
enum BitrateStrategy {
115+
unknown_strategy = 0;
116+
best_matching = 1;
117+
backend_advised = 2;
118+
offlined_file = 3;
119+
cached_file = 4;
120+
local_file = 5;
121+
}
122+
123+
enum HiFiStatus {
124+
none = 0;
125+
off = 1;
126+
on = 2;
127+
}
128+
129+
message PlaybackQuality {
130+
BitrateLevel bitrate_level = 1;
131+
BitrateStrategy strategy = 2;
132+
BitrateLevel target_bitrate_level = 3;
133+
bool target_bitrate_available = 4;
134+
HiFiStatus hifi_status = 5;
135+
}

player/src/main/java/xyz/gianlu/librespot/player/state/DeviceStateHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import xyz.gianlu.librespot.dealer.DealerClient;
3838
import xyz.gianlu.librespot.dealer.DealerClient.RequestResult;
3939
import xyz.gianlu.librespot.mercury.MercuryClient;
40+
import xyz.gianlu.librespot.mercury.MercuryRequests;
4041
import xyz.gianlu.librespot.player.PlayerConfiguration;
4142

4243
import java.io.Closeable;
@@ -91,6 +92,7 @@ private static Connect.DeviceInfo.Builder initializeDeviceInfo(@NotNull Session
9192
.setDeviceId(session.deviceId())
9293
.setDeviceType(session.deviceType())
9394
.setDeviceSoftwareVersion(Version.versionString())
95+
.setClientId(MercuryRequests.KEYMASTER_CLIENT_ID)
9496
.setSpircVersion("3.2.6")
9597
.setCapabilities(Connect.Capabilities.newBuilder()
9698
.setCanBePlayer(true).setGaiaEqConnectId(true).setSupportsLogout(true)

0 commit comments

Comments
 (0)