Skip to content

Commit

Permalink
honor configuration when setting the speech rate
Browse files Browse the repository at this point in the history
up to now, configuration was read, but never actually used. This begins a series of changes, perhaps across multiple fronts, to do so.
This makes `state::new` send a message on the ssip channel, with the request to set the rate to a user defined value
warning: if somehow the ssip task isn't initialized by the point we get there, the change will be lost in the channel, or may be picked up later than intended
  • Loading branch information
albertotirla committed Mar 19, 2024
1 parent f0133aa commit 3748321
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/src/settings/speech.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
#[allow(clippy::module_name_repetitions)]
pub struct SpeechSettings {
pub rate: i32,
pub rate: i8,
}
impl Default for SpeechSettings {
fn default() -> Self {
Expand Down
2 changes: 1 addition & 1 deletion odilia/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl ScreenReaderState {
let accessible_history = Mutex::new(CircularQueue::with_capacity(16));
let event_history = Mutex::new(CircularQueue::with_capacity(16));
let cache = Arc::new(Cache::new(atspi.connection().clone()));

ssip.send(SSIPRequest::SetRate(ssip_client_async::ClientScope::Current, config.speech().rate)).await?;
Ok(Self {
atspi,
dbus,
Expand Down

0 comments on commit 3748321

Please sign in to comment.