summaryrefslogtreecommitdiff
path: root/cmd/dolmetschctld/dolmetschctld.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-02-09 22:33:01 +0100
committerChristian Pointner <equinox@spreadspace.org>2019-02-09 22:33:01 +0100
commit22d8f5888d062b0093b58bae934a6d78ad9ac846 (patch)
tree8ff985e37b7e5e67e6b229d0a76d1af380196f90 /cmd/dolmetschctld/dolmetschctld.go
parentlanguage selection now returns result (diff)
languages now have a state
Diffstat (limited to 'cmd/dolmetschctld/dolmetschctld.go')
-rw-r--r--cmd/dolmetschctld/dolmetschctld.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmd/dolmetschctld/dolmetschctld.go b/cmd/dolmetschctld/dolmetschctld.go
index 45536e8..dfbb47a 100644
--- a/cmd/dolmetschctld/dolmetschctld.go
+++ b/cmd/dolmetschctld/dolmetschctld.go
@@ -29,6 +29,14 @@ import (
"spreadspace.org/dolmetschctl/pkg/mixer"
)
+func addLanguage(sm *StateMachine, name Language, main, voice mixer.Channel) {
+ if err := sm.AddLanguage(name, main, voice); err != nil {
+ log.Printf("adding language '%s' failed: %v", name, err)
+ os.Exit(1)
+ }
+ log.Printf("successfully added language: '%s'", name)
+}
+
func main() {
log.Println("hello world.")
@@ -56,6 +64,10 @@ func main() {
}
log.Printf("state machine successfully initialized!")
+ // TODO: make this configurable
+ addLanguage(sm, "en", 0x20, 0x24)
+ addLanguage(sm, "de", 0x22, 0x25)
+
sm.Start()
defer sm.Shutdown()