feat!: rewrote the GUI and model for better testability

The Model was getting unmaintanable mess. This is an attempt to refactor/rewrite the Model so that data of certain type is exposed in standardized way, offering certain standard manipulations for that data type, and on the GUI side, certain standard widgets to tied to that data.

This rewrite closes #72, #106 and #120.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2023-10-24 13:35:43 +03:00
parent 6d3c65e11d
commit d92426a100
53 changed files with 5992 additions and 4507 deletions

View File

@ -66,7 +66,7 @@ type (
// Play plays the Song by first compiling the patch with the given Synther,
// returning the stereo audio buffer as a result (and possible errors).
func Play(synther Synther, song Song) (AudioBuffer, error) {
func Play(synther Synther, song Song, progress func(float32)) (AudioBuffer, error) {
err := song.Validate()
if err != nil {
return nil, err
@ -125,6 +125,9 @@ func Play(synther Synther, song Song) (AudioBuffer, error) {
return nil, fmt.Errorf("Song speed modulation likely so slow that row never advances; error at pattern %v, row %v", pattern, patternRow)
}
}
if progress != nil {
progress(float32(row+1) / float32(song.Score.LengthInRows()))
}
}
return buffer, nil
}