From c1e9d2578c7521b3b034b3159f147e8a557fe64a Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Tue, 14 Oct 2025 16:57:20 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E6=9C=AC=E5=85=A5?= =?utf8?q?=E9=98=9F=E5=A4=84=E7=90=86=EF=BC=8C=E5=AE=9E=E7=8E=B0=E9=9F=B3?= =?utf8?q?=E9=A2=91=E4=B8=8E=E6=96=87=E6=9C=AC=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../thunderbird/include/ThunderBirdMainView.h | 2 ++ .../thunderbird/include/ThunderBirdModel.h | 16 ++++++++++++++++ .../thunderbird/src/ThunderBirdDialogueView.cpp | 4 ++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h index f12354b28..dbf889890 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h @@ -121,6 +121,8 @@ namespace OHOS int16_t prevSubView_{0}; // 网络状态变化标志(-1 未初始化,0 无网络,1 有网络) int8_t lastNetworkOnline_{-1}; + // 防止GoBackToPreviousView循环跳转的标志位 + bool isGoingBack_{false}; UIImageView *curFace{nullptr}; DialVideoView *videoPlayer_ = nullptr; UILiteSurfaceView *surfaceView_ = nullptr; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h index fefbc18df..7ae09a379 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include "AppViewIDs.h" // #include "UiConfig.h" @@ -219,8 +221,18 @@ namespace OHOS // 恢复视频帧率 void HighFrequence(); + // 音频播放开始处理函数 + void HandleAudioPlaybackStart(); // 音频播放结束处理函数 void HandleAudioPlaybackEnd(); + // NPC表情变化处理函数 + void HandleNpcEmotionChange(const char* emotion); + + // 音频文本队列操作函数 + void EnqueueAudioText(const std::string& text); + void DequeueAndPushAudioText(); + bool HasAudioTextInQueue(); + void ClearAudioTextQueue(); // 对话状态显示相关函数 void SetCurrentExpression(const std::string& expression); @@ -242,6 +254,10 @@ namespace OHOS std::vector m_reminders; uint32_t m_nextReminderId; std::string m_currentTimeStr; + // 音频播放文本队列存储 + std::queue m_audioTextQueue; // 音频文本队列 + std::mutex m_textQueueMutex; // 文本队列互斥锁 + bool m_hasTextProcessing; // 是否有文本正在处理中 // OTA升级状态 int m_otaStatus; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp index e96726dab..30f7f15fe 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp @@ -254,8 +254,8 @@ namespace OHOS void ThunderBirdDialogueView::AudioPlaybackEnd() { if(!TextLabel || !TextLabel_Y) return; - TextLabel->SetText(""); - TextLabel_Y->SetText(""); + //TextLabel->SetText("还有什么想聊的吗?"); + //TextLabel_Y->SetText("还有什么想聊的吗?"); if(speakAnimator) {speakAnimator->Stop();} } } -- 2.17.1