00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __INTERFACES_SPEECHSYNTHINTERFACE_H_
00025 #define __INTERFACES_SPEECHSYNTHINTERFACE_H_
00026
00027 #include <interface/interface.h>
00028 #include <interface/message.h>
00029 #include <interface/field_iterator.h>
00030
00031 namespace fawkes {
00032
00033 class SpeechSynthInterface : public Interface
00034 {
00035
00036 INTERFACE_MGMT_FRIENDS(SpeechSynthInterface)
00037
00038 public:
00039
00040
00041 private:
00042 #pragma pack(push,4)
00043
00044 typedef struct {
00045 int64_t timestamp_sec;
00046 int64_t timestamp_usec;
00047 char text[1024];
00048
00049
00050 uint32_t msgid;
00051
00052
00053
00054 bool final;
00055
00056
00057 float duration;
00058
00059
00060
00061
00062 } SpeechSynthInterface_data_t;
00063 #pragma pack(pop)
00064
00065 SpeechSynthInterface_data_t *data;
00066
00067 public:
00068
00069 class SayMessage : public Message
00070 {
00071 private:
00072 #pragma pack(push,4)
00073
00074 typedef struct {
00075 int64_t timestamp_sec;
00076 int64_t timestamp_usec;
00077 char text[1024];
00078
00079
00080 } SayMessage_data_t;
00081 #pragma pack(pop)
00082
00083 SayMessage_data_t *data;
00084
00085 public:
00086 SayMessage(const char * ini_text);
00087 SayMessage();
00088 ~SayMessage();
00089
00090 SayMessage(const SayMessage *m);
00091
00092 char * text() const;
00093 void set_text(const char * new_text);
00094 size_t maxlenof_text() const;
00095 virtual Message * clone() const;
00096 };
00097
00098 virtual bool message_valid(const Message *message) const;
00099 private:
00100 SpeechSynthInterface();
00101 ~SpeechSynthInterface();
00102
00103 public:
00104
00105 char * text() const;
00106 void set_text(const char * new_text);
00107 size_t maxlenof_text() const;
00108 uint32_t msgid() const;
00109 void set_msgid(const uint32_t new_msgid);
00110 size_t maxlenof_msgid() const;
00111 bool is_final() const;
00112 void set_final(const bool new_final);
00113 size_t maxlenof_final() const;
00114 float duration() const;
00115 void set_duration(const float new_duration);
00116 size_t maxlenof_duration() const;
00117 virtual Message * create_message(const char *type) const;
00118
00119 virtual void copy_values(const Interface *other);
00120 virtual const char * enum_tostring(const char *enumtype, int val) const;
00121
00122 };
00123
00124 }
00125
00126 #endif