mirror of
https://github.com/block/buzz.git
synced 2026-11-01 06:51:17 +00:00
Keep playback settings within file limits
Signed-off-by: John Tennant <johnmatthewtennant@gmail.com>
This commit is contained in:
committed by
John Tennant
parent
9c85e19c3d
commit
5caf01e5af
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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. */
|
||||
|
||||
7
desktop/src/shared/api/ttsPlayback.ts
Normal file
7
desktop/src/shared/api/ttsPlayback.ts
Normal 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 });
|
||||
Reference in New Issue
Block a user