Commit Graph

15 Commits

Author SHA1 Message Date
mcb2003 bab977c0ea FFI:: Fix spelling error in doc comments. 2020-12-31 15:31:46 +00:00
mcb2003 a868aa670a FFI: Add module level doc comment. 2020-12-31 13:54:15 +00:00
mcb2003 989b6bb310 FFI: Implement tts_is_speaking() function. 2020-12-31 13:54:15 +00:00
mcb2003 0ffa4c6afe FFI: Allow getting and setting volume, and getting min, normal and max volume. 2020-12-31 13:54:15 +00:00
mcb2003 32c9327f5c FFI: Allow getting and setting pitch, and getting min, normal and max pitch. 2020-12-31 13:54:15 +00:00
mcb2003 cf35c19c57 FFI: Allow getting and setting rate, and getting min, normal and max rate. 2020-12-31 13:54:15 +00:00
mcb2003 729ece9a07 FFI: Make all functions with unsafe blocks completely unsafe.
This is better than using unsafe blocks inside the functions, as that
tells the compiler that the unsafeness won't leak out of the block,
which isn't true in this case as we're dealing with another unsafe
language.
2020-12-31 13:54:15 +00:00
mcb2003 0905f6d6c6 FFI: Implement tts_stop() function. 2020-12-31 13:54:15 +00:00
mcb2003 05a065c6d3 FFI: Implement tts_speak()
The tts_speak() function has an additional parameter that, if not NULL,
will be filled with a pointer to an UtteranceId. If this is specified,
the caller must also call tts_free_utterance() to deallocate the
UtteranceId when they're done with it.
2020-12-31 13:54:15 +00:00
mcb2003 53f352e1a8 FFI: Update documentation comments to match their Rust equivilents. 2020-12-31 13:54:15 +00:00
mcb2003 f6546303f8 FFI: Allow determining TTS supported Features from C/C++ 2020-12-31 13:54:15 +00:00
mcb2003 8e86afb444 FFI: Implement tts_new(backend)
This required giving the Backends enum and Features struct a C
representation.
2020-12-31 13:54:15 +00:00
mcb2003 5e7ab42f59 FFI: Implement tts_default() constructor and tts_free() destructor
* tts_default() allocates a new TTS struct via it's default() constructor, returning a pointer to it or NULL on error.
* tts_free(tts) destroys the TTS pointed to by tts. If tts is NULL, this
  function does nothing.
2020-12-31 13:54:15 +00:00
mcb2003 c5bbbfcfd7 FFI: Create error handling code and LAST_ERROR static
Any errors reported will cause the C API functions to return an error
value (NULL or -1). The caller can then use:

* const char* tts_get_error() to get a pointer to a string describing
  the error
* void tts_clear_error() to deallocate any currently stored error
message.
2020-12-31 13:54:15 +00:00
mcb2003 0ca3100a97 FFI: Create ffi Cargo feature and include ffi module. 2020-12-31 13:54:15 +00:00