summaryrefslogtreecommitdiff
path: root/cmd/dolmetschctld/dolmetschctld.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-02-09 19:55:58 +0100
committerChristian Pointner <equinox@spreadspace.org>2019-02-09 19:55:58 +0100
commit4c7eb5a0dc4b146b36142d74def31bcf9dfb4fb2 (patch)
treea4dca2e8d0952274a14f2c27126d4ab98cb5bc1d /cmd/dolmetschctld/dolmetschctld.go
parentmixer: implement mute/unmute and setting fader level (diff)
added basic state machine
Diffstat (limited to 'cmd/dolmetschctld/dolmetschctld.go')
-rw-r--r--cmd/dolmetschctld/dolmetschctld.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/cmd/dolmetschctld/dolmetschctld.go b/cmd/dolmetschctld/dolmetschctld.go
index 6cd74bb..783358d 100644
--- a/cmd/dolmetschctld/dolmetschctld.go
+++ b/cmd/dolmetschctld/dolmetschctld.go
@@ -25,7 +25,6 @@ package main
import (
"log"
"os"
- "time"
"spreadspace.org/dolmetschctl/pkg/mixer"
)
@@ -48,15 +47,15 @@ func main() {
log.Println("Error initializeing the mixer: %v", err)
os.Exit(1)
}
-
log.Printf("mixer successfully initialized!")
- // TODO: implement state machine
- m.UnMute(0x24)
- m.SetLevel(0x24, 42)
- time.Sleep(2 * time.Second)
- m.Mute(0x24)
- m.SetLevel(0x24, mixer.FaderLevel0db)
+ var sm *StateMachine
+ if sm, err = NewStateMachine(m); err != nil {
+ log.Printf("state machone successfully initialized!")
+ }
+
+ sm.Start()
+ defer sm.Shutdown()
log.Printf("exiting.")
}