libtunes: (bugfix) sending a custom msg tune overrides everything

Custom msg tune can override any tune playing, regardless of the tune_override flag.
This commit is contained in:
Alessandro Simovic 2018-01-23 09:21:07 +01:00 committed by Beat Küng
parent 2acd431fcb
commit f47443f283

View File

@ -92,10 +92,13 @@ int Tunes::set_control(const tune_control_s &tune_control)
if (tune_control.tune_id < _default_tunes_size) {
switch (tune_control.tune_id) {
case static_cast<int>(TuneID::CUSTOM):
_frequency = (unsigned)tune_control.frequency;
_duration = (unsigned)tune_control.duration;
_silence = (unsigned)tune_control.silence;
_using_custom_msg = true;
if (_tune == nullptr || tune_control.tune_override) {
_frequency = (unsigned)tune_control.frequency;
_duration = (unsigned)tune_control.duration;
_silence = (unsigned)tune_control.silence;
_using_custom_msg = true;
}
break;
// tunes that have a high priority