raop_sink.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. This example code is in the Public Domain (or CC0 licensed, at your option.)
  3. Unless required by applicable law or agreed to in writing, this
  4. software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  5. CONDITIONS OF ANY KIND, either express or implied.
  6. */
  7. #ifndef RAOP_SINK_H
  8. #define RAOP_SINK_H
  9. #include <stdint.h>
  10. #include <stdarg.h>
  11. #define RAOP_SAMPLE_RATE 44100
  12. typedef enum { RAOP_SETUP, RAOP_STREAM, RAOP_PLAY, RAOP_FLUSH, RAOP_METADATA, RAOP_ARTWORK, RAOP_PROGRESS, RAOP_PAUSE, RAOP_STOP, RAOP_STALLED,
  13. RAOP_VOLUME, RAOP_TIMING, RAOP_PREV, RAOP_NEXT, RAOP_REW, RAOP_FWD,
  14. RAOP_VOLUME_UP, RAOP_VOLUME_DOWN, RAOP_RESUME, RAOP_TOGGLE } raop_event_t ;
  15. typedef bool (*raop_cmd_cb_t)(raop_event_t event, ...);
  16. typedef bool (*raop_cmd_vcb_t)(raop_event_t event, va_list args);
  17. typedef void (*raop_data_cb_t)(const u8_t *data, size_t len, u32_t playtime);
  18. /**
  19. * @brief init sink mode (need to be provided)
  20. */
  21. void raop_sink_init(raop_cmd_vcb_t cmd_cb, raop_data_cb_t data_cb);
  22. /**
  23. * @brief deinit sink mode (need to be provided)
  24. */
  25. void raop_sink_deinit(void);
  26. /**
  27. * @brief force disconnection
  28. */
  29. void raop_disconnect(void);
  30. #endif /* RAOP_SINK_H*/