hv_mw_OsdEvent.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /*
  2. * @file hv_mw_OsdEvent.h
  3. * @brief Header file of osd event.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. * (+) Use Hv_Mw_OsdSetKeyState() to set a key's state.
  10. * (+) Use Hv_Mw_OsdGetKeyValue() to get current key value.
  11. * (+) Use Hv_Mw_OsdGetHoldKey() to get holding key value.
  12. * (+) Use Hv_Mw_OsdGetKeyIsRepeating() to get a key is repeating.
  13. * (+) Use Hv_Mw_OsdSetKeyRepeatPeriod() to set key repeat period.
  14. * (+) Use Hv_Mw_OsdSetKeyHoldPeriod() to set key hold period.
  15. * (+) Use Hv_Mw_OsdEventProc() to process osd event.
  16. * (+) Use Hv_Mw_OsdEventGetCloseSceneId() to get osd auto close scene id.
  17. * (+) Use Hv_Mw_OsdStartAutoCloseTimer() to start auto close timer.
  18. * (+) Use Hv_Mw_OsdStopAutoCloseTimer() to start auto close timer.
  19. * (+) Use Hv_Mw_OsdEventGetRefreshSceneId() to get osd auto refresh scene id.
  20. * (+) Use Hv_Mw_OsdStartAutoRefreshTimer() to start auto refresh timer.
  21. * (+) Use Hv_Mw_OsdStopAutoRefreshTimer() to stop auto refresh timer.
  22. * (+) Use Hv_Mw_OsdEventInit() to init osd event.
  23. * (+) Use Hv_Mw_OsdEventDeinit() to de-init osd event.
  24. *
  25. * @endverbatim
  26. * @author HiView SoC Software Team
  27. * @version 1.0.0
  28. * @date 2022-09-01
  29. */
  30. #ifndef _HV_MW_OSD_EVENT_H
  31. #define _HV_MW_OSD_EVENT_H
  32. #include "hv_comm_Event.h"
  33. #include "hv_comm_Timer.h"
  34. #include "KeyboardConfig.h"
  35. typedef enum {
  36. KEY_STATE_HOLDABLE,
  37. KEY_STATE_REPEATABLE,
  38. KEY_STATE_DISABLE,
  39. } OsdKeyState;
  40. typedef enum
  41. {
  42. OSDEVT_CACHABLE,
  43. OSDEVT_CACHABLE_ONCE,
  44. OSDEVT_FORCE_PROCESS,
  45. OSDEVT_LOGOING_PROCESS,
  46. } OsdEventProp;
  47. /**
  48. * @brief 设置消息属性
  49. * @param[in] usEventId 消息序号
  50. * @param[in] enProp 消息属性
  51. * @param[in] bIsSet 是set,否则为clear
  52. */
  53. VOID Hv_Mw_OsdSetEventProp(USHORT16 usEventId, OsdEventProp enProp, BOOL bIsSet);
  54. /**
  55. * @brief 获取消息属性
  56. * @param[in] usEventId 消息序号
  57. * @param[in] enProp 消息属性
  58. */
  59. BOOL Hv_Mw_OsdGetEventProp(USHORT16 usEventId, OsdEventProp enProp);
  60. /**
  61. * @brief 设置按键状态
  62. * @param[in] enId 消息序号
  63. * @param[in] CHAR8 * 名称字符串
  64. */
  65. const CHAR8 *Hv_Mw_OsdGetEventName(OsdEventId enId);
  66. /**
  67. * @brief 设置按键状态
  68. * @param[in] enId 按键键值
  69. * @param[in] CHAR8 * 名称字符串
  70. */
  71. const CHAR8 *Hv_Mw_OsdGetKeyName(OsdEvtKeyValue enId);
  72. /**
  73. * @brief 设置按键状态
  74. * @param[in] eKey 按键键值
  75. * @param[in] eState 按键状态:可重复、可长按、禁用
  76. * @param[in] bIsSet 是否是set,否则为clear
  77. */
  78. VOID Hv_Mw_OsdSetKeyState(OsdEvtKeyValue eKey, OsdKeyState eState, BOOL bIsSet);
  79. /**
  80. * @brief 启用/禁用所有按键
  81. * @param[in] bEnable 使能
  82. */
  83. VOID Hv_Mw_OsdSetAllKeyEnable(BOOL bEnable);
  84. /**
  85. * @brief 获取当前的键值
  86. * @return OSD内部事件类型
  87. */
  88. OsdEvtKeyValue Hv_Mw_OsdGetKeyValue(VOID);
  89. /**
  90. * @brief 获取长按键的键值
  91. * @return OSD内部事件类型
  92. */
  93. OsdEvtKeyValue Hv_Mw_OsdGetHoldKey(VOID);
  94. /**
  95. * @brief 判断按键当前是否正在repeating
  96. * @param[in] eKey 按键键值
  97. * @return 按键是否正在repeating
  98. */
  99. BOOL Hv_Mw_OsdGetKeyIsRepeating(OsdEvtKeyValue enKey);
  100. /**
  101. * @brief 设置重复按键timer的周期
  102. * @param[in] uiPeriodMS 重复按键timer的周期(ms)
  103. */
  104. VOID Hv_Mw_OsdSetKeyRepeatPeriod(UINT32 uiPeriodMS);
  105. /**
  106. * @brief 设置长按按键timer的时长
  107. * @param[in] uiHoldTimeMS 长按按键timer的时长(ms)
  108. */
  109. VOID Hv_Mw_OsdSetKeyHoldPeriod(UINT32 uiHoldTimeMS);
  110. /**
  111. * @brief 设置长按某个按键timer的时长
  112. * @param[in] eKey 按键键值
  113. * @param[in] uiHoldTimeMS 长按按键timer的时长(ms)
  114. */
  115. VOID Hv_Mw_OsdSetOneKeyHoldPeriod(OsdEvtKeyValue enKey, UINT32 uiHoldTimeMS);
  116. /**
  117. * @brief 将来自外部EventHub的OSD事件类型转为OSD内部事件类型
  118. * @param[in] stEventMsg 来自外部EventHub的OSD事件类型
  119. */
  120. VOID Hv_Mw_OsdEventProc(OsdEvent *pstEventMsg);
  121. /**
  122. * @brief 启动自动关闭指定scene的timer
  123. * @param[in] ucSceneId 自动关闭的scene id
  124. * @param[in] uiMs 超时时间,单位:毫秒
  125. */
  126. VOID Hv_Mw_OsdStartAutoCloseTimerMs(UCHAR8 ucSceneId, UINT32 uiMs);
  127. /**
  128. * @brief 启动自动关闭指定scene的timer
  129. * @param[in] ucSceneId 自动关闭的scene id
  130. * @param[in] usSecond 超时时间,单位:秒
  131. */
  132. VOID Hv_Mw_OsdStartAutoCloseTimer(UCHAR8 ucSceneId, USHORT16 usSecond);
  133. /**
  134. * @brief 停止自动关闭指定scene的timer
  135. * @param[in] ucSceneId 自动关闭的scene id
  136. */
  137. VOID Hv_Mw_OsdStopAutoCloseTimer(UCHAR8 ucSceneId);
  138. /**
  139. * @brief 启动自动刷新指定scene的timer
  140. * @param[in] ucSceneId 自动刷新的scene id
  141. * @param[in] uiTimeoutMs 超时时间,单位:毫秒
  142. */
  143. VOID Hv_Mw_OsdStartAutoRefreshTimer(UCHAR8 ucSceneId, UINT32 uiTimeoutMs);
  144. /**
  145. * @brief 停止自动刷新指定scene的timer
  146. * @param[in] ucSceneId 自动刷新的scene id
  147. */
  148. VOID Hv_Mw_OsdStopAutoRefreshTimer(UCHAR8 ucSceneId);
  149. /**
  150. * @brief 开始Logo显示的timer
  151. * @param[in] uiMs 时间:毫秒
  152. */
  153. VOID Hv_Mw_OsdStartLogoTimerMs(UINT32 uiMs);
  154. /**
  155. * @brief 开始Logo显示的timer
  156. * @param[in] ucSceneId 自动刷新的scene id
  157. */
  158. VOID Hv_Mw_OsdStartLogoTimer(USHORT16 usSecond);
  159. /**
  160. * @brief 停止自动刷新指定scene的timer
  161. */
  162. VOID Hv_Mw_OsdStopLogoTimer(VOID);
  163. /**
  164. * @brief 开始定时提醒的timer
  165. * @param[in] ucRemindId 定时提醒的id
  166. * @param[in] uiTimeoutMs 超时时间,单位:毫秒
  167. * @param[in] bRepeat 是否重复
  168. */
  169. VOID Hv_Mw_OsdStartReminderTimer(UCHAR8 ucRemindId, UINT32 uiTimeoutMs, BOOL bRepeat);
  170. /**
  171. * @brief 停止定时提醒的timer
  172. * @param[in] ucRemindId 定时提醒的id
  173. */
  174. VOID Hv_Mw_OsdStopReminderTimer(UCHAR8 ucRemindId);
  175. /**
  176. * @brief Osd Event相关数据初始化
  177. */
  178. VOID Hv_Mw_OsdEventInit(VOID);
  179. /**
  180. * @brief Event deinit
  181. */
  182. VOID Hv_Mw_OsdEventDeinit(VOID);
  183. #ifdef HV_SCALER_DEBUG_VERSION
  184. VOID Hv_Mw_OsdSetAutoCloseTimerEnable(BOOL bEnable);
  185. BOOL Hv_Mw_OsdIsMonkeyRunning(VOID);
  186. VOID Hv_Mw_OsdMonkeyTest(BOOL bStart);
  187. VOID Hv_Mw_OsdStartAutoTestTimer(UINT32 uiTimeoutMs);
  188. VOID Hv_Mw_OsdStopAutoTestTimer(VOID);
  189. #endif
  190. #endif