tramhao / termusic

Music Player TUI written in Rust
GNU General Public License v3.0
1.05k stars 44 forks source link

Refactor `PlayerTrait` to combine `_up` and `_down` function into `add_` #281

Closed hasezoey closed 6 months ago

hasezoey commented 6 months ago

This PR adds a new function for volume & speed prefixed with add_ to do signed operations, and replaces (and removes) the old _up and _down functions. Also the new function(s) provide a default implementation, as it would be the same in all backends.

For now the PlayerCmd enum is un-touched, but i plan to also replace the Up and Down events there with a relative and value.