//go:build windows package cat import "fmt" // TCIAudioController is the receive-audio capability of the TCI backend, kept // as an interface for the same reason as the Flex and Yaesu ones: the host asks // the manager, and a station running something else gets a clear "this backend // does not do that" instead of a nil dereference. type TCIAudioController interface { StartTCIAudio(rx, rate int) error StopTCIAudio() error TCIAudioStatus() TCIAudioStatus } // TCIAudioState returns the stream's state, or (zero, false) when the active // backend is not a TCI radio. func (m *Manager) TCIAudioState() (TCIAudioStatus, bool) { m.mu.RLock() b := m.backend m.mu.RUnlock() if tc, ok := b.(TCIAudioController); ok { return tc.TCIAudioStatus(), true } return TCIAudioStatus{}, false } // TCIAudioDo dispatches an audio command onto the CAT goroutine, like every // other backend-specific control. func (m *Manager) TCIAudioDo(fn func(TCIAudioController) error) error { return m.exec(func(b Backend) error { tc, ok := b.(TCIAudioController) if !ok { return fmt.Errorf("active CAT backend is not a TCI radio") } return fn(tc) }) }