refactor!: rename SynthService to Synther and related types

The -er suffix is more idiomatic for single method interfaces, and
the interface is not doing much more than converting the patch to a
synth. Names were updated throughout the project to reflect this
change. In particular, the "Service" in SynthService was not telling
anything helpful.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2023-10-18 17:32:13 +03:00
parent e4a2ed9f32
commit 0a67129a0c
13 changed files with 44 additions and 44 deletions

View File

@ -29,7 +29,7 @@ type (
recordingFrames int
recordingEvents []PlayerProcessEvent
synthService sointu.SynthService
synther sointu.Synther
playerMessages chan<- PlayerMessage
modelMessages <-chan interface{}
}
@ -85,11 +85,11 @@ type (
const NUM_RENDER_TRIES = 10000
func NewPlayer(synthService sointu.SynthService, playerMessages chan<- PlayerMessage, modelMessages <-chan interface{}) *Player {
func NewPlayer(synther sointu.Synther, playerMessages chan<- PlayerMessage, modelMessages <-chan interface{}) *Player {
p := &Player{
playerMessages: playerMessages,
modelMessages: modelMessages,
synthService: synthService,
synther: synther,
volume: Volume{Average: [2]float64{1e-9, 1e-9}, Peak: [2]float64{1e-9, 1e-9}},
}
return p
@ -308,10 +308,10 @@ func (p *Player) compileOrUpdateSynth() {
}
} else {
var err error
p.synth, err = p.synthService.Compile(p.patch, p.bpm)
p.synth, err = p.synther.Synth(p.patch, p.bpm)
if err != nil {
p.synth = nil
p.trySend(PlayerCrashMessage{fmt.Errorf("synthService.Compile: %w", err)})
p.trySend(PlayerCrashMessage{fmt.Errorf("synther.Synth: %w", err)})
return
}
for i := 0; i < 32; i++ {