summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-04-06 00:47:02 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-04-06 00:47:02 +0200
commitdfb57bb771d5b8c06e932ef90ae09a3c8bf70dca (patch)
tree046f0c691fb8dea288e9a029d1b6b6ca705f61ab /cmd
parentmixer: basic osc message handling for /info operation (diff)
new mixer interface mostly done, remaining issues with floats and rounding errors...
Diffstat (limited to 'cmd')
-rw-r--r--cmd/dolmetschctld/dolmetschctld.go4
-rw-r--r--cmd/dolmetschctld/statemachine.go9
2 files changed, 4 insertions, 9 deletions
diff --git a/cmd/dolmetschctld/dolmetschctld.go b/cmd/dolmetschctld/dolmetschctld.go
index a6d9ed8..3242dde 100644
--- a/cmd/dolmetschctld/dolmetschctld.go
+++ b/cmd/dolmetschctld/dolmetschctld.go
@@ -67,8 +67,8 @@ func main() {
log.Printf("state machine successfully initialized!")
// TODO: make this configurable
- addLanguage(sm, "en", 0x20, 0x24)
- addLanguage(sm, "de", 0x22, 0x25)
+ addLanguage(sm, "en", "auxin/01", "auxin/05")
+ addLanguage(sm, "de", "auxin/03", "auxin/06")
sm.Start()
defer sm.Shutdown()
diff --git a/cmd/dolmetschctld/statemachine.go b/cmd/dolmetschctld/statemachine.go
index 15f0e41..b6d46ba 100644
--- a/cmd/dolmetschctld/statemachine.go
+++ b/cmd/dolmetschctld/statemachine.go
@@ -178,12 +178,7 @@ func (sm *StateMachine) handleMixerEvent(ev mixer.Event) {
// make sure that our state and the mixer are in sync
func (sm *StateMachine) initMixer() {
for _, mcs := range sm.languages {
- sm.mixer.SetLevel(mcs.original.num, mixer.FaderLevel0db-1)
- sm.mixer.SetLevel(mcs.original.num, mixer.FaderLevel0db)
mcs.original.target.level = mixer.FaderLevel0db
-
- sm.mixer.SetLevel(mcs.interpreter.num, mixer.FaderLevelOff+1)
- sm.mixer.SetLevel(mcs.interpreter.num, mixer.FaderLevelOff)
mcs.interpreter.target.level = mixer.FaderLevelOff
}
sm.language = ""
@@ -226,9 +221,9 @@ func calcNextLevel(target, current mixer.FaderLevel) mixer.FaderLevel {
next := target
if current != mixer.FaderLevelUnknown {
if next > current {
- next = current + 1
+ next = current + 0.01
} else {
- next = current - 1
+ next = current - 0.01
}
}
return next