Audacity  2.2.2
Public Member Functions | List of all members
AudioThread Class Reference

Defined different on Mac and other platforms (on Mac it does not use wxWidgets wxThread), this class sits in a thread loop reading and writing audio. More...

Inheritance diagram for AudioThread:

Public Member Functions

 AudioThread ()
 
ExitCode Entry () override
 

Detailed Description

Defined different on Mac and other platforms (on Mac it does not use wxWidgets wxThread), this class sits in a thread loop reading and writing audio.

Definition at line 1091 of file AudioIO.cpp.

Constructor & Destructor Documentation

AudioThread::AudioThread ( )
inline

Definition at line 1093 of file AudioIO.cpp.

1093 :wxThread(wxTHREAD_JOINABLE) {}

Member Function Documentation

AudioThread::ExitCode AudioThread::Entry ( )
override

Definition at line 3252 of file AudioIO.cpp.

References AudioIO::FillBuffers(), gAudioIO, AudioIO::mAudioThreadFillBuffersLoopActive, AudioIO::mAudioThreadFillBuffersLoopRunning, AudioIO::mAudioThreadShouldCallFillBuffersOnce, AudioIO::mPlayMode, and AudioIO::PLAY_SCRUB.

3253 {
3254  while( !TestDestroy() )
3255  {
3256  // Set LoopActive outside the tests to avoid race condition
3259  {
3260  gAudioIO->FillBuffers();
3262  }
3264  {
3265  gAudioIO->FillBuffers();
3266  }
3268 
3270  // Rely on the Wait() in ScrubQueue::Transformer()
3271  // This allows the scrubbing update interval to be made very short without
3272  // playback becoming intermittent.
3273  }
3274  else {
3275  // Perhaps this too could use a condition variable, for available space in the
3276  // ring buffer, instead of a polling loop? But no harm in doing it this way.
3277  Sleep(10);
3278  }
3279  }
3280 
3281  return 0;
3282 }
enum AudioIO::@3 mPlayMode
void FillBuffers()
Definition: AudioIO.cpp:3798
volatile bool mAudioThreadShouldCallFillBuffersOnce
Definition: AudioIO.h:685
AudioIO * gAudioIO
Definition: AudioIO.cpp:481
volatile bool mAudioThreadFillBuffersLoopActive
Definition: AudioIO.h:687
volatile bool mAudioThreadFillBuffersLoopRunning
Definition: AudioIO.h:686

The documentation for this class was generated from the following file: