From a9a5f6bc068d95810539b8e8dc62ad6eef302acd Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Mon, 14 Oct 2024 11:19:58 +0800 Subject: [PATCH] =?utf8?q?=E4=B8=BB=E7=95=8C=E9=9D=A2=E9=9F=B3=E4=B9=90?= =?utf8?q?=E6=92=AD=E6=94=BE=E5=99=A8=E9=9F=B3=E4=B9=90=E5=88=97=E8=A1=A8?= =?utf8?q?=E9=87=87=E7=94=A8=E9=98=9F=E5=88=97=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/player/include/PlayersModelC.h | 3 ++- .../wearable/fd230app/nativeui/player/src/PlayersModel.cpp | 6 ++++++ .../wearable/fd230app/nativeui/player/src/PlayersView.cpp | 3 ++- .../drivers/peripheral/utils/custom_fileoperate_service.c | 5 +++++ code/sdk/drivers/peripheral/utils/custom_utils.h | 1 + 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersModelC.h b/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersModelC.h index ee3a7484c..af325e910 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersModelC.h +++ b/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersModelC.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-08-17 14:06:51 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-17 14:08:25 + * @LastEditTime: 2024-10-14 11:02:57 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersModelC.h */ @@ -17,6 +17,7 @@ extern "C" #endif #include void stopPlayingMusic(void); + void custom_setUpListCase(void); #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp index aefa17d3e..b659e6ec8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp @@ -1127,6 +1127,12 @@ extern "C" OHOS::PlayersModel::GetInstance()->ClearActivateAudioInterrupt(); } + // 初始化音乐播放列表(会读取内存中文件名,然后设置到列表中) + void custom_setUpListCase(void) + { + OHOS::PlayersListGroup::GetInstance()->SetUpListCase(); + } + #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp index 322095cf3..32fb079ba 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersView.cpp @@ -1020,7 +1020,8 @@ namespace OHOS UpdatePlayerView(); /* -------------------------------------------------------------------------- */ - PlayersListGroup::GetInstance()->SetUpListCase(); + // PlayersListGroup::GetInstance()->SetUpListCase(); + do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_MUSICNAME_READ, nullptr, 0); PlayersModel::GetInstance()->PlayerInit(); SetTouchable(true); SetDraggable(true); diff --git a/code/sdk/drivers/peripheral/utils/custom_fileoperate_service.c b/code/sdk/drivers/peripheral/utils/custom_fileoperate_service.c index 6727198f1..fc360387b 100644 --- a/code/sdk/drivers/peripheral/utils/custom_fileoperate_service.c +++ b/code/sdk/drivers/peripheral/utils/custom_fileoperate_service.c @@ -43,6 +43,8 @@ #include "sleep/include/SleepModelC.h" +#include "player/include/PlayersModelC.h" + typedef struct { uint8_t cmd; @@ -129,6 +131,9 @@ static void custom_fileoperate_service_check_task(void const *arg) case CUSTOM_FILEOPERATE_MSG_TYPE_NAPDATA_READ: custom_read_nap_data(); break; + case CUSTOM_FILEOPERATE_MSG_TYPE_MUSICNAME_READ: + custom_setUpListCase(); + break; default: PRINT("Unknown CUSTOM_FILE_OPERATE_MSG cmd 0x%02X \r\n", mail.cmd); break; diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index 99a43ed0a..305df570e 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -242,6 +242,7 @@ errcode_t do_custom_cmd_service_check_msg(int cmd, void *params, int paramlen); #define CUSTOM_FILEOPERATE_MSG_TYPE_SLEEPDATA_READ 0x07 //读取睡眠时间 #define CUSTOM_FILEOPERATE_MSG_TYPE_NAPDATA_READ 0x08 //读取小睡数据 +#define CUSTOM_FILEOPERATE_MSG_TYPE_MUSICNAME_READ 0x09 //读取音乐文件名 errcode_t uapi_custom_fileoperate_service_init(void); errcode_t do_custom_fileoperate_service_check_msg(int cmd, void *params, int paramlen); -- 2.17.1