From 6f45c0f669effacb535b8985396fe3b21a9a08f7 Mon Sep 17 00:00:00 2001 From: Avamander Date: Thu, 15 Oct 2020 22:45:53 +0300 Subject: [PATCH] Unified MusicStatus enum constant capitalization with others --- src/components/ble/MusicService.h | 4 ++-- src/displayapp/screens/Music.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/ble/MusicService.h b/src/components/ble/MusicService.h index 00cffb27..b365909b 100644 --- a/src/components/ble/MusicService.h +++ b/src/components/ble/MusicService.h @@ -66,8 +66,8 @@ namespace Pinetime { static const char EVENT_MUSIC_VOLDOWN = 0x06; enum MusicStatus { - NOT_PLAYING = 0x00, - PLAYING = 0x01 + NotPlaying = 0x00, + Playing = 0x01 }; private: static constexpr uint8_t msId[2] = {0x00, 0x01}; diff --git a/src/displayapp/screens/Music.cpp b/src/displayapp/screens/Music.cpp index 63e2e276..12c7e5ad 100644 --- a/src/displayapp/screens/Music.cpp +++ b/src/displayapp/screens/Music.cpp @@ -174,10 +174,10 @@ bool Music::Refresh() { UpdateLength(); } - if (playing == Pinetime::Controllers::MusicService::MusicStatus::PLAYING) { + if (playing == Pinetime::Controllers::MusicService::MusicStatus::Playing) { lv_label_set_text(txtPlayPause, "||"); if (xTaskGetTickCount() - 1024 >= lastIncrement) { - + if (frameB) { lv_img_set_src(imgDiscAnim, &disc_f_1); } else { @@ -238,17 +238,17 @@ void Music::OnObjectEvent(lv_obj_t *obj, lv_event_t event) { } else if (obj == btnPrev) { musicService.event(Controllers::MusicService::EVENT_MUSIC_PREV); } else if (obj == btnPlayPause) { - if (playing == Pinetime::Controllers::MusicService::MusicStatus::PLAYING) { + if (playing == Pinetime::Controllers::MusicService::MusicStatus::Playing) { musicService.event(Controllers::MusicService::EVENT_MUSIC_PAUSE); - + // Let's assume it stops playing instantly - playing = Controllers::MusicService::NOT_PLAYING; + playing = Controllers::MusicService::NotPlaying; } else { musicService.event(Controllers::MusicService::EVENT_MUSIC_PLAY); - + // Let's assume it starts playing instantly // TODO: In the future should check for BT connection for better UX - playing = Controllers::MusicService::PLAYING; + playing = Controllers::MusicService::Playing; } } else if (obj == btnNext) { musicService.event(Controllers::MusicService::EVENT_MUSIC_NEXT);