openshot-audio  0.1.6
Public Member Functions | List of all members
AudioFormatWriter::ThreadedWriter::Buffer Class Reference
Inheritance diagram for AudioFormatWriter::ThreadedWriter::Buffer:
TimeSliceClient

Public Member Functions

 Buffer (TimeSliceThread &tst, AudioFormatWriter *w, int channels, int numSamples)
 
 ~Buffer ()
 
bool write (const float *const *data, int numSamples)
 
int useTimeSlice () override
 
int writePendingData ()
 
void setDataReceiver (IncomingDataReceiver *newReceiver)
 
void setFlushInterval (int numSamples) noexcept
 

Constructor & Destructor Documentation

AudioFormatWriter::ThreadedWriter::Buffer::Buffer ( TimeSliceThread tst,
AudioFormatWriter w,
int  channels,
int  numSamples 
)
inline
AudioFormatWriter::ThreadedWriter::Buffer::~Buffer ( )
inline

Member Function Documentation

void AudioFormatWriter::ThreadedWriter::Buffer::setDataReceiver ( IncomingDataReceiver newReceiver)
inline
void AudioFormatWriter::ThreadedWriter::Buffer::setFlushInterval ( int  numSamples)
inlinenoexcept
int AudioFormatWriter::ThreadedWriter::Buffer::useTimeSlice ( )
inlineoverridevirtual

Called back by a TimeSliceThread.

When you register this class with it, a TimeSliceThread will repeatedly call this method.

The implementation of this method should use its time-slice to do something that's quick - never block for longer than absolutely necessary.

Returns
Your method should return the number of milliseconds which it would like to wait before being called again. Returning 0 will make the thread call again as soon as possible (after possibly servicing other busy clients). If you return a value below zero, your client will be removed from the list of clients, and won't be called again. The value you specify isn't a guaranteee, and is only used as a hint by the thread - the actual time before the next callback may be more or less than specified. You can force the TimeSliceThread to wake up and poll again immediately by calling its notify() method.

Implements TimeSliceClient.

bool AudioFormatWriter::ThreadedWriter::Buffer::write ( const float *const data,
int  numSamples 
)
inline
int AudioFormatWriter::ThreadedWriter::Buffer::writePendingData ( )
inline

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