diff options
Diffstat (limited to 'src/rhctl/conf.go')
-rw-r--r-- | src/rhctl/conf.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rhctl/conf.go b/src/rhctl/conf.go index 36a3b5a..bf68fec 100644 --- a/src/rhctl/conf.go +++ b/src/rhctl/conf.go @@ -40,6 +40,14 @@ type ConfigSwitchInputs []struct { func (p ConfigSwitchInputs) Len() int { return len(p) } func (p ConfigSwitchInputs) Swap(i, j int) { p[i], p[j] = p[j], p[i] } func (p ConfigSwitchInputs) Less(i, j int) bool { return p[i].Number < p[j].Number } +func (p ConfigSwitchInputs) Get(server, channel string) SwitchInputNum { + for _, i := range p { + if i.Server == server && i.Channel == channel { + return i.Number + } + } + return SwitchInputNum(0) +} type Config struct { Audioswitch struct { |