MCPcopy Create free account
hub / github.com/audacity/audacity / EnableDisableButtons

Method EnableDisableButtons

src/toolbars/DeviceToolBar.cpp:354–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352
353
354void DeviceToolBar::EnableDisableButtons()
355{
356 auto gAudioIO = AudioIOBase::Get();
357 if (gAudioIO) {
358 // we allow changes when monitoring, but not when recording
359 bool audioStreamActive = gAudioIO->IsStreamActive() && !gAudioIO->IsMonitoring();
360
361 // Here we should relinquish focus
362 if (audioStreamActive) {
363 wxWindow *focus = wxWindow::FindFocus();
364 if (focus == mHost || focus == mInput || focus == mOutput || focus == mInputChannels)
365 TrackPanel::Get( mProject ).SetFocus();
366 }
367
368 mHost->Enable(!audioStreamActive);
369 mInput->Enable(!audioStreamActive);
370 mOutput->Enable(!audioStreamActive);
371 mInputChannels->Enable(!audioStreamActive);
372 }
373}
374
375void DeviceToolBar::SetNames()
376{

Callers

nothing calls this directly

Calls 6

GetFunction · 0.85
FindFocusFunction · 0.85
IsStreamActiveMethod · 0.80
IsMonitoringMethod · 0.45
SetFocusMethod · 0.45
EnableMethod · 0.45

Tested by

no test coverage detected