live elapsed and fps readout on capture frame
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user