Commit Graph

29 Commits

Author SHA1 Message Date
Alessandro Simovic 9d3dfb7864 libtunes: addressing comments of #9117 2018-03-26 14:54:23 +02:00
Alessandro Simovic 6e1c495268 libtunes: added TUNE_MAX_STRENGTH 2018-03-26 14:54:23 +02:00
Alessandro Simovic 80d80835a0 libtunes: fixed some type conversions and other minor changes 2018-03-26 14:54:23 +02:00
Alessandro Simovic 92b89368f1 libtunes: fixed playback of string melodies 2018-03-26 14:54:23 +02:00
Alessandro Simovic 7d9b09b5e5 libtunes: made logic in Tunes::set_control() more obvious 2018-03-26 14:54:23 +02:00
Alessandro Simovic 4e479b7f04 libtunes: renamed config_tone() to reset() 2018-03-26 14:54:23 +02:00
Alessandro Simovic 6ce839ea1e libtunes: added tone strength as state and output to libtunes
Since the tune library also contains logic how tunes can be overriden,
a user of the tunes library cannot know the strength of the current tune
without replicating some logic. Easy solution is to add strength to the
output of Tunes::get_next_tune().
2018-03-26 14:54:23 +02:00
Alessandro Simovic acdc81ea0a libtunes: cleanup / docs 2018-03-26 14:54:23 +02:00
Alessandro Simovic d455c1e7e1 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.
2018-03-26 14:54:23 +02:00
Alessandro Simovic 34836a2b21 libtunes: allow custom tune (id 0) to be used to stop playback.
Override flag must still be set to true!
2018-03-26 14:54:23 +02:00
Alessandro Simovic 2cf93df918 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.
2018-03-26 14:54:23 +02:00
Alessandro Simovic f47443f283 libtunes: (bugfix) sending a custom msg tune overrides everything
Custom msg tune can override any tune playing, regardless of the tune_override flag.
2018-03-26 14:54:23 +02:00
Martina be275b880b tunes: add fallthrough macro 2018-03-19 14:15:52 +01:00
Simone Guscetti 879c698cab libtunes: Change TuneID::ERROR in ERROR_TUNE
This prevents the expanction of the ERROR macro inside the TuneID enum
2018-03-19 14:15:52 +01:00
Simone Guscetti 4c6daf0748 libtunes: Update tunes and mkblctrl to use the tune_definition 2018-03-19 14:15:52 +01:00
Simone Guscetti 47e5382e7e libtunes: insert explicit fallthrough 2018-01-29 09:45:59 -05:00
Simone Guscetti 9cb95b64ca libtunes: change variable name
This make the variable purpose more clear.
2018-01-29 09:45:59 -05:00
Martina 2ec5ea48a3 tunes: for custom tunes set silence from tune control message and set
silence to 0 when the end of the string is reached
2018-01-29 09:45:59 -05:00
Martina 1988141c6d tunes: add pointer to the beginning of a tune to allow tune replay 2018-01-29 09:45:59 -05:00
Simone Guscetti f63be6b055 libtunes: If default tune does not exist
return -EINVAL
2018-01-29 09:45:59 -05:00
Simone Guscetti 915f728145 libtunes: Separate the default tunes from tunes.cpp 2018-01-29 09:45:59 -05:00
Simone Guscetti 591f9a8a38 libtunes: Handle notification tunes as high priority 2018-01-29 09:45:59 -05:00
Simone Guscetti 3f123acd7e libtunes: handle tune override 2018-01-29 09:45:59 -05:00
Simone Guscetti 6c8b16391e libtunes: complete API doc, minor changes 2018-01-29 09:45:59 -05:00
Simone Guscetti b84a97c6d5 libtunes: Changed to a set_control/string and a get_next_tune functions
Now it is possible to set a string and a control.
The get_next_tune function use the same return values as the erliaer
implemented parse_cmd and parse_string functions.
2018-01-29 09:45:59 -05:00
Simone Guscetti 5214642bc3 tunes lib: Minor changes 2018-01-29 09:45:59 -05:00
Simone Guscetti e9ea7ab698 lib tunes: clean up 2018-01-29 09:45:59 -05:00
Simone Guscetti 79ae413982 lib tunes: Add string input method 2018-01-29 09:45:59 -05:00
Simone Guscetti 8ce57bedb7 libtunes: create a new library for tunes
cmake configs: Modify to include new library
2018-01-29 09:45:59 -05:00