player_ui.h 1.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
#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,
};

40
/* init player ui */
41 42
void player_ui_init(void);

43
/* notification function, which invoked by player background thread */
44 45 46
void player_notify_play(void);
void player_notify_stop(void);

47
/* set player information */
48
void player_set_position(rt_uint32_t position);
49 50
void player_set_title(const char* title);
void player_set_buffer_status(rt_bool_t buffering);
51 52

#endif