Browse Source

libtunes: _repeat was uninitialized. Defaulting to false now.

Bugfix: This fixes a bug where libtunes might indicate that there are more tones to play even after the last note of a tune.
sbg
Alessandro Simovic 7 years ago committed by Beat Küng
parent
commit
2cf93df918
  1. 1
      src/lib/tunes/tunes.cpp
  2. 2
      src/lib/tunes/tunes.h

1
src/lib/tunes/tunes.cpp

@ -88,6 +88,7 @@ void Tunes::config_tone(bool repeat_flag) @@ -88,6 +88,7 @@ void Tunes::config_tone(bool repeat_flag)
int Tunes::set_control(const tune_control_s &tune_control)
{
bool reset_playing_tune = false;
_repeat = false;
if (tune_control.tune_id < _default_tunes_size) {
switch (tune_control.tune_id) {

2
src/lib/tunes/tunes.h

@ -96,7 +96,7 @@ private: @@ -96,7 +96,7 @@ private:
static const char *_default_tunes[];
static const uint8_t _note_tab[];
static const unsigned int _default_tunes_size;
bool _repeat; ///< if true, tune restarts at end
bool _repeat = false; ///< if true, tune restarts at end
const char *_tune = nullptr; ///< current tune string
const char *_next = nullptr; ///< next note in the string

Loading…
Cancel
Save