Detach tone-test savers on reconnect
This commit is contained in:
committed by
Brandon McGinty
parent
b23afebdb3
commit
bad4e8172a
+16
-4
@@ -64,10 +64,11 @@ type Barnard struct {
|
||||
FileStreamMutex sync.Mutex
|
||||
|
||||
// Added for tone test mode (bypasses all soundcard/OpenAL)
|
||||
ToneTest bool
|
||||
ToneTestOutput string
|
||||
toneTestStop chan struct{}
|
||||
toneTestSaver *AudioFileSaver
|
||||
ToneTest bool
|
||||
ToneTestOutput string
|
||||
toneTestStop chan struct{}
|
||||
toneTestSaver *AudioFileSaver
|
||||
toneTestSaverDetach gumble.Detacher
|
||||
|
||||
// Added for recording
|
||||
RecordingMutex sync.Mutex
|
||||
@@ -98,6 +99,17 @@ func (b *Barnard) cleanupConnectionAudio() {
|
||||
b.FileStreamMutex.Unlock()
|
||||
}
|
||||
|
||||
func (b *Barnard) cleanupToneTestAudio() {
|
||||
if b.toneTestSaverDetach != nil {
|
||||
b.toneTestSaverDetach.Detach()
|
||||
b.toneTestSaverDetach = nil
|
||||
}
|
||||
if b.toneTestSaver != nil {
|
||||
b.toneTestSaver.Stop()
|
||||
b.toneTestSaver = nil
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Barnard) StopTransmission() {
|
||||
if b.Tx {
|
||||
b.Notify("micdown", "me", "")
|
||||
|
||||
Reference in New Issue
Block a user