From df63e3e28dbfe9957e3f2575ca723cd52ec42e6b Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Thu, 9 Oct 2025 16:50:19 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3=E9=9A=8F=E6=9C=BA=E6=95=85?= =?utf8?q?=E4=BA=8B=E6=A8=A1=E5=BC=8Fui=E6=96=87=E6=9C=AC=E4=B8=8D?= =?utf8?q?=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?utf8?q?=E9=9F=B3=E9=A2=91=E6=92=AD=E6=94=BE=E7=BB=93=E6=9D=9Fui?= =?utf8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeapp/nativeui/include/uiservice/ui_service.h | 1 + .../ln/nativeapp/nativeui/uiservice/src/ui_service.cpp | 7 +++++++ code/sdk/zhihui/leiniao/imsl_ln/ln_api.c | 10 ++++++++++ .../sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp | 5 +++++ code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h | 2 ++ 5 files changed, 25 insertions(+) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h index 97d2e735e..43e43ce9d 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/include/uiservice/ui_service.h @@ -64,6 +64,7 @@ typedef enum { HAND_DOWNLOAD_FILE_NOTIFY, // 下载文件通知 HAND_DOWNLOAD_SUCCESS_NOTIFY, // 下载成功通知 HAND_DOWNLOAD_FAIL_NOTIFY, // 下载失败通知 + HAND_AUDIO_PLAYBACK_END_NOTIFY, // 音频播放结束通知 MAX_NUM_HANDLER, } UiServiceMsgId; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp index 34e9fb5a2..2d1e1e217 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp @@ -100,6 +100,7 @@ static void HandTextUpdateNotify(Request *request); static void HandDownloadFileNotify(Request *request); static void HandDownloadSuccessNotify(Request *request); static void HandDownloadFailNotify(Request *request); +static void HandAudioPlaybackEndNotify(Request *request); // 消息处理程序项数组(每个消息类型对应一个处理函数,函数名以 Handle 开头) MsgHandlerEntry msgHandlers[] = { {HANDLE_JUMP_OTA_VIEW, HandleJumpOtaView}, @@ -116,6 +117,7 @@ MsgHandlerEntry msgHandlers[] = { {HAND_DOWNLOAD_FILE_NOTIFY,HandDownloadFileNotify}, {HAND_DOWNLOAD_SUCCESS_NOTIFY,HandDownloadSuccessNotify}, {HAND_DOWNLOAD_FAIL_NOTIFY,HandDownloadFailNotify}, + {HAND_AUDIO_PLAYBACK_END_NOTIFY,HandAudioPlaybackEndNotify}, }; /* -------------------------------------------------------------------------- */ void ScreenTurnOn(int32_t timeout) @@ -598,6 +600,11 @@ void HandDownloadFailNotify(Request *request) int type = *(int *)request->data; WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "HandDownloadFailNotify type = %d", type); } +// 音频播放结束通知 +void HandAudioPlaybackEndNotify(Request *request) +{ + WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "HandAudioPlaybackEndNotify msg_id = %d", request->msgId); +} /* -------------------------------------------------------------------------- */ #ifdef __cplusplus } diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c index 1bedf9dfd..38ffd0f60 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c @@ -672,6 +672,16 @@ void ln_ws_process_message(const ws_data_msg_t *data_msg, ws_command_t type) push_text_to_ui(data_msg->text_content); break; } + case WS_CMD_RANDOM_STORY_RESPONSE: + { + push_text_to_ui(data_msg->text_content); + break; + } + case WS_CMD_AUDIO_PLAYBACK_END: + { + push_audio_playback_end_notification(); + break; + } default: { printf("[WS] Unknown command=%s\n", cmd_str ? cmd_str : ""); diff --git a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp index 1e4b9c973..5d4da4d93 100644 --- a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp +++ b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp @@ -252,6 +252,11 @@ void push_download_progress_notification(int progress) { } +//通知音频播放结束了 +void push_audio_playback_end_notification(void) +{ + SendMsgToUIService(HAND_AUDIO_PLAYBACK_END_NOTIFY, 0, NULL, 0); +} #ifdef __cplusplus }; #endif \ No newline at end of file diff --git a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h index ebbcfe3ae..8fa6d05e9 100644 --- a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h +++ b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h @@ -98,6 +98,8 @@ void push_download_success_notification(int type); void push_download_fail_notification(int type); // 推送文件下载进度通知到UI void push_download_progress_notification(int progress); +//通知音频播放结束了 +void push_audio_playback_end_notification(void); #ifdef __cplusplus } #endif -- 2.17.1