Background
Just like QtAssiant, it's deserved to collection an user guide while learning GuiLite, so I prepare to follow the source code folder tree strcution to make an Assiant, and then name it GtAssiant.
Base on Tag V1.1
Core
api.h
audio.h
Detail---->Core--->api.h
void log_out(const char* log) // save msg into log
Detail---->Core--->audio.h
c_audio class: Create a thread and monitor variant, while the variant equal critical condition, play sound 'heart_beat.wav' . It's thread safe.
enum AUDIO_TYPE
{
AUDIO_HEART_BEAT,
AUDIO_ALARM,
AUDIO_MAX
};
static int play(AUDIO_TYPE type) | save variant-type into memory |
Detail---->Core--->msg.h
typedef struct
{
unsigned int dwMsgId;
unsigned int dwParam1;
unsigned int dwParam2;
}MSG_INFO;
int read_usr_msg(MSG_INFO* msg);
int write_usr_msg(MSG_INFO* msg);
c_fifo class | It's a circule link list, use to save unsigned char buffer.It's thread safe. |
c_fifo(const char* name) | |
int read(void* buf, int len) | Read specific length data from buffer |
int write(void* buf, int len) | Write specific length data into buffer, maximum save length is 1024 |
c_hid_pipe class | It's a circule link list, use to save unsigned char buffer.It's thread safe. |
static int read_hid_msg() | Read msg from memory by c_fifo class |
static int write_hid_msg(MSG_INFO* msg, unsigned int display_id = 0) | Write msg into memory by c_fifo class |