debian/0000775000000000000000000000000012321600340007157 5ustar debian/copyright0000664000000000000000000000623312321600340011116 0ustar This package was debianized by the Debian Qt/KDE Maintainers on June 2012. It was downloaded from ftp://ftp.kde.org Upstream Author: The KDE development team Numerous people, too many to count, have contributed to kdeaccesibility as a whole. The KDE project tries to make an extensive list of people who contributed to KDE at http://www.kde.org/people/credits Upstream Authors and copyright holders: Copyright 2004-2006 by Gary Cramblitt Copyright 2004 by Paul Giannaros Copyright 2002-2003 by José Pablo Ezequiel "Pupeno" Fernández Copyright 2009-2010 by Jeremy Whiting Copyright 2011, Raphael Kubo da Costa License: Files under cmake/ | Redistribution and use in source and binary forms, with or without | modification, are permitted provided that the following conditions | are met: | | 1. Redistributions of source code must retain the copyright | notice, this list of conditions and the following disclaimer. | 2. Redistributions in binary form must reproduce the copyright | notice, this list of conditions and the following disclaimer in the | documentation and/or other materials provided with the distribution. | 3. The name of the author may not be used to endorse or promote products | derived from this software without specific prior written permission. | | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The rest of the files is available under a mix of (GPLv2 and GPLv2) and GPLv2 or later versions, effectively making the programs GPLv2 and GPLv3. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) version 3. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. The Debian packaging is Copyright (C) 2008-2009, Debian Qt/KDE team and is licensed under the GPL, see `/usr/share/common-licenses/GPL-2'. debian/jovie.install0000664000000000000000000000162712321600340011671 0ustar usr/bin/jovie usr/lib/kde4/jovie_*.so usr/lib/kde4/kcm_kttsd.so usr/lib/libkttsd.so.4 usr/lib/libkttsd.so.4.*.* usr/share/applications/kde4/jovieapp.desktop usr/share/doc/kde/HTML/en/jovie/* usr/share/icons/hicolor/16x16/actions/female.png usr/share/icons/hicolor/16x16/actions/male.png usr/share/icons/hicolor/16x16/actions/nospeak.png usr/share/icons/hicolor/16x16/actions/speak.png usr/share/icons/hicolor/22x22/actions/nospeak.png usr/share/icons/hicolor/22x22/actions/speak.png usr/share/icons/hicolor/32x32/actions/nospeak.png usr/share/icons/hicolor/32x32/actions/speak.png usr/share/icons/hicolor/48x48/actions/nospeak.png usr/share/icons/hicolor/48x48/actions/speak.png usr/share/kde4/apps/jovie/* usr/share/kde4/services/jovie.desktop usr/share/kde4/services/jovie_*.desktop usr/share/kde4/services/kcmkttsd.desktop usr/share/kde4/services/kttsd.desktop usr/share/kde4/servicetypes/jovie_filterplugin.desktop debian/docs0000664000000000000000000000002412321600340010026 0ustar README README.kttsd debian/jovie.lintian-overrides0000664000000000000000000000015412321600340013653 0ustar jovie: package-name-doesnt-match-sonames libkttsd4 jovie: no-symbols-control-file usr/lib/libkttsd.so.4.8.0 debian/watch0000664000000000000000000000012012321600340010201 0ustar version=3 ftp://ftp.kde.org/pub/kde/stable/([\d\.]*)/src/jovie-([\d\.]*).tar.xz debian/rules0000775000000000000000000000026612321600340010243 0ustar #!/usr/bin/make -f include /usr/share/pkg-kde-tools/qt-kde-team/2/debian-qt-kde.mk override_dh_strip: $(overridden_command) --dbg-package=jovie-dbg .PHONY: override_dh_auto_test debian/source/0000775000000000000000000000000012321600340010457 5ustar debian/source/format0000664000000000000000000000001412321600340011665 0ustar 3.0 (quilt) debian/changelog0000664000000000000000000001720612321600340011037 0ustar jovie (4:4.13.0-0ubuntu1) trusty; urgency=medium * New upstream KDE Software Compilation release -- Jonathan Riddell Thu, 10 Apr 2014 21:36:47 +0100 jovie (4:4.12.97-0ubuntu1) trusty; urgency=medium * New upstream release candidate -- Philip Muškovac Wed, 02 Apr 2014 11:08:20 +0200 jovie (4:4.12.95-0ubuntu1) trusty; urgency=medium * New upstream beta release -- Rohan Garg Sun, 23 Mar 2014 11:54:59 +0100 jovie (4:4.12.90-0ubuntu1) trusty; urgency=medium * New upstream beta release -- Jonathan Riddell Wed, 19 Mar 2014 10:34:54 +0000 jovie (4:4.12.3-0ubuntu1) trusty; urgency=medium * New upstream bugfix release -- Rohan Garg Tue, 04 Mar 2014 20:27:27 +0100 jovie (4:4.12.2-0ubuntu1) trusty; urgency=medium * New upstream bugfix release -- Rohan Garg Tue, 04 Feb 2014 23:36:11 +0000 jovie (4:4.12.1-0ubuntu1) trusty; urgency=low * New upstream bugfix release -- Rohan Garg Thu, 16 Jan 2014 07:55:56 +0000 jovie (4:4.12.0-0ubuntu1) trusty; urgency=low * New upstream release -- Jonathan Riddell Wed, 18 Dec 2013 16:24:02 +0000 jovie (4:4.11.97-0ubuntu1) trusty; urgency=low * New upstream RC release -- Jonathan Riddell Fri, 29 Nov 2013 12:29:58 +0000 jovie (4:4.11.95-0ubuntu1) trusty; urgency=low * New upstream beta release -- Rohan Garg Mon, 25 Nov 2013 17:42:06 +0100 jovie (4:4.11.80-0ubuntu1) trusty; urgency=low * New upstream beta release * Disable tests -- Rohan Garg Sat, 23 Nov 2013 17:26:23 +0100 jovie (4:4.11.2-0ubuntu1) saucy; urgency=low * New upstream bugfix release -- Jonathan Riddell Mon, 30 Sep 2013 13:56:47 +0100 jovie (4:4.11.1-0ubuntu1) saucy; urgency=low * New upstream bugfix release. -- Howard Chan Fri, 06 Sep 2013 22:04:57 +0100 jovie (4:4.11.0-0ubuntu1) saucy; urgency=low [ Howard Chan ] * New upstream release [ Jonathan Riddell ] * New upstream release -- Jonathan Riddell Tue, 13 Aug 2013 23:56:50 +0100 jovie (4:4.10.97-0ubuntu1) saucy; urgency=low * New upstream RC 2 release * New upstream RC 2 release -- Jonathan Riddell Fri, 26 Jul 2013 19:04:09 +0100 jovie (4:4.10.95-0ubuntu1) saucy; urgency=low * New upstream RC release -- Rohan Garg Fri, 19 Jul 2013 12:31:45 +0000 jovie (4:4.10.90-0ubuntu1) saucy; urgency=low * New upstream bet release -- Michał Zając Fri, 28 Jun 2013 17:58:35 +0100 jovie (4:4.10.80-0ubuntu1) saucy; urgency=low [ Rohan Garg ] * New upstream release * Update install files [ Jonathan Riddell ] * New upstream release -- Jonathan Riddell Fri, 21 Jun 2013 00:45:34 +0100 jovie (4:4.10.4-0ubuntu1) saucy-proposed; urgency=low * New upstream bugfix release -- Rohan Garg Thu, 06 Jun 2013 23:34:31 +0100 jovie (4:4.10.3-0ubuntu1) saucy; urgency=low * New upstream release * Merge with Debian -- Jonathan Riddell Tue, 07 May 2013 16:55:09 +0000 jovie (4:4.10.2-1) experimental; urgency=low * New upstream. * Remove scroll-fix patch. Merged upstream. * Bump build-deps to 4.10. -- Sune Vuorela Sat, 06 Apr 2013 10:35:37 +0000 jovie (4:4.10.2-0ubuntu1) raring; urgency=low * New upstream bugfix release - drop jovie_scroll_when_add.diff, applied upstream -- Philip Muškovac Sun, 31 Mar 2013 14:35:38 +0200 jovie (4:4.10.1-0ubuntu1) raring-proposed; urgency=low * New upstream bugfix release * Move transitional kttsd package to oldlibs/extra * Drop obsolete lintian-overrides file from kdeaccessibility -- Philip Muškovac Tue, 05 Mar 2013 15:12:07 +0000 jovie (4:4.10.0-0ubuntu1) raring-proposed; urgency=low * New upstream release -- Rohan Garg Wed, 06 Feb 2013 11:30:10 +0000 jovie (4:4.9.98-0ubuntu1) raring-proposed; urgency=low * New upstream release candidate -- Jonathan Riddell Fri, 18 Jan 2013 14:55:18 +0000 jovie (4:4.9.97-0ubuntu1) raring; urgency=low * New upstream release candidate -- Philip Muškovac Thu, 03 Jan 2013 22:23:32 +0100 jovie (4:4.9.95-0ubuntu1) raring; urgency=low * New upstream RC release -- Jonathan Riddell Tue, 18 Dec 2012 23:15:01 +0000 jovie (4:4.9.90-0ubuntu1) raring-proposed; urgency=low * New upstream beta release -- Jonathan Riddell Fri, 07 Dec 2012 17:35:21 +0000 jovie (4:4.9.80-0ubuntu1) raring; urgency=low * New upstream beta release -- Jonathan Riddell Mon, 19 Nov 2012 15:42:46 +0000 jovie (4:4.9.3-0ubuntu1) raring; urgency=low * New upstream release (LP: #1074747) -- Philip Muškovac Tue, 06 Nov 2012 22:21:26 +0100 jovie (4:4.9.2-0ubuntu1) quantal-proposed; urgency=low * New upstream bugfix release -- Jonathan Riddell Tue, 02 Oct 2012 15:10:00 +0100 jovie (4:4.9.1-0ubuntu1) quantal; urgency=low [ Harald Sitter ] * New upstream release [ Philip Muškovac ] * Change sonames from 4.9.0 to 4.9.* -- Harald Sitter Mon, 10 Sep 2012 18:15:21 +0530 jovie (4:4.9.0-0ubuntu2) quantal; urgency=low * Build-dep on kdelibs 4.9.0a, adjust .install files to new library version no -- Jonathan Riddell Thu, 02 Aug 2012 11:57:47 +0100 jovie (4:4.9.0-0ubuntu1) quantal; urgency=low * Use direct build-depends versions rather than kde-sc-dev-latest * New upstream release -- Jonathan Riddell Thu, 26 Jul 2012 16:59:28 +0100 jovie (4:4.8.90-0ubuntu1) quantal; urgency=low * New upstream beta release. -- Felix Geyer Mon, 11 Jun 2012 22:02:03 +0200 jovie (4:4.8.80-0ubuntu1) quantal; urgency=low * New upstream release -- Jonathan Riddell Wed, 06 Jun 2012 16:21:33 +0100 jovie (4:4.8.4-2) unstable; urgency=low * Woops. Missing a epoch. reuploading with epoch. -- Sune Vuorela Thu, 21 Jun 2012 12:21:33 +0200 jovie (4:4.8.3-0ubuntu1) quantal; urgency=low * New upstream release - Add libssl-dev to build-dep - Bump Standard-Version to 3.9.3 (no change) -- Jonathan Kolberg Thu, 03 May 2012 21:01:52 +0200 jovie (4:4.8.2-0ubuntu1) precise; urgency=low * new upstream release -- Jonathan Riddell Tue, 03 Apr 2012 08:51:53 +0000 jovie (4:4.8.1-0ubuntu1) precise; urgency=low * New upstream release -- Philip Muškovac Sun, 04 Mar 2012 21:19:20 +0100 jovie (4:4.8.0-0ubuntu1) precise; urgency=low * New upstream release -- Jonathan Riddell Fri, 20 Jan 2012 12:10:39 +0000 jovie (4:4.7.97-0ubuntu1) precise; urgency=low * New upstream release candidate -- Jonathan Riddell Thu, 05 Jan 2012 12:18:36 +0000 jovie (4:4.7.95-0ubuntu1) precise; urgency=low * New upstream release candidate -- Philip Muškovac Sat, 24 Dec 2011 22:19:40 +0100 jovie (4:4.7.90-0ubuntu1) precise; urgency=low * Initial package -- Jonathan Riddell Thu, 15 Dec 2011 15:32:24 +0000 jovie (4.8.4-1) unstable; urgency=low * Team upload. [ Sune Vuorela ] * Initial release split from kdeaccessibility -- Lisandro Damián Nicanor Pérez Meyer Sun, 17 Jun 2012 22:23:55 -0300 debian/compat0000664000000000000000000000000212321600340010355 0ustar 8 debian/jovie.README.Debian0000664000000000000000000000273612321600340012343 0ustar kttsd for Debian ================ ktts is the KDE Text-to-Speech System. More information may be found on the web page of the project: http://accessibility.kde.org/developer/kttsd/ kttsd plugins ============= kttsd comes with 3 kind of plugins: o AudioPlugins o FilterPlugins o SynthPlugins The synthetizer plugins rely on third party software, that you have to install in order to make them fully functional (see kttsd Recommends: field). That software are : o festival for the Festival Plugin. o epos for the epos plugin. o filte for the FLite plugin. They all are packaged in Debian. There is a Command Plugin also, that allow you to use any TTS synthetizer that has a command line interface. kttsd contrib plugins ===================== kttsd comes also with free Synthetizer plugins, but depends upon non free software : o FreeTTS plugin. o Hadifix (mbrola/txt2pho) plugin. kttsd provides support for those plugins, but for using them they require manual installation of third party, non free software to work. For additional instructions on downloading and configuring these engines for use in KTTS, please read the Appendix A of the kttsd handbook (either type help:/kttsd in konqueror, or run khelpcenter help:/kttsd). -- Pierre Habouzit Thu, 03 Mar 2005 13:17:20 +0100 Update to KDE 4.2 by Ana Guerrero on Wed, Jan 28 22:05:23 UTC 2009 debian/control0000664000000000000000000000371612321600340010571 0ustar Source: jovie Section: utils Priority: optional Maintainer: Kubuntu Developers XSBC-Original-Maintainer: Debian Qt/KDE Maintainers Uploaders: Sune Vuorela , Modestas Vainius , Eshat Cakar Build-Depends: kde-sc-dev-latest (>= 4:4.10), cmake, debhelper (>= 8.0), pkg-kde-tools (>= 0.12), kdelibs5-dev (>= 4:4.13.0), libspeechd-dev Standards-Version: 3.9.3 Homepage: http://accessibility.kde.org/developer/kttsd Vcs-Browser: http://bazaar.launchpad.net/~kubuntu-packagers/kubuntu-packaging/jovie Vcs-Bzr: https://code.launchpad.net/~kubuntu-packagers/kubuntu-packaging/jovie Package: jovie Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, speech-dispatcher Replaces: kttsd (<< 4:4.6), kmouth (<< 4:4.8) Breaks: kttsd (<< 4:4.6) Provides: kttsd Recommends: speech-dispatcher-festival | espeak | flite, kmouth Description: text-to-speech system The Jovie text-to-speech system is a plugin based service that allows any KDE (or non-KDE) application to speak using the D-Bus interface. . It uses the speech-dispatcher daemon for the actual speech job; kmouth is an useful front-end for it. . This package is part of the KDE accessibility module. Package: kttsd Section: oldlibs Architecture: all Priority: extra Depends: ${misc:Depends}, jovie Description: transitional package for jovie This is a transitional package provided to ease upgrade from kttsd to jovie. Package: jovie-dbg Section: debug Priority: extra Architecture: any Depends: jovie (= ${binary:Version}) Breaks: kdeaccessibility-dbg (<< 4:4.8) Replaces: kdeaccessibility-dbg (<< 4:4.8) Description: debugging symbols for jovie This package contains the debugging symbols for jovie. It is to be used in order to be able provide proper back traces for possible crashes or for running jovie in gdb or valgrind for meaningful output . This package is part of the KDE accessibility module debian/patches/0000775000000000000000000000000012321600340010606 5ustar debian/patches/kcmkttsd_permanent_settings_jobmgr_fixes.diff0000664000000000000000000003420312321600340022015 0ustar From: Modestas Vainius Subject: Properly support permanent storage of kttsd talker settings, jobmgr fixes. Origin: vendor Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=599825 Last-Update: 2010-12-04 Forwarded: no This patch builds on top of the upstream jobmgr patch (commits 1072198, 1138400) and: 1) adds support for permanent storage (to config file) of talker settings in both KTTS daemon and its configuration GUI. This includes saving and loading of the settings; 2) brings job manager GUI to a usable state rather than half-ported and hardly working bunch of GUI elements. Not entirely bug-free, but usable (i.e. should be RC bug free). --- a/kcmkttsmgr/kcmkttsmgr.cpp +++ b/kcmkttsmgr/kcmkttsmgr.cpp @@ -498,6 +498,10 @@ void KCMKttsMgr::load() m_changed = false; m_suppressConfigChanged = false; + + // load the first talker into job manager + if (m_jobMgrWidget && m_talkerListModel.rowCount() > 0) + m_jobMgrWidget->load(m_talkerListModel.getRow(0)); } /** @@ -592,12 +596,16 @@ void KCMKttsMgr::save() m_config->sync(); - // apply changes in the jobs page if it exists + // schedule apply of the changes in the jobs page once kttsd restarts if (m_jobMgrWidget) { - m_jobMgrWidget->save(); + m_jobMgrWidget->setSavePending(true); + //m_jobMgrWidget->save(); } + // Restart kttsd in order to pick up talker changes from config file + m_kspeech->reinit(); + // If we automatically unchecked the Enable KTTSD checkbox, stop KTTSD. if (enableKttsdWasToggled) slotEnableKttsd_toggled(false); @@ -1033,6 +1041,9 @@ void KCMKttsMgr::updateTalkerButtons(){ configureTalkerButton->setEnabled(true); higherTalkerPriorityButton->setEnabled(modelIndex.row() != 0); lowerTalkerPriorityButton->setEnabled(modelIndex.row() < (m_talkerListModel.rowCount() - 1)); + // Update output module and language in jobMgrWidget + if (m_jobMgrWidget) + m_jobMgrWidget->load(m_talkerListModel.getRow(modelIndex.row())); } else { removeTalkerButton->setEnabled(false); configureTalkerButton->setEnabled(false); @@ -1140,6 +1151,13 @@ void KCMKttsMgr::kttsdStarted() // Check/Uncheck the Enable KTTSD check box. if (kttsdLoaded) { + bool reinit = false; + if (m_kspeech) { // already connected, reinit called + // disconnect first + disconnect( QDBusConnection::sessionBus().interface(), 0, this, 0 ); + delete m_kspeech; + reinit = true; + } enableKttsdCheckBox->setChecked(true); m_kspeech = new OrgKdeKSpeechInterface("org.kde.kttsd", "/KSpeech", QDBusConnection::sessionBus()); m_kspeech->setParent(this); @@ -1157,6 +1175,8 @@ void KCMKttsMgr::kttsdStarted() kttsdVersion->setText(i18n("KTTSD Version: %1", m_kspeech->version())); + if (!reinit) + m_jobMgrWidget->load(TalkerCode()); } else { enableKttsdCheckBox->setChecked(false); delete m_kspeech; --- a/kcmkttsmgr/kttsjobmgr.cpp +++ b/kcmkttsmgr/kttsjobmgr.cpp @@ -56,7 +56,8 @@ #include "selecttalkerdlg.h" KttsJobMgr::KttsJobMgr(QWidget *parent) : - QWidget(parent) + QWidget(parent), + m_savePending(false) { m_ui = new Ui::kttsjobmgr; m_ui->setupUi(this); @@ -77,7 +78,7 @@ KttsJobMgr::KttsJobMgr(QWidget *parent) connect (m_ui->volumeSlider, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged())); connect (m_ui->moduleComboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(slot_moduleChanged(const QString &))); - connect (m_ui->languageComboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(slot_languageChanged(const QString &))); + connect (m_ui->languageComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_languageChanged(int))); connect (m_ui->voiceComboBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(configChanged())); m_ui->stopButton->setIcon(KIcon("media-playback-stop")); @@ -139,25 +140,104 @@ void KttsJobMgr::slot_resume() void KttsJobMgr::save() { + if (m_ui->moduleComboBox->currentIndex() > -1) + m_kspeech->setOutputModule(m_ui->moduleComboBox->currentText()); + if (m_ui->languageComboBox->currentIndex() > -1) + { + int langIndex = m_ui->languageComboBox->currentIndex(); + m_kspeech->setLanguage(m_ui->languageComboBox->itemData(langIndex).toString()); + } m_kspeech->setSpeed(m_ui->speedSlider->value()); m_kspeech->setPitch(m_ui->pitchSlider->value()); m_kspeech->setVolume(m_ui->volumeSlider->value()); m_kspeech->setVoiceType(m_ui->voiceComboBox->currentIndex() + 1); + + m_savePending = false; +} + +void KttsJobMgr::load(const TalkerCode & tc, bool complete) +{ + m_ui->moduleComboBox->clear(); + bool wasSet = false; + QStringList modules = m_kspeech->outputModules(); + int i = 0; + + foreach (const QString module, modules) + { + m_ui->moduleComboBox->addItem(module); + if (module == tc.outputModule()) + { + m_ui->moduleComboBox->setCurrentIndex(i); + wasSet = true; + } + i++; + } + if (wasSet) + { + if (complete) { + loadLanguages(tc.language()); + m_ui->voiceComboBox->setCurrentIndex(tc.voiceType()-1); + m_ui->speedSlider->setValue(tc.rate()); + m_ui->pitchSlider->setValue(tc.pitch()); + m_ui->volumeSlider->setValue(tc.volume()); + } + } + else + { + m_ui->moduleComboBox->setCurrentIndex(-1); + } } -void KttsJobMgr::load() +void KttsJobMgr::loadLanguages(const QString & selectedLanguage) { + QString module = m_ui->moduleComboBox->currentText(); + m_ui->languageComboBox->clear(); + if (!module.isEmpty()) + { + int i = 0; + bool wasSet = false; + QStringList languages = m_kspeech->languagesByModule(module); + foreach (const QString language, languages) + { + QString langName = TalkerCode::languageCodeToLanguage(language); + QString langLabel = (langName.isEmpty()) ? language : + QString("%1 (%2)").arg(langName).arg(language); + m_ui->languageComboBox->addItem(langLabel, language); + if (language == selectedLanguage) + { + m_ui->languageComboBox->setCurrentIndex(i); + wasSet = true; + } + i++; + } + if (!wasSet) m_ui->languageComboBox->setCurrentIndex(-1); + } } void KttsJobMgr::slot_moduleChanged(const QString & module) { + if (module.isEmpty()) { + m_ui->languageComboBox->clear(); + return; + } + kDebug() << "changing the output module to " << module; m_kspeech->setOutputModule(module); + + QString fullLanguageCode = KGlobal::locale()->defaultLanguage(); + QString languageCode, countryCode; + TalkerCode::splitFullLanguageCode(fullLanguageCode, languageCode, countryCode); + loadLanguages(languageCode); + emit configChanged(); } -void KttsJobMgr::slot_languageChanged(const QString & language) +void KttsJobMgr::slot_languageChanged(int index) { + if (index < 0) + return; + + QString language = m_ui->languageComboBox->itemData(index).toString(); kDebug() << "changing the language to " << language; m_kspeech->setLanguage(language); emit configChanged(); @@ -261,6 +341,16 @@ QString KttsJobMgr::cachedTalkerCodeToTa } } +void KttsJobMgr::setSavePending(bool value) +{ + m_savePending = value; +} + +bool KttsJobMgr::isSavePending() +{ + return m_savePending; +} + /** Slots connected to DBUS Signals emitted by KTTSD. */ /** @@ -268,4 +358,6 @@ QString KttsJobMgr::cachedTalkerCodeToTa */ Q_SCRIPTABLE void KttsJobMgr::kttsdStarted() { + if (isSavePending()) + save(); } --- a/kcmkttsmgr/kttsjobmgr.h +++ b/kcmkttsmgr/kttsjobmgr.h @@ -37,6 +37,7 @@ class KPushButton; class KttsJobMgrBrowserExtension; class JobInfo; class JobInfoListModel; +class TalkerCode; namespace Ui { @@ -54,7 +55,10 @@ public: /** apply current settings, i.e. speech-dispatcher what to do */ void save(); /** get the current settings from speech-dispatcher */ - void load(); + void load(const TalkerCode & tc, bool complete = true); + + void setSavePending(bool value); + bool isSavePending(); signals: void configChanged(); @@ -83,7 +87,7 @@ private slots: */ void slot_moduleChanged(const QString & module); - void slot_languageChanged(const QString & language); + void slot_languageChanged(int index); private: /** @@ -98,6 +102,8 @@ private: */ QString cachedTalkerCodeToTalkerID(const QString& talkerCode); + void loadLanguages(const QString & selectedLanguage); + /** * Job ListView. */ @@ -107,6 +113,8 @@ private: * Cache mapping Talker Codes to Talker IDs. */ QMap m_talkerCodesToTalkerIDs; + + bool m_savePending; }; #endif // KTTSJOBMGR_H --- a/kttsd/kspeech.cpp +++ b/kttsd/kspeech.cpp @@ -436,6 +436,7 @@ void KSpeech::init() new KSpeechAdaptor(this); if (ready()) { QDBusConnection::sessionBus().registerObject("/KSpeech", this, QDBusConnection::ExportAdaptors); + emit kttsdStarted(); } } @@ -450,6 +451,7 @@ void KSpeech::reinit() QDBusConnection::sessionBus().unregisterObject("/KSpeech"); if (ready()) { QDBusConnection::sessionBus().registerObject("/KSpeech", this, QDBusConnection::ExportAdaptors); + emit kttsdStarted(); } } @@ -477,7 +479,6 @@ bool KSpeech::ready() if (!initializeSpeaker()) return false; announceEvent("ready", "kttsdStarted"); - emit kttsdStarted(); return true; } --- a/kttsd/speaker.cpp +++ b/kttsd/speaker.cpp @@ -53,7 +53,7 @@ #include "talkercode.h" // KTTSD includes. -//#include "talkermgr.h" +#include "talkermgr.h" #include "ssmlconvert.h" @@ -103,7 +103,8 @@ class SpeakerPrivate SpeakerPrivate() : connection(NULL), filterMgr(NULL), - config(NULL) + config(NULL), + currentTalker(QString()) { if (!ConnectToSpeechd()) kError() << "could not get a connection to speech-dispatcher"<< endl; @@ -112,6 +113,8 @@ class SpeakerPrivate filterMgr->init(); config = new KConfig("kttsdrc"); + + TalkerMgr::Instance()->loadTalkers(config); } ~SpeakerPrivate() @@ -195,6 +198,8 @@ protected: */ KConfig *config; + QString currentTalker; + }; /* Public Methods ==========================================================*/ @@ -256,6 +261,14 @@ void Speaker::init() delete d->filterMgr; d->filterMgr = new FilterMgr(); d->filterMgr->init(); + + if (d->config) delete d->config; + d->config = new KConfig("kttsdrc"); + TalkerMgr::Instance()->loadTalkers(d->config); + + QString defTalker = TalkerMgr::Instance()->userDefaultTalker(); + if (!defTalker.isEmpty()) + activateTalker(defTalker); } AppData* Speaker::getAppData(const QString& appId) const @@ -330,6 +343,13 @@ int Speaker::say(const QString& appId, c //kDebug() << "Running: Speaker::say appId = " << appId << " text = " << text; //QString talker = appData->defaultTalker(); + // Activate another talker if requested + if (!appData->defaultTalker().isEmpty() && + appData->defaultTalker() != d->currentTalker) + { + activateTalker(appData->defaultTalker()); + } + SPDPriority spdpriority = SPD_PROGRESS; // default to least priority switch (priority) { @@ -406,7 +426,7 @@ int Speaker::say(const QString& appId, c } //// Note: Set state last so job is fully populated when jobStateChanged signal is emitted. - appData->jobList()->append(jobNum); + //appData->jobList()->append(jobNum); return jobNum; } @@ -449,6 +469,19 @@ bool Speaker::isSpeaking() return true; // TODO: ask speech-dispatcher somehow? } +void Speaker::activateTalker(const QString & talker) +{ + TalkerCode tc(talker); + setOutputModule(tc.outputModule()); + setLanguage(tc.language()); + setVoiceType(tc.voiceType()); + setSpeed(tc.rate()); + setPitch(tc.pitch()); + setVolume(tc.volume()); + + d->currentTalker = talker; +} + int Speaker::getCurrentJobNum() { return 0;// TODO: ask speech dispatcher if it's needed... @@ -819,6 +852,9 @@ QStringList Speaker::outputModules() QStringList Speaker::languagesByModule(const QString & module) { + if (module.isEmpty()) + return QStringList(); + QStringList languages; if (spd_set_output_module(d->connection, module.toUtf8().data()) == 0) { @@ -850,12 +886,18 @@ void Speaker::setVolume(int volume) void Speaker::setOutputModule(const QString & module) { + if (module.isEmpty()) + return; + int result = spd_set_output_module(d->connection, module.toUtf8().data()); // discard result for now, TODO: add error reporting } void Speaker::setLanguage(const QString & language) { + if (language.isEmpty()) + return; + int result = spd_set_language(d->connection, language.toUtf8().data()); // discard result for now, TODO: add error reporting } --- a/kttsd/speaker.h +++ b/kttsd/speaker.h @@ -380,6 +380,8 @@ public: void setLanguage(const QString & language); void setVoiceType(int voiceType); + void activateTalker(const QString & talker); + signals: /** * Emitted when a marker is processed. --- a/kttsd/talkermgr.cpp +++ b/kttsd/talkermgr.cpp @@ -239,12 +239,7 @@ void TalkerMgr::loadTalkers(KConfig* c) */ QStringList TalkerMgr::getTalkers() { - QStringList talkerList; - //for (int ndx = 0; ndx < int(m_loadedPlugIns.count()); ++ndx) - //{ - // talkerList.append(m_loadedTalkerCodes[ndx].getTalkerCode()); - //} - return talkerList; + return m_loadedTalkerIds; } /** @@ -340,7 +335,8 @@ QString TalkerMgr::talkerCodeToTalkerId( */ QString TalkerMgr::userDefaultTalker() const { - return m_loadedTalkerCodes[0].getTalkerCode(); + return (m_loadedTalkerCodes.isEmpty()) ? QString() : + m_loadedTalkerCodes[0].getTalkerCode(); } /** debian/patches/series0000664000000000000000000000000012321600340012011 0ustar debian/not-installed0000664000000000000000000000004312321600340011654 0ustar #dev symlink ./usr/lib/libkttsd.so