diff options
author | <philippe colliot> | 2015-12-10 15:12:55 +0100 |
---|---|---|
committer | <philippe colliot> | 2015-12-10 15:12:55 +0100 |
commit | 42b73e847d58ada53c8a71f9a0b85f9eabf334f6 (patch) | |
tree | f50d6efbab3909cb6b83887de2fc1f94b2021682 /src | |
parent | 0a00affdc77ed4fb1865a421b87bc6a61d8b983f (diff) | |
download | poi-service-42b73e847d58ada53c8a71f9a0b85f9eabf334f6.tar.gz |
Update of the franca files after telco
Diffstat (limited to 'src')
6 files changed, 215 insertions, 2 deletions
diff --git a/src/navigation/CMakeLists.txt b/src/navigation/CMakeLists.txt index 5751e99..e39333b 100644 --- a/src/navigation/CMakeLists.txt +++ b/src/navigation/CMakeLists.txt @@ -55,10 +55,12 @@ set(API_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../api") if(NOT ${YOCTO_CONFIG}) set(NAVIT_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/navit/navit/cmake") set(DBUS_GENERATED_INCLUDE_DIR_POSITIONING "${CMAKE_CURRENT_BINARY_DIR}/enhanced-position-service/dbus/api") # this one is for positioning + set(DBUS_GENERATED_INCLUDE_DIR_SPEECH "${CMAKE_CURRENT_BINARY_DIR}/dbus-include/speech-service") # this one is for speech set(NAVIT_CONFIG_H_DIR "${CMAKE_CURRENT_BINARY_DIR}/navit/navit") else() set(NAVIT_CMAKE_DIR "${STAGING_LIBDIR}/navit/cmake") set(DBUS_GENERATED_INCLUDE_DIR_POSITIONING "${STAGING_INCDIR}/positioning") # this one is for positioning + set(DBUS_GENERATED_INCLUDE_DIR_SPEECH "${STAGING_INCDIR}/speechservice") # this one is for speech set(NAVIT_CONFIG_H_DIR "${STAGING_DATADIR}") endif() @@ -105,6 +107,8 @@ add_subdirectory(${API_DIR}/map-viewer "${DBUS_GENERATED_INCLUDE_DIR}/map-viewer add_subdirectory(${API_DIR}/poi-service "${DBUS_GENERATED_INCLUDE_DIR}/poi-service") +add_subdirectory(${API_DIR}/speech-service "${DBUS_GENERATED_INCLUDE_DIR}/speech-service") + include(${NAVIT_CMAKE_DIR}/navit_macros.cmake) add_subdirectory(navigation-core) @@ -113,5 +117,3 @@ add_subdirectory(map-viewer) add_subdirectory(poi-cam) - - diff --git a/src/navigation/navigation-core/CMakeLists.txt b/src/navigation/navigation-core/CMakeLists.txt index f7119a4..9990edb 100644 --- a/src/navigation/navigation-core/CMakeLists.txt +++ b/src/navigation/navigation-core/CMakeLists.txt @@ -87,4 +87,5 @@ add_subdirectory(session-plugin) add_subdirectory(enhancedposition-plugin) +add_subdirectory(speech-plugin) diff --git a/src/navigation/navigation-core/navit_genivi_navigationcore.xsl b/src/navigation/navigation-core/navit_genivi_navigationcore.xsl index c736e6b..45ddba3 100644 --- a/src/navigation/navigation-core/navit_genivi_navigationcore.xsl +++ b/src/navigation/navigation-core/navit_genivi_navigationcore.xsl @@ -37,6 +37,8 @@ <xsl:text>
 </xsl:text> <plugin path="../../../navigation-core/enhancedposition-plugin/.libs/libgenivi_positioning_enhancedposition.so" ondemand="no"/> <xsl:text>
 </xsl:text> + <plugin path="../../../navigation-core/speech-plugin/.libs/libgenivi_speechservice_speechoutput.so" ondemand="no"/> + <xsl:text>
 </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 new file mode 100644 index 0000000..96372cd --- /dev/null +++ b/src/navigation/navigation-core/speech-plugin/.gitignore @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..6020aaa --- /dev/null +++ b/src/navigation/navigation-core/speech-plugin/CMakeLists.txt @@ -0,0 +1,39 @@ +########################################################################### +# @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 new file mode 100644 index 0000000..eb77439 --- /dev/null +++ b/src/navigation/navigation-core/speech-plugin/genivi_navigationcore_speechoutput.cxx @@ -0,0 +1,160 @@ +/** +* @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); +} |