Skip to content

Commit

Permalink
connect: expose disable_volume (#1451)
Browse files Browse the repository at this point in the history
  • Loading branch information
photovoltex authored Jan 20, 2025
1 parent f3bb380 commit b54f3e3
Showing 1 changed file with 12 additions and 4 deletions.
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

0 comments on commit b54f3e3

Please sign in to comment.