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

Reimplement change of color of playhead after pre-roll, more simply

This commit is contained in:
Paul Licameli 2018-06-11 18:27:18 -04:00
parent 77779395c7
commit 2c7ca97095
3 changed files with 10 additions and 1 deletions

View File

@ -5477,3 +5477,9 @@ double AudioIO::RecordingSchedule::ToDiscard() const
{
return std::max(0.0, -( mPosition + TotalCorrection() ) );
}
bool AudioIO::IsCapturing() const
{
return GetNumCaptureChannels() > 0 &&
mTime >= mT0 + mRecordingSchedule.mPreRoll;
}

View File

@ -398,6 +398,9 @@ class AUDACITY_DLL_API AudioIO final {
unsigned GetNumPlaybackChannels() const { return mNumPlaybackChannels; }
unsigned GetNumCaptureChannels() const { return mNumCaptureChannels; }
// Meaning really capturing, not just pre-rolling
bool IsCapturing() const;
/** \brief Array of common audio sample rates
*
* These are the rates we will always support, regardless of hardware support

View File

@ -60,7 +60,7 @@ std::pair<wxRect, bool> PlayIndicatorOverlayBase::DoGetRectangle(wxSize size)
void PlayIndicatorOverlayBase::Draw(OverlayPanel &panel, wxDC &dc)
{
// Set play/record color
bool rec = (gAudioIO->GetNumCaptureChannels() > 0);
bool rec = gAudioIO->IsCapturing();
AColor::IndicatorColor(&dc, !rec);
mLastIndicatorX = mNewIndicatorX;
if (!between_incexc(0, mLastIndicatorX, dc.GetSize().GetWidth()))