Nsound
0.9.4
|
This class enables easy scheduling and mixing of multiple AudioStreams. More...
#include <Nsound/Mixer.h>
Public Member Functions | |
Mixer () | |
Constructor. More... | |
~Mixer () | |
Destuctor. More... | |
void | add (float64 first_beat_time, float64 beats_per_minute, const AudioStream &audio_stream) |
This method inserts the AudioStream to the Mixer's LinkList. More... | |
AudioStream | getStream (float64 end_time) |
This method returns one AudioStream composed of all AudioStreams stored in the Mixer's LinkList. More... | |
AudioStream | getStream (float64 start_time, float64 end_time) |
void | clear () |
This method removes all streams from the mixer. More... | |
uint32 | size () const |
This method returns the number of stream stored in it. More... | |
Private Attributes | |
Nsound::uint32 | max_channels_ |
Stores the maximum number of channels. More... | |
Nsound::MixerSet | mixer_set_ |
This stores all the MixerNodes. More... | |
This class enables easy scheduling and mixing of multiple AudioStreams.
This class can que up AudioStreams using beats per minute and first beat time.
Mixer::Mixer | ( | ) |
Constructor.
Constructor
Definition at line 47 of file Mixer.cc.
void Mixer::add | ( | float64 | first_beat_time, |
float64 | beats_per_minute, | ||
const AudioStream & | audio_stream | ||
) |
This method inserts the AudioStream to the Mixer's LinkList.
This method inserts the AudioStream into the Mixer's LinkList.
first_beat_time | - The time this AudioStream starts playing in the Mixer, must be >= zero. |
beats_per_minute | - The number of times this AudioStream will play per minute. If this is <= zero, the AudioStream will play only once. |
audio_stream | - The AudioStream object to be stored. |
Definition at line 59 of file Mixer.cc.
References Nsound::AudioStream::getNChannels(), M_ASSERT_VALUE, max_channels_, and mixer_set_.
Referenced by main().
AudioStream Mixer::getStream | ( | float64 | end_time | ) |
This method returns one AudioStream composed of all AudioStreams stored in the Mixer's LinkList.
This method returns one AudioStream composed of all AudioStreams stored in the Mixer's LinkList.
Definition at line 91 of file Mixer.cc.
Referenced by main().
AudioStream Mixer::getStream | ( | float64 | start_time, |
float64 | end_time | ||
) |
Definition at line 123 of file Mixer.cc.
References Nsound::AudioStream::add(), Nsound::AudioStream::getLength(), M_ASSERT_VALUE, max_channels_, mixer_set_, Nsound::start_time, and Nsound::AudioStream::substream().
void Mixer::clear | ( | ) |
This method removes all streams from the mixer.
Definition at line 84 of file Mixer.cc.
References mixer_set_.
Referenced by main().
|
inline |
This method returns the number of stream stored in it.
Definition at line 124 of file Mixer.h.
References mixer_set_.
Referenced by main().
|
private |
Stores the maximum number of channels.
Definition at line 124 of file Mixer.h.
Referenced by add(), and getStream().
|
private |