Re-add support for speech-dispatcher 0.9.
This commit is contained in:
parent
1ba40e898b
commit
f854e386a6
|
@ -10,6 +10,7 @@ edition = "2021"
|
||||||
[features]
|
[features]
|
||||||
0_11 = ["0_10"]
|
0_11 = ["0_10"]
|
||||||
0_10 = []
|
0_10 = []
|
||||||
|
0_9 = []
|
||||||
default = ["0_11"]
|
default = ["0_11"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
@ -99,6 +99,7 @@ pub enum Notification {
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
pub enum Punctuation {
|
pub enum Punctuation {
|
||||||
All = SPDPunctuation::SPD_PUNCT_ALL,
|
All = SPDPunctuation::SPD_PUNCT_ALL,
|
||||||
|
#[cfg(feature = "0_10")]
|
||||||
Most = SPDPunctuation::SPD_PUNCT_MOST,
|
Most = SPDPunctuation::SPD_PUNCT_MOST,
|
||||||
Some = SPDPunctuation::SPD_PUNCT_SOME,
|
Some = SPDPunctuation::SPD_PUNCT_SOME,
|
||||||
None = SPDPunctuation::SPD_PUNCT_NONE,
|
None = SPDPunctuation::SPD_PUNCT_NONE,
|
||||||
|
@ -413,25 +414,25 @@ impl Connection {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_voice_type(&self, voice_type: VoiceType) -> Result<(), Error> {
|
pub fn set_voice_type(&self, voice_type: VoiceType) -> Result<(), Error> {
|
||||||
#[cfg(all(feature = "0_10", not(feature = "0_11")))]
|
#[cfg(all(any(feature = "0_9", feature = "0_10"), not(feature = "0_11")))]
|
||||||
let v = unsafe { spd_set_voice_type(*self.0, voice_type as u32) };
|
let v = unsafe { spd_set_voice_type(*self.0, voice_type as u32) };
|
||||||
#[cfg(any(feature = "0_11", not(feature = "0_10")))]
|
#[cfg(all(not(feature = "0_9"), any(feature = "0_11", not(feature = "0_10"))))]
|
||||||
let v = unsafe { spd_set_voice_type(*self.0, voice_type as i32) };
|
let v = unsafe { spd_set_voice_type(*self.0, voice_type as i32) };
|
||||||
c_int_to_result(v)
|
c_int_to_result(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_voice_type_all(&self, voice_type: VoiceType) -> Result<(), Error> {
|
pub fn set_voice_type_all(&self, voice_type: VoiceType) -> Result<(), Error> {
|
||||||
#[cfg(all(feature = "0_10", not(feature = "0_11")))]
|
#[cfg(all(any(feature = "0_9", feature = "0_10"), not(feature = "0_11")))]
|
||||||
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as u32) };
|
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as u32) };
|
||||||
#[cfg(any(feature = "0_11", not(feature = "0_10")))]
|
#[cfg(all(not(feature = "0_9"), any(feature = "0_11", not(feature = "0_10"))))]
|
||||||
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as i32) };
|
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as i32) };
|
||||||
c_int_to_result(v)
|
c_int_to_result(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_voice_type_uid(&self, voice_type: VoiceType, target_uid: u32) -> Result<(), Error> {
|
pub fn set_voice_type_uid(&self, voice_type: VoiceType, target_uid: u32) -> Result<(), Error> {
|
||||||
#[cfg(all(feature = "0_10", not(feature = "0_11")))]
|
#[cfg(all(any(feature = "0_9", feature = "0_10"), not(feature = "0_11")))]
|
||||||
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as u32, target_uid) };
|
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as u32, target_uid) };
|
||||||
#[cfg(any(feature = "0_11", not(feature = "0_10")))]
|
#[cfg(all(not(feature = "0_9"), any(feature = "0_11", not(feature = "0_10"))))]
|
||||||
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as i32, target_uid) };
|
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as i32, target_uid) };
|
||||||
c_int_to_result(v)
|
c_int_to_result(v)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user