HoaLibrary  2.0
High Order Ambisonics Library
 All Classes Namespaces Functions Enumerations Enumerator
Public Member Functions | List of all members
Hoa2D::SourcesManager Class Reference

The sources manager. More...

#include <SourcesManager.h>

Public Member Functions

 SourcesManager (double maximumRadius=1., bool existence=true)
 The source manager constructor. More...
 
 ~SourcesManager ()
 The source manager destructor free the memory.
 
void clearAll ()
 Clear all the sources and groups.
 
void setMaximumRadius (double limitValue)
 Set the maximum radius the sources and groups can have. More...
 
void setExistence (bool state)
 Set the existence state of the sources manager. More...
 
void setZoom (double zoom)
 Set the zoom factor. More...
 
long getMaximumIndexOfSource ()
 Get the maximum index of sources. More...
 
long getNumberOfSources ()
 Get the number of sources actually managed. More...
 
long getMaximumIndexOfGroup ()
 Get the maximum index of the sources actually managed. More...
 
long getNumberOfGroups ()
 Get the number of groups actually managed. More...
 
double getLimitMaximum ()
 Get the maximum radius of the sources and groups. More...
 
bool getExistence ()
 Get the existence state of the source manager. More...
 
double getZoom ()
 Get the zoom factor value. More...
 
void sourceNewPolar (double radius, double azimuth)
 Add a new source with polar coordinates. More...
 
void sourceNewCartesian (double abscissa, double ordinate)
 Add a new source with cartesian coordinates. More...
 
void sourceSetPolar (long index, double radius, double azimuth)
 Set position of a source with polar coordinates. More...
 
void sourceSetRadius (long index, double radius)
 Set radius of a source. More...
 
void sourceSetAzimuth (long index, double azimuth)
 Set azimuth of a source. More...
 
void sourceSetCartesian (long index, double abscissa, double ordinate)
 Set position of a source with cartesian coordinates. More...
 
void sourceSetAbscissa (long index, double abscissa)
 Set abscissa of a source. More...
 
void sourceSetOrdinate (long index, double ordinate)
 Set ordinate of a source. More...
 
void sourceSetColor (long index, double red, double green, double blue, double alpha)
 Set the rgba color of a source. More...
 
void sourceSetDescription (long index, std::string description)
 Add a description to a given source. More...
 
void sourceRemove (long index)
 Remove a source. More...
 
void sourceSetMute (long index, bool state)
 Set the mute state of a source. More...
 
long sourceGetExistence (long index)
 Retrieve the existence state of a source. More...
 
double sourceGetRadius (long index)
 Get the radius of a source. More...
 
double sourceGetAzimuth (long index)
 Get the azimuth of a source. More...
 
double sourceGetAbscissa (long index)
 Get the abscissa of a source. More...
 
double sourceGetOrdinate (long index)
 Get the ordinate of a source. More...
 
double * sourceGetColor (long index)
 Get the rgba color of a source. More...
 
std::string sourceGetDescription (long index)
 Get the text description of a source. More...
 
long sourceGetNumberOfGroups (long index)
 Get the number of group a source is owned by. More...
 
long sourceGetGroupIndex (long sourceIndex, long groupIndex)
 Get the the group index the source is owned by at a particular index. More...
 
long sourceGetMute (long index)
 Retrieve the mute state of a source. More...
 
void groupSetSource (long groupIndex, long sourceIndex)
 Add a source to a group. More...
 
void groupRemoveSource (long groupIndex, long sourceIndex)
 Remove source from a group. More...
 
void groupSetPolar (long index, double radius, double azimuth)
 Set position of a group with polar coordinates. More...
 
void groupSetRadius (long index, double radius)
 Set radius of a group. More...
 
void groupSetAzimuth (long index, double azimuth)
 Set azimuth of a group. More...
 
void groupSetCartesian (long index, double abscissa, double ordinate)
 Set position of a group with cartesian coordinates. More...
 
void groupSetAbscissa (long index, double abscissa)
 Set abscissa of a group. More...
 
void groupSetOrdinate (long index, double ordinate)
 Set ordinate of a group. More...
 
void groupSetRelativePolar (long groupIndex, double radius, double azimuth)
 Set position of a group with relative polar coordinates. More...
 
void groupSetRelativeRadius (long groupIndex, double radius)
 Set radius of a group with relative value. More...
 
void groupSetRelativeAzimuth (long groupIndex, double azimuth)
 Set azimuth of a group with relative value. More...
 
void groupSetColor (long index, double red, double green, double blue, double alpha)
 Set the rgba color of a group. More...
 
void groupSetDescription (long index, std::string description)
 Add a description to a given group. More...
 
void groupRemove (long groupIndex)
 Remove group. More...
 
void groupRemoveWithSources (long groupIndex)
 Remove group and sources it contains. More...
 
long groupGetNumberOfSources (long groupIndex)
 Get the number of sources a group contains. More...
 
long groupGetSourceIndex (long groupIndex, long sourceIndex)
 Get the the index of a source stored at a particular index by a group. More...
 
void groupSetMute (long index, long state)
 Set the mute state of a group. More...
 
void groupClean ()
 Clean all groups.
 
long groupGetExistence (long index)
 Retrieve the existence state of a group. More...
 
double groupGetRadius (long index)
 Get the radius of a group. More...
 
double groupGetAzimuth (long index)
 Get the azimuth of a group. More...
 
double groupGetAbscissa (long index)
 Get the abscissa of a group. More...
 
double groupGetOrdinate (long index)
 Get the ordinate of a group. More...
 
double * groupGetColor (long index)
 Get the rgba color of a group. More...
 
std::string groupGetDescription (long index)
 Get the text description of a group. More...
 
long groupGetMute (long index)
 Retrieve the mute state of a group. More...
 
bool groupGetIfSourceMuted (long index)
 Returns true if a source is is muted in a group. More...
 
long groupGetNextIndex ()
 Retrieve the next free group index. More...
 

Detailed Description

The sources manager.

The SourcesManager should be used to store and manage multiple Source and SourcesGroup

Definition at line 21 of file SourcesManager.h.

Constructor & Destructor Documentation

Hoa2D::SourcesManager::SourcesManager ( double  maximumRadius = 1.,
bool  existence = true 
)

The source manager constructor.

The source manager constructor allocates and initialize the member values.
Parameters
maximumRadiusThe maximum radius the sources or groups in the source manager could have
existenceThe existence state of the source manager.

Definition at line 11 of file SourcesManager.cpp.

Member Function Documentation

bool Hoa2D::SourcesManager::getExistence ( )

Get the existence state of the source manager.

Returns
The existence state.

Definition at line 37 of file SourcesManager.cpp.

double Hoa2D::SourcesManager::getLimitMaximum ( )

Get the maximum radius of the sources and groups.

Returns
The maximum radius.

Definition at line 59 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::getMaximumIndexOfGroup ( )

Get the maximum index of the sources actually managed.

Returns
The maximum index.

Definition at line 86 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::getMaximumIndexOfSource ( )

Get the maximum index of sources.

Returns
The maximum index of source.

Definition at line 64 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::getNumberOfGroups ( )

Get the number of groups actually managed.

Returns
The number of group.

Definition at line 91 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::getNumberOfSources ( )

Get the number of sources actually managed.

Returns
The number of sources.

Definition at line 75 of file SourcesManager.cpp.

double Hoa2D::SourcesManager::getZoom ( )

Get the zoom factor value.

Returns
The zoom factor value.

Definition at line 54 of file SourcesManager.cpp.

double Hoa2D::SourcesManager::groupGetAbscissa ( long  index)

Get the abscissa of a group.

Parameters
indexThe index of the group.
Returns
The abscissa of the group.

Definition at line 613 of file SourcesManager.cpp.

double Hoa2D::SourcesManager::groupGetAzimuth ( long  index)

Get the azimuth of a group.

Parameters
indexThe index of the group.
Returns
The azimuth of the group.

Definition at line 605 of file SourcesManager.cpp.

double * Hoa2D::SourcesManager::groupGetColor ( long  index)

Get the rgba color of a group.

Parameters
indexThe index of the group.
Returns
The rgba color of the group as an array of 4 values (red, green, blue, alpha).

Definition at line 629 of file SourcesManager.cpp.

std::string Hoa2D::SourcesManager::groupGetDescription ( long  index)

Get the text description of a group.

Parameters
indexThe index of the group.
Returns
The text description.

Definition at line 637 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::groupGetExistence ( long  index)

Retrieve the existence state of a group.

Parameters
indexThe index of the group.
Returns
The existence state of the group.

Definition at line 645 of file SourcesManager.cpp.

bool Hoa2D::SourcesManager::groupGetIfSourceMuted ( long  index)

Returns true if a source is is muted in a group.

Parameters
indexThe index of the group.
Returns
True if a source is is muted in the group, false otherwise.

Definition at line 681 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::groupGetMute ( long  index)

Retrieve the mute state of a group.

Parameters
indexThe index of the group.
Returns
The mute state of the group.

Definition at line 672 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::groupGetNextIndex ( )

Retrieve the next free group index.

Returns
The next free group index.

Definition at line 696 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::groupGetNumberOfSources ( long  groupIndex)

Get the number of sources a group contains.

Parameters
groupIndexThe index of the group.

Definition at line 654 of file SourcesManager.cpp.

double Hoa2D::SourcesManager::groupGetOrdinate ( long  index)

Get the ordinate of a group.

Parameters
indexThe index of the group.
Returns
The ordinate of the group.

Definition at line 621 of file SourcesManager.cpp.

double Hoa2D::SourcesManager::groupGetRadius ( long  index)

Get the radius of a group.

Parameters
indexThe index of the group.
Returns
The radius of the group.

Definition at line 597 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::groupGetSourceIndex ( long  groupIndex,
long  sourceIndex 
)

Get the the index of a source stored at a particular index by a group.

Parameters
groupIndexThe index of the group.
sourceIndexThe index of the source.
Returns
The index of the source if it exists, -1 otherwise.

Definition at line 663 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupRemove ( long  groupIndex)

Remove group.

Parameters
groupIndexThe index of the group.
See Also
groupRemoveWithSources

Definition at line 548 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupRemoveSource ( long  groupIndex,
long  sourceIndex 
)

Remove source from a group.

Parameters
groupIndexThe index of the group.
sourceIndexThe index of the source.
See Also
groupSetSource

Definition at line 448 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupRemoveWithSources ( long  groupIndex)

Remove group and sources it contains.

Parameters
groupIndexThe index of the group.
See Also
groupRemove

Definition at line 568 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetAbscissa ( long  index,
double  abscissa 
)

Set abscissa of a group.

Parameters
indexThe index of the group.
abscissaThe abscissa of the group.
See Also
groupSetOrdinate

Definition at line 492 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetAzimuth ( long  index,
double  azimuth 
)

Set azimuth of a group.

Parameters
indexThe index of the group.
azimuthThe azimuth of the group.
See Also
groupSetRadius, groupSetAzimuth

Definition at line 476 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetCartesian ( long  index,
double  abscissa,
double  ordinate 
)

Set position of a group with cartesian coordinates.

Parameters
indexThe index of the group.
abscissaThe abscissa of the group.
ordinateThe ordinate of the group.
See Also
groupSetAbscissa, groupSetOrdinate, groupSetPolar

Definition at line 484 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetColor ( long  index,
double  red,
double  green,
double  blue,
double  alpha 
)

Set the rgba color of a group.

All values are clipped between 0 and 1.

Parameters
indexThe index of the group.
redThe red component of the color.
greenThe green component of the color
blueThe blue component of the color
alphaThe alpha component of the color

Definition at line 532 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetDescription ( long  index,
std::string  description 
)

Add a description to a given group.

Parameters
indexThe index of the group.
descriptionThe text description of the group.

Definition at line 540 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetMute ( long  index,
long  state 
)

Set the mute state of a group.

Parameters
indexThe index of the group.
stateThe mute state of the group.

Definition at line 579 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetOrdinate ( long  index,
double  ordinate 
)

Set ordinate of a group.

Parameters
indexThe index of the group.
ordinateThe ordinate of the group.
See Also
groupSetAbscissa

Definition at line 500 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetPolar ( long  index,
double  radius,
double  azimuth 
)

Set position of a group with polar coordinates.

Parameters
indexThe index of the group.
radiusThe radius of the group.
azimuthThe azimuth of the group.
See Also
groupSetRadius, groupSetAzimuth, groupSetCartesian

Definition at line 460 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetRadius ( long  index,
double  radius 
)

Set radius of a group.

Parameters
indexThe index of the group.
radiusThe radius of the group.
See Also
groupSetPolar, groupSetAzimuth

Definition at line 468 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetRelativeAzimuth ( long  groupIndex,
double  azimuth 
)

Set azimuth of a group with relative value.

Parameters
indexThe index of the group.
azimuthThe relative azimuth of the group.
See Also
groupSetAzimuth, groupSetRadius, groupSetPolar

Definition at line 524 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetRelativePolar ( long  groupIndex,
double  radius,
double  azimuth 
)

Set position of a group with relative polar coordinates.

Parameters
indexThe index of the group.
radiusThe relative radius of the group.
azimuthThe relative azimuth of the group.
See Also
groupSetRadius, groupSetAzimuth, groupSetCartesian

Definition at line 508 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetRelativeRadius ( long  groupIndex,
double  radius 
)

Set radius of a group with relative value.

Parameters
indexThe index of the group.
radiusThe relative radius of the group.
See Also
groupSetRadius, groupSetAzimuth, groupSetPolar

Definition at line 516 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::groupSetSource ( long  groupIndex,
long  sourceIndex 
)

Add a source to a group.

Parameters
groupIndexThe index of the group.
sourceIndexThe index of the source.
See Also
groupRemoveSource

Definition at line 416 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::setExistence ( bool  state)

Set the existence state of the sources manager.

If the existence state is false it will delete all sources and groups already stored.

Parameters
stateThe existence state.

Definition at line 18 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::setMaximumRadius ( double  limitValue)

Set the maximum radius the sources and groups can have.

Parameters
limitValueThe radius limit value.

Definition at line 42 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::setZoom ( double  zoom)

Set the zoom factor.

Set the zoom factor between 0 and 1.

Parameters
zoomThe zoom factor.

Definition at line 49 of file SourcesManager.cpp.

double Hoa2D::SourcesManager::sourceGetAbscissa ( long  index)

Get the abscissa of a source.

Parameters
indexThe index of the source.
Returns
The abscissa of the source.

Definition at line 344 of file SourcesManager.cpp.

double Hoa2D::SourcesManager::sourceGetAzimuth ( long  index)

Get the azimuth of a source.

Parameters
indexThe index of the source.
Returns
The azimuth of the source.

Definition at line 336 of file SourcesManager.cpp.

double * Hoa2D::SourcesManager::sourceGetColor ( long  index)

Get the rgba color of a source.

Parameters
indexThe index of the source.
Returns
The rgba color of the source as an array of 4 values (red, green, blue, alpha).

Definition at line 360 of file SourcesManager.cpp.

std::string Hoa2D::SourcesManager::sourceGetDescription ( long  index)

Get the text description of a source.

Parameters
indexThe index of the source.
Returns
The text description.

Definition at line 368 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::sourceGetExistence ( long  index)

Retrieve the existence state of a source.

Parameters
indexThe index of the source.
Returns
The existence state of the source.

Definition at line 376 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::sourceGetGroupIndex ( long  sourceIndex,
long  groupIndex 
)

Get the the group index the source is owned by at a particular index.

Parameters
sourceIndexThe index of the source.
groupIndexThe index of the group
Returns
The group index.

Definition at line 394 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::sourceGetMute ( long  index)

Retrieve the mute state of a source.

Parameters
indexThe index of the source.
Returns
The mute state of the source.

Definition at line 403 of file SourcesManager.cpp.

long Hoa2D::SourcesManager::sourceGetNumberOfGroups ( long  index)

Get the number of group a source is owned by.

Parameters
indexThe index of the source.
Returns
The number of group.

Definition at line 385 of file SourcesManager.cpp.

double Hoa2D::SourcesManager::sourceGetOrdinate ( long  index)

Get the ordinate of a source.

Parameters
indexThe index of the source.
Returns
The ordinate of the source.

Definition at line 352 of file SourcesManager.cpp.

double Hoa2D::SourcesManager::sourceGetRadius ( long  index)

Get the radius of a source.

Parameters
indexThe index of the source.
Returns
The radius of the source.

Definition at line 328 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceNewCartesian ( double  abscissa,
double  ordinate 
)

Add a new source with cartesian coordinates.

Parameters
abscissaThe abscissa of the source.
ordinateThe ordinate of the source.
See Also
sourceNewPolar

Definition at line 142 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceNewPolar ( double  radius,
double  azimuth 
)

Add a new source with polar coordinates.

Parameters
radiusThe radius of the source.
azimuthThe azimuth of the source.
See Also
sourceNewCartesian

Definition at line 130 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceRemove ( long  index)

Remove a source.

This will also remove the source from all the group that the source is a part of.

Parameters
indexThe index of the source to remove.

Definition at line 106 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceSetAbscissa ( long  index,
double  abscissa 
)

Set abscissa of a source.

Parameters
indexThe index of the source.
abscissaThe abscissa of the source.
See Also
sourceSetOrdinate

Definition at line 221 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceSetAzimuth ( long  index,
double  azimuth 
)

Set azimuth of a source.

Parameters
indexThe index of the source.
azimuthThe azimuth of the source.
See Also
sourceSetRadius, sourceSetAzimuth

Definition at line 188 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceSetCartesian ( long  index,
double  abscissa,
double  ordinate 
)

Set position of a source with cartesian coordinates.

Parameters
indexThe index of the source.
abscissaThe abscissa of the source.
ordinateThe ordinate of the source.
See Also
sourceSetAbscissa, sourceSetOrdinate, sourceSetPolar

Definition at line 215 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceSetColor ( long  index,
double  red,
double  green,
double  blue,
double  alpha 
)

Set the rgba color of a source.

All values are clipped between 0 and 1.

Parameters
indexThe index of the source.
redThe red component of the color.
greenThe green component of the color
blueThe blue component of the color
alphaThe alpha component of the color

Definition at line 275 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceSetDescription ( long  index,
std::string  description 
)

Add a description to a given source.

Parameters
indexThe index of the source.
descriptionThe text description of the source.

Definition at line 283 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceSetMute ( long  index,
bool  state 
)

Set the mute state of a source.

Parameters
indexThe index of the source.
stateThe mute state of the source.

Definition at line 309 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceSetOrdinate ( long  index,
double  ordinate 
)

Set ordinate of a source.

Parameters
indexThe index of the source.
ordinateThe ordinate of the source.
See Also
sourceSetAbscissa

Definition at line 248 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceSetPolar ( long  index,
double  radius,
double  azimuth 
)

Set position of a source with polar coordinates.

Parameters
indexThe index of the source.
radiusThe radius of the source.
azimuthThe azimuth of the source.
See Also
sourceSetRadius, sourceSetAzimuth, sourceSetCartesian

Definition at line 154 of file SourcesManager.cpp.

void Hoa2D::SourcesManager::sourceSetRadius ( long  index,
double  radius 
)

Set radius of a source.

Parameters
indexThe index of the source.
radiusThe radius of the source.
See Also
sourceSetPolar, sourceSetAzimuth

Definition at line 160 of file SourcesManager.cpp.