capture, encode, export wiring
This commit is contained in:
@@ -49,6 +49,25 @@ export type DownloadProgress = {
|
||||
total: number | null
|
||||
}
|
||||
|
||||
export type RecordedClip = {
|
||||
temp_path: string
|
||||
duration_secs: number
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
export type ExportRequest = {
|
||||
format: Format
|
||||
target_bytes: number
|
||||
fps: number
|
||||
keep_audio: boolean
|
||||
}
|
||||
|
||||
export type ExportResult = {
|
||||
output_path: string
|
||||
size_bytes: number
|
||||
}
|
||||
|
||||
export const api = {
|
||||
getStatus: () => invoke<AppStatus>("get_status"),
|
||||
getConfig: () => invoke<Config>("get_config"),
|
||||
@@ -56,6 +75,9 @@ export const api = {
|
||||
downloadFfmpeg: () => invoke<void>("download_ffmpeg"),
|
||||
onFfmpegProgress: (handler: (p: DownloadProgress) => void): Promise<UnlistenFn> =>
|
||||
listen<DownloadProgress>("ffmpeg-progress", (e) => handler(e.payload)),
|
||||
startCapture: () => invoke<void>("start_capture"),
|
||||
stopCapture: () => invoke<RecordedClip>("stop_capture"),
|
||||
export: (request: ExportRequest) => invoke<ExportResult>("export", { request }),
|
||||
}
|
||||
|
||||
export function formatBytes(n: number): string {
|
||||
|
||||
Reference in New Issue
Block a user