7#include "texttospeechinterface.h"
8#include "texttospeech.h"
10using namespace TextEditTextToSpeech;
12class Q_DECL_HIDDEN TextEditTextToSpeech::TextToSpeechInterfacePrivate
16 : mTextToSpeechWidget(textToSpeechWidget)
25 , d(new TextEditTextToSpeech::TextToSpeechInterfacePrivate(textToSpeechWidget))
27 TextEditTextToSpeech::TextToSpeech::self();
28 connect(d->mTextToSpeechWidget, &TextEditTextToSpeech::TextToSpeechWidget::stateChanged,
this, &TextToSpeechInterface::stateChanged);
29 connect(TextEditTextToSpeech::TextToSpeech::self(),
30 &TextEditTextToSpeech::TextToSpeech::stateChanged,
31 d->mTextToSpeechWidget,
32 &TextEditTextToSpeech::TextToSpeechWidget::slotStateChanged);
35TextToSpeechInterface::~TextToSpeechInterface() =
default;
37bool TextToSpeechInterface::isReady()
const
39 return TextEditTextToSpeech::TextToSpeech::self()->isReady();
42void TextToSpeechInterface::say(
const QString &text)
44 d->mTextToSpeechWidget->setState(TextEditTextToSpeech::TextToSpeechWidget::Play);
45 d->mTextToSpeechWidget->showWidget();
46 TextEditTextToSpeech::TextToSpeech::self()->say(text);
49double TextToSpeechInterface::volume()
const
51 return TextEditTextToSpeech::TextToSpeech::self()->volume();
54void TextToSpeechInterface::setVolume(
double value)
56 TextEditTextToSpeech::TextToSpeech::self()->setVolume(value);
59void TextToSpeechInterface::reloadSettings()
61 TextEditTextToSpeech::TextToSpeech::self()->reloadSettings();
64void TextToSpeechInterface::stateChanged(TextToSpeechWidget::State state)
67 case TextToSpeechWidget::Stop:
68 TextEditTextToSpeech::TextToSpeech::self()->stop();
70 case TextToSpeechWidget::Play:
71 TextEditTextToSpeech::TextToSpeech::self()->resume();
73 case TextToSpeechWidget::Pause:
74 TextEditTextToSpeech::TextToSpeech::self()->pause();
79#include "moc_texttospeechinterface.cpp"
The TextToSpeechWidget class.
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)