Compare commits

..

No commits in common. "89fcced31e8c892dcf4f8fb5a633d832666f9ad6" and "2239c2539aee75975291443d68c5acd4f5948bd9" have entirely different histories.

3 changed files with 12 additions and 17 deletions

View File

@ -9,16 +9,16 @@ steps:
- rustup component add clippy rustfmt - rustup component add clippy rustfmt
- apt-get update -qq - apt-get update -qq
- apt-get install -qqy llvm-dev libclang-dev clang libspeechd-dev - apt-get install -qqy llvm-dev libclang-dev clang libspeechd-dev
- cargo fmt --all --check - cargo fmt --check
- cargo test --no-default-features --features 0_10 - cargo test
- cargo clippy --no-default-features --features 0_10 - cargo clippy
- name: release - name: release
image: rust image: rust
commands: commands:
- apt-get update -qq - apt-get update -qq
- apt-get install -qqy llvm-dev libclang-dev clang libspeechd-dev - apt-get install -qqy llvm-dev libclang-dev clang libspeechd-dev
- cargo publish --no-default-features --features 0_10 --manifest-path speech-dispatcher-sys/Cargo.toml || true - cargo publish --manifest-path speech-dispatcher-sys/Cargo.toml || true
- cargo publish --no-default-features --features 0_10 --manifest-path speech-dispatcher/Cargo.toml - cargo publish --manifest-path speech-dispatcher/Cargo.toml
when: when:
ref: ref:
- refs/tags/v* - refs/tags/v*

View File

@ -1,6 +1,6 @@
[package] [package]
name = "speech-dispatcher" name = "speech-dispatcher"
version = "0.16.0" version = "0.15.0"
authors = ["Nolan Darilek <nolan@thewordnerd.info>"] authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
repository = "https://gitlab.com/ndarilek/speech-dispatcher-rs" repository = "https://gitlab.com/ndarilek/speech-dispatcher-rs"
description = "Rusty interface to the speech-dispatcher speech synthesis library" description = "Rusty interface to the speech-dispatcher speech synthesis library"
@ -10,17 +10,14 @@ 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]
lazy_static = "1" lazy_static = "1"
speech-dispatcher-sys = { version = "0.7", path = "../speech-dispatcher-sys" } speech-dispatcher-sys = { version = "0.7", path = "../speech-dispatcher-sys" }
libc = "0.2.125"
[package.metadata.docs.rs] [package.metadata.docs.rs]
no-default-features = true no-default-features = true
features = ["0_9"]
[package.metadata.release] [package.metadata.release]
tag-prefix = "" tag-prefix = ""

View File

@ -1,6 +1,5 @@
#![allow(non_upper_case_globals)] #![allow(non_upper_case_globals)]
use libc::size_t;
use std::{ use std::{
collections::HashMap, collections::HashMap,
ffi::{CStr, CString}, ffi::{CStr, CString},
@ -99,7 +98,6 @@ 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,
@ -414,25 +412,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(any(feature = "0_9", feature = "0_10"), not(feature = "0_11")))] #[cfg(all(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(all(not(feature = "0_9"), any(feature = "0_11", not(feature = "0_10"))))] #[cfg(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(any(feature = "0_9", feature = "0_10"), not(feature = "0_11")))] #[cfg(all(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(all(not(feature = "0_9"), any(feature = "0_11", not(feature = "0_10"))))] #[cfg(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(any(feature = "0_9", feature = "0_10"), not(feature = "0_11")))] #[cfg(all(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(all(not(feature = "0_9"), any(feature = "0_11", not(feature = "0_10"))))] #[cfg(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)
} }