-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgateway.go
More file actions
28 lines (20 loc) · 807 Bytes
/
gateway.go
File metadata and controls
28 lines (20 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package mawt
// This module implements a sound effects generator that tracks the state of portal(s)
// based on portal state messages events that are sent to it, it then
// in turn queues up sounds effects to match.
import (
"github.com/TeamNorCal/mawt/model"
"github.com/karlmutch/errors"
)
type Gateway struct {
}
func (*Gateway) Start(server string, debug bool, errorC chan<- errors.Error, quitC <-chan struct{}) (tectC chan *model.PortalMsg, subscribeC chan chan *model.PortalMsg) {
tectC, subscribeC = startFanOut(quitC)
// After creating the broadcast channel we add a listener
// for the sounds effects so that it can process detected
// state changes etc
//
go StartSFX(subscribeC, errorC, quitC)
StartFadeCandy(server, subscribeC, debug, errorC, quitC)
return tectC, subscribeC
}