From d6f9043e60ab03b06ee22a1aa4350939ddc50d9c Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 29 Aug 2022 16:29:57 -0500 Subject: [PATCH] Add support for speech-dispatcher 0.10.2 and bump version. --- speech-dispatcher/Cargo.toml | 5 +++-- speech-dispatcher/src/lib.rs | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/speech-dispatcher/Cargo.toml b/speech-dispatcher/Cargo.toml index 8286e0d..11288ca 100644 --- a/speech-dispatcher/Cargo.toml +++ b/speech-dispatcher/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "speech-dispatcher" -version = "0.13.1" +version = "0.14.0" authors = ["Nolan Darilek "] repository = "https://gitlab.com/ndarilek/speech-dispatcher-rs" description = "Rusty interface to the speech-dispatcher speech synthesis library" @@ -8,8 +8,9 @@ license = "LGPL-2.1 OR MIT OR Apache-2.0" edition = "2021" [features] +0_10_2 = ["0_10"] 0_10 = [] -default = ["0_10"] +default = ["0_10_2"] [dependencies] lazy_static = "1" diff --git a/speech-dispatcher/src/lib.rs b/speech-dispatcher/src/lib.rs index 7266613..d8b5697 100644 --- a/speech-dispatcher/src/lib.rs +++ b/speech-dispatcher/src/lib.rs @@ -413,25 +413,25 @@ impl Connection { } pub fn set_voice_type(&self, voice_type: VoiceType) -> Result<(), Error> { - #[cfg(feature = "0_10")] + #[cfg(all(feature = "0_10", not(feature = "0_10_2")))] let v = unsafe { spd_set_voice_type(*self.0, voice_type as i32) }; - #[cfg(not(feature = "0_10"))] + #[cfg(any(feature = "0_10_2", not(feature = "0_10")))] let v = unsafe { spd_set_voice_type(*self.0, voice_type as u32) }; c_int_to_result(v) } pub fn set_voice_type_all(&self, voice_type: VoiceType) -> Result<(), Error> { - #[cfg(feature = "0_10")] + #[cfg(all(feature = "0_10", not(feature = "0_10_2")))] let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as i32) }; - #[cfg(not(feature = "0_10"))] + #[cfg(any(feature = "0_10_2", not(feature = "0_10")))] let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as u32) }; c_int_to_result(v) } pub fn set_voice_type_uid(&self, voice_type: VoiceType, target_uid: u32) -> Result<(), Error> { - #[cfg(feature = "0_10")] + #[cfg(all(feature = "0_10", not(feature = "0_10_2")))] let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as i32, target_uid) }; - #[cfg(not(feature = "0_10"))] + #[cfg(any(feature = "0_10_2", not(feature = "0_10")))] let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as u32, target_uid) }; c_int_to_result(v) }