live elapsed and fps readout on capture frame

This commit is contained in:
2026-05-12 01:49:46 +03:00
parent b7ac517381
commit 27d7453ea2
2 changed files with 62 additions and 2 deletions
+5
View File
@@ -10,6 +10,7 @@
type ExportResult,
} from "./api"
import { save } from "@tauri-apps/plugin-dialog"
import { emit } from "@tauri-apps/api/event"
type Phase = "idle" | "recording" | "paused" | "editing" | "exporting" | "done"
@@ -100,6 +101,7 @@
await api.startCapture({ crop })
phase = "recording"
tick()
void emit("recording-state", { phase: "recording", fps })
} catch (e) {
errMsg = String(e)
}
@@ -107,6 +109,7 @@
async function stopRec() {
clearTick()
void emit("recording-state", { phase: "idle", fps })
try {
const c = await api.stopCapture()
clip = c
@@ -149,6 +152,7 @@
try {
await api.pauseCapture()
phase = "paused"
void emit("recording-state", { phase: "paused", fps })
} catch (e) {
errMsg = String(e)
tick()
@@ -160,6 +164,7 @@
await api.resumeCapture()
phase = "recording"
tick()
void emit("recording-state", { phase: "recording", fps })
} catch (e) {
errMsg = String(e)
}