Beatmup
|
Abstract audio playback base class. More...
#include <abstract_playback.h>
Classes | |
struct | Mode |
Playback configuration. More... | |
Public Member Functions | |
ThreadIndex | getMaxThreads () const |
Gives the upper limint on the number of threads the task may be performed by. More... | |
void | beforeProcessing (ThreadIndex threadCount, ProcessingTarget target, GraphicPipeline *gpu) |
Instruction called before the task is executed. More... | |
virtual void | initialize (Mode mode) |
Initializes the playback setting its main parameters. More... | |
void | setSource (Source *source) |
Specifies a Source to sample. More... | |
Source * | getSource () const |
Returns the signal source to sample. More... | |
Public Member Functions inherited from Beatmup::AbstractTask | |
virtual void | afterProcessing (ThreadIndex threadCount, GraphicPipeline *gpu, bool aborted) |
Instruction called after the task is executed. More... | |
virtual bool | process (TaskThread &thread)=0 |
Executes the task on CPU within a given thread. More... | |
virtual bool | processOnGPU (GraphicPipeline &gpu, TaskThread &thread) |
Executes the task on GPU. More... | |
virtual TaskDeviceRequirement | getUsedDevices () const |
Communicates devices (CPU and/or GPU) the task is run on. More... | |
Public Member Functions inherited from Beatmup::Object | |
virtual | ~Object () |
Protected Member Functions | |
AbstractPlayback () | |
void | advanceTime () |
Moves time pointer one buffer forward. More... | |
Protected Attributes | |
Mode | mode |
Source * | source |
dtime | clock |
Additional Inherited Members | |
Public Types inherited from Beatmup::AbstractTask | |
enum class | TaskDeviceRequirement { CPU_ONLY , GPU_OR_CPU , GPU_ONLY } |
Specifies which device (CPU and/or GPU) is used to run the task. More... | |
Static Public Member Functions inherited from Beatmup::AbstractTask | |
static ThreadIndex | validThreadCount (int number) |
Valid thread count from a given integer value. More... | |
Abstract audio playback base class.
An AbstractTask incarnation that samples a given Source in a buffered fashion. The further processing of the sampled signal (e.g., sending to a device or writing to file) is done in subclasses.
Definition at line 34 of file abstract_playback.h.
|
protected |
Definition at line 72 of file abstract_playback.cpp.
|
protected |
Moves time pointer one buffer forward.
Definition at line 91 of file abstract_playback.cpp.
|
virtual |
Gives the upper limint on the number of threads the task may be performed by.
The actual number of threads running a specific task may be less or equal to the returned value, depending on the number of workers in ThreadPool running the task.
Reimplemented from Beatmup::AbstractTask.
Definition at line 80 of file abstract_playback.cpp.
|
virtual |
Instruction called before the task is executed.
threadCount | Number of threads used to perform the task |
target | Device used to perform the task |
gpu | A graphic pipeline instance; may be null. |
Reimplemented from Beatmup::AbstractTask.
Definition at line 84 of file abstract_playback.cpp.
|
virtual |
Initializes the playback setting its main parameters.
Reimplemented in Beatmup::Audio::BasicRealtimePlayback, Beatmup::Audio::Android::SLESPlayback, and Beatmup::Audio::Android::AAudioPlayback.
Definition at line 74 of file abstract_playback.cpp.
|
inline |
Specifies a Source to sample.
[in] | source | The source of audio signal to play from |
Definition at line 88 of file abstract_playback.h.
|
inline |
|
protected |
Definition at line 65 of file abstract_playback.h.
|
protected |
Definition at line 66 of file abstract_playback.h.
|
protected |
Definition at line 68 of file abstract_playback.h.