hinto-janai / festival

Music player
https://festival.pm
MIT License
275 stars 6 forks source link

`Audio` rewrite #16

Open hinto-janai opened 1 year ago

hinto-janai commented 1 year ago

What

The code for Audio is too entwined.

The major roles Audio plays is:

Problems

The cause of most of these issues is the state + logic handling of AUDIO_STATE being half-baked into Audio:

Goal

"Given this signal, what will happen to the audio state?"

This is really hard to answer as it stands, because everything is so intertwined.

The goal should be small finite state machine, which AUDIO_STATE really is at its core.

The methods should be tied to the global AUDIO_STATE, not the Audio thread.

hinto-janai commented 9 months ago

https://github.com/hinto-janai/sansan is basically a re-write of src/audio, extracted out into its own dedicated library.