diff options
Diffstat (limited to 'cmd/dolmetschctld/dolmetschctld.go')
-rw-r--r-- | cmd/dolmetschctld/dolmetschctld.go | 12 |
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() |