[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:22:37 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=a9a0773
The following commit has been merged in the master branch:
commit a9a0773b691616e46a0640275e29b3cde048a03b
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Wed Aug 8 11:23:21 2012 +1000
Implement skeleton TTS
REVIEW: 106428
---
filters/CMakeLists.txt | 1 +
filters/texttospeech/CMakeLists.txt | 30 ++++++++++++
.../ktptextui_message_filter_tts.desktop | 14 ++++++
filters/texttospeech/tts-filter.cpp | 54 ++++++++++++++++++++++
.../images-filter.h => texttospeech/tts-filter.h} | 15 +++---
5 files changed, 107 insertions(+), 7 deletions(-)
diff --git a/filters/CMakeLists.txt b/filters/CMakeLists.txt
index ee7c23d..3dac798 100644
--- a/filters/CMakeLists.txt
+++ b/filters/CMakeLists.txt
@@ -4,3 +4,4 @@ add_subdirectory(emoticons)
add_subdirectory(images)
#Commented out until https://bugs.kde.org/show_bug.cgi?id=304740
# add_subdirectory(searchexpansion)
+add_subdirectory(texttospeech)
diff --git a/filters/texttospeech/CMakeLists.txt b/filters/texttospeech/CMakeLists.txt
new file mode 100644
index 0000000..4de03cb
--- /dev/null
+++ b/filters/texttospeech/CMakeLists.txt
@@ -0,0 +1,30 @@
+set (ktptextui_message_filter_tts_SRCS
+ tts-filter.cpp
+)
+
+kde4_add_ui_files (ktptextui_message_filter_tts_SRCS
+)
+
+qt4_add_dbus_interfaces(ktptextui_message_filter_tts_SRCS /usr/share/dbus-1/interfaces/org.kde.KSpeech.xml)
+
+kde4_add_plugin (ktptextui_message_filter_tts
+ ${ktptextui_message_filter_tts_SRCS}
+)
+
+target_link_libraries (ktptextui_message_filter_tts
+ ktpchat
+ ${QT_LIBRARIES}
+ ${KDE4_KDEUI_LIBS}
+ ${TELEPATHY_QT4_LIBRARIES}
+ ${KDE4_KEMOTICONS_LIBS}
+)
+
+# Install:
+install (TARGETS ktptextui_message_filter_tts
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+install (FILES ktptextui_message_filter_tts.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+)
+
diff --git a/filters/texttospeech/ktptextui_message_filter_tts.desktop b/filters/texttospeech/ktptextui_message_filter_tts.desktop
new file mode 100644
index 0000000..b0df7be
--- /dev/null
+++ b/filters/texttospeech/ktptextui_message_filter_tts.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Name=Text To Speech
+Encoding=UTF-8
+Comment=Read out incoming messages using text-to-speech service
+Type=Service
+ServiceTypes=KTpTextUi/MessageFilter
+X-KDE-Library=ktptextui_message_filter_tts
+X-KDE-PluginInfo-Author=David Edmundson
+X-KDE-PluginInfo-Email=davidedmundson at kde.org
+X-KDE-PluginInfo-Name=tts
+X-KDE-PluginInfo-Version=0.4
+X-KDE-PluginInfo-Website=http://community.kde.org/Real-Time_Communication_and_Collaboration
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=false
diff --git a/filters/texttospeech/tts-filter.cpp b/filters/texttospeech/tts-filter.cpp
new file mode 100644
index 0000000..aeda0c7
--- /dev/null
+++ b/filters/texttospeech/tts-filter.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012 David Edmundson <davidedmundson at kde.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "tts-filter.h"
+
+
+#include <KPluginFactory>
+#include <KDebug>
+#include <KLocalizedString>
+
+#include <kspeech.h>
+#include <kspeechinterface.h>
+
+
+class TTSFilter::Private {
+public:
+ org::kde::KSpeech *kspeech;
+};
+
+TTSFilter::TTSFilter (QObject* parent, const QVariantList&) :
+ AbstractMessageFilter (parent), d(new Private)
+{
+ d->kspeech = new org::kde::KSpeech(QLatin1String("org.kde.kttsd"), QLatin1String("/KSpeech"), QDBusConnection::sessionBus());
+ d->kspeech->setApplicationName(i18n("KDE Instant Messaging"));
+}
+
+TTSFilter::~TTSFilter()
+{
+ delete d;
+}
+
+void TTSFilter::filterMessage (Message& message)
+{
+ //FIXME with real name.
+ d->kspeech->say(i18n("New message. %1").arg(message.mainMessagePart()), KSpeech::soHtml);
+}
+
+K_PLUGIN_FACTORY(MessageFilterFactory, registerPlugin<TTSFilter>();)
+K_EXPORT_PLUGIN(MessageFilterFactory("ktptextui_message_filter_tts"))
diff --git a/filters/images/images-filter.h b/filters/texttospeech/tts-filter.h
similarity index 77%
copy from filters/images/images-filter.h
copy to filters/texttospeech/tts-filter.h
index bbf3b44..609ed57 100644
--- a/filters/images/images-filter.h
+++ b/filters/texttospeech/tts-filter.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Lasath Fernando <kde at lasath.org>
+ * Copyright (C) 2012 David Edmundson <davidedmundson at kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -16,17 +16,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef IMAGES_FILTER_H
-#define IMAGES_FILTER_H
+#ifndef TTS_FILTER_H
+#define TTS_FILTER_H
+
#include <KTp/AbstractMessageFilter>
-class ImagesFilter : public AbstractMessageFilter
+class TTSFilter : public AbstractMessageFilter
{
Q_OBJECT
public:
- ImagesFilter (QObject* parent, const QVariantList &);
- virtual ~ImagesFilter();
+ TTSFilter (QObject* parent, const QVariantList &);
+ virtual ~TTSFilter();
virtual void filterMessage (Message& message);
private:
@@ -34,4 +35,4 @@ private:
Private *d;
};
-#endif // IMAGES_FILTER_H
+#endif // FORMAT_FILTER_H
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list