Skip to content

Commit 2a9b925

Browse files
committed
add Run() to Remote type. Launches Voicemeeter GUI
pooler no longer defined as singleton
1 parent 68e9654 commit 2a9b925

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

publisher.go

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,20 @@ type pooler struct {
7575
}
7676

7777
func newPooler(k *kind) *pooler {
78-
if p == nil {
79-
p = &pooler{
80-
k: k,
81-
run: true,
82-
event: newEvent(),
83-
pdirtyDone: make(chan bool),
84-
mdirtyDone: make(chan bool),
85-
midiDone: make(chan bool),
86-
ldirtyDone: make(chan bool),
87-
}
88-
go p.done()
89-
go p.parameters()
90-
go p.macrobuttons()
91-
go p.midi()
92-
go p.levels()
78+
p = &pooler{
79+
k: k,
80+
run: true,
81+
event: newEvent(),
82+
pdirtyDone: make(chan bool),
83+
mdirtyDone: make(chan bool),
84+
midiDone: make(chan bool),
85+
ldirtyDone: make(chan bool),
9386
}
87+
go p.done()
88+
go p.parameters()
89+
go p.macrobuttons()
90+
go p.midi()
91+
go p.levels()
9492
return p
9593
}
9694

remote.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ func (r *Remote) InitPooler() {
5555
r.pooler = newPooler(r.Kind)
5656
}
5757

58+
// Run launches the Voicemeeter GUI for a kind.
59+
func (r *Remote) Run(kindId string) error {
60+
err := runVoicemeeter(kindId)
61+
if err != nil {
62+
return err
63+
}
64+
time.Sleep(time.Second)
65+
clear()
66+
return nil
67+
}
68+
5869
// Type returns the type of Voicemeeter (basic, banana, potato)
5970
func (r *Remote) Type() string {
6071
val, err := getVMType()

0 commit comments

Comments
 (0)