1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-31 08:58:43 +01:00

Play head is green during pre-roll, then turns red for real recording

This commit is contained in:
Paul Licameli
2018-06-09 14:19:29 -04:00
parent e40420ba72
commit 8e51391b98
3 changed files with 46 additions and 17 deletions

View File

@@ -18,6 +18,7 @@
#include "Experimental.h"
#include "MemoryX.h"
#include <atomic>
#include <utility>
#include <vector>
#include <wx/atomic.h>
@@ -398,6 +399,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
@@ -846,16 +850,20 @@ private:
double mDuration{};
PRCrossfadeData mCrossfadeData;
// These are initialized by the main thread, then updated
// This is initialized by the main thread, then updated
// only by the thread calling FillBuffers:
double mPosition{};
bool mLatencyCorrected{};
double TotalCorrection() const { return mLatencyCorrection - mPreRoll; }
double ToConsume() const;
double Consumed() const;
double ToDiscard() const;
double ToConsume(double position) const;
double Consumed(double position) const;
double ToDiscard(double position) const;
} mRecordingSchedule{};
// This is initialized by the main thread, then updated
// only by the thread calling FillBuffers, but may need to be read by the
// main thread to draw display correctly.
std::atomic<double> mRecordingPosition{};
};
#endif