1
0
Fork 0

Inititialize members in class declaration

Also added initializers for previously unintialized members.
This commit is contained in:
Jonathan Vander Mey 2021-06-12 19:04:13 -04:00 committed by JF002
parent d13b0a7ec5
commit 8031cd1b40
2 changed files with 12 additions and 22 deletions

View file

@ -111,16 +111,6 @@ Pinetime::Controllers::MusicService::MusicService(Pinetime::System::SystemTask&
serviceDefinition[0] = { serviceDefinition[0] = {
.type = BLE_GATT_SVC_TYPE_PRIMARY, .uuid = &msUuid.u, .characteristics = characteristicDefinition}; .type = BLE_GATT_SVC_TYPE_PRIMARY, .uuid = &msUuid.u, .characteristics = characteristicDefinition};
serviceDefinition[1] = {0}; serviceDefinition[1] = {0};
artistName = "Waiting for";
albumName = "";
trackName = "track information..";
playing = false;
repeat = false;
shuffle = false;
playbackSpeed = 1.0f;
trackProgress = 0;
trackLength = 0;
} }
void Pinetime::Controllers::MusicService::Init() { void Pinetime::Controllers::MusicService::Init() {

View file

@ -69,23 +69,23 @@ namespace Pinetime {
struct ble_gatt_chr_def characteristicDefinition[14]; struct ble_gatt_chr_def characteristicDefinition[14];
struct ble_gatt_svc_def serviceDefinition[2]; struct ble_gatt_svc_def serviceDefinition[2];
uint16_t eventHandle; uint16_t eventHandle {};
std::string artistName; std::string artistName {"Waiting for"};
std::string albumName; std::string albumName {};
std::string trackName; std::string trackName {"track information.."};
bool playing; bool playing {false};
int trackProgress; int trackProgress {0};
int trackLength; int trackLength {0};
int trackNumber; int trackNumber {};
int tracksTotal; int tracksTotal {};
float playbackSpeed; float playbackSpeed {1.0f};
bool repeat; bool repeat {false};
bool shuffle; bool shuffle {false};
Pinetime::System::SystemTask& m_system; Pinetime::System::SystemTask& m_system;
}; };