MCPcopy Index your code
hub / github.com/Recordscript/recordscript / main

Function main

src-tauri/src/main.rs:322–728  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

320}
321
322fn main() {
323 std::panic::set_hook(Box::new(|info| {
324 let message = info.to_string();
325
326 eprintln!("{message:?}");
327
328 dialog::Message::new(message)
329 .title("Error")
330 .show().ok();
331 }));
332
333 gst::init().unwrap();
334
335 let gst_registry = gst::Registry::get();
336
337 gst_registry.scan_path(std::env::current_exe().unwrap().parent().unwrap());
338
339 let (record_tx, mut record_rx): (RecordChannel, _) = tauri::async_runtime::channel(128);
340
341 let transcriber = Arc::new(Mutex::new(transcriber::Transcriber::new(transcriber::Model::SmallWhisper)));
342
343 let host = cpal::default_host();
344
345 let selected_device: SelectedDevice = Arc::new(Mutex::new(recorder::SelectedDevice {
346 microphone: host.default_input_device(),
347 speaker: host.default_output_device(),
348 screen: scrap::Display::all().unwrap().swap_remove(0),
349 }));
350
351 let general_config: GeneralConfig = Arc::new(Mutex::new(configuration::GeneralConfig::default()));
352 let smtp_config: SMTPConfig = Arc::new(Mutex::new(configuration::SMTPConfig::default()));
353
354 tauri::Builder::default()
355 .manage(selected_device)
356 .manage(transcriber.clone())
357 .manage(record_tx)
358 .manage(host)
359 .manage(general_config.clone())
360 .manage(smtp_config.clone())
361 .invoke_handler(tauri::generate_handler![
362 start_record,
363 stop_record,
364 pause_record,
365 resume_record,
366 start_transcription,
367 list_model,
368 list_model_categories,
369 download_model,
370 select_model,
371 select_language,
372 list_microphone,
373 list_speaker,
374 list_screen,
375 select_microphone,
376 select_speaker,
377 select_screen,
378 preview_screen,
379 get_general_config,

Callers

nothing calls this directly

Calls 15

gstreamer_loopFunction · 0.85
emit_allFunction · 0.85
to_stringMethod · 0.80
setupMethod · 0.80
buildMethod · 0.80
loadMethod · 0.80
joinMethod · 0.80
iterMethod · 0.80
storeMethod · 0.80
clearMethod · 0.80
transcribeMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected