Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduce disable_volume as connect device option #1451

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions connect/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::{
},
protocol::{
connect::{Capabilities, Device, DeviceInfo, MemberType, PutStateReason, PutStateRequest},
media::AudioQuality,
player::{
ContextIndex, ContextPlayerOptions, PlayOrigin, PlayerState, ProvidedTrack,
Suppressions,
Expand Down Expand Up @@ -82,6 +83,7 @@ pub struct ConnectStateConfig {
pub device_type: DeviceType,
pub volume_steps: i32,
pub is_group: bool,
pub disable_volume: bool,
}

impl Default for ConnectStateConfig {
Expand All @@ -93,6 +95,7 @@ impl Default for ConnectStateConfig {
device_type: DeviceType::Speaker,
volume_steps: 64,
is_group: false,
disable_volume: false,
}
}
}
Expand Down Expand Up @@ -137,14 +140,14 @@ impl ConnectState {
is_group: cfg.is_group,
capabilities: MessageField::some(Capabilities {
volume_steps: cfg.volume_steps,
hidden: false, // could be exposed later to only observe the playback
disable_volume: cfg.disable_volume,

gaia_eq_connect_id: true,
can_be_player: true,

needs_full_player_state: true,

is_observable: true,
is_controllable: true,
hidden: false,

supports_gzip_pushes: true,
// todo: enable after logout handling is implemented, see spirc logout_request
Expand All @@ -157,14 +160,19 @@ impl ConnectState {

is_voice_enabled: false,
restrict_to_local: false,
disable_volume: false,
connect_disabled: false,
supports_rename: false,
supports_external_episodes: false,
supports_set_backend_metadata: false,
supports_hifi: MessageField::none(),
// that "AI" dj thingy only available to specific regions/users
supports_dj: false,
supports_rooms: false,
// AudioQuality::HIFI is available, further investigation necessary
supported_audio_quality: EnumOrUnknown::new(AudioQuality::VERY_HIGH),

command_acks: true,

..Default::default()
}),
..Default::default()
Expand Down
Loading