player_ui.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef __PLAYER_H__
  2. #define __PLAYER_H__
  3. #include <rtthread.h>
  4. /* music tag information structure */
  5. struct tag_info
  6. {
  7. char title [40]; /* music title */
  8. char artist[40]; /* music artist */
  9. rt_uint32_t duration; /* music total duration (second) */
  10. rt_uint32_t position; /* music current position (second) */
  11. rt_uint32_t bit_rate; /* bit rate */
  12. rt_uint32_t sampling; /* sampling */
  13. rt_uint32_t data_start; /* start position of data */
  14. };
  15. enum PLAYER_CMD
  16. {
  17. PLAYER_CMD_START,
  18. PLAYER_CMD_STOP
  19. };
  20. enum PLAYER_MODE
  21. {
  22. PLAYER_STOP,
  23. PLAYER_PLAY_FILE,
  24. PLAYER_PLAY_RADIO,
  25. };
  26. enum PLAYER_STEP
  27. {
  28. PLAYER_STEP_STOP,
  29. PLAYER_STEP_PREV,
  30. PLAYER_STEP_NEXT,
  31. };
  32. /* init player ui */
  33. void player_ui_init(void);
  34. void player_ui_freeze(void);
  35. /* notification function, which invoked by player background thread */
  36. void player_notify_play(void);
  37. void player_notify_stop(void);
  38. /* set player information */
  39. void player_set_position(rt_uint32_t position);
  40. void player_set_title(const char* title);
  41. void player_set_buffer_status(rt_bool_t buffering);
  42. /* get playing mode */
  43. enum PLAYER_MODE player_get_mode(void);
  44. #endif