refactor: rename sointu.Render as AudioBuffer.Fill

The Render name misleading as it did not do the same thing as normal
Synth.Render, because it disregarded time limits. Conceptually, as
the function modifies the state of the synth, it would be better to
be synth.Fill(audioBuffer), but we cannot define methods on
interfaces; therefore, it is audioBuffer.Fill(synth) now.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2023-10-19 11:11:42 +03:00
parent ff4155a08e
commit 5bbec75120
4 changed files with 22 additions and 23 deletions

View File

@ -83,7 +83,7 @@ func TestStackUnderflow(t *testing.T) {
t.Fatalf("bridge compile error: %v", err)
}
buffer := make(sointu.AudioBuffer, 1)
err = sointu.Render(synth, buffer)
err = buffer.Fill(synth)
if err == nil {
t.Fatalf("rendering should have failed due to stack underflow")
}
@ -99,7 +99,7 @@ func TestStackBalancing(t *testing.T) {
t.Fatalf("bridge compile error: %v", err)
}
buffer := make(sointu.AudioBuffer, 1)
err = sointu.Render(synth, buffer)
err = buffer.Fill(synth)
if err == nil {
t.Fatalf("rendering should have failed due to unbalanced stack push/pop")
}