summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author <philippe colliot>2015-12-10 17:03:06 +0100
committer <philippe colliot>2015-12-10 17:03:06 +0100
commitfab44b1a473c19a61c36e535971a18fd184ef7e6 (patch)
treeb4f2290eb0efc64282295810c5f788bb2771d473
parent42b73e847d58ada53c8a71f9a0b85f9eabf334f6 (diff)
downloadpoi-service-fab44b1a473c19a61c36e535971a18fd184ef7e6.tar.gz
No need of extra plugin, so let's use guidance plugin for speech output
-rw-r--r--src/navigation/navigation-core/CMakeLists.txt1
-rw-r--r--src/navigation/navigation-core/guidance-plugin/CMakeLists.txt1
-rw-r--r--src/navigation/navigation-core/guidance-plugin/genivi_navigationcore_guidance.cxx46
-rw-r--r--src/navigation/navigation-core/navit_genivi_navigationcore.xsl2
-rw-r--r--src/navigation/navigation-core/speech-plugin/.gitignore9
-rw-r--r--src/navigation/navigation-core/speech-plugin/CMakeLists.txt39
-rw-r--r--src/navigation/navigation-core/speech-plugin/genivi_navigationcore_speechoutput.cxx160
7 files changed, 46 insertions, 212 deletions
diff --git a/src/navigation/navigation-core/CMakeLists.txt b/src/navigation/navigation-core/CMakeLists.txt
index 9990edb..f7119a4 100644
--- a/src/navigation/navigation-core/CMakeLists.txt
+++ b/src/navigation/navigation-core/CMakeLists.txt
@@ -87,5 +87,4 @@ add_subdirectory(session-plugin)
add_subdirectory(enhancedposition-plugin)
-add_subdirectory(speech-plugin)
diff --git a/src/navigation/navigation-core/guidance-plugin/CMakeLists.txt b/src/navigation/navigation-core/guidance-plugin/CMakeLists.txt
index f3ff8f3..d1ee9f9 100644
--- a/src/navigation/navigation-core/guidance-plugin/CMakeLists.txt
+++ b/src/navigation/navigation-core/guidance-plugin/CMakeLists.txt
@@ -31,6 +31,7 @@ cmake_minimum_required(VERSION 2.8)
message(STATUS "guidance")
include_directories(${DBUS_GENERATED_INCLUDE_DIR}/navigation-core)
+include_directories(${DBUS_GENERATED_INCLUDE_DIR_SPEECH})
set(genivi_navigationcore_guidance_LIBS ${PLUGIN_LDFLAGS})
set(genivi_navigationcore_guidance_LIBRARY_DIRS ${PLUGIN_LIBRARIES})
diff --git a/src/navigation/navigation-core/guidance-plugin/genivi_navigationcore_guidance.cxx b/src/navigation/navigation-core/guidance-plugin/genivi_navigationcore_guidance.cxx
index a36f568..f3c87b2 100644
--- a/src/navigation/navigation-core/guidance-plugin/genivi_navigationcore_guidance.cxx
+++ b/src/navigation/navigation-core/guidance-plugin/genivi_navigationcore_guidance.cxx
@@ -29,6 +29,10 @@
#include <dbus-c++/glib-integration.h>
#include "genivi-navigationcore-constants.h"
#include "genivi-navigationcore-guidance_adaptor.h"
+
+#include "genivi-speechservice-constants.h"
+#include "genivi-speechservice-speechoutput_proxy.h"
+
#include "config.h"
#define USE_PLUGINS 1
#include "debug.h"
@@ -52,6 +56,41 @@
static DBus::Glib::BusDispatcher dispatcher;
static DBus::Connection *conn;
+class SpeechOutput
+: public org::genivi::hmi::speechservice::SpeechOutput_proxy,
+ public DBus::ObjectProxy
+{
+ public:
+ struct callback *cb;
+ SpeechOutput(DBus::Connection &connection)
+ : DBus::ObjectProxy(connection,
+ "/org/genivi/hmi/speechservice/SpeechOutput",
+ "org.genivi.hmi.speechservice.SpeechOutput")
+ {
+ }
+
+ void notifyConnectionStatus(const uint32_t& connectionStatus)
+ {
+
+ }
+
+ void notifyMarkerReached(const uint32_t& chunkID, const std::string& marker)
+ {
+
+ }
+
+ void notifyQueueStatus(const uint32_t& queueStatus)
+ {
+
+ }
+
+ void notifyTTSStatus(const uint32_t& ttsStatus)
+ {
+
+ }
+};
+
+
class Guidance;
class GuidanceObj
@@ -61,6 +100,7 @@ class GuidanceObj
struct attr m_route, m_vehicleprofile, m_tracking_callback;
uint32_t m_session,m_route_handle;
Guidance *m_guidance;
+ SpeechOutput *m_speechoutput;
bool m_paused;
bool m_voice_guidance;
uint16_t m_prompt_mode;
@@ -733,6 +773,9 @@ GuidanceObj::GuidanceObj(Guidance *guidance, uint32_t SessionHandle, uint32_t Ro
struct attr **ret=NULL;
struct attr callback_list;
struct navit *navit=get_navit();
+
+ m_speechoutput=new SpeechOutput(*conn);
+
if (navit_get_attr(navit, attr_callback_list, &callback_list, NULL)) {
callback_list_call_attr_4(callback_list.u.callback_list, attr_command, "navit_genivi_get_route", in, &ret, NULL);
if (ret && ret[0] && ret[1] && ret[0]->type == attr_route && ret[1]->type == attr_vehicleprofile) {
@@ -769,6 +812,7 @@ GuidanceObj::~GuidanceObj()
callback_destroy(m_guidance_callback);
}
m_guidance->GuidanceStatusChanged(GENIVI_NAVIGATIONCORE_INACTIVE, 0);
+ delete(m_speechoutput);
}
static class Guidance *server;
@@ -776,7 +820,7 @@ static class Guidance *server;
void
plugin_init(void)
{
- dispatcher.attach(NULL);
+ dispatcher.attach(NULL);
DBus::default_dispatcher = &dispatcher;
// FIXME: What dbus address to use?
conn = new DBus::Connection(DBus::Connection::SessionBus());
diff --git a/src/navigation/navigation-core/navit_genivi_navigationcore.xsl b/src/navigation/navigation-core/navit_genivi_navigationcore.xsl
index 45ddba3..c736e6b 100644
--- a/src/navigation/navigation-core/navit_genivi_navigationcore.xsl
+++ b/src/navigation/navigation-core/navit_genivi_navigationcore.xsl
@@ -37,8 +37,6 @@
<xsl:text>&#x0A; </xsl:text>
<plugin path="../../../navigation-core/enhancedposition-plugin/.libs/libgenivi_positioning_enhancedposition.so" ondemand="no"/>
<xsl:text>&#x0A; </xsl:text>
- <plugin path="../../../navigation-core/speech-plugin/.libs/libgenivi_speechservice_speechoutput.so" ondemand="no"/>
- <xsl:text>&#x0A; </xsl:text>
<plugin path="../../../poi-cam/.libs/libgenivi_poiservice_cam_navit.so" ondemand="no"/>
</xsl:template>
<xsl:template match="/config/plugins/plugin">
diff --git a/src/navigation/navigation-core/speech-plugin/.gitignore b/src/navigation/navigation-core/speech-plugin/.gitignore
deleted file mode 100644
index 96372cd..0000000
--- a/src/navigation/navigation-core/speech-plugin/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-CMakeCache.txt
-CMakeFiles/
-cmake_install.cmake
-compat_includes
-compat_libs
-*_adaptor.h
-Makefile
-.svn
-.libs
diff --git a/src/navigation/navigation-core/speech-plugin/CMakeLists.txt b/src/navigation/navigation-core/speech-plugin/CMakeLists.txt
deleted file mode 100644
index 6020aaa..0000000
--- a/src/navigation/navigation-core/speech-plugin/CMakeLists.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-###########################################################################
-# @licence app begin@
-# SPDX-License-Identifier: MPL-2.0
-#
-# \copyright Copyright (C) 2013-2014, PCA Peugeot Citroen
-#
-# \file CMakeLists.txt
-#
-# \brief This file is part of the build system.
-#
-# \author Philippe Colliot <philippe.colliot@mpsa.com>
-#
-# \version 1.0
-#
-# This Source Code Form is subject to the terms of the
-# Mozilla Public License (MPL), v. 2.0.
-# If a copy of the MPL was not distributed with this file,
-# You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# For further information see http://www.genivi.org/.
-#
-# List of changes:
-#
-# <date>, <name>, <description of change>
-#
-# @licence end@
-###########################################################################
-project(navigation)
-cmake_minimum_required(VERSION 2.8)
-
-message(STATUS "speech-output")
-
-include_directories(${DBUS_GENERATED_INCLUDE_DIR_SPEECH})
-
-set(genivi_navigationcore_speechoutput_LIBS ${PLUGIN_LDFLAGS})
-set(genivi_navigationcore_speechoutput_LIBRARY_DIRS ${PLUGIN_LIBRARIES})
-
-module_add_library(genivi_navigationcore_speechoutput genivi_navigationcore_speechoutput.cxx ${DBUS_GENERATED_INCLUDE_DIR_SPEECH}/genivi-speechservice-speechoutput_proxy.h ${DBUS_GENERATED_INCLUDE_DIR_SPEECH}/genivi-speechservice-constants.h)
-
diff --git a/src/navigation/navigation-core/speech-plugin/genivi_navigationcore_speechoutput.cxx b/src/navigation/navigation-core/speech-plugin/genivi_navigationcore_speechoutput.cxx
deleted file mode 100644
index eb77439..0000000
--- a/src/navigation/navigation-core/speech-plugin/genivi_navigationcore_speechoutput.cxx
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
-* @licence app begin@
-* SPDX-License-Identifier: MPL-2.0
-*
-* \copyright Copyright (C) 2013-2014, PCA Peugeot Citroen
-*
-* \file genivi_navigationcore_speechoutput.cxx
-*
-* \brief This file is part of the Navit POC.
-*
-* \author Philippe Colliot <philippe.colliot@mpsa.com>
-*
-* \version 1.0
-*
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License (MPL), v. 2.0.
-* If a copy of the MPL was not distributed with this file,
-* You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* For further information see http://www.genivi.org/.
-*
-* List of changes:
-*
-* <date>, <name>, <description of change>
-*
-* @licence end@
-*/
-#include <dbus-c++/glib-integration.h>
-#include "genivi-speechservice-constants.h"
-#include "genivi-speechservice-speechoutput_proxy.h"
-#include "config.h"
-#define USE_PLUGINS 1
-#include "debug.h"
-#include "plugin.h"
-#include "item.h"
-#include "config_.h"
-#include "navit.h"
-#include "search.h"
-#include "callback.h"
-#include "event.h"
-#include "coord.h"
-#include "transform.h"
-#include "speech.h"
-
-#if (!DEBUG_ENABLED)
-#undef dbg
-#define dbg(level,...) ;
-#endif
-
-DBus::Glib::BusDispatcher dispatcher;
-DBus::Connection *conn;
-
-struct speech_priv {
- class SpeechOutput *speech_output;
- struct callback_list *cbl;
- struct callback *cb;
- GList *free_buffers;
- GList *phrases;
-};
-
-class SpeechOutput
-: public org::genivi::hmi::speechservice::SpeechOutput_proxy,
- public DBus::ObjectProxy
-{
- public:
- struct speech_priv *m_priv;
- SpeechOutput(DBus::Connection &connection, struct vehicle_priv *priv)
- : DBus::ObjectProxy(connection,
- "/org/genivi/hmi/speechservice/SpeechOutput",
- "org.genivi.hmi.speechservice.SpeechOutput")
- {
- m_priv=priv;
- }
-
- void notifyConnectionStatus(const uint32_t& connectionStatus)
- {
-
- }
-
- void notifyMarkerReached(const uint32_t& chunkID, const std::string& marker)
- {
-
- }
-
- void notifyQueueStatus(const uint32_t& queueStatus)
- {
-
- }
-
- void notifyTTSStatus(const uint32_t& ttsStatus)
- {
-
- }
-};
-
-static void
-free_list(gpointer pointer, gpointer list )
-{
- if ( list )
- {
- struct speech_priv *sp_priv = (struct speech_priv *)list;
- }
- g_free(pointer);
-}
-
-static void
-genivi_speechoutput_destroy(struct speech_priv *sp_priv)
-{
- dbg(lvl_debug,"enter\n");
- DBus::default_dispatcher = &dispatcher;
- delete(sp_priv->speech_output);
- callback_destroy(sp_priv->cb);
- g_free(priv);
-}
-
-static int
-genivi_speechoutput_say(struct speech_priv *sp_priv, const char *text) {
- char *phrase = g_strdup(text);
- dbg(lvl_debug, "Speak: '%s'\n", text);
-
- return 0;
-}
-
-static struct speech_methods genivi_speechoutput_meth = {
- genivi_speechoutput_destroy,
- genivi_speechoutput_say,
-};
-
-static void
-genivi_speechoutput_callback(struct speech_priv *sp_priv)
-{
-}
-
-static struct speech_priv *
-genivi_speechoutput_new(struct speech_methods *meth, genivi_speech, struct callback_list *cb_list) {
- struct speech_priv *ret = NULL;
-
- dbg(lvl_debug, "enter\n");
-
- *meth=genivi_speechoutput_meth;
-
- ret=g_new(struct speech_priv,1);
- ret->speech_output = new SpeechOutput(*conn,ret);
- ret->cb=callback_new_1(callback_cast(genivi_speechoutput_callback), ret);
- ret->cbl=cb_list;
-
- return ret;
-}
-
-void plugin_init(void)
-{
- event_request_system("glib","genivi_speechservice_speechoutput");
- dispatcher.attach(NULL);
- DBus::default_dispatcher = &dispatcher;
- conn = new DBus::Connection(DBus::Connection::SessionBus());
- conn->setup(&dispatcher);
- dbg(lvl_debug,"enter\n");
-
- plugin_register_speech_type("genivi_speech", genivi_speechoutput_new);
-}