24 #include <interfaces/SpeechSynthInterface.h> 26 #include <core/exceptions/software.h> 47 SpeechSynthInterface::SpeechSynthInterface() : Interface()
49 data_size =
sizeof(SpeechSynthInterface_data_t);
51 data = (SpeechSynthInterface_data_t *)
data_ptr;
59 unsigned char tmp_hash[] = {0x28, 0x11, 0x46, 0x87, 0xb1, 0x65, 0x92, 0x96, 0xe6, 0x6e, 0x18, 0x8a, 0xdc, 0x8, 0xb0, 0x69};
64 SpeechSynthInterface::~SpeechSynthInterface()
100 strncpy(data->text, new_text,
sizeof(data->text));
137 data->msgid = new_msgid;
172 data->final = new_final;
187 return data->duration;
211 data->duration = new_duration;
219 if ( strncmp(
"SayMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
223 "message type for this interface type.", type);
239 memcpy(data, oi->data,
sizeof(SpeechSynthInterface_data_t));
264 data = (SayMessage_data_t *)
data_ptr;
266 strncpy(data->text, ini_text, 1024);
275 data = (SayMessage_data_t *)
data_ptr;
294 data = (SayMessage_data_t *)
data_ptr;
330 strncpy(data->text, new_text,
sizeof(data->text));
void * data_ptr
Pointer to memory that contains local data.
void set_duration(const float new_duration)
Set duration value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
void set_final(const bool new_final)
Set final value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_text() const
Get maximum length of text value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
size_t maxlenof_duration() const
Get maximum length of duration value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
void set_hash(unsigned char *ihash)
Set hash.
const char * type() const
Get message type.
void set_text(const char *new_text)
Set text value.
Fawkes library namespace.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
size_t maxlenof_text() const
Get maximum length of text value.
char * text() const
Get text value.
SayMessage Fawkes BlackBoard Interface Message.
Base class for all Fawkes BlackBoard interfaces.
size_t maxlenof_final() const
Get maximum length of final value.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
uint32_t msgid() const
Get msgid value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
void add_messageinfo(const char *name)
Add an entry to the message info list.
bool data_changed
Indicator if data has changed.
virtual Message * clone() const
Clone this message.
bool is_final() const
Get final value.
void set_text(const char *new_text)
Set text value.
char * text() const
Get text value.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0)
Add an entry to the info list.
virtual Message * create_message(const char *type) const
Create message based on type name.
float duration() const
Get duration value.
const char * type() const
Get type of interface.
32 bit unsigned integer field
SpeechSynthInterface Fawkes BlackBoard Interface.