Skip to content
Snippets Groups Projects
Commit d455c1e7 authored by Alessandro Simovic's avatar Alessandro Simovic Committed by Beat Küng
Browse files

libtunes: Repeating tunes can be interrupted without override

Otherwise the only way of interrupting a repeated tune would be with the override flag, which should only be used rarely.
Now repeating tunes have lowest priority, followed by one-shot tunes, followed by anything with an override flag.
parent 34836a2b
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,15 @@ void Tunes::config_tone(bool repeat_flag)
int Tunes::set_control(const tune_control_s &tune_control)
{
bool reset_playing_tune = false;
_repeat = false;
// Only reset these flags if the new tune will actually be played.
// Note that repeated tunes can always be interrupted, even without the
// override flag.
if (_repeat || _tune == nullptr || tune_control.tune_override) {
_repeat = false;
_using_custom_msg = false;
_tune = nullptr;
}
if (tune_control.tune_id < _default_tunes_size) {
switch (tune_control.tune_id) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment