1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

Double-click record with overdub pins record head center not right

This commit is contained in:
Paul Licameli 2016-05-17 13:21:39 -04:00
parent cf28490c83
commit e1f4ab6af6
2 changed files with 18 additions and 3 deletions

View File

@ -382,7 +382,8 @@ class AUDACITY_DLL_API AudioIO final {
double GetStreamTime();
sampleFormat GetCaptureFormat() { return mCaptureFormat; }
int GetNumCaptureChannels() { return mNumCaptureChannels; }
int GetNumPlaybackChannels() const { return mNumPlaybackChannels; }
int GetNumCaptureChannels() const { return mNumCaptureChannels; }
/** \brief Array of common audio sample rates
*

View File

@ -857,8 +857,22 @@ void ControlToolBar::OnRecord(wxCommandEvent &evt)
mRecord->ClearDoubleClicked();
if (doubleClicked) {
GetActiveProject()->GetPlaybackScroller().Activate
(AudacityProject::PlaybackScroller::Mode::Right);
// Display a fixed recording head while scrolling the waves continuously.
// If you overdub, you may want to anticipate some context in existing tracks,
// so center the head. If not, put it rightmost to display as much wave as we can.
const auto project = GetActiveProject();
bool duplex;
gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, true);
if (duplex) {
// See if there is really anything being overdubbed
if (gAudioIO->GetNumPlaybackChannels() == 0)
// No.
duplex = false;
}
using Mode = AudacityProject::PlaybackScroller::Mode;
project->GetPlaybackScroller().Activate(duplex ? Mode::Centered : Mode::Right);
return;
}