mirror of
				https://github.com/cookiengineer/audacity
				synced 2025-11-03 23:53:55 +01:00 
			
		
		
		
	Double-click record with overdub pins record head center not right
This commit is contained in:
		@@ -382,7 +382,8 @@ class AUDACITY_DLL_API AudioIO final {
 | 
				
			|||||||
   double GetStreamTime();
 | 
					   double GetStreamTime();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   sampleFormat GetCaptureFormat() { return mCaptureFormat; }
 | 
					   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
 | 
					   /** \brief Array of common audio sample rates
 | 
				
			||||||
    *
 | 
					    *
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -857,8 +857,22 @@ void ControlToolBar::OnRecord(wxCommandEvent &evt)
 | 
				
			|||||||
   mRecord->ClearDoubleClicked();
 | 
					   mRecord->ClearDoubleClicked();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   if (doubleClicked) {
 | 
					   if (doubleClicked) {
 | 
				
			||||||
      GetActiveProject()->GetPlaybackScroller().Activate
 | 
					      // Display a fixed recording head while scrolling the waves continuously.
 | 
				
			||||||
         (AudacityProject::PlaybackScroller::Mode::Right);
 | 
					      // 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;
 | 
					      return;
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user