Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <Source.h>
Public Member Functions | |
virtual | ~Source () |
LVector3 | getPosition () const throw () |
void | setPosition (LVector3 x) throw () |
Vector3 | getDirection () const throw () |
void | setDirection (Vector3 x) throw () |
Vector3 | getVelocity () const throw () |
void | setVelocity (Vector3 x) throw () |
Range< Scalar > | getAngleRange () const throw () |
void | setAngleRange (Range< Scalar > r) throw () |
Range< Scalar > | getCosAngleRange () const throw () |
void | setCosAngleRange (Range< Scalar > r) throw () |
Scalar | getRadius () const throw () |
void | setRadius (Scalar r) throw () |
PerFrequency< Scalar > | getPerFrequencyRadiusRatios () const throw () |
void | setPerFrequencyRadiusRatios (PerFrequency< Scalar > val) throw () |
PerFrequency< Scalar > | getReferenceFreqs () const throw () |
void | setReferenceFreqs (PerFrequency< Scalar > val) throw () |
Scalar | getGain () const throw () |
void | setGain (Scalar g) throw () |
bool | isLooping () const throw () |
void | setLooping (bool loop) throw () |
bool | isAttenuated () const throw () |
void | setAttenuated (bool attenuated) throw () |
bool | isRelative () const throw () |
void | setRelative (bool relative) throw () |
void | startPlaying (Timestamp start=0) throw (Exception) |
void | stopPlaying () throw () |
void | pausePlaying () throw () |
void | continuePlaying () throw (Exception) |
bool | isPlaying () const throw () |
bool | isActive () const throw () |
Timestamp | getPlayingTime () const throw () |
Timestamp | getWouldbePlayingTime () const throw () |
SharedPtr< RenderableSource > | getRenderable () const throw () |
void | setRenderable (SharedPtr< RenderableSource > ptr) throw () |
SharedPtr< UserData > | getUserDataPtr () const throw () |
void | setUserDataLong (SharedPtr< UserData > ptr) throw () |
long | getUserDataLong () const throw () |
void | setUserDataLong (long data) throw () |
SharedPtr< SourceListener > | getSourceListener () const throw () |
void | setSourceListener (SharedPtr< SourceListener > ptr) throw () |
SharedPtr< Sound > | getSound () const throw () |
void | setSound (SharedPtr< Sound > ptr) throw () |
void | updateRenderable (int flags, const Listener &sceneListener) throw () |
void | seek (Timestamp time) throw (Exception) |
void | _notifyPlaying () throw () |
Protected Member Functions | |
Source (SharedPtr< Sound > sound, bool looping=false) throw () | |
Timestamp | setLastKnownPlayingTime (Timestamp timestamp) throw () |
virtual void | startPlayingImpl (Timestamp start)=0 throw (Exception) |
virtual void | stopPlayingImpl ()=0 throw (Exception) |
virtual bool | isPlayingImpl () const =0 throw (Exception) |
Protected Attributes | |
LVector3 | position |
Vector3 | direction |
Vector3 | velocity |
Range< Scalar > | cosAngleRange |
Scalar | radius |
PerFrequency< Scalar > | pfRadiusRatios |
PerFrequency< Scalar > | referenceFreqs |
Scalar | gain |
struct { | |
int looping: 1 | |
int attenuated: 1 | |
int relative: 1 | |
} | flags |
Timestamp | lastKnownPlayingTime |
Timestamp | lastKnownPlayingTimeTime |
struct { | |
int location: 1 | |
int attributes: 1 | |
int gain: 1 | |
int soundPtr: 1 | |
int soundAttributes: 1 | |
} | dirty |
Source abstract class
|
virtual |
Definition at line 40 of file Source.cpp.
void Audio::Source::_notifyPlaying | ( | ) | ||
throw | ( | |||
) |
Notifies source listeners (if any) that the source has begun actually playing.
void Audio::Source::continuePlaying | ( | ) | ||
throw | ( | Exception | ||
) |
Continue playing a source
Definition at line 83 of file Source.cpp.
References getWouldbePlayingTime(), isActive(), and isPlaying().
Return the source's minimum/maximum propagation angle
Definition at line 138 of file Source.cpp.
References UniverseUtil::acos(), cosAngleRange, Audio::Range< T >::max, and Audio::Range< T >::min.
Referenced by Audio::OpenALRenderableSource::updateImpl(), and Audio::OpenALRenderableStreamingSource::updateImpl().
Definition at line 141 of file Source.h.
References cosAngleRange.
|
inline |
Return the source's main propagation direction
Definition at line 119 of file Source.h.
References direction.
Referenced by Audio::OpenALRenderableSource::updateImpl(), and Audio::OpenALRenderableStreamingSource::updateImpl().
|
inline |
Get the source's main gain
Definition at line 172 of file Source.h.
References gain.
Referenced by Audio::OpenALRenderableSource::updateImpl(), and Audio::OpenALRenderableStreamingSource::updateImpl().
|
inline |
Get the source's frequency-dependant radius ratios
Definition at line 158 of file Source.h.
References pfRadiusRatios.
Timestamp Audio::Source::getPlayingTime | ( | ) | const | |
throw | ( | |||
) |
Get the playing position of a playing or paused source
Definition at line 99 of file Source.cpp.
References e, isActive(), and lastKnownPlayingTime.
Referenced by pausePlaying().
|
inline |
Return the source's central position in 3D space
Definition at line 113 of file Source.h.
References position.
Referenced by Audio::OpenALRenderableSource::updateImpl(), and Audio::OpenALRenderableStreamingSource::updateImpl().
|
inline |
Get the source's radius
Definition at line 147 of file Source.h.
References radius.
Referenced by Audio::OpenALRenderableSource::updateImpl(), and Audio::OpenALRenderableStreamingSource::updateImpl().
|
inline |
Get the source's refernece frequencies
Definition at line 166 of file Source.h.
References referenceFreqs.
|
inline |
Get the associated sound stream
Definition at line 267 of file Source.h.
Referenced by Audio::OpenALRenderableSource::attachALBuffers(), Audio::OpenALRenderableStreamingSource::getPlayingTimeImpl(), Audio::OpenALRenderableStreamingSource::queueALBuffers(), and Audio::OpenALRenderableStreamingSource::updateImpl().
|
inline |
|
inline |
Get user-specific data associated with this sound source
Definition at line 255 of file Source.h.
Referenced by Audio::Test::EngParticleListener::onUpdate().
|
inline |
Return the source's velocity
Definition at line 125 of file Source.h.
References velocity.
Referenced by Audio::OpenALRenderableSource::updateImpl(), and Audio::OpenALRenderableStreamingSource::updateImpl().
Timestamp Audio::Source::getWouldbePlayingTime | ( | ) | const | |
throw | ( | |||
) |
Get the playing position of a playing or paused source. For a paused source, extrapolate from the last known playing time and elapsed time since the measurement was done.
Definition at line 111 of file Source.cpp.
References e, Audio::getRealTime(), isActive(), lastKnownPlayingTime, and lastKnownPlayingTimeTime.
Referenced by continuePlaying().
bool Audio::Source::isActive | ( | ) | const | |
throw | ( | |||
) |
Is the attached renderable playing this source?
Definition at line 129 of file Source.cpp.
References e.
Referenced by continuePlaying(), getPlayingTime(), getWouldbePlayingTime(), and pausePlaying().
|
inline |
Is the source using distance attenuation?
Definition at line 184 of file Source.h.
References flags.
Referenced by Audio::OpenALRenderableSource::updateImpl(), and Audio::OpenALRenderableStreamingSource::updateImpl().
|
inline |
Is the source in looping mode?
Definition at line 178 of file Source.h.
References flags.
Referenced by Audio::OpenALRenderableStreamingSource::queueALBuffers(), Audio::OpenALRenderableSource::updateImpl(), and Audio::OpenALRenderableStreamingSource::updateImpl().
bool Audio::Source::isPlaying | ( | ) | const | |
throw | ( | |||
) |
Is the source still playing?
Definition at line 120 of file Source.cpp.
References e, and isPlayingImpl().
Referenced by continuePlaying(), and Audio::SimpleSource::stopPlayingImpl().
|
inline |
Is the source's position always relative to the root listener?
Definition at line 194 of file Source.h.
References flags.
Referenced by Audio::OpenALRenderableSource::updateImpl(), and Audio::OpenALRenderableStreamingSource::updateImpl().
void Audio::Source::pausePlaying | ( | ) | ||
throw | ( | |||
) |
Pause a playing source
Definition at line 64 of file Source.cpp.
References e, getPlayingTime(), isActive(), and setLastKnownPlayingTime().
Referenced by stopPlaying().
Seek to the specified position
EndOfStreamException | if you try to seek past the end |
Definition at line 209 of file Source.cpp.
|
inline |
Set whether the source uses distance attenuation
Definition at line 187 of file Source.h.
References attenuated, dirty, and flags.
Definition at line 144 of file Source.h.
References cosAngleRange, and dirty.
|
inline |
|
inline |
Set the last known playing time, update the measurement timestamp as well.
Definition at line 44 of file Source.cpp.
References Audio::getRealTime().
Referenced by pausePlaying().
|
inline |
|
inline |
Set the source's frequency-dependant radius ratios
Definition at line 163 of file Source.h.
References dirty, and pfRadiusRatios.
|
inline |
|
inline |
|
inline |
Set the source's reference frequencies
Definition at line 169 of file Source.h.
References dirty, and referenceFreqs.
|
inline |
void Audio::Source::setRenderable | ( | SharedPtr< RenderableSource > | ptr) | ||
throw | ( | ||||
) |
Set renderer-specific data to be associated (and destroyed) with this sound source
Definition at line 195 of file Source.cpp.
|
inline |
|
inline |
|
inline |
Play the source
start | an optional timestamp to start playing from. |
Definition at line 51 of file Source.cpp.
References start.
void Audio::Source::stopPlaying | ( | ) | ||
throw | ( | |||
) |
Stop a playing source
Definition at line 57 of file Source.cpp.
References pausePlaying(), and stopPlayingImpl().
|
protectedpure virtual |
Convenience function to update the attached renderable, if present, and active.
flags | see RenderableSource::UpdateFlags |
sceneListener | the listener to which this source is associated |
Definition at line 151 of file Source.cpp.
References Audio::RenderableSource::UPDATE_ALL, Audio::RenderableSource::UPDATE_ATTRIBUTES, Audio::RenderableSource::UPDATE_EFFECTS, Audio::RenderableSource::UPDATE_GAIN, and Audio::RenderableSource::UPDATE_LOCATION.
int Audio::Source::attenuated |
Definition at line 60 of file Source.h.
Referenced by setAttenuated().
int Audio::Source::attributes |
Definition at line 50 of file Source.h.
Referenced by getAngleRange(), getCosAngleRange(), and setCosAngleRange().
|
protected |
Definition at line 47 of file Source.h.
Referenced by getDirection(), and setDirection().
struct { ... } Audio::Source::dirty |
Notify implementations after position and/or attributes changes
Referenced by setAttenuated(), setCosAngleRange(), setDirection(), setGain(), setLooping(), setPerFrequencyRadiusRatios(), setPosition(), setRadius(), setReferenceFreqs(), setRelative(), setSound(), and setVelocity().
struct { ... } Audio::Source::flags |
Referenced by isAttenuated(), isLooping(), isRelative(), setAttenuated(), setLooping(), and setRelative().
|
protected |
|
protected |
Definition at line 64 of file Source.h.
Referenced by getPlayingTime(), and getWouldbePlayingTime().
|
protected |
Definition at line 65 of file Source.h.
Referenced by getWouldbePlayingTime().
|
protected |
Definition at line 53 of file Source.h.
Referenced by getPerFrequencyRadiusRatios(), and setPerFrequencyRadiusRatios().
|
protected |
Definition at line 46 of file Source.h.
Referenced by getPosition(), and setPosition().
|
protected |
Definition at line 52 of file Source.h.
Referenced by getRadius(), and setRadius().
|
protected |
Definition at line 54 of file Source.h.
Referenced by getReferenceFreqs(), and setReferenceFreqs().
int Audio::Source::relative |
Definition at line 61 of file Source.h.
Referenced by setRelative().
|
protected |
Definition at line 48 of file Source.h.
Referenced by getVelocity(), and setVelocity().