Add start of music appliction

This commit is contained in:
Adam Pigg 2020-07-11 21:37:28 +01:00
parent 0bcaf9c22d
commit 7a1e6e6e5b
8 changed files with 17 additions and 4 deletions

View File

@ -336,6 +336,7 @@ list(APPEND SOURCE_FILES
DisplayApp/Screens/ScreenList.cpp DisplayApp/Screens/ScreenList.cpp
DisplayApp/Screens/Label.cpp DisplayApp/Screens/Label.cpp
DisplayApp/Screens/FirmwareUpdate.cpp DisplayApp/Screens/FirmwareUpdate.cpp
DisplayApp/Screens/Music.cpp
main.cpp main.cpp
drivers/St7789.cpp drivers/St7789.cpp
drivers/SpiNorFlash.cpp drivers/SpiNorFlash.cpp
@ -356,6 +357,7 @@ list(APPEND SOURCE_FILES
Components/Ble/DfuService.cpp Components/Ble/DfuService.cpp
Components/Ble/CurrentTimeService.cpp Components/Ble/CurrentTimeService.cpp
Components/Ble/AlertNotificationService.cpp Components/Ble/AlertNotificationService.cpp
Components/Ble/MusicService.cpp
drivers/Cst816s.cpp drivers/Cst816s.cpp
FreeRTOS/port.c FreeRTOS/port.c
FreeRTOS/port_cmsis_systick.c FreeRTOS/port_cmsis_systick.c

View File

@ -80,6 +80,7 @@ void NimbleController::Init() {
deviceInformationService.Init(); deviceInformationService.Init();
currentTimeClient.Init(); currentTimeClient.Init();
currentTimeService.Init(); currentTimeService.Init();
musicService.Init();
anService.Init(); anService.Init();

View File

@ -7,6 +7,7 @@
#include "CurrentTimeClient.h" #include "CurrentTimeClient.h"
#include "DfuService.h" #include "DfuService.h"
#include "CurrentTimeService.h" #include "CurrentTimeService.h"
#include "MusicService.h"
#include <host/ble_gap.h> #include <host/ble_gap.h>
namespace Pinetime { namespace Pinetime {
@ -35,6 +36,9 @@ namespace Pinetime {
uint16_t characteristicValueHandle, const ble_gatt_dsc *descriptor); uint16_t characteristicValueHandle, const ble_gatt_dsc *descriptor);
void StartDiscovery(); void StartDiscovery();
Pinetime::Controllers::MusicService& music() {return musicService;};
private: private:
static constexpr char* deviceName = "Pinetime-JF"; static constexpr char* deviceName = "Pinetime-JF";
Pinetime::System::SystemTask& systemTask; Pinetime::System::SystemTask& systemTask;
@ -49,6 +53,7 @@ namespace Pinetime {
AlertNotificationService anService; AlertNotificationService anService;
AlertNotificationClient alertNotificationClient; AlertNotificationClient alertNotificationClient;
CurrentTimeService currentTimeService; CurrentTimeService currentTimeService;
MusicService musicService;
uint8_t addrType; // 1 = Random, 0 = PUBLIC uint8_t addrType; // 1 = Random, 0 = PUBLIC
uint16_t connectionHandle; uint16_t connectionHandle;

View File

@ -15,6 +15,7 @@
#include <DisplayApp/Screens/Gauge.h> #include <DisplayApp/Screens/Gauge.h>
#include <DisplayApp/Screens/Brightness.h> #include <DisplayApp/Screens/Brightness.h>
#include <DisplayApp/Screens/ScreenList.h> #include <DisplayApp/Screens/ScreenList.h>
#include <DisplayApp/Screens/Music.h>
#include <Components/Ble/NotificationManager.h> #include <Components/Ble/NotificationManager.h>
#include <DisplayApp/Screens/FirmwareUpdate.h> #include <DisplayApp/Screens/FirmwareUpdate.h>
#include "../SystemTask/SystemTask.h" #include "../SystemTask/SystemTask.h"
@ -189,6 +190,7 @@ void DisplayApp::RunningState() {
case Apps::Meter: currentScreen.reset(new Screens::Meter(this)); break; case Apps::Meter: currentScreen.reset(new Screens::Meter(this)); break;
case Apps::Gauge: currentScreen.reset(new Screens::Gauge(this)); break; case Apps::Gauge: currentScreen.reset(new Screens::Gauge(this)); break;
case Apps::Brightness : currentScreen.reset(new Screens::Brightness(this, brightnessController)); break; case Apps::Brightness : currentScreen.reset(new Screens::Brightness(this, brightnessController)); break;
case Apps::Music : currentScreen.reset(new Screens::Music(this)); break;
} }
nextApp = Apps::None; nextApp = Apps::None;
} }

View File

@ -43,7 +43,7 @@ namespace Pinetime {
void Start(); void Start();
void PushMessage(Messages msg); void PushMessage(Messages msg);
enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness}; enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness, Music};
void StartApp(Apps app); void StartApp(Apps app);
void SetFullRefresh(FullRefreshDirections direction); void SetFullRefresh(FullRefreshDirections direction);

View File

@ -19,6 +19,7 @@ Gauge::Gauge(Pinetime::Applications::DisplayApp *app) : Screen(app) {
style.text.color = LV_COLOR_WHITE; style.text.color = LV_COLOR_WHITE;
style.line.color = LV_COLOR_RED; /*Line color after the critical value*/ style.line.color = LV_COLOR_RED; /*Line color after the critical value*/
/*Describe the color for the needles*/ /*Describe the color for the needles*/
needle_colors[0] = LV_COLOR_ORANGE; needle_colors[0] = LV_COLOR_ORANGE;

View File

@ -16,7 +16,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
screen->OnObjectEvent(obj, event, eventData); screen->OnObjectEvent(obj, event, eventData);
} }
static const char * btnm_map1[] = {"Meter", "Gauge", "Clock", "\n", "Soft\nversion", "App2", "Brightness", ""}; static const char * btnm_map1[] = {"Meter", "Music", "Clock", "\n", "Soft\nversion", "App2", "Brightness", ""};
Tile::Tile(DisplayApp* app) : Screen(app) { Tile::Tile(DisplayApp* app) : Screen(app) {
modal.reset(new Modal(app)); modal.reset(new Modal(app));
@ -166,7 +166,7 @@ void Tile::StartMeterApp() {
} }
void Tile::StartGaugeApp() { void Tile::StartGaugeApp() {
app->StartApp(DisplayApp::Apps::Gauge); app->StartApp(DisplayApp::Apps::Music);
running = false; running = false;
} }

View File

@ -35,6 +35,8 @@ namespace Pinetime {
void OnIdle(); void OnIdle();
Pinetime::Controllers::NimbleController& nimble() {return nimbleController;};
private: private:
TaskHandle_t taskHandle; TaskHandle_t taskHandle;
@ -74,4 +76,4 @@ namespace Pinetime {
void GoToRunning(); void GoToRunning();
}; };
} }
} }