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 1094 of file AudioIO.cpp.

Constructor & Destructor Documentation

AudioThread::AudioThread ( )
inline

Definition at line 1096 of file AudioIO.cpp.

1096 :wxThread(wxTHREAD_JOINABLE) {}

Member Function Documentation

AudioThread::ExitCode AudioThread::Entry ( )
override

Definition at line 3271 of file AudioIO.cpp.

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

3272 {
3273  while( !TestDestroy() )
3274  {
3275  // Set LoopActive outside the tests to avoid race condition
3278  {
3279  gAudioIO->FillBuffers();
3281  }
3283  {
3284  gAudioIO->FillBuffers();
3285  }
3287 
3289  // Rely on the Wait() in ScrubQueue::Transformer()
3290  // This allows the scrubbing update interval to be made very short without
3291  // playback becoming intermittent.
3292  }
3293  else {
3294  // Perhaps this too could use a condition variable, for available space in the
3295  // ring buffer, instead of a polling loop? But no harm in doing it this way.
3296  Sleep(10);
3297  }
3298  }
3299 
3300  return 0;
3301 }
enum AudioIO::@3 mPlayMode
void FillBuffers()
Definition: AudioIO.cpp:3817
volatile bool mAudioThreadShouldCallFillBuffersOnce
Definition: AudioIO.h:685
AudioIO * gAudioIO
Definition: AudioIO.cpp:482
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: