From 55f841d8878bd411ec5b7349bca76a5835e5f3a2 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 30 Mar 2022 10:54:30 -0500 Subject: [PATCH] Merge extra module into main module. --- src/lib.rs | 21 ++++++++++++++++++++- src/voices.rs | 20 -------------------- 2 files changed, 20 insertions(+), 21 deletions(-) delete mode 100644 src/voices.rs diff --git a/src/lib.rs b/src/lib.rs index 72e1ecd..8328edb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,6 +22,7 @@ use std::{boxed::Box, sync::RwLock}; #[cfg(any(target_os = "macos", target_os = "ios"))] use cocoa_foundation::base::id; use dyn_clonable::*; +pub use unic_langid::LanguageIdentifier; use lazy_static::lazy_static; #[cfg(target_os = "macos")] use libc::c_char; @@ -34,7 +35,6 @@ use thiserror::Error; use tolk::Tolk; mod backends; -mod voices; #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] @@ -690,3 +690,22 @@ impl Drop for Tts { } } } + +pub enum Gender { + Other, + Male, + Female, +} + +pub trait VoiceImpl: Sized { + type Backend: crate::Backend; + fn from_id(id: String) -> Self; + fn from_language(lang: LanguageIdentifier) -> Self; + fn list() -> Vec; + fn name(self) -> String; + fn gender(self) -> Gender; + fn id(self) -> String; + fn language(self) -> LanguageIdentifier; +} + +pub struct Voice(Box); diff --git a/src/voices.rs b/src/voices.rs deleted file mode 100644 index f4b3490..0000000 --- a/src/voices.rs +++ /dev/null @@ -1,20 +0,0 @@ -pub use unic_langid::LanguageIdentifier; - -pub enum Gender { - Other, - Male, - Female, -} - -pub trait Backend: Sized { - type Backend: crate::Backend; - fn from_id(id: String) -> Self; - fn from_language(lang: LanguageIdentifier) -> Self; - fn list() -> Vec; - fn name(self) -> String; - fn gender(self) -> Gender; - fn id(self) -> String; - fn language(self) -> LanguageIdentifier; -} - -pub struct Voice(Box);