Fawkes API Fawkes Development Version
synth_thread.h
1
2/***************************************************************************
3 * synth_thread.h - Festival synthesis thread
4 *
5 * Created: Tue Oct 28 14:31:58 2008
6 * Copyright 2006-2008 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Library General Public License for more details.
19 *
20 * Read the full text in the LICENSE.GPL file in the doc directory.
21 */
22
23#ifndef _PLUGINS_FESTIVAL_SYNTH_THREAD_H_
24#define _PLUGINS_FESTIVAL_SYNTH_THREAD_H_
25
26#include <aspect/blackboard.h>
27#include <aspect/blocked_timing.h>
28#include <aspect/clock.h>
29#include <aspect/configurable.h>
30#include <aspect/logging.h>
31#include <blackboard/interface_listener.h>
32#include <core/threading/thread.h>
33
34#include <string>
35
36namespace fawkes {
37class SpeechSynthInterface;
38}
39
46{
47public:
49
50 virtual void init();
51 virtual void finalize();
52 virtual void once();
53 virtual void loop();
54
55 void say(const char *text);
57 fawkes::Message * message) noexcept;
58
59 /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
60protected:
61 virtual void
63 {
64 Thread::run();
65 }
66
67private:
68 fawkes::SpeechSynthInterface *speechsynth_if_;
69
70 std::string cfg_voice_;
71 std::string cfg_extra_code_;
72};
73
74#endif
Festival Synthesis Thread.
Definition: synth_thread.h:46
virtual bool bb_interface_message_received(fawkes::Interface *interface, fawkes::Message *message) noexcept
BlackBoard message received notification.
virtual void loop()
Code to execute in the thread.
virtual void once()
Execute an action exactly once.
void say(const char *text)
Say something.
FestivalSynthThread()
Constructor.
virtual void init()
Initialize the thread.
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: synth_thread.h:62
virtual void finalize()
Finalize the thread.
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
BlackBoard interface listener.
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:34
Thread aspect to access configuration data.
Definition: configurable.h:33
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
Thread aspect to log output.
Definition: logging.h:33
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
SpeechSynthInterface Fawkes BlackBoard Interface.
Thread class encapsulation of pthreads.
Definition: thread.h:46
Fawkes library namespace.