mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2026-04-18 05:23:31 +00:00
package module moved into root of repository.
example in readme updated. level pooler implemented, runs in its own goroutine. Remote type now exported observers example updated.
This commit is contained in:
63
kinds.go
Normal file
63
kinds.go
Normal file
@@ -0,0 +1,63 @@
|
||||
package voicemeeter
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var basic, banana, potato *kind
|
||||
|
||||
// A kind represents a Voicemeeter kinds layout
|
||||
type kind struct {
|
||||
name string
|
||||
physIn, virtIn, physOut, virtOut, vbanIn, vbanOut int
|
||||
}
|
||||
|
||||
// numStrip returns the total number of strips for a kind
|
||||
func (k *kind) numStrip() int {
|
||||
n := k.physIn + k.virtIn
|
||||
return n
|
||||
}
|
||||
|
||||
// numBus returns the total number of buses for a kind
|
||||
func (k *kind) numBus() int {
|
||||
n := k.physOut + k.virtOut
|
||||
return n
|
||||
}
|
||||
|
||||
// String implements the fmt.stringer interface
|
||||
func (k *kind) String() string {
|
||||
return fmt.Sprintf("%s%s", strings.ToUpper(k.name[:1]), k.name[1:])
|
||||
}
|
||||
|
||||
// newBasicKind returns a basic kind struct address
|
||||
func newBasicKind() *kind {
|
||||
if basic == nil {
|
||||
basic = &kind{"basic", 2, 1, 1, 1, 4, 4}
|
||||
}
|
||||
return basic
|
||||
}
|
||||
|
||||
// newBananaKind returns a banana kind struct address
|
||||
func newBananaKind() *kind {
|
||||
if banana == nil {
|
||||
banana = &kind{"banana", 3, 2, 3, 2, 8, 8}
|
||||
}
|
||||
return banana
|
||||
}
|
||||
|
||||
// newPotatoKind returns a potato kind struct address
|
||||
func newPotatoKind() *kind {
|
||||
if potato == nil {
|
||||
potato = &kind{"potato", 5, 3, 5, 3, 8, 8}
|
||||
}
|
||||
return potato
|
||||
}
|
||||
|
||||
var (
|
||||
kindMap = map[string]*kind{
|
||||
"basic": newBasicKind(),
|
||||
"banana": newBananaKind(),
|
||||
"potato": newPotatoKind(),
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user