wav_player_view.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <gui/view.h>
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. typedef struct WavPlayerView WavPlayerView;
  7. typedef enum {
  8. WavPlayerCtrlVolUp,
  9. WavPlayerCtrlVolDn,
  10. WavPlayerCtrlMoveL,
  11. WavPlayerCtrlMoveR,
  12. WavPlayerCtrlOk,
  13. WavPlayerCtrlBack,
  14. } WavPlayerCtrl;
  15. typedef void (*WavPlayerCtrlCallback)(WavPlayerCtrl ctrl, void* context);
  16. WavPlayerView* wav_player_view_alloc();
  17. void wav_player_view_free(WavPlayerView* wav_view);
  18. View* wav_player_view_get_view(WavPlayerView* wav_view);
  19. void wav_player_view_set_volume(WavPlayerView* wav_view, float volume);
  20. void wav_player_view_set_start(WavPlayerView* wav_view, size_t start);
  21. void wav_player_view_set_end(WavPlayerView* wav_view, size_t end);
  22. void wav_player_view_set_current(WavPlayerView* wav_view, size_t current);
  23. void wav_player_view_set_play(WavPlayerView* wav_view, bool play);
  24. void wav_player_view_set_data(WavPlayerView* wav_view, uint16_t* data, size_t data_count);
  25. void wav_player_view_set_ctrl_callback(WavPlayerView* wav_view, WavPlayerCtrlCallback callback);
  26. void wav_player_view_set_context(WavPlayerView* wav_view, void* context);
  27. #ifdef __cplusplus
  28. }
  29. #endif