Tray options implementation + Voice system rewrite + build fixes
This commit is contained in:
parent
412acb7e2d
commit
47b7e7a65d
117 changed files with 1300 additions and 2334 deletions
22
crates/jarvis-gui/src/tauri_commands/commands.rs
Normal file
22
crates/jarvis-gui/src/tauri_commands/commands.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use jarvis_core::commands::{self, JCommand, JCommandsList};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
static COMMANDS: Lazy<Vec<JCommandsList>> = Lazy::new(|| {
|
||||
commands::parse_commands().unwrap_or_default()
|
||||
});
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_commands_count() -> usize {
|
||||
COMMANDS
|
||||
.iter()
|
||||
.map(|list| list.commands.len())
|
||||
.sum()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_commands_list() -> Vec<JCommand> {
|
||||
COMMANDS
|
||||
.iter()
|
||||
.flat_map(|list| list.commands.clone())
|
||||
.collect()
|
||||
}
|
||||
16
crates/jarvis-gui/src/tauri_commands/voices.rs
Normal file
16
crates/jarvis-gui/src/tauri_commands/voices.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
use jarvis_core::voices::{self, structs::VoiceConfig};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn list_voices() -> Vec<VoiceConfig> {
|
||||
voices::list_voices()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_voice(voice_id: String) -> Option<VoiceConfig> {
|
||||
voices::get_voice(&voice_id)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn preview_voice(voice_id: String) {
|
||||
voices::play_preview(&voice_id);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue