Update support for boot_sound kernel patch

This commit is contained in:
Luke D. Jones
2024-03-10 20:53:03 +13:00
parent 0fac33a8ff
commit e371229b6c
11 changed files with 64 additions and 42 deletions

View File

@@ -40,7 +40,7 @@ pub struct PlatformState {
impl PlatformState {
pub fn new(dbus: &RogDbusClientBlocking<'_>) -> Result<Self> {
Ok(Self {
post_sound: dbus.proxies().platform().post_animation_sound().ok(),
post_sound: dbus.proxies().platform().boot_sound().ok(),
gpu_mux_mode: dbus
.proxies()
.platform()

View File

@@ -415,6 +415,7 @@ pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
nv_dynamic_boost: sys_props.contains(&Properties::NvDynamicBoost),
nv_temp_target: sys_props.contains(&Properties::NvTempTarget),
panel_od: sys_props.contains(&Properties::PanelOd),
boot_sound: sys_props.contains(&Properties::PostAnimationSound),
ppt_apu_sppt: sys_props.contains(&Properties::PptApuSppt),
ppt_fppt: sys_props.contains(&Properties::PptFppt),
ppt_pl1_spl: sys_props.contains(&Properties::PptPl1Spl),
@@ -452,6 +453,7 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
set_ui_props_async!(handle, platform, SystemPageData, throttle_policy_on_ac);
set_ui_props_async!(handle, platform, SystemPageData, panel_od);
set_ui_props_async!(handle, platform, SystemPageData, boot_sound);
set_ui_props_async!(handle, platform, SystemPageData, mini_led_mode);
set_ui_props_async!(handle, platform, SystemPageData, ppt_pl1_spl);
set_ui_props_async!(handle, platform, SystemPageData, ppt_pl2_sppt);
@@ -473,6 +475,7 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
nv_dynamic_boost: sys_props.contains(&Properties::NvDynamicBoost),
nv_temp_target: sys_props.contains(&Properties::NvTempTarget),
panel_od: sys_props.contains(&Properties::PanelOd),
boot_sound: sys_props.contains(&Properties::PostAnimationSound),
ppt_apu_sppt: sys_props.contains(&Properties::PptApuSppt),
ppt_fppt: sys_props.contains(&Properties::PptFppt),
ppt_pl1_spl: sys_props.contains(&Properties::PptPl1Spl),
@@ -498,6 +501,13 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
"Panel OverDrive successfully set to {}",
"Setting Panel OverDrive failed"
);
set_ui_callbacks!(
handle,
SystemPageData(),
platform.boot_sound(),
"POST Animation sound successfully set to {}",
"Setting POST Animation sound failed"
);
set_ui_callbacks!(
handle,
SystemPageData(),

View File

@@ -34,7 +34,7 @@ static mut POWER_BAT_CMD: Option<Command> = None;
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(default)]
pub struct EnabledNotifications {
pub receive_post_animation_sound_changed: bool,
pub receive_boot_sound_changed: bool,
pub receive_panel_od_changed: bool,
pub receive_mini_led_mode_changed: bool,
pub receive_dgpu_disable_changed: bool,
@@ -54,7 +54,7 @@ pub struct EnabledNotifications {
impl Default for EnabledNotifications {
fn default() -> Self {
Self {
receive_post_animation_sound_changed: false,
receive_boot_sound_changed: false,
receive_panel_od_changed: true,
receive_mini_led_mode_changed: true,
receive_dgpu_disable_changed: true,
@@ -199,7 +199,7 @@ pub fn start_notifications(
// BIOS notif
recv_changed!(
PlatformProxy,
receive_post_animation_sound_changed,
receive_boot_sound_changed,
last_notification,
enabled_notifications,
page_states,