8 #ifndef SPEAKERLAYOUT_H
9 #define SPEAKERLAYOUT_H
54 void addSpeaker(
float azimuth,
float elevation = 0.0,
float radius = 1.0);
56 void addSpeaker(
float x,
float y,
float z,
float xNorm,
float yNorm,
float zNorm,
float gain);
108 Speaker(
float x,
float y,
float z,
float xNorm,
float yNorm,
float zNorm,
float gain = 1.0);
static SpeakerLayout * sDefaultSpeakerLayout
virtual ~SpeakerLayout()
destructor
The Model/Observable/Subject class; instances of its subclasses should send themselves, this->changed(some_data); on "relevant" state changes; the code they inherit (from Model) manages updating the list of observer/dependent objects in that they each receive update(some_data); and can access the model-passed data (the model might pass "this").
float * mSpeakerDistanceDeltas
Holds the diference of the optimal speaker distance and the real one. Only used if distances are norm...
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
"Headphone Layout", where two phones are positioned 90¼ left, 90¼ right and no elevation (0¼)...
Speaker * speakerAtIndex(unsigned speakerIndex) const
Returns the speaker at the specified index.
void normalizeSpeakerDistances(float radius=0)
Returns the number of loudspeakers in the layout.
Speaker(float azimuth, float elevation, float radius=1.0)
Speaker constructor. The speaker class should only be used by the speaker layout. Clients should modi...
SpeakerLayout(const char *filePath=NULL)
Creates an empty speaker layout. Optionally reads loudspeaker layout from file.
void readSpeakerFile(const char *filePath)
Reads the speaker listing file according to the specification.
Represents a speaker as a position relative to the center of a space.
void dump()
Print speaker information.
vector< Speaker * > mSpeakers
Vector of pointers to the loudspeakers.
static void setDefaultSpeakerLayout(SpeakerLayout *defaultLayout)
Use it to set a layout as default. Clients (e.g. a Panner) can then make use of this layout...
void dump()
If any of the speakers in the layout has an elevation other than 0, it returns true.
unsigned numSpeakers() const
static SpeakerLayout * defaultSpeakerLayout()
Returns a pointer to the default layout. If no default exists, it creates one.
void setRadius(float radius)
Specify the distance from the center of the coordinate space to the speaker.
void addSpeaker(float azimuth, float elevation=0.0, float radius=1.0)
Add a speaker specifying its position in degrees from the center of the listening space...
SpeakerLayout & operator=(const SpeakerLayout &layout)
Overloaded "=" operator allows copying the layout.
Standard "Stereo Speaker Layout", where two speakers are positioned 30¼ left, 30¼ right and no elevat...