From 42b73e847d58ada53c8a71f9a0b85f9eabf334f6 Mon Sep 17 00:00:00 2001 From: Date: Thu, 10 Dec 2015 15:12:55 +0100 Subject: Update of the franca files after telco --- api/franca/hmi/speechoutputservice/CMakeLists.txt | 64 +++++++ .../hmi/speechoutputservice/SpeechOutput.fidl | 177 ++++++++++++++++++++ api/franca/hmi/speechservice/CMakeLists.txt | 64 ------- api/franca/hmi/speechservice/SpeechOutput.fidl | 177 -------------------- api/franca/navigation/NavigationTypes.fidl | 22 ++- .../freetextsearchservice/FreeTextSearch.fidl | 39 +---- api/speech-service/CMakeLists.txt | 46 ++++++ api/speech-service/constants.xsl | 71 ++++++++ api/speech-service/enum.xsl | 32 ++++ .../genivi-speechservice-constants.xml | 55 +++++++ .../genivi-speechservice-speechoutput.xml | 122 ++++++++++++++ api/speech-service/introspect.xsd | 147 +++++++++++++++++ api/speech-service/introspect.xsl | 183 +++++++++++++++++++++ src/navigation/CMakeLists.txt | 6 +- src/navigation/navigation-core/CMakeLists.txt | 1 + .../navit_genivi_navigationcore.xsl | 2 + .../navigation-core/speech-plugin/.gitignore | 9 + .../navigation-core/speech-plugin/CMakeLists.txt | 39 +++++ .../genivi_navigationcore_speechoutput.cxx | 160 ++++++++++++++++++ 19 files changed, 1136 insertions(+), 280 deletions(-) create mode 100644 api/franca/hmi/speechoutputservice/CMakeLists.txt create mode 100644 api/franca/hmi/speechoutputservice/SpeechOutput.fidl delete mode 100644 api/franca/hmi/speechservice/CMakeLists.txt delete mode 100644 api/franca/hmi/speechservice/SpeechOutput.fidl create mode 100644 api/speech-service/CMakeLists.txt create mode 100644 api/speech-service/constants.xsl create mode 100644 api/speech-service/enum.xsl create mode 100644 api/speech-service/genivi-speechservice-constants.xml create mode 100644 api/speech-service/genivi-speechservice-speechoutput.xml create mode 100644 api/speech-service/introspect.xsd create mode 100644 api/speech-service/introspect.xsl create mode 100644 src/navigation/navigation-core/speech-plugin/.gitignore create mode 100644 src/navigation/navigation-core/speech-plugin/CMakeLists.txt create mode 100644 src/navigation/navigation-core/speech-plugin/genivi_navigationcore_speechoutput.cxx diff --git a/api/franca/hmi/speechoutputservice/CMakeLists.txt b/api/franca/hmi/speechoutputservice/CMakeLists.txt new file mode 100644 index 0000000..94ec064 --- /dev/null +++ b/api/franca/hmi/speechoutputservice/CMakeLists.txt @@ -0,0 +1,64 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: franca speech output generation +# +# Author: Philippe Colliot +# +# Copyright (C) 2015, PCA Peugeot Citroen +# +# Note: +# The current file is an adaptation of the example file +# http://git.projects.genivi.org/?p=ipc/common-api-tools.git;a=blob;f=CommonAPI-Examples/E01HelloWorld/CMakeLists.txt +# +# License: +# This Source Code Form is subject to the terms of the +# Mozilla Public License, 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/. +# +# @licence end@ +########################################################################### + +cmake_minimum_required (VERSION 2.8.1) + +project(franca-speechoutput) + +option(COMMONAPI_TOOL_DIR + "Absolute path to CommonAPI tool" "") +option(COMMONAPI_DBUS_TOOL_DIR + "Absolute path to CommonAPI-DBus tool" "") + +execute_process(COMMAND uname -i OUTPUT_VARIABLE OS_VERSION) +if("${OS_VERSION}" MATCHES "i686") + set(OS_VERSION "x86") +endif() +message(STATUS "OS_VERSION = ${OS_VERSION}") + +set(COMMONAPI_FIDL_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + +find_package(PkgConfig REQUIRED) + +include(FindPkgConfig) + +# generate code from fidl +if(NOT COMMONAPI_GEN_DIR) + message (FATAL_ERROR "Set the variable -DCOMMONAPI_GEN_DIR=") +endif() + +file(GLOB FIDL_FILES "${COMMONAPI_FIDL_DIR}/*.fidl") + +if (COMMONAPI_TOOL_DIR) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND ${COMMONAPI_TOOL_DIR}/org.genivi.commonapi.core.cli.product/target/products/org.genivi.commonapi.core.cli.product/linux/gtk/${OS_VERSION}/commonapi-generator-linux-${OS_VERSION} -sk -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) +else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_TOOL_DIR=") +endif () + +if (COMMONAPI_DBUS_TOOL_DIR) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND ${COMMONAPI_DBUS_TOOL_DIR}/org.genivi.commonapi.dbus.cli.product/target/products/org.genivi.commonapi.dbus.cli.product/linux/gtk/${OS_VERSION}/commonapi-dbus-generator-linux-${OS_VERSION} -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) +else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_DBUS_TOOL_DIR=") +endif () + diff --git a/api/franca/hmi/speechoutputservice/SpeechOutput.fidl b/api/franca/hmi/speechoutputservice/SpeechOutput.fidl new file mode 100644 index 0000000..99091f1 --- /dev/null +++ b/api/franca/hmi/speechoutputservice/SpeechOutput.fidl @@ -0,0 +1,177 @@ +// SPDX-License-Identifier: MPL-2.0 +// Component Name: SpeechOutputService +// Compliance Level: Abstract Component +// Copyright (C) 2014, Continental Automotive GmbH, Elektrobit Automotive GmbH +// License: +// This Source Code Form is subject to the terms of the +// Mozilla Public License, 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/. + +package org.genivi.hmi.speechoutputservice + +import org.genivi.CommonTypes.* from "../../CommonTypes.fidl" + +<** @description : SpeechOutput interface. + The GENIVI SpeechOutput interface allows client applications to access TTS functionality +**> +interface SpeechOutput { + version { + major 0 + minor 1 + } + + <** @description : This method returns the API version implemented by the content access module.**> + method getVersion { + out { + <** @description: .**> + Version ^version + } + } + + <** @description : Max length of a single prompt part. **> + const UInt32 MAX_CHUNK_LENGTH = 1024 + + <** @description : String containing the prompt to play. **> + typedef Chunk is String + + <** @description : Index of the added prompt, zero based. **> + typedef ChunkID is UInt32 + + <** @description : String containing the name of the last reached marker. **> + typedef Marker is String + + <** @description : Connection status, will be notified. **> + enumeration ConnectionStatus + { + CS_UNKNOWN /* no instance of prompter available for member initialization purposes. */ + CS_ESTABLISHED /* success status, client is connected */ + CS_REFUSED /* currently a connection with the given priority is not possible. */ + CS_POSSIBLE /* notification that after a rejected prompt, a new attempt would be successful */ + CS_PENDING /* while connecting to service */ + CS_PAUSED /* client is paused */ + CS_TERMINATED /* client is disconnected */ + CS_MAX /* max value shall be error checked */ + } + + <** @description : Connection type, used from openPrompter(). + Defines the Audio connection that should be used for the prompter application. + The enum values will be mapped to an existing product connection id. **> + enumeration ConnectionType + { + CT_NAVIGATION /* reserved for internal Navigation application */ + CT_READER /* reserved for internal Reader application */ + CT_GEN_HIGH /* reserved for connections of generic application with high priority */ + CT_GEN_MEDIUM /* reserved for connections of generic application with medium priority */ + CT_GEN_LOW /* reserved for connections of generic application with low priority */ + CT_MAX /* max value shall be error checked */ + } + + <** @description : Processing type, used from openPrompter(). Sets text normalization mode and active prompt database of the TTS engine for the given context **> + enumeration PreProcessingType + { + PPT_DIALOG /* activates preprocessing rules for Dialog context */ + PPT_NAVIGATION /* activates preprocessing rules for Navigation context */ + PPT_NONE /* resets preprocessing rules */ + PPT_READER /* activates preprocessing rules for Reader context */ + PPT_MAX /* max value shall be error checked */ + } + + <** @description : Queue status, will be notified. **> + enumeration QueueStatus + { + QS_UNKNOWN /* no instance of prompter available for member initialization purposes. */ + QS_FULL /* chunk was rejected because chunk doesn't fit into buffer */ + QS_HIGH_FILL /* was added, but less than n% space missing. The client should consider delaying further additions. There is a risk successive chunk additions will not be heard and return an error. */ + QS_LOW_FILL /* the chunk was added, and there is enough memory for more chunks available */ + QS_MAX /* max value shall be error checked */ + } + + <** @description : TTS status, will be notified. **> + enumeration TtsStatus + { + TS_UNKNOWN /* no instance of prompter available for member initialization purposes. */ + TS_NOT_INITIALIZED /* prompter is not ready (startup , language change) */ + TS_ACTIVE /* prompter is active */ + TS_ABORTED /* prompter was aborted */ + TS_MARKER /* marker reached */ + TS_IDLE /* prompter in idle state */ + TS_ENQUEUED /* queue not empty, new chunk arrived */ + TS_FINISHED /* prompter finished speaking */ + TS_FAILED /* prompting failed */ + TS_MAX /* max value shall be error checked */ + } + + <** @description : Must be called to open a SpeechOutputService session and to get the audio connection. **> + method openPrompter { + in { + <** @description : Sets the Audio connection that should be used for the prompter application. **> + ConnectionType connectionType + <** @description : Sets the text normaization mode and which active prompt data base will be activated. **> + PreProcessingType preProcessingType + } + } + + <** @description : The prompter must be opened to trigger the playback of the provided prompt. + The prompt length must not exceed the length of a PromptChunk buffer. + Synthesizes the provided text or if using the escape sequence of the engine supplier a wave file in a supported sampling rate is provided, the system will back back also wave files. + The text will be normalized using the context identifier provided to openprompter. This applies to matching prerecorded files as well as the synthesis of number and words that are matched to a lexical dictionary. + The synthesize will start if the prompter is idle, if the prompter is already playing the playback will be delayed until all previously added text chunks are played back. For every text chunk provided a notification will be send. **> + method addTextChunk { + in { + <** @description : String containing the prompt to play. **> + Chunk chunk + } + out { + <** @description : Index of the added prompt, zero based. **> + ChunkID chunkID + } + } + + <** @description : A prompt must be playing to perform an abort action. If no prompting operation in progress there will be no reaction of the system. **> + method abortPrompter { } + + <** @description : The prompter is closed after the last text chunk submitted has finished playing. **> + method closePrompter { } + + + // *** notification methods + + /** + * The notify status messages will be send to signal the status as feedback on control of prompting functionalities. + */ + + <** @description : Notifies the connection status **> + broadcast notifyConnectionStatus selective { + out { + <** @description : Client connection status. **> + ConnectionStatus connectionStatus + } + } + + <** @description : Notifies the last reached marker. **> + broadcast notifyMarkerReached selective { + out { + <** @description : ID of the processed chunk. **> + ChunkID chunkID + <** @description : String with the name of the reached marker (if TTS engine supports inserting bookmarks with a name). **> + Marker marker + } + } + + <** @description : Notifies the queue status. **> + broadcast notifyQueueStatus selective { + out { + <** @description : Fill status of the text buffer. **> + QueueStatus queueStatus + } + } + + <** @description : Notifies the TTS engine status. **> + broadcast notifyTTSStatus selective { + out { + <** @description : Current status of the TTS. **> + TtsStatus ttsStatus + } + } +} + diff --git a/api/franca/hmi/speechservice/CMakeLists.txt b/api/franca/hmi/speechservice/CMakeLists.txt deleted file mode 100644 index 94ec064..0000000 --- a/api/franca/hmi/speechservice/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -########################################################################### -# @licence app begin@ -# SPDX-License-Identifier: MPL-2.0 -# -# Component Name: franca speech output generation -# -# Author: Philippe Colliot -# -# Copyright (C) 2015, PCA Peugeot Citroen -# -# Note: -# The current file is an adaptation of the example file -# http://git.projects.genivi.org/?p=ipc/common-api-tools.git;a=blob;f=CommonAPI-Examples/E01HelloWorld/CMakeLists.txt -# -# License: -# This Source Code Form is subject to the terms of the -# Mozilla Public License, 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/. -# -# @licence end@ -########################################################################### - -cmake_minimum_required (VERSION 2.8.1) - -project(franca-speechoutput) - -option(COMMONAPI_TOOL_DIR - "Absolute path to CommonAPI tool" "") -option(COMMONAPI_DBUS_TOOL_DIR - "Absolute path to CommonAPI-DBus tool" "") - -execute_process(COMMAND uname -i OUTPUT_VARIABLE OS_VERSION) -if("${OS_VERSION}" MATCHES "i686") - set(OS_VERSION "x86") -endif() -message(STATUS "OS_VERSION = ${OS_VERSION}") - -set(COMMONAPI_FIDL_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - -find_package(PkgConfig REQUIRED) - -include(FindPkgConfig) - -# generate code from fidl -if(NOT COMMONAPI_GEN_DIR) - message (FATAL_ERROR "Set the variable -DCOMMONAPI_GEN_DIR=") -endif() - -file(GLOB FIDL_FILES "${COMMONAPI_FIDL_DIR}/*.fidl") - -if (COMMONAPI_TOOL_DIR) - execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} - COMMAND ${COMMONAPI_TOOL_DIR}/org.genivi.commonapi.core.cli.product/target/products/org.genivi.commonapi.core.cli.product/linux/gtk/${OS_VERSION}/commonapi-generator-linux-${OS_VERSION} -sk -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) -else () - message (FATAL_ERROR "Set the variable -DCOMMONAPI_TOOL_DIR=") -endif () - -if (COMMONAPI_DBUS_TOOL_DIR) - execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} - COMMAND ${COMMONAPI_DBUS_TOOL_DIR}/org.genivi.commonapi.dbus.cli.product/target/products/org.genivi.commonapi.dbus.cli.product/linux/gtk/${OS_VERSION}/commonapi-dbus-generator-linux-${OS_VERSION} -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) -else () - message (FATAL_ERROR "Set the variable -DCOMMONAPI_DBUS_TOOL_DIR=") -endif () - diff --git a/api/franca/hmi/speechservice/SpeechOutput.fidl b/api/franca/hmi/speechservice/SpeechOutput.fidl deleted file mode 100644 index e4107d6..0000000 --- a/api/franca/hmi/speechservice/SpeechOutput.fidl +++ /dev/null @@ -1,177 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Component Name: SpeechOutputService -// Compliance Level: Abstract Component -// Copyright (C) 2014, Continental Automotive GmbH, Elektrobit Automotive GmbH -// License: -// This Source Code Form is subject to the terms of the -// Mozilla Public License, 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/. - -package org.genivi.hmi.speechservice - -import org.genivi.CommonTypes.* from "../../CommonTypes.fidl" - -<** @description : SpeechOutput interface. - The GENIVI SpeechOutput interface allows client applications to access TTS functionality -**> -interface SpeechOutput { - version { - major 0 - minor 1 - } - - <** @description : This method returns the API version implemented by the content access module.**> - method getVersion { - out { - <** @description: .**> - Version ^version - } - } - - <** @description : Max length of a single prompt part. **> - const UInt32 MAX_CHUNK_LENGTH = 1024 - - <** @description : String containing the prompt to play. **> - typedef Chunk is String - - <** @description : Index of the added prompt, zero based. **> - typedef ChunkID is UInt32 - - <** @description : String containing the name of the last reached marker. **> - typedef Marker is String - - <** @description : Connection status, will be notified. **> - enumeration ConnectionStatus - { - CS_UNKNOWN /* no instance of prompter available for member initialization purposes. */ - CS_ESTABLISHED /* success status, client is connected */ - CS_REFUSED /* currently a connection with the given priority is not possible. */ - CS_POSSIBLE /* notification that after a rejected prompt, a new attempt would be successful */ - CS_PENDING /* while connecting to service */ - CS_PAUSED /* client is paused */ - CS_TERMINATED /* client is disconnected */ - CS_MAX /* max value shall be error checked */ - } - - <** @description : Connection type, used from openPrompter(). - Defines the Audio connection that should be used for the prompter application. - The enum values will be mapped to an existing product connection id. **> - enumeration ConnectionType - { - CT_NAVIGATION /* reserved for internal Navigation application */ - CT_READER /* reserved for internal Reader application */ - CT_GEN_HIGH /* reserved for connections of generic application with high priority */ - CT_GEN_MEDIUM /* reserved for connections of generic application with medium priority */ - CT_GEN_LOW /* reserved for connections of generic application with low priority */ - CT_MAX /* max value shall be error checked */ - } - - <** @description : Processing type, used from openPrompter(). Sets text normalization mode and active prompt database of the TTS engine for the given context **> - enumeration PreProcessingType - { - PPT_DIALOG /* activates preprocessing rules for Dialog context */ - PPT_NAVIGATION /* activates preprocessing rules for Navigation context */ - PPT_NONE /* resets preprocessing rules */ - PPT_READER /* activates preprocessing rules for Reader context */ - PPT_MAX /* max value shall be error checked */ - } - - <** @description : Queue status, will be notified. **> - enumeration QueueStatus - { - QS_UNKNOWN /* no instance of prompter available for member initialization purposes. */ - QS_FULL /* chunk was rejected because chunk doesn't fit into buffer */ - QS_HIGH_FILL /* was added, but less than n% space missing. The client should consider delaying further additions. There is a risk successive chunk additions will not be heard and return an error. */ - QS_LOW_FILL /* the chunk was added, and there is enough memory for more chunks available */ - QS_MAX /* max value shall be error checked */ - } - - <** @description : TTS status, will be notified. **> - enumeration TtsStatus - { - TS_UNKNOWN /* no instance of prompter available for member initialization purposes. */ - TS_NOT_INITIALIZED /* prompter is not ready (startup , language change) */ - TS_ACTIVE /* prompter is active */ - TS_ABORTED /* prompter was aborted */ - TS_MARKER /* marker reached */ - TS_IDLE /* prompter in idle state */ - TS_ENQUEUED /* queue not empty, new chunk arrived */ - TS_FINISHED /* prompter finished speaking */ - TS_FAILED /* prompting failed */ - TS_MAX /* max value shall be error checked */ - } - - <** @description : Must be called to open a SpeechOutputService session and to get the audio connection. **> - method openPrompter { - in { - <** @description : Sets the Audio connection that should be used for the prompter application. **> - ConnectionType connectionType - <** @description : Sets the text normaization mode and which active prompt data base will be activated. **> - PreProcessingType preProcessingType - } - } - - <** @description : The prompter must be opened to trigger the playback of the provided prompt. - The prompt length must not exceed the length of a PromptChunk buffer. - Synthesizes the provided text or if using the escape sequence of the engine supplier a wave file in a supported sampling rate is provided, the system will back back also wave files. - The text will be normalized using the context identifier provided to openprompter. This applies to matching prerecorded files as well as the synthesis of number and words that are matched to a lexical dictionary. - The synthesize will start if the prompter is idle, if the prompter is already playing the playback will be delayed until all previously added text chunks are played back. For every text chunk provided a notification will be send. **> - method addTextChunk { - in { - <** @description : String containing the prompt to play. **> - Chunk chunk - } - out { - <** @description : Index of the added prompt, zero based. **> - ChunkID chunkID - } - } - - <** @description : A prompt must be playing to perform an abort action. If no prompting operation in progress there will be no reaction of the system. **> - method abortPrompter { } - - <** @description : The prompter is closed after the last text chunk submitted has finished playing. **> - method closePrompter { } - - - // *** notification methods - - /** - * The notifiy status messages will be send to signal the status as feedback on control of prompting functionalities. - */ - - <** @description : Notifies the connection status **> - broadcast notifyConnectionStatus selective { - out { - <** @description : Client connection status. **> - ConnectionStatus connectionStatus - } - } - - <** @description : Notifies the last reached marker. **> - broadcast notifyMarkerReached selective { - out { - <** @description : ID of the processed chunk. **> - ChunkID chunkID - <** @description : String with the name of the reached marker (if TTS engine supports inserting bookmarks with a name). **> - Marker marker - } - } - - <** @description : Notifies the queue status. **> - broadcast notifyQueueStatus selective { - out { - <** @description : Fill status of the text buffer. **> - QueueStatus queueStatus - } - } - - <** @description : Notifies the TTS engine status. **> - broadcast notifyTTSStatus selective { - out { - <** @description : Current status of the TTS. **> - TtsStatus ttsStatus - } - } -} - diff --git a/api/franca/navigation/NavigationTypes.fidl b/api/franca/navigation/NavigationTypes.fidl index c1cf0c2..2f652ad 100755 --- a/api/franca/navigation/NavigationTypes.fidl +++ b/api/franca/navigation/NavigationTypes.fidl @@ -8,6 +8,18 @@ package org.genivi.navigation typeCollection NavigationTypes { + <** @description: version.**> + struct Version { + <** @description : when the major changes, then backward compatibility with previous releases is not granted.**> + UInt16 ^versionMajor + <** @description : when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added).**> + UInt16 ^versionMinor + <** @description : when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications).**> + UInt16 ^versionMicro + <** @description : release date (e.g. 21-06-2011).**> + String date + } + typedef Handle is UInt32 <** @description: Handle to a location. @@ -19,11 +31,14 @@ typeCollection NavigationTypes { /* geometric types */ struct Coordinate2D { + <** @description: latitude of the current position (according WGS84). Range [-90:+90]. Example: 48.053250 .**> Double latitude + <** @description: longitude of the current position (according WGS84). Range [-180:+180]. Example: 8.324500 .**> Double longitude } struct Coordinate3D extends Coordinate2D { + <** @description: altitude above the sea level of the current position in meters .**> Int32 altitude } @@ -50,13 +65,6 @@ typeCollection NavigationTypes { DistanceInMeters radius } - <** @description: Kind of shapes. **> - enumeration ShapeType { - CIRCLE - RECTANGLE - POLYGON - } - typedef Timestamp is UInt64 diff --git a/api/franca/navigation/freetextsearchservice/FreeTextSearch.fidl b/api/franca/navigation/freetextsearchservice/FreeTextSearch.fidl index c64516f..6eebedd 100755 --- a/api/franca/navigation/freetextsearchservice/FreeTextSearch.fidl +++ b/api/franca/navigation/freetextsearchservice/FreeTextSearch.fidl @@ -1,3 +1,4 @@ + // SPDX-License-Identifier: MPL-2.0 // Copyright (C) 2015-2016, PCA Peugeot Citroën, XS Embedded GmbH, TomTom International B.V., Continental Automotive GmbH, // Alpine Electronics R&D Europe GmbH, Harman-Becker Automotive GmbH. @@ -7,7 +8,6 @@ package org.genivi.navigation.freetextsearchservice -import org.genivi.CommonTypes.* from "../../CommonTypes.fidl" import org.genivi.navigation.NavigationTypes.* from "../NavigationTypes.fidl" <** @description : This interface allows a user to find locations by entering a single text string. @@ -63,19 +63,12 @@ interface FreeTextSearch { <** @description: A union to contain any of the possble search shapes. **> - union ShapeSpecificDetails { + union Shape { Circle circle Rectangle rectangle } - <** @description: A shape. **> - struct Shape { - ShapeType shapeType - ShapeSpecificDetails shapeDetails - } - - <** @description: A list of shapes. maximum length = 31 **> @@ -107,7 +100,7 @@ interface FreeTextSearch { } <** @description: An OR-ed combination of SearchOption flags. - Range[0:0x7fffffff] + Range[0:0xffffffff] **> typedef SearchOptions is UInt32 @@ -142,7 +135,7 @@ interface FreeTextSearch { <** @description: Handle to a location. - Range[0:0x7fffffff] + Range[0:0xffffffff] **> typedef LocationHandle is UInt32 @@ -153,14 +146,6 @@ interface FreeTextSearch { array LocationHandleList of LocationHandle - <** @description: An address can represent a street, a named place, or a mapcode. **> - enumeration AddressType { - STREET - PLACE - MAP_CODE - } - - <** @description: If a user entered a non-existing house number then the closest existing number is returned. The houseNumberFromInput will contain the house number from the user input, the houseNumber will contain closest house number. @@ -204,7 +189,8 @@ interface FreeTextSearch { <** @description: Mapcode details. **> struct MapCodeDetails { - <** @description: If the location of the mapcode is close to a street, this field + <** @description: Mapcodes are a free, open way to make every house or location on Earth addressable by a short code. + If the location of the mapcode is close to a street, this field contains the name of that street, otherwise this field is left empty. **> FtsString closestStreetName @@ -212,24 +198,17 @@ interface FreeTextSearch { <** @description: A union to contain any of the specific types of address details. **> - union AddressTypeSpecificDetails { + union AddressDetails { StreetDetails streetDetails PlaceDetails placeDetails MapCodeDetails mapCodeDetails } - <** @description: Address details for lines, nodes and mapcodes. **> - struct AddressDetails { - AddressType addressType - AddressTypeSpecificDetails addressTypeSpecificDetails - } - - <** @description: A higher score means a better match. - Range[0:0x7fff] + Range[0:0xffff] **> - typedef Score is Int16 + typedef Score is UInt16 <** @description: Address information. **> diff --git a/api/speech-service/CMakeLists.txt b/api/speech-service/CMakeLists.txt new file mode 100644 index 0000000..8541643 --- /dev/null +++ b/api/speech-service/CMakeLists.txt @@ -0,0 +1,46 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: speech service +# +# Author: Philippe Colliot +# +# Copyright (C) 2014, PCA Peugeot Citroën +# +# License: +# This Source Code Form is subject to the terms of the +# Mozilla Public License, 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/. +# +# @licence end@ +########################################################################### +project(speech-service) +cmake_minimum_required(VERSION 2.8) + +message(STATUS "generation of DBus files for speech-service") + +find_program(XSLTPROC xsltproc REQUIRED) +find_program(DBUSXML2CPP dbusxx-xml2cpp REQUIRED) + +file (GLOB XML_TO_DBUS + ${CMAKE_CURRENT_SOURCE_DIR}/genivi-speechservice-speechoutput.xml +) +foreach (RAW_FILE ${XML_TO_DBUS}) + get_filename_component(FILE ${RAW_FILE} NAME_WE) + execute_process( + COMMAND ${DBUSXML2CPP} ${RAW_FILE} --proxy=${CMAKE_CURRENT_BINARY_DIR}/${FILE}_proxy.h + COMMAND ${DBUSXML2CPP} ${RAW_FILE} --adaptor=${CMAKE_CURRENT_BINARY_DIR}/${FILE}_adaptor.h + ) +endforeach() + +file (GLOB XML_TO_DBUS_CONSTANT + ${CMAKE_CURRENT_SOURCE_DIR}/genivi-speechservice-constants.xml +) +foreach (RAW_FILE ${XML_TO_DBUS_CONSTANT}) + get_filename_component(FILE ${RAW_FILE} NAME_WE) + execute_process( + OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.h + COMMAND ${XSLTPROC} ${CMAKE_CURRENT_SOURCE_DIR}/enum.xsl ${RAW_FILE} + ) +endforeach() diff --git a/api/speech-service/constants.xsl b/api/speech-service/constants.xsl new file mode 100644 index 0000000..e45a37a --- /dev/null +++ b/api/speech-service/constants.xsl @@ -0,0 +1,71 @@ + + + + + + + + + + + DBUS Introspection Data + + + + + + + + + + +
+

+ constants + + + + + + version + + + + +

+ + +
+
  • + + = +
  • +
    +
    +
    + +
  • + + + + + + +
  • +
    +
    diff --git a/api/speech-service/enum.xsl b/api/speech-service/enum.xsl new file mode 100644 index 0000000..4c093e8 --- /dev/null +++ b/api/speech-service/enum.xsl @@ -0,0 +1,32 @@ + + + + + + +/* This is an automatically generated file, do not edit */ + +enum GENIVI__Constants { + GENIVI__ = , +}; + + diff --git a/api/speech-service/genivi-speechservice-constants.xml b/api/speech-service/genivi-speechservice-constants.xml new file mode 100644 index 0000000..bee6d27 --- /dev/null +++ b/api/speech-service/genivi-speechservice-constants.xml @@ -0,0 +1,55 @@ + + + + + 1.0.0 (21-01-2014) + + This document defines the constants used in the Speech service APIs + + + + /* no instance of prompter available for member initialization purposes. */ + /* success status, client is connected */ + /* currently a connection with the given priority is not possible. */ + /* notification that after a rejected prompt, a new attempt would be successful */ + /* while connecting to service */ + /* client is paused */ + /* client is disconnected */ + /* max value shall be error checked */ + + /* reserved for internal Navigation application */ + /* reserved for internal Reader application */ + /* reserved for connections of generic application with high priority */ + /* reserved for connections of generic application with medium priority */ + /* reserved for connections of generic application with low priority */ + /* max value shall be error checked */ + + /* activates preprocessing rules for Dialog context */ + /* activates preprocessing rules for Navigation context */ + /* resets preprocessing rules */ + /* activates preprocessing rules for Reader context */ + /* max value shall be error checked */ + + /* no instance of prompter available for member initialization purposes. */ + /* chunk was rejected because chunk doesn't fit into buffer */ + /* was added, but less than n% space missing. The client should consider delaying further additions. There is a risk successive chunk additions will not be heard and return an error. */ + /* the chunk was added, and there is enough memory for more chunks available */ + /* max value shall be error checked */ + + /* no instance of prompter available for member initialization purposes. */ + /* prompter is not ready (startup , language change) */ + /* prompter is active */ + /* prompter was aborted */ + /* marker reached */ + /* prompter in idle state */ + /* queue not empty, new chunk arrived */ + /* prompter finished speaking */ + /* prompting failed */ + /* max value shall be error checked */ + + diff --git a/api/speech-service/genivi-speechservice-speechoutput.xml b/api/speech-service/genivi-speechservice-speechoutput.xml new file mode 100644 index 0000000..35838c3 --- /dev/null +++ b/api/speech-service/genivi-speechservice-speechoutput.xml @@ -0,0 +1,122 @@ + + + + + + + 0.1 + + + getVersion = This method returns the API version implemented by the content access module. + + + + version (of type Version) = . + Version struct[versionMajor, versionMinor, versionMicro, date] = version. + 0: Version.versionMajor ('q') = when the major changes, then backward compatibility with previous releases is not granted. + 1: Version.versionMinor ('q') = when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added). + 2: Version.versionMicro ('q') = when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications). + 3: Version.date ('s') = release date (e.g. 21-06-2011). + + + + + + openPrompter = Must be called to open a SpeechOutputService session and to get the audio connection. + + + + connectionType (of type ConnectionType) = Sets the Audio connection that should be used for the prompter application. + enum[CT_NAVIGATION (null), CT_READER (null), CT_GEN_HIGH (null), CT_GEN_MEDIUM (null), CT_GEN_LOW (null), CT_MAX (null)] + + + + + preProcessingType (of type PreProcessingType) = Sets the text normaization mode and which active prompt data base will be activated. + enum[PPT_DIALOG (null), PPT_NAVIGATION (null), PPT_NONE (null), PPT_READER (null), PPT_MAX (null)] + + + + + + addTextChunk = The prompter must be opened to trigger the playback of the provided prompt. + The prompt length must not exceed the length of a PromptChunk buffer. + Synthesizes the provided text or if using the escape sequence of the engine supplier a wave file in a supported sampling rate is provided, the system will back back also wave files. + The text will be normalized using the context identifier provided to openprompter. This applies to matching prerecorded files as well as the synthesis of number and words that are matched to a lexical dictionary. + The synthesize will start if the prompter is idle, if the prompter is already playing the playback will be delayed until all previously added text chunks are played back. For every text chunk provided a notification will be send. + + + + chunk (of type Chunk) = String containing the prompt to play. + lineComment to be defined + + + + + chunkID (of type ChunkID) = Index of the added prompt, zero based. + lineComment to be defined + + + + + + abortPrompter = A prompt must be playing to perform an abort action. If no prompting operation in progress there will be no reaction of the system. + + + + + closePrompter = The prompter is closed after the last text chunk submitted has finished playing. + + + + + notifyConnectionStatus = Notifies the connection status + + + + connectionStatus (of type ConnectionStatus) = Client connection status. + enum[CS_UNKNOWN (null), CS_ESTABLISHED (null), CS_REFUSED (null), CS_POSSIBLE (null), CS_PENDING (null), CS_PAUSED (null), CS_TERMINATED (null), CS_MAX (null)] + + + + + + notifyMarkerReached = Notifies the last reached marker. + + + + chunkID (of type ChunkID) = ID of the processed chunk. + lineComment to be defined + + + + + marker (of type Marker) = String with the name of the reached marker (if TTS engine supports inserting bookmarks with a name). + lineComment to be defined + + + + + + notifyQueueStatus = Notifies the queue status. + + + + queueStatus (of type QueueStatus) = Fill status of the text buffer. + enum[QS_UNKNOWN (null), QS_FULL (null), QS_HIGH_FILL (null), QS_LOW_FILL (null), QS_MAX (null)] + + + + + + notifyTTSStatus = Notifies the TTS engine status. + + + + ttsStatus (of type TtsStatus) = Current status of the TTS. + enum[TS_UNKNOWN (null), TS_NOT_INITIALIZED (null), TS_ACTIVE (null), TS_ABORTED (null), TS_MARKER (null), TS_IDLE (null), TS_ENQUEUED (null), TS_FINISHED (null), TS_FAILED (null), TS_MAX (null)] + + + + + diff --git a/api/speech-service/introspect.xsd b/api/speech-service/introspect.xsd new file mode 100644 index 0000000..76ed7ef --- /dev/null +++ b/api/speech-service/introspect.xsd @@ -0,0 +1,147 @@ + + + + + + DTD for D-Bus Introspection data + + (C) 2005-02-02 David A. Wheeler; released under + the D-Bus licenses, + GNU GPL version 2 (or greater) and AFL 1.1 (or + greater) + + see D-Bus specification for documentation + + Method arguments SHOULD include "direction", + while + signal and error arguments SHOULD not (since there's no point). + The + DTD format can't express that subtlety. + + Generic metadata + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AKA "attribute" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/speech-service/introspect.xsl b/api/speech-service/introspect.xsl new file mode 100644 index 0000000..29cc34c --- /dev/null +++ b/api/speech-service/introspect.xsl @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + DBUS Introspection Data + + + + + + +
    +

    + interface + + + + + + version + + + + +

    +
      + +
    +
      + + + +
      +
    • + + [] + + + [] + + + + + + + + + + + + + + + + + + +
        + + + +
        + +
      • + + + + + + + out + + + in + + + + + + + + + + + + +
      • +
        +
        + + +
        +
      +
    • +
      +
    +
    +
    + + +
    + +
  • + annotation + + + + = + + + +
  • +
    + +
  • + + + + + + +
  • +
    + +
  • + + error + + + + + + + +
    +
  • +
    +
    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 @@ + + 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 +# +# \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: +# +# , , +# +# @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 +* +* \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: +* +* , , +* +* @licence end@ +*/ +#include +#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); +} -- cgit v1.2.1