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

jovie

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Properties | List of all members
Jovie Class Reference

#include <jovie.h>

Inheritance diagram for Jovie:
Inheritance graph
[legend]

Public Slots

QString applicationName ()
 
bool autoConfigureTalkersOn ()
 
void cancel ()
 
void changeJobTalker (int jobNum, const QString &talker)
 
int defaultPriority ()
 
QString defaultTalker ()
 
bool filteringOn ()
 
int getCurrentJob ()
 
int getJobCount (int priority)
 
QByteArray getJobInfo (int jobNum)
 
QStringList getJobNumbers (int priority)
 
QString getJobSentence (int jobNum, int sentenceNum)
 
int getJobState (int jobNum)
 
QStringList getPossibleTalkers ()
 
int getSentenceCount (int jobNum)
 
int getTalkerCapabilities1 (const QString &talker)
 
int getTalkerCapabilities2 (const QString &talker)
 
QStringList getTalkerCodes ()
 
QStringList getTalkerVoices (const QString &talker)
 
QString htmlFilterXsltFile ()
 
void init ()
 
bool isApplicationPaused ()
 
bool isSpeaking () const
 
bool isSystemManager ()
 
void kttsdExit ()
 
QStringList languagesByModule (const QString &module)
 
void moveJobLater (int jobNum)
 
int moveRelSentence (int jobNum, int n)
 
QStringList outputModules ()
 
void pause ()
 
int pitch ()
 
void reinit ()
 
void removeAllJobs ()
 
void removeJob (int jobNum)
 
void resume ()
 
int say (const QString &text, int options)
 
int sayClipboard ()
 
int sayFile (const QString &filename, const QString &encoding)
 
QString sentenceDelimiter ()
 
void setApplicationName (const QString &applicationName)
 
void setAutoConfigureTalkersOn (bool autoConfigureTalkersOn)
 
void setCallingAppId (const QString &appId)
 
void setCurrentTalker (const TalkerCode &talker)
 
void setDefaultPriority (int defaultPriority)
 
void setDefaultTalker (const QString &defaultTalker)
 
void setFilteringOn (bool filteringOn)
 
void setHtmlFilterXsltFile (const QString &htmlFilterXsltFile)
 
void setIsSystemManager (bool isSystemManager)
 
void setLanguage (const QString &language)
 
void setOutputModule (const QString &module)
 
void setPitch (int pitch)
 
void setSentenceDelimiter (const QString &sentenceDelimiter)
 
void setSpeed (int speed)
 
void setSsmlFilterXsltFile (const QString &ssmlFilterXsltFile)
 
void setVoiceType (int voiceType)
 
void setVolume (int volume)
 
void showManagerDialog ()
 
int speed ()
 
QString ssmlFilterXsltFile ()
 
void stop ()
 
QString talkerToTalkerId (const QString &talker)
 
QString version () const
 
int voiceType ()
 
int volume ()
 

Signals

void jobStateChanged (const QString &appId, int jobNum, int state)
 
void kttsdExiting ()
 
void kttsdStarted ()
 
void marker (const QString &appId, int jobNum, int markerType, const QString &markerData)
 

Public Member Functions

 ~Jovie ()
 

Static Public Member Functions

static Jovie * Instance ()
 

Properties

bool isSpeaking
 
QString version
 

Detailed Description

Jovie – the KDE Text-to-Speech API.

Note: Applications do not use this class directly.

Definition at line 46 of file jovie.h.

Constructor & Destructor Documentation

Jovie::~Jovie ( )

Destructor.

Definition at line 108 of file jovie.cpp.

Member Function Documentation

QString Jovie::applicationName ( )
slot

Returns the friendly display name for the application.

Returns
Application display name.

If application has not provided a friendly name, the DBUS connection name is returned.

Definition at line 129 of file jovie.cpp.

bool Jovie::autoConfigureTalkersOn ( )
slot

Returns whether KTTSD will automatically attempt to configure new talkers to meet required talker attributes.

Returns
True if KTTSD will autoconfigure talkers.
See also
defaultTalker

Definition at line 190 of file jovie.cpp.

void Jovie::cancel ( )
slot

Definition at line 362 of file jovie.cpp.

void Jovie::changeJobTalker ( int  jobNum,
const QString &  talker 
)
slot

Change the talker of an already-submitted job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
talkerDesired new talker.

Definition at line 460 of file jovie.cpp.

int Jovie::defaultPriority ( )
slot

Returns the default priority for speech jobs submitted by the application.

Returns
Default job priority.
See also
JobPriority

Definition at line 160 of file jovie.cpp.

QString Jovie::defaultTalker ( )
slot

Returns the default talker for the application.

Returns
Talker.

The default is "", which uses the default talker configured by user.

Definition at line 140 of file jovie.cpp.

bool Jovie::filteringOn ( )
slot

Returns whether speech jobs for this application are filtered using configured filter plugins.

Returns
True if filtering is on.

Filtering is on by default.

Definition at line 180 of file jovie.cpp.

int Jovie::getCurrentJob ( )
slot

Returns the job number of the currently speaking job (any application).

Returns
Job Number

Definition at line 393 of file jovie.cpp.

int Jovie::getJobCount ( int  priority)
slot

Returns the number of jobs belonging to the application with the specified job priority.

Parameters
priorityJob Priority.
Returns
Number of jobs.

If priority is KSpeech::jpAll, returns the number of jobs belonging to the application (all priorities).

When called from a System Manager, returns count of all jobs of the specified priority for all applications.

See also
JobPriority

Definition at line 399 of file jovie.cpp.

QByteArray Jovie::getJobInfo ( int  jobNum)
slot

Get information about a job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
Returns
A QDataStream containing information about the job. Blank if no such job.

The stream contains the following elements:

  • int priority Job Type.
  • int state Job state.
  • QString appId DBUS senderId of the application that requested the speech job.
  • QString talker Talker code as requested by application.
  • int sentenceNum Current sentence being spoken. Sentences are numbered starting at 1.
  • int sentenceCount Total number of sentences in the job.
  • QString applicationName Application's friendly name (if provided by app)

If the job is currently filtering, waits for that to finish before returning.

The following sample code will decode the stream:

          QByteArray jobInfo = m_kspeech->getJobInfo(jobNum);
          if (jobInfo != QByteArray()) {
              QDataStream stream(&jobInfo, QIODevice::ReadOnly);
              qint32 priority;
              qint32 state;
              QString talker;
              qint32 sentenceNum;
              qint32 sentenceCount;
              QString applicationName;
              stream >> priority;
              stream >> state;
              stream >> appId;
              stream >> talker;
              stream >> sentenceNum;
              stream >> sentenceCount;
              stream >> applicationName;
          };

Definition at line 417 of file jovie.cpp.

QStringList Jovie::getJobNumbers ( int  priority)
slot

Returns a list job numbers for the jobs belonging to the application with the specified priority.

Parameters
priorityJob Priority.
Returns
List of job numbers. Note that the numbers are strings.

If priority is KSpeech::jpAll, returns the job numbers belonging to the application (all priorities).

When called from a System Manager, returns job numbers of the specified priority for all applications.

See also
JobPriority

Definition at line 405 of file jovie.cpp.

QString Jovie::getJobSentence ( int  jobNum,
int  sentenceNum 
)
slot

Return a sentence of a job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
sentenceNumSentence Number. Sentence numbers start at 1.
Returns
The specified sentence in the specified job. If no such job or sentence, returns "".

Definition at line 423 of file jovie.cpp.

int Jovie::getJobState ( int  jobNum)
slot

Returns the state of a job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
Returns
Job state.
See also
JobState

Definition at line 411 of file jovie.cpp.

QStringList Jovie::getPossibleTalkers ( )
slot

Get all possible talkers supported by speech-dispatcher configuration.

Returns
QStringList of talkercodes

Definition at line 287 of file jovie.cpp.

int Jovie::getSentenceCount ( int  jobNum)
slot

Returns the number of sentences in a job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
Returns
Number of sentences in the job.

Definition at line 387 of file jovie.cpp.

int Jovie::getTalkerCapabilities1 ( const QString &  talker)
slot

Returns a bitarray giving the capabilities of a talker.

Parameters
talkerTalker. Example: "en".
Returns
A word with bits set according to the capabilities of the talker.
See also
TalkerCapabilities1
getTalkerCapabilities2

Definition at line 439 of file jovie.cpp.

int Jovie::getTalkerCapabilities2 ( const QString &  talker)
slot

Returns a bitarray giving the capabilities of a talker.

Parameters
talkerTalker. Example: "en".
Returns
A word with bits set according to the capabilities of the talker.
See also
TalkerCapabilities2
getTalkerCapabilities1

Definition at line 446 of file jovie.cpp.

QStringList Jovie::getTalkerCodes ( )
slot

Return a list of full Talker Codes for configured talkers.

Returns
List of Talker codes.

Definition at line 429 of file jovie.cpp.

QStringList Jovie::getTalkerVoices ( const QString &  talker)
slot

Return a list of the voice codes of voices available in the synthesizer corresponding to a talker.

Parameters
talkerTalker. Example: "synthesizer='Festival'"
Returns
List of voice codes.

Voice codes are synthesizer specific.

Definition at line 453 of file jovie.cpp.

QString Jovie::htmlFilterXsltFile ( )
slot

Returns the full path name to XSLT file used to convert HTML markup to speakable form.

Returns
XSLT filename.

Definition at line 205 of file jovie.cpp.

void Jovie::init ( )
slot

post ctor helper method that instantiates the dbus adaptor class, and registers

Definition at line 491 of file jovie.cpp.

Jovie * Jovie::Instance ( )
static

singleton accessor

Definition at line 93 of file jovie.cpp.

bool Jovie::isApplicationPaused ( )
slot

Returns whether application is paused.

Returns
True if application is paused.

Definition at line 200 of file jovie.cpp.

bool Jovie::isSpeaking ( ) const
slot

Returns true if KTTSD is currently speaking.

Returns
True if currently speaking.
bool Jovie::isSystemManager ( )
slot

Returns whether this is a System Manager application.

Returns
True if the application is a System Manager.

Definition at line 225 of file jovie.cpp.

void Jovie::jobStateChanged ( const QString &  appId,
int  jobNum,
int  state 
)
signal

This signal is emitted each time the state of a job changes.

Parameters
appIdThe DBUS connection name of the application that submitted the job.
jobNumJob Number.
stateJob state.
void Jovie::kttsdExit ( )
slot

Shuts down KTTSD.

Do not call this!

Definition at line 484 of file jovie.cpp.

void Jovie::kttsdExiting ( )
signal

This signal is emitted just before KTTS exits.

void Jovie::kttsdStarted ( )
signal

This signal is emitted when KTTSD starts.

QStringList Jovie::languagesByModule ( const QString &  module)
slot

Definition at line 282 of file jovie.cpp.

void Jovie::marker ( const QString &  appId,
int  jobNum,
int  markerType,
const QString &  markerData 
)
signal

This signal is emitted when a marker is processed.

Currently only emits mtSentenceBegin and mtSentenceEnd.

Parameters
appIdThe DBUS connection name of the application that submitted the job.
jobNumJob Number of the job emitting the marker.
markerTypeThe type of marker. Currently either mtSentenceBegin or mtSentenceEnd.
markerDataData for the marker. Currently, this is the sentence number of the sentence begun or ended. Sentence numbers begin at 1.
void Jovie::moveJobLater ( int  jobNum)
slot

Move a job one position down in the queue so that it is spoken later.

If the job is already speaking, it is stopped and will resume when processing next gets to it.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.

Since there is only one ScreenReaderOutput, this method is meaningless for ScreenReaderOutput jobs.

Definition at line 466 of file jovie.cpp.

int Jovie::moveRelSentence ( int  jobNum,
int  n 
)
slot

Advance or rewind N sentences in a job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
nNumber of sentences to advance (positive) or rewind (negative) in the job.
Returns
Number of the sentence actually moved to. Sentence numbers are numbered starting at 1.

If no such job, does nothing and returns 0. If n is zero, returns the current sentence number of the job. Does not affect the current speaking/not-speaking state of the job.

Since ScreenReaderOutput jobs are not split into sentences, this method is meaningless for ScreenReaderOutput jobs.

Definition at line 471 of file jovie.cpp.

QStringList Jovie::outputModules ( )
slot

Definition at line 277 of file jovie.cpp.

void Jovie::pause ( )
slot

Pauses speech jobs belonging to the application.

When called by a System Manager, pauses all jobs of all applications.

Definition at line 367 of file jovie.cpp.

int Jovie::pitch ( )
slot

Definition at line 317 of file jovie.cpp.

void Jovie::reinit ( )
slot

Cause KTTSD to re-read its configuration.

Definition at line 499 of file jovie.cpp.

void Jovie::removeAllJobs ( )
slot

Removes all jobs belonging to the application.

When called from a System Manager, removes all jobs of all applications.

Definition at line 382 of file jovie.cpp.

void Jovie::removeJob ( int  jobNum)
slot

Removes the specified job.

If the job is speaking, it is stopped.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.

Definition at line 377 of file jovie.cpp.

void Jovie::resume ( )
slot

Resumes speech jobs belonging to the application.

When called by a System Manager, resumes all jobs of all applications.

Definition at line 372 of file jovie.cpp.

int Jovie::say ( const QString &  text,
int  options 
)
slot

Creates and starts a speech job.

The job is created at the application's default job priority using the default talker.

Parameters
textThe text to be spoken.
optionsSpeech options.
Returns
Job Number for the new job.
See also
JobPriority
SayOptions

Definition at line 235 of file jovie.cpp.

int Jovie::sayClipboard ( )
slot

Submits a speech job from the contents of the clipboard.

The job is spoken using application's default talker.

Returns
Job Number for the new job.
See also
defaultTalker

Definition at line 260 of file jovie.cpp.

int Jovie::sayFile ( const QString &  filename,
const QString &  encoding 
)
slot

Creates and starts a speech job from a specified file.

Parameters
filenameFull path name of the file.
encodingThe encoding of the file. Default UTF-8.
Returns
Job Number for the new job.

The job is spoken using application's default talker.

See also
defaultTalker

Plain text is parsed into individual sentences using the current sentence delimiter. Call setSentenceDelimiter to change the sentence delimiter prior to calling sayFile. Call getSentenceCount to retrieve the sentence count after calling sayFile.

The text may contain speech mark language, such as SMML, provided that the speech plugin/engine support it. In this case, sentence parsing follows the semantics of the markup language.

Definition at line 241 of file jovie.cpp.

QString Jovie::sentenceDelimiter ( )
slot

Returns the regular expression used to perform Sentence Boundary Detection (SBD) for the application.

Returns
Sentence delimiter regular expression.

The default sentence delimiter is

    ([\\.\\?\\!\\:\\;])(\\s|$|(\\n *\\n))

Note that backward slashes must be escaped.

See also
sentenceparsing

Definition at line 170 of file jovie.cpp.

void Jovie::setApplicationName ( const QString &  applicationName)
slot

Sets a friendly display name for the application.

Parameters
applicationNameFriendly name for the application.

Definition at line 134 of file jovie.cpp.

void Jovie::setAutoConfigureTalkersOn ( bool  autoConfigureTalkersOn)
slot

Sets whether KTTSD will automatically attempt to configure new talkers to meet required talker attributes.

Parameters
autoConfigureTalkersOnTrue to enable auto configuration.

Definition at line 195 of file jovie.cpp.

void Jovie::setCallingAppId ( const QString &  appId)
slot

Called by DBusAdaptor so that KTTSD knows the application that called it.

Parameters
appIdDBUS connection name that called KSpeech.

Definition at line 514 of file jovie.cpp.

void Jovie::setCurrentTalker ( const TalkerCode &  talker)
slot

Sets the current talker for all applications.

Parameters
talkerTalkerCode representing wanted options

Definition at line 150 of file jovie.cpp.

void Jovie::setDefaultPriority ( int  defaultPriority)
slot

Sets the default priority for speech jobs submitted by the application.

Parameters
defaultPriorityDefault job priority.
See also
JobPriority

Definition at line 165 of file jovie.cpp.

void Jovie::setDefaultTalker ( const QString &  defaultTalker)
slot

Sets the default talker for the application.

Parameters
defaultTalkerDefault talker. Example: "en".

Definition at line 145 of file jovie.cpp.

void Jovie::setFilteringOn ( bool  filteringOn)
slot

Sets whether speech jobs for this application are filtered using configured filter plugins.

Parameters
filteringOnTrue to set filtering on.

Definition at line 185 of file jovie.cpp.

void Jovie::setHtmlFilterXsltFile ( const QString &  htmlFilterXsltFile)
slot

Sets the full path name to an XSLT file used to convert HTML markup to speakable form.

Parameters
htmlFilterXsltFileXSLT filename.

Definition at line 210 of file jovie.cpp.

void Jovie::setIsSystemManager ( bool  isSystemManager)
slot

Sets whether this is a System Manager application.

Parameters
isSystemManagerTrue if this is a System Manager.

System Managers are used to control and configure overall TTS output. When True, many of the Jovie methods alter their behavior.

Definition at line 230 of file jovie.cpp.

void Jovie::setLanguage ( const QString &  language)
slot

Definition at line 342 of file jovie.cpp.

void Jovie::setOutputModule ( const QString &  module)
slot

Definition at line 337 of file jovie.cpp.

void Jovie::setPitch ( int  pitch)
slot

Definition at line 307 of file jovie.cpp.

void Jovie::setSentenceDelimiter ( const QString &  sentenceDelimiter)
slot

Sets the regular expression used to perform Sentence Boundary Detection (SBD) for the application.

Parameters
sentenceDelimiterSentence delimiter regular expression.

Definition at line 175 of file jovie.cpp.

void Jovie::setSpeed ( int  speed)
slot

Definition at line 292 of file jovie.cpp.

void Jovie::setSsmlFilterXsltFile ( const QString &  ssmlFilterXsltFile)
slot

Sets the full path name to XSLT file used to convert SSML markup to a speakable form.

Parameters
ssmlFilterXsltFileXSLT filename.

Definition at line 220 of file jovie.cpp.

void Jovie::setVoiceType ( int  voiceType)
slot

Definition at line 347 of file jovie.cpp.

void Jovie::setVolume ( int  volume)
slot

Definition at line 322 of file jovie.cpp.

void Jovie::showManagerDialog ( )
slot

Display the KttsMgr program so that user can configure KTTS options.

Only one instance of KttsMgr is displayed.

Definition at line 477 of file jovie.cpp.

int Jovie::speed ( )
slot

Definition at line 302 of file jovie.cpp.

QString Jovie::ssmlFilterXsltFile ( )
slot

Returns the full path name to XSLT file used to convert SSML markup to a speakable form.

Returns
XSLT filename.

Definition at line 215 of file jovie.cpp.

void Jovie::stop ( )
slot

Definition at line 357 of file jovie.cpp.

QString Jovie::talkerToTalkerId ( const QString &  talker)
slot

Given a talker, returns the Talker ID for the talker.

that will speak the job.

Parameters
talkerTalker. Example: "en".
Returns
Talker ID. A Talker ID is an internally-assigned identifier for a talker.

This method is normally used only by System Managers.

Definition at line 434 of file jovie.cpp.

QString Jovie::version ( ) const
slot

Returns the version number of KTTSD.

Returns
Version number string.
int Jovie::voiceType ( )
slot

Definition at line 352 of file jovie.cpp.

int Jovie::volume ( )
slot

Definition at line 332 of file jovie.cpp.

Property Documentation

bool Jovie::isSpeaking
read

Definition at line 61 of file jovie.h.

QString Jovie::version
read

Definition at line 62 of file jovie.h.


The documentation for this class was generated from the following files:
  • jovie.h
  • jovie.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:32:26 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