volume_manager.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright (c) 2018 Actions Semiconductor Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file volume manager interface
  8. */
  9. #ifndef __VOLUME_MANGER_H__
  10. #define __VOLUME_MANGER_H__
  11. typedef enum
  12. {
  13. SYNC_TYPE_TWS,
  14. SYNC_TYPE_AVRCP,
  15. SYNC_TYPE_HFP,
  16. SYNC_TYPE_ROLE_SWITCH,
  17. }sync_type_e;
  18. /**
  19. * @defgroup volume_manager_apis App volume Manager APIs
  20. * @{
  21. */
  22. /**
  23. * @brief get system volume value
  24. *
  25. * This routine calls get system volume ,can't called by ISR.
  26. *
  27. * @return current system volume
  28. */
  29. int system_volume_get(int stream_type);
  30. /**
  31. * @brief set system volume value
  32. *
  33. * This routine calls set system volume ,can't called by ISR.
  34. * @param stream_type volume of stream type
  35. * @param volume the volume level user want to set, rang is 0-40
  36. * @param display display or not display volume
  37. *
  38. * @return 0 set success
  39. * @return others set failed
  40. */
  41. int system_volume_set(int stream_type, int volume, bool display);
  42. /**
  43. * @brief set system volume down decrement
  44. *
  45. * This routine calls set system volume down decrment , can't called by ISR.
  46. * @param decrement the volume level user want to down, rang is 0-40
  47. *
  48. *
  49. * @return 0 set success
  50. * @return others set failed
  51. */
  52. int system_volume_down(int stream_type, int decrement);
  53. /**
  54. * @brief set system volume up increment
  55. *
  56. * This routine calls set system volume up increment , can't called by ISR.
  57. * @param decrement the volume level user want to up,rang is 0-40
  58. *
  59. *
  60. * @return 0 set success
  61. * @return others set failed
  62. */
  63. int system_volume_up(int stream_type, int increment);
  64. /**
  65. * @brief remote volume sync
  66. *
  67. * This routine calls remote volume sync
  68. *
  69. *
  70. * @return N/A
  71. */
  72. void system_volume_sync_remote_to_device(uint32_t stream_type, uint32_t volume);
  73. /**
  74. * @} end defgroup volume_manager_apis
  75. */
  76. #endif