libtunes: allow custom tune (id 0) to be used to stop playback.

Override flag must still be set to true!
This commit is contained in:
Alessandro Simovic
2018-03-26 14:54:23 +02:00
committed by Beat Küng
parent 2cf93df918
commit 34836a2b21
2 changed files with 16 additions and 4 deletions
+1
View File
@@ -94,6 +94,7 @@ int Tunes::set_control(const tune_control_s &tune_control)
switch (tune_control.tune_id) {
case static_cast<int>(TuneID::CUSTOM):
if (_tune == nullptr || tune_control.tune_override) {
_tune = nullptr; // remove tune in case of override
_frequency = (unsigned)tune_control.frequency;
_duration = (unsigned)tune_control.duration;
_silence = (unsigned)tune_control.silence;