Add libc dependency for unix targets
This commit adds the `libc` dependency to the `Cargo.toml` file for Unix-based targets. This dependency is required by the `ffmpeg` command execution within the `recorder` module, specifically for handling process management and signaling on Unix-like systems.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
//! UI-visible application state. Transitions are driven by user actions
|
||||
//! (buttons) and async events from the recorder + uploader channels.
|
||||
|
||||
use std::time::Instant;
|
||||
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum AppState {
|
||||
/// No valid config on disk — show settings panel.
|
||||
NotConfigured,
|
||||
/// Ready for a new recording. No ephemeral context.
|
||||
Idle,
|
||||
/// ffmpeg is actively capturing audio.
|
||||
Recording {
|
||||
case_id: Uuid,
|
||||
recorded_at: String,
|
||||
started_at: Instant,
|
||||
},
|
||||
/// User pressed Stop; waiting for ffmpeg to finalize the MOOV atom.
|
||||
FinalizingRecording {
|
||||
case_id: Uuid,
|
||||
recorded_at: String,
|
||||
},
|
||||
/// File handed to uploader; waiting for server ACK.
|
||||
Uploading {
|
||||
case_id: Uuid,
|
||||
},
|
||||
/// Terminal error; user must dismiss or fix config.
|
||||
Error {
|
||||
message: String,
|
||||
},
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
pub fn label(&self) -> &'static str {
|
||||
match self {
|
||||
Self::NotConfigured => "Konfiguration fehlt",
|
||||
Self::Idle => "Bereit",
|
||||
Self::Recording { .. } => "Aufnahme läuft",
|
||||
Self::FinalizingRecording { .. } => "Speichere…",
|
||||
Self::Uploading { .. } => "Upload läuft",
|
||||
Self::Error { .. } => "Fehler",
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user