MPMA Framework 0.4
Public Member Functions
AUDIO::LoopSource Class Reference

Source that creates a streaming infinite length loop from another source. If reading data reaches the end or the loop endpoint, it seeks back to the loop start point. More...

#include <Source.h>

Inheritance diagram for AUDIO::LoopSource:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 LoopSource (std::shared_ptr< Source > source, nuint loopStartSample=0, nuint loopEndSample=~0)
 Source will initially start at the beginning (you can always Seek() still), and read until loopEndSample or the end is hit, at which point it is Seek()'d back to loopStartSample. This will loop forever.
virtual nuint FillData (void *data, nuint maxSamples)
 Instructs the data source to write in the next maxSamples worth of data. It should return how many samples were actually written. If less samples than requested were returned and GetRemainingSamples still returns that there is data left, this may be called multiple times consecutively. All sound samples must be 16-bit signed values. Stereo samples must be interleaved, with the left channel first.
nuint GetRemainingSamples () const
 This must return the number of samples left to be read, or 0 if all data has been read. For stereo sources, a single sample includes both left and right channel data. It may also return FINITE_DATA or INFINITE_DATA.
bool IsStereo () const
 Returns whether the sound is stereo. Stereo sources will have their output collpased to mono if they are used with 3D positioning. The value returned from this must remain constant for any given instance.
nuint GetSampleRate () const
 Returns the number of samples per second that should be played under normal conditions. The value returned from this must remain constant for any given instance.

Detailed Description

Source that creates a streaming infinite length loop from another source. If reading data reaches the end or the loop endpoint, it seeks back to the loop start point.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends