summaryrefslogtreecommitdiff
path: root/cmd/dolmetschctld/dolmetschctld.go
diff options
context:
space:
mode:
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.")
}