24 #include <interfaces/SpeechSynthInterface.h> 26 #include <core/exceptions/software.h> 49 SpeechSynthInterface::SpeechSynthInterface() : Interface()
51 data_size =
sizeof(SpeechSynthInterface_data_t);
53 data = (SpeechSynthInterface_data_t *)
data_ptr;
61 unsigned char tmp_hash[] = {0x28, 0x11, 0x46, 0x87, 0xb1, 0x65, 0x92, 0x96, 0xe6, 0x6e, 0x18, 0x8a, 0xdc, 0x8, 0xb0, 0x69};
66 SpeechSynthInterface::~SpeechSynthInterface()
102 strncpy(data->text, new_text,
sizeof(data->text));
139 data->msgid = new_msgid;
174 data->final = new_final;
189 return data->duration;
213 data->duration = new_duration;
221 if ( strncmp(
"SayMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
225 "message type for this interface type.", type);
241 memcpy(data, oi->data,
sizeof(SpeechSynthInterface_data_t));
266 data = (SayMessage_data_t *)
data_ptr;
268 strncpy(data->text, ini_text, 1024);
277 data = (SayMessage_data_t *)
data_ptr;
296 data = (SayMessage_data_t *)
data_ptr;
332 strncpy(data->text, new_text,
sizeof(data->text));
size_t maxlenof_final() const
Get maximum length of final value.
void * data_ptr
Pointer to memory that contains local data.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
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.
uint32_t msgid() const
Get msgid value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
virtual Message * clone() const
Clone this message.
void set_hash(unsigned char *ihash)
Set hash.
void set_text(const char *new_text)
Set text value.
virtual Message * create_message(const char *type) const
Create message based on type name.
Fawkes library namespace.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
char * text() const
Get text value.
SayMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
Base class for all Fawkes BlackBoard interfaces.
void set_msgid(const uint32_t new_msgid)
Set 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.
const char * type() const
Get type of interface.
size_t maxlenof_text() const
Get maximum length of text value.
void set_text(const char *new_text)
Set text value.
bool is_final() const
Get final value.
size_t maxlenof_text() const
Get maximum length of 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, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
float duration() const
Get duration value.
const char * type() const
Get message type.
32 bit unsigned integer field
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
size_t maxlenof_duration() const
Get maximum length of duration value.
SpeechSynthInterface Fawkes BlackBoard Interface.