Commit Graph

88 Commits

Author SHA1 Message Date
Orgad Shaneh
44219dfa1a BACKENDS: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Orgad Shaneh
b11c5ace90 BACKENDS: JANITORIAL: Remove 'virtual' when override is specified 2021-11-14 14:31:41 +02:00
sluicebox
c5604b20e4 WIN32: Make WindowsTextToSpeechManager UNICODE compatible 2021-06-29 12:38:01 -05:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
mataniko
28a1a0d3f1 TTS: Fix builds when cross compiling 2021-03-28 17:17:55 -04:00
mataniko
c67fd1b63a TTS: Fix UI lag when TTS is turned on in Windows
Without specifying the XML format, SAPI throws a hidden exception that stalls the GUI every time we use TTS
2021-03-28 14:07:36 -04:00
Vladimir Serbinenko
68a9136e4d
COMMON: Rewrite Encoder and drop dependency on iconv (#2586)
Different platforms have different levels of support of encodings and
often have slight variations. We already have tables for most encoding
with only CJK missing. Full transcoding inclusion allows us to get reliable
encoding results independently of platform. The biggest con is the need for
external tables encoding.dat.

It removes a duplicate table for korean in graphics/korfont.cpp
2020-11-15 16:20:35 +01:00
Cameron Cawley
5c255b3aa9 WIN32: Add override and final keywords 2020-10-16 18:32:08 +01:00
Matthew Duggan
c71ac4748b TTS: Fix compiler warning 2020-10-10 15:11:49 +09:00
Cameron Cawley
02c09a8ed6 WIN32: Replace strToInt with wcstol 2020-09-12 11:59:23 +02:00
Cameron Cawley
da978f3a2f WIN32: Simplify string conversion 2020-09-12 11:59:23 +02:00
aryanrawlani28
0ca5a40d85 TTS: ALL: Improve u32-ity
- Allow the base class to take in a string with custom charset, convert to U32 and pass it along.
- Remove redudandant functions in all tts-subsystems
- Remove unnecessary "charset" argument, as U32Strings imply that we are using a UTF-32 charset
- Adjust relative code appropriately according to the above point.
2020-08-30 14:43:41 +02:00
aryanrawlani28
68d01321d6 GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.

- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-08-30 14:43:41 +02:00
aryanrawlani28
4b6976c558 GUI: U32: Reduce number of files changed and fixes
Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.

- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
2020-08-30 14:43:41 +02:00
aryanrawlani28
185fb72783 GUI: U32: Improve U32 code
- Revert accidentally put translations in mt32.cpp
- Use U32::format in some places earlier missed
- Add %u and %i for u32::format
- Add support for GUIErrorMsgFormat to use u32::format internally
- Use the above whereever needed
- Improve linux tts by removing redundant code
- Some places I had changed nullptr -> "". Revert this
2020-08-30 14:43:41 +02:00
aryanrawlani28
0118839c59 GUI: U32: Use u32 for tts (MacOS) 2020-08-30 14:43:41 +02:00
aryanrawlani28
bcbe2fe2ea GUI: U32: Enable u32 for tts (Linux) 2020-08-30 14:43:41 +02:00
aryanrawlani28
ef7ec444d3 GUI: U32: Enable u32 for tts (Windows)
They always take in U32 strings now.

- Revert tts descriptions to string, they don't use translations, so better to keep it as strings.
- Make read() take in const U32 references.
2020-08-30 14:43:41 +02:00
aryanrawlani28
3641e24daa JANITORIAL: Add missing space 2020-08-30 14:43:41 +02:00
Cameron Cawley
30f2c2f3cd WIN32: Use malloc instead of new in string conversion functions 2020-08-21 00:02:13 +02:00
Cameron Cawley
27a2b94687 WIN32: Remove unnecessary string conversion 2020-08-21 00:02:13 +02:00
Cameron Cawley
835cb919e5 WIN32: Support using additional OneCore voices for text to speech 2020-08-02 14:53:27 +02:00
Cameron Cawley
9dd91d651c POSIX: Support building with TTS support on FreeBSD
This fixes Trac #11347.
2020-06-24 21:10:44 +01:00
Thierry Crozat
025dd965f5 MACOSX: Fix TTS when stopping speech and immediately starting another 2020-06-21 19:13:02 +01:00
Thierry Crozat
6254fe8dec TTS: Add override keyword 2020-06-21 16:31:15 +01:00
Thierry Crozat
75698aa306 MACOSX: Implement TextToSpeechManager::getDefaultVoice()
On macOS, TextToSpeechManager::getDefaultVoice() now returns the
system default voice (assuming the system language is the same as
the language for which we ask the default voice in ScummVM, otherwise
it returns the first voice).
2020-06-21 16:31:15 +01:00
SupSuper
9a3e420bd2 TTS: Fix crash on Windows when there are no audio devices 2020-04-29 15:22:21 +01:00
Bastien Bouclet
34bf3f2de0 TTS: Fix use of virtual function in TTSMan destructor
TextToSpeechManager::freeVoiceData was called while the virtual function
table pointer was already reset by the parent class destructor.
2019-11-15 21:24:22 +01:00
sluicebox
fc9786231c TTS: Improve Windows audio, remove sphelper-scummvm.h
- Remove sphelper-scummvm.h
- Use default audio quality instead of lowest
- Add HRESULT tests
- Fix new[]/free() mismatches
- Fix voice description memory leak
2019-11-06 11:00:37 -08:00
Jaromir Wysoglad
b9d3c84db4 TTS: Fix language setting. 2019-10-16 19:30:56 +02:00
sluicebox
da77bfd792 TTS: Use lowercase when including Windows headers
Fixes building for mingw-w64 on case sensitive file systems
2019-10-11 15:41:53 -07:00
sluicebox
912bbf364c TTS: Enable in Mingw-w64 builds
TTS libraries can now be used in default Mingw-w64 environments.

- Removes reference to sapiddk.h which isn't used and isn't in Mingw-w64
- Defines guids whose symbols are missing from Mingw-w64
- Restores TTS detection to configure script
2019-10-10 22:55:12 +03:00
Jaromir Wysoglad
26bf329b95 TTS: Fix possible deadlock 2019-09-05 23:52:46 +01:00
Jaromir Wysoglad
ba859f1eed TTS: Minimize the time needed for stop() on Win32
This gets rid of freezes when using TTS on Windows.
2019-09-05 23:52:46 +01:00
Jaromir Wysoglad
55c399c7c0 TTS: Use Common::Encoding for encoding conversion. 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
4b5b812712 TTS: Better documentation of TTSVoice. 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
0d332e065e TTS: Rename LinuxTextToSpeechManager to SpeechDispatcherManager
Add a new define for the SpeechDispatcherManager
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
b97333d4b7 TTS: Remove USE_PLATFORM_TTS defines
Use defined(USE_TTS) && defined(PLATFORM) instead
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
d49331132a TTS: Add summary of changes in sphelper-scummvm.h 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
c402666635 TTS: Refactoring
Refactoring as suggested by bluegr on github.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
c861581adc TTS: Fix missing indentation 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
c2c4458253 JANITORIAL: Remove some trailing whitespaces 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
b1bffaba86 TTS: Implement our own queuing on windows.
Similarly as on linux, there isn't enough control of the speech
queue to properly implement INTERRUPT_NO_REPEAT. So since this
commit we use our own queuing and use SAPI to speak each speech.
This is done outside the main thread.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
be5c865c50 TTS: Add proper speech queuing, update INT_NO_REP.
Before I used SPD to queue messages and I had a copy of the queue,
so I could requeue everything when resume is called(). But more
control of the queue is needed, so I don't use the SPD's queue
and instead start speeches from my queue one by one from another
thread.

INTERRUPT_NO_REPEAT now behaves as described in the documentation
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
bc10117980 TTS: Restart SPD if resume() fails. 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
4036b73b6c TTS: Fix INTERRUPT_NO_REPEAT on Windows 2019-09-01 22:47:55 +03:00
Thierry Crozat
13a32fc5e9 TTS: Implement *_NO_REPEAT actions and Fix state synchronization issues on macOS
The NSSpeechSynthesizer is asynchronous and does not immediately start, pause,
or stop the speech. As a result querrying the state of the NSSpeechSynthesizer
does not alwats return the expected result (for example isSpeaking may not
yet been true just after we requested starting to speak). So instead the
TextToSpeechManager on macOS keeps track of the state itself.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
21fb4cef06 TTS: Implement our own queuing for linux
It seems like, that at least some versions of speech-dispatcher
aren't able to successfuly pause and resume. For me, when trying
to pause, it still finishes the speech just being said instead
of pausing it and then it puts it at the end of the speech queue
with some speech-dispatcher internal commands added to it, which
are also hearable.

There is no way to find out where the speech ended when calling
pause, so it is just stopped and when resume is called it is
read from it's start again.
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
4bae32ffe7 TTS: Add *_NO_REPEAT actions 2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
feaba6fff6 TTS: Reimplement isSpeaking on Windows. 2019-09-01 22:47:55 +03:00