mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
move router to module New func
This commit is contained in:
@@ -23,7 +23,7 @@ func init() {
|
||||
RegisterModule(ModuleRegistration{
|
||||
//TODO(jwetzell): find a better namespace than "misc"
|
||||
Type: "misc.midi.client",
|
||||
New: func(config config.ModuleConfig) (Module, error) {
|
||||
New: func(config config.ModuleConfig, router *Router) (Module, error) {
|
||||
params := config.Params
|
||||
input, ok := params["input"]
|
||||
|
||||
@@ -49,7 +49,7 @@ func init() {
|
||||
return nil, fmt.Errorf("misc.midi.client output must be a string")
|
||||
}
|
||||
|
||||
return &MIDIClient{config: config, InputPort: inputString, OutputPort: outputString}, nil
|
||||
return &MIDIClient{config: config, InputPort: inputString, OutputPort: outputString, router: router}, nil
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -62,10 +62,6 @@ func (mc *MIDIClient) Type() string {
|
||||
return mc.config.Type
|
||||
}
|
||||
|
||||
func (mc *MIDIClient) RegisterRouter(router *Router) {
|
||||
mc.router = router
|
||||
}
|
||||
|
||||
func (mc *MIDIClient) Run() error {
|
||||
defer midi.CloseDriver()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user