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:
parent
77779395c7
commit
2c7ca97095
@ -5477,3 +5477,9 @@ double AudioIO::RecordingSchedule::ToDiscard() const
|
|||||||
{
|
{
|
||||||
return std::max(0.0, -( mPosition + TotalCorrection() ) );
|
return std::max(0.0, -( mPosition + TotalCorrection() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AudioIO::IsCapturing() const
|
||||||
|
{
|
||||||
|
return GetNumCaptureChannels() > 0 &&
|
||||||
|
mTime >= mT0 + mRecordingSchedule.mPreRoll;
|
||||||
|
}
|
||||||
|
@ -398,6 +398,9 @@ class AUDACITY_DLL_API AudioIO final {
|
|||||||
unsigned GetNumPlaybackChannels() const { return mNumPlaybackChannels; }
|
unsigned GetNumPlaybackChannels() const { return mNumPlaybackChannels; }
|
||||||
unsigned GetNumCaptureChannels() const { return mNumCaptureChannels; }
|
unsigned GetNumCaptureChannels() const { return mNumCaptureChannels; }
|
||||||
|
|
||||||
|
// Meaning really capturing, not just pre-rolling
|
||||||
|
bool IsCapturing() const;
|
||||||
|
|
||||||
/** \brief Array of common audio sample rates
|
/** \brief Array of common audio sample rates
|
||||||
*
|
*
|
||||||
* These are the rates we will always support, regardless of hardware support
|
* These are the rates we will always support, regardless of hardware support
|
||||||
|
@ -60,7 +60,7 @@ std::pair<wxRect, bool> PlayIndicatorOverlayBase::DoGetRectangle(wxSize size)
|
|||||||
void PlayIndicatorOverlayBase::Draw(OverlayPanel &panel, wxDC &dc)
|
void PlayIndicatorOverlayBase::Draw(OverlayPanel &panel, wxDC &dc)
|
||||||
{
|
{
|
||||||
// Set play/record color
|
// Set play/record color
|
||||||
bool rec = (gAudioIO->GetNumCaptureChannels() > 0);
|
bool rec = gAudioIO->IsCapturing();
|
||||||
AColor::IndicatorColor(&dc, !rec);
|
AColor::IndicatorColor(&dc, !rec);
|
||||||
mLastIndicatorX = mNewIndicatorX;
|
mLastIndicatorX = mNewIndicatorX;
|
||||||
if (!between_incexc(0, mLastIndicatorX, dc.GetSize().GetWidth()))
|
if (!between_incexc(0, mLastIndicatorX, dc.GetSize().GetWidth()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user