Keep playback settings within file limits

Signed-off-by: John Tennant <johnmatthewtennant@gmail.com>
This commit is contained in:
John Tennant
2026-07-28 23:13:18 -04:00
committed by John Tennant
parent 9c85e19c3d
commit 5caf01e5af
4 changed files with 13 additions and 12 deletions

View File

@@ -49,9 +49,8 @@ pub struct AppState {
pub managed_agent_processes: Mutex<HashMap<ManagedAgentRuntimeKey, ManagedAgentPairRuntime>>,
pub huddle_state: Mutex<HuddleState>,
pub huddle_audio: crate::huddle::tts_settings::HuddleAudioSettingsState,
/// Tauri app handle — stored after setup so huddle commands can emit
/// `huddle-state-changed` events without needing the handle threaded
/// through every call site.
/// Tauri app handle, stored after setup so huddle commands can emit
/// `huddle-state-changed` without threading it through every call site.
/// Set once during `setup()` in `lib.rs`; never cleared.
pub app_handle: Mutex<Option<AppHandle>>,
pub tts_playback_speed: crate::huddle::playback_speed::PlaybackSpeedControl,

View File

@@ -1,5 +1,8 @@
import { useEffect, useRef, useState } from "react";
import { getTtsPlaybackSpeed, setTtsPlaybackSpeed } from "@/shared/api/tauri";
import {
getTtsPlaybackSpeed,
setTtsPlaybackSpeed,
} from "@/shared/api/ttsPlayback";
import { Button } from "@/shared/ui/button";
import {
applyLoadedPlaybackSpeed,

View File

@@ -1197,14 +1197,6 @@ export const setPreventSleepActive = (active: boolean) =>
export const setAgentManagedProfiles = (enabled: boolean) =>
invokeTauri("set_agent_managed_profiles", { enabled });
export function getTtsPlaybackSpeed(): Promise<number> {
return invokeTauri<number>("get_tts_playback_speed");
}
export function setTtsPlaybackSpeed(speed: number): Promise<void> {
return invokeTauri<void>("set_tts_playback_speed", { speed });
}
/** Returns true on macOS, Windows, and Linux AppImage installs.
* Returns false on Linux non-AppImage packages (e.g. .deb) where
* Tauri's updater cannot swap the binary. */

View File

@@ -0,0 +1,7 @@
import { invokeTauri } from "@/shared/api/tauri";
export const getTtsPlaybackSpeed = () =>
invokeTauri<number>("get_tts_playback_speed");
export const setTtsPlaybackSpeed = (speed: number) =>
invokeTauri<void>("set_tts_playback_speed", { speed });