• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeaccessibility API Reference
  • KDE Home
  • Contact Us
 

jovie

  • sources
  • kde-4.12
  • kdeaccessibility
  • jovie
  • jovie
speaker.h
Go to the documentation of this file.
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2  Speaker class.
3 
4  This class is in charge of getting the messages, warnings and text from
5  the queue and calling speech-dispatcher to actually speak the texts.
6  -------------------
7  Copyright:
8  (C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
9  (C) 2009 by Jeremy Whiting <jpwhiting@kde.org>
10  -------------------
11  Original author: Gary Cramblitt <garycramblitt@comcast.net>
12 
13  This program is free software; you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 2 of the License, or
16  (at your option) any later version.
17 
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with this program; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  ******************************************************************************/
27 
28 #ifndef SPEAKER_H
29 #define SPEAKER_H
30 
31 // Qt includes.
32 #include <QtCore/QObject>
33 #include <QtCore/QList>
34 #include <QtCore/QEvent>
35 
36 #include <kspeech.h>
37 
38 // KTTSD includes.
39 #include <config-jovie.h>
40 #ifdef OPENTTS_FOUND
41 #include <opentts/libopentts.h>
42 #elif defined(SPEECHD_FOUND)
43 #include <libspeechd.h>
44 #endif
45 
46 #include "filtermgr.h"
47 #include "appdata.h"
48 #include "speechjob.h"
49 
53 //struct PooledFilterMgr {
54 // FilterMgr* filterMgr; /* The FilterMgr object. */
55 // bool busy; /* True if the FilterMgr is busy. */
56 // SpeechJob* job; /* The job the FilterMgr is filtering. */
57 // TalkerCode* talkerCode; /* TalkerCode object passed to FilterMgr. */
58 //};
59 
64 class SpeakerPrivate;
65 class Speaker : public QObject
66 {
67 Q_OBJECT
68 
69 public:
73  static Speaker * Instance();
74 
75  static void speechdCallback(size_t msg_id, size_t client_id, SPDNotificationType type);
76 
80  ~Speaker();
81 
85  void init();
86 
91  void requestExit();
92 
97  bool isSpeaking();
98 
107  AppData* getAppData(const QString& appId) const;
108 
123  int say(const QString& appId, const QString& text, int sayOptions);
124 
135  void setTalker(int jobNum, const QString &talker);
136 
145  int findJobNumByAppId(const QString& appId) const;
146 
154  SpeechJob* findLastJobByAppId(const QString& appId) const;
155 
159  bool isApplicationPaused(const QString& appId);
160 
165  void stop();
166 
171  void cancel();
172 
176  void pause();
177 
181  void resume();
182 
186  QStringList outputModules();
187  QStringList languagesByModule(const QString & module);
188 
189  QStringList getPossibleTalkers();
190 
191  void setSpeed(int speed);
192  void setPitch(int pitch);
193  void setVolume(int volume);
194 
195  void setOutputModule(const QString & module);
196  void setLanguage(const QString & language);
197  void setVoiceType(int voiceType);
198  void setVoiceName(const QString & voiceName);
199 
200  int speed();
201  int pitch();
202  int volume();
203  QString outputModule();
204  QString language();
205  int voiceType();
206  QString voiceName();
207 
208 signals:
215  void newJobFiltered(const QString &prefilterText, const QString &postfilterText);
216 
217 private slots:
218  void slotServiceUnregistered(const QString& serviceName);
219 
220 private:
224  Speaker();
225 
229  bool isSsml(const QString &text);
230 
238  QStringList parseText(const QString &text, const QString &appId);
239 
240 private:
241  SpeakerPrivate* const d;
242  static Speaker * m_instance;
243 };
244 
245 #endif // SPEAKER_H
Speaker::requestExit
void requestExit()
Tells the thread to exit.
Definition: speaker.cpp:485
Speaker::findLastJobByAppId
SpeechJob * findLastJobByAppId(const QString &appId) const
Given an appId, returns the last (most recently queued) job with that appId.
Speaker::getAppData
AppData * getAppData(const QString &appId) const
Get application data.
Definition: speaker.cpp:315
Speaker::pitch
int pitch()
Definition: speaker.cpp:570
Speaker::findJobNumByAppId
int findJobNumByAppId(const QString &appId) const
Given an appId, returns the last (most recently queued) Job Number with that appId, or if no such job, the Job Number of the last (most recent) job in the queue.
Definition: speaker.cpp:477
Speaker::isApplicationPaused
bool isApplicationPaused(const QString &appId)
Return true if the application is paused.
Definition: speaker.cpp:675
appdata.h
Speaker::voiceName
QString voiceName()
Definition: speaker.cpp:610
Speaker::setOutputModule
void setOutputModule(const QString &module)
Definition: speaker.cpp:588
Speaker::speed
int speed()
Definition: speaker.cpp:557
Speaker::cancel
void cancel()
Stops the currently spoken message from this connection (if there is any) and discards all the queued...
Definition: speaker.cpp:651
QObject
Speaker::resume
void resume()
Resumes the speech.
Definition: speaker.cpp:667
Speaker::~Speaker
~Speaker()
Destructor.
Definition: speaker.cpp:297
filtermgr.h
SpeechJob
Object containing a speech job.
Definition: speechjob.h:41
Speaker::setVolume
void setVolume(int volume)
Definition: speaker.cpp:575
AppData
Definition: appdata.h:38
Speaker::setVoiceName
void setVoiceName(const QString &voiceName)
Definition: speaker.cpp:602
Speaker::outputModule
QString outputModule()
Definition: speaker.cpp:597
Speaker::Instance
static Speaker * Instance()
singleton accessor
Definition: speaker.cpp:249
Speaker::newJobFiltered
void newJobFiltered(const QString &prefilterText, const QString &postfilterText)
This signal is emitted when a new job coming in is filtered (or not filtered if no filters are on)...
Speaker::language
QString language()
Definition: speaker.cpp:624
Speaker::say
int say(const QString &appId, const QString &text, int sayOptions)
Queue and start a speech job.
Definition: speaker.cpp:365
Speaker::voiceType
int voiceType()
Definition: speaker.cpp:638
Speaker::volume
int volume()
Definition: speaker.cpp:583
Speaker::isSpeaking
bool isSpeaking()
Determine if kttsd is currently speaking any jobs.
Definition: speaker.cpp:491
Speaker::languagesByModule
QStringList languagesByModule(const QString &module)
Definition: speaker.cpp:506
Speaker::init
void init()
(re)initializes the filtermgr
Definition: speaker.cpp:302
Speaker::stop
void stop()
Stops the message currently being spoken on a given connection.
Definition: speaker.cpp:643
Speaker::outputModules
QStringList outputModules()
Get the output modules available from speech-dispatcher.
Definition: speaker.cpp:501
Speaker::setSpeed
void setSpeed(int speed)
Definition: speaker.cpp:549
Speaker::pause
void pause()
Pauses the speech.
Definition: speaker.cpp:659
Speaker::setPitch
void setPitch(int pitch)
Definition: speaker.cpp:562
Speaker::setLanguage
void setLanguage(const QString &language)
Definition: speaker.cpp:615
Speaker
Definition: speaker.h:65
Speaker::setTalker
void setTalker(int jobNum, const QString &talker)
Change the talker for a job.
Definition: speaker.cpp:496
Speaker::getPossibleTalkers
QStringList getPossibleTalkers()
Definition: speaker.cpp:523
Speaker::speechdCallback
static void speechdCallback(size_t msg_id, size_t client_id, SPDNotificationType type)
Definition: speaker.cpp:258
speechjob.h
Speaker::setVoiceType
void setVoiceType(int voiceType)
Definition: speaker.cpp:629
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:32:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

jovie

Skip menu "jovie"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeaccessibility API Reference

Skip menu "kdeaccessibility API Reference"
  • jovie

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal