2009-12-01 23:31:48 +08:00
|
|
|
#ifndef __PLAYER_H__
|
|
|
|
#define __PLAYER_H__
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
|
|
|
|
/* music tag information structure */
|
|
|
|
struct tag_info
|
|
|
|
{
|
|
|
|
char title [40]; /* music title */
|
|
|
|
char artist[40]; /* music artist */
|
|
|
|
|
|
|
|
rt_uint32_t duration; /* music total duration (second) */
|
|
|
|
rt_uint32_t position; /* music current position (second) */
|
|
|
|
|
|
|
|
rt_uint32_t bit_rate; /* bit rate */
|
|
|
|
rt_uint32_t sampling; /* sampling */
|
|
|
|
rt_uint32_t data_start; /* start position of data */
|
|
|
|
};
|
|
|
|
|
|
|
|
enum PLAYER_CMD
|
|
|
|
{
|
|
|
|
PLAYER_CMD_START,
|
|
|
|
PLAYER_CMD_STOP
|
|
|
|
};
|
|
|
|
|
|
|
|
enum PLAYER_MODE
|
|
|
|
{
|
|
|
|
PLAYER_STOP,
|
|
|
|
PLAYER_PLAY_FILE,
|
|
|
|
PLAYER_PLAY_RADIO,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum PLAYER_STEP
|
|
|
|
{
|
|
|
|
PLAYER_STEP_STOP,
|
|
|
|
PLAYER_STEP_PREV,
|
|
|
|
PLAYER_STEP_NEXT,
|
|
|
|
};
|
|
|
|
|
2010-02-18 07:56:49 +08:00
|
|
|
/* init player ui */
|
2009-12-01 23:31:48 +08:00
|
|
|
void player_ui_init(void);
|
2010-02-25 00:05:37 +08:00
|
|
|
void player_ui_freeze(void);
|
2009-12-01 23:31:48 +08:00
|
|
|
|
2010-02-18 07:56:49 +08:00
|
|
|
/* notification function, which invoked by player background thread */
|
2009-12-01 23:31:48 +08:00
|
|
|
void player_notify_play(void);
|
|
|
|
void player_notify_stop(void);
|
|
|
|
|
2010-02-18 07:56:49 +08:00
|
|
|
/* set player information */
|
2009-12-01 23:31:48 +08:00
|
|
|
void player_set_position(rt_uint32_t position);
|
2010-02-18 07:56:49 +08:00
|
|
|
void player_set_title(const char* title);
|
|
|
|
void player_set_buffer_status(rt_bool_t buffering);
|
2009-12-01 23:31:48 +08:00
|
|
|
|
2010-02-22 21:35:47 +08:00
|
|
|
/* get playing mode */
|
|
|
|
enum PLAYER_MODE player_get_mode(void);
|
|
|
|
|
2009-12-01 23:31:48 +08:00
|
|
|
#endif
|