DummyTextToSpeech.cpp
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package RobotAPI::ArmarXObjects::DummyTextToSpeech
17 * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#include "DummyTextToSpeech.h"
24
26
27namespace armarx
28{
29 void
31 {
32 usingTopic(getProperty<std::string>("TextToSpeechTopicName").getValue());
33 offeringTopic(getProperty<std::string>("TextToSpeechStateTopicName").getValue());
34 }
35
36 void
38 {
39 textToSpeechStateTopicPrx = getTopic<TextToSpeechStateInterfacePrx>(
40 getProperty<std::string>("TextToSpeechStateTopicName").getValue());
41 textToSpeechStateTopicPrx->reportState(eIdle);
42 }
43
44 void
48
49 void
53
60
61 void
62 armarx::DummyTextToSpeech::reportText(const std::string& text, const Ice::Current&)
63 {
64 //ARMARX_IMPORTANT << "reportState";
65 textToSpeechStateTopicPrx->reportState(eStartedSpeaking);
66
67 ARMARX_IMPORTANT << "DummyTTS StartedSpeaking: " << text;
68
69 //ARMARX_IMPORTANT << "sleep";
70 sleep(1);
71 TimeUtil::SleepMS(text.length() * 10);
72 //ARMARX_IMPORTANT << "reportState";
73 ARMARX_IMPORTANT << "DummyTTS FinishedSpeaking";
74 textToSpeechStateTopicPrx->reportState(eFinishedSpeaking);
75 }
76
77 void
79 const Ice::StringSeq& params,
80 const Ice::Current&)
81 {
82 ARMARX_WARNING << "reportTextWithParams is not implemented";
83 }
84} // namespace armarx
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
Property< PropertyType > getProperty(const std::string &name)
void reportText(const std::string &text, const Ice::Current &) override
void reportTextWithParams(const std::string &text, const Ice::StringSeq &params, const Ice::Current &) override
void onDisconnectComponent() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
TopicProxyType getTopic(const std::string &name)
Returns a proxy of the specified topic.
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
static void SleepMS(float milliseconds)
Definition TimeUtil.h:203
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
Definition Logging.h:190
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:193
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.