diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-02-14 20:40:33 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-02-14 20:40:33 +0100 |
commit | bebf25438793a645ba022bb6b379f1882faac9b5 (patch) | |
tree | 246ef142f09ea2df7cc8e216b5867c6a48867e29 | |
parent | also improve subscription for statemachine (diff) |
minor refactoring
-rw-r--r-- | pkg/controller/controller.go | 4 | ||||
-rw-r--r-- | pkg/mixer/mixer.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 36c3776..fb5f5ca 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -110,7 +110,7 @@ func NewController(c Config) (*Controller, error) { return ctrl, nil } -func (c *Controller) sendEvent(ev Event) { +func (c *Controller) publishEvent(ev Event) { c.subscribersLock.Lock() defer c.subscribersLock.Unlock() @@ -152,7 +152,7 @@ func (c *Controller) handleMidiPacket(p midi.Packet) { // ignore all other events return } - c.sendEvent(ev) + c.publishEvent(ev) } func (c *Controller) Init() error { diff --git a/pkg/mixer/mixer.go b/pkg/mixer/mixer.go index 53b0410..96fbf8d 100644 --- a/pkg/mixer/mixer.go +++ b/pkg/mixer/mixer.go @@ -159,7 +159,7 @@ func NewMixer(c Config) (*Mixer, error) { return m, nil } -func (m *Mixer) sendEvent(ev Event) { +func (m *Mixer) publishEvent(ev Event) { m.subscribersLock.Lock() defer m.subscribersLock.Unlock() @@ -209,7 +209,7 @@ func (m *Mixer) handleMidiPacket(p midi.Packet) { default: return } - m.sendEvent(ev) + m.publishEvent(ev) } func (m *Mixer) Init() error { |