From b4674aefb0d0580b0d6f2e0c27f3a2b49ead1226 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Tue, 12 Dec 2023 20:16:56 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E4=BC=A0=E8=BE=93=E9=80=9F?= =?utf8?q?=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wearable/nativeapp/nativeui/player/include/PlayersModel.h | 2 +- .../wearable/nativeapp/nativeui/player/src/PlayersModel.cpp | 1 + .../nativeapp/nativeui/player/src/PlayersPresenter.cpp | 1 + .../wearable/nativeapp/nativeui/player/src/PlayersView.cpp | 3 +++ code/sdk/drivers/chips/brandy/porting/uart/uart_porting.c | 2 +- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersModel.h b/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersModel.h index dceda4b35..ada17bab6 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersModel.h @@ -107,7 +107,7 @@ private: AudioInterrupt interrupt; std::shared_ptr playerInterruptListener{nullptr}; int64_t circleProgress{0}; - bool playButtonState{false}; + bool playButtonState{true}; void SequencePlayout(void); void RandomPlayout(void); void NextSong(int16_t index); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersModel.cpp index fbcd64fd8..cb0ba2e7a 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersModel.cpp @@ -254,6 +254,7 @@ int PlayersModel::PlayerInit(void) playersPresenter->SetTitleSetText(songName); playersPresenter->SetPlaybackProgress(circleProgress); playersPresenter->SetPlayerState(playButtonState); + PlayerStat(); return 0; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp index ffa5ac4ad..6744d6d73 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp @@ -501,6 +501,7 @@ void ButtonOnClickListener::PlayerButtonOnClick() int32_t connTgState = avrcp_tg_get_device_connect_state(BluetoothModel::GetInstance()->GetLastConnedAddr()); state = playersView->GetPlayerButtonState(); + if (PlayersModel::GetInstance()->GetPlayerCtr() == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PlayersModel::GetInstance()->GetPlayerCtr() nullptr"); return; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp index 1e0215f44..801f2697f 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp @@ -583,6 +583,9 @@ bool PlayersView::InitView(void) if (ret == OHOS_FAILURE) { return false; } + // 需要一个模拟信息,假装发生了按键点击,开始播放音乐 + // 调用 OnClick 回调函数来处理点击事件 + //playerButton.OnClick(,); // 遍历文件名到list链表 PlayersListGroup::GetInstance()->SetUpListCase(); PlayersModel::GetInstance()->PlayerInit(); diff --git a/code/sdk/drivers/chips/brandy/porting/uart/uart_porting.c b/code/sdk/drivers/chips/brandy/porting/uart/uart_porting.c index b6f409070..e308f60cc 100755 --- a/code/sdk/drivers/chips/brandy/porting/uart/uart_porting.c +++ b/code/sdk/drivers/chips/brandy/porting/uart/uart_porting.c @@ -221,7 +221,7 @@ static uart_config_t g_uart_config[UART_BUS_MAX_NUMBER] = { log_factory_at_callback, #endif { - .baud_rate = 500000, + .baud_rate = 2000000, .data_bits = UART_DATA_BIT_8, .parity = UART_PARITY_NONE, .stop_bits = UART_STOP_BIT_1, -- 2.17.1