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

The channel manager. More...

#include <ChannelManager.h>

Public Member Functions

 ChannelManager (unsigned int number_of_channels=1)
 The channel manager constructor. More...
 
 ~ChannelManager ()
 The channel manager destructor. More...
 
void setNumberOfChannels (unsigned int number_of_channels)
 Set the number of channels you want to manage. More...
 
void setAzimuth (const int index, double azimuth)
 Set one or each channel azimuth value. More...
 
void setAzimuthList (double *azimuths, long size)
 Set several channel azimuth with a list. More...
 
void resetAzimuth (const int index=-1)
 Reset one or each channel azimuth value. More...
 
void setDirectivity (const int index, const double directivity)
 Set one or each channel directivity value. More...
 
void setDirectivityList (double *directivities, long size)
 Set several channel directivity value with a list. More...
 
void resetDirectivity (const int index=-1)
 Reset one or each channel directivity to 1. More...
 
void setSelected (const int index, int selectedState)
 Set the selected state of one or each channel. More...
 
void rotateSelectedChannels (double newRadian, int channelBeingDragged, int magnet=0)
 Rotate all of the currently selected channels relative to one channel azimuth rotation. More...
 
void setFisheyeDestAzimuth (double azimuth)
 Set fisheye destination azimuth. More...
 
void setFisheyeStartAzimuth (const int index)
 Set the fisheye start azimuth of one or several channel with current azimuth. More...
 
void setFisheyeStartAzimuth (const int index, double radian)
 Set the fisheye start azimuth of one or several channel. More...
 
void setFisheyeStepWithDelta (const int index, double delta)
 Increment or decrement the fisheye step by a value. More...
 
void setFisheyeStepDirect (const int index, double fisheyeStep)
 Set the fisheye step directly. More...
 
void setAzimuthToClosestDefChannelAzimuth (const int index)
 Set channel azimuth value to the closest default azimuth position value. More...
 
long getNumberOfSelectedChannels ()
 Retrieve the number of selected channels. More...
 
double getClosestDefChannelAzimuth (const int index)
 Retrieve the closest default azimuth position of a channel. More...
 
double getClosestDefChannelAzimuth (double azimuth)
 Retrieve the closest default azimuth position relative to an azimuth value. More...
 
double getClosestDefChannelDistance (const int index)
 Retrieve the distance to the closest default azimuth position relative to the azimuth of a channel. More...
 
double getClosestDefChannelDistance (double azimuth)
 Retrieve the distance to the closest default azimuth position relative to an azimuth value. More...
 
double getFisheyeDestAzimuth () const
 Retrieve the fisheye destination azimuth value. More...
 
long getNumberOfChannels () const
 Retrieve the number of channels currently managed. More...
 
double getFisheyeStep () const
 Retrieve the current fisheye step. More...
 
bool isSelected (const int index) const
 Retrieve the selection state of a channel. More...
 
double getDirectivity (const int index) const
 Retrieve the directivity value of a channel. More...
 
double getFisheyeStartAzimuth (const int index) const
 Retrieve the fisheye start azimuth value of a channel. More...
 
double getAbscissa (const int index) const
 Retrieve the abscissa of a channel. More...
 
double getOrdinate (const int index) const
 Retrieve the ordinate of a channel. More...
 
double getAzimuth (const int index) const
 Retrieve the azimuth of a channel. More...
 

Detailed Description

The channel manager.

The channel manager should be used to manage a group of channel.

Definition at line 17 of file ChannelManager.h.

Constructor & Destructor Documentation

Hoa2D::ChannelManager::ChannelManager ( unsigned int  number_of_channels = 1)

The channel manager constructor.

The channel manager constructor allocates and initialize the member values for each channel.
Parameters
number_of_channelsThe number of channels you need to manage, default is 1.

Definition at line 11 of file ChannelManager.cpp.

Hoa2D::ChannelManager::~ChannelManager ( )

The channel manager destructor.

The channel manager destructor free the memory.

Definition at line 17 of file ChannelManager.cpp.

Member Function Documentation

double Hoa2D::ChannelManager::getAbscissa ( const int  index) const
inline

Retrieve the abscissa of a channel.

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

Definition at line 305 of file ChannelManager.h.

double Hoa2D::ChannelManager::getAzimuth ( const int  index) const
inline

Retrieve the azimuth of a channel.

Parameters
indexThe index of the channel.
Returns
The azimuth of the channel.
See Also
setAzimuth

Definition at line 330 of file ChannelManager.h.

double Hoa2D::ChannelManager::getClosestDefChannelAzimuth ( const int  index)

Retrieve the closest default azimuth position of a channel.

Parameters
indexThe index of the channel.
Returns
closest default azimuth position of the channel.
See Also
getClosestDefChannelDistance

Definition at line 267 of file ChannelManager.cpp.

double Hoa2D::ChannelManager::getClosestDefChannelAzimuth ( double  azimuth)

Retrieve the closest default azimuth position relative to an azimuth value.

Parameters
azimuthThe relative azimuth.
Returns
The closest default azimuth position of the channel relative to the azimuth value you passed in.
See Also
getClosestDefChannelDistance

Definition at line 272 of file ChannelManager.cpp.

double Hoa2D::ChannelManager::getClosestDefChannelDistance ( const int  index)

Retrieve the distance to the closest default azimuth position relative to the azimuth of a channel.

Parameters
indexThe index of the channel.
Returns
The distance to the closest default azimuth position.
See Also
getClosestDefChannelAzimuth

Definition at line 291 of file ChannelManager.cpp.

double Hoa2D::ChannelManager::getClosestDefChannelDistance ( double  azimuth)

Retrieve the distance to the closest default azimuth position relative to an azimuth value.

Parameters
azimuthThe relative azimuth.
Returns
The distance to the closest default azimuth position of the channel relative to the azimuth value you passed in.
See Also
getClosestDefChannelAzimuth

Definition at line 296 of file ChannelManager.cpp.

double Hoa2D::ChannelManager::getDirectivity ( const int  index) const
inline

Retrieve the directivity value of a channel.

Parameters
indexThe index of the channel.
Returns
The directivity value of the channel.
See Also
setDirectivity

Definition at line 280 of file ChannelManager.h.

double Hoa2D::ChannelManager::getFisheyeDestAzimuth ( ) const
inline

Retrieve the fisheye destination azimuth value.

Returns
The fisheye destination azimuth value.
See Also
setFisheyeDestAzimuth

Definition at line 245 of file ChannelManager.h.

double Hoa2D::ChannelManager::getFisheyeStartAzimuth ( const int  index) const
inline

Retrieve the fisheye start azimuth value of a channel.

Parameters
indexThe index of the channel.
Returns
The fisheye start azimuth value of the channel.
See Also
setFisheyeStartAzimuth

Definition at line 293 of file ChannelManager.h.

double Hoa2D::ChannelManager::getFisheyeStep ( ) const
inline

Retrieve the current fisheye step.

Returns
The current fisheye step.
See Also
setFisheyeStepDirect, setFisheyeStepWithDelta

Definition at line 259 of file ChannelManager.h.

long Hoa2D::ChannelManager::getNumberOfChannels ( ) const
inline

Retrieve the number of channels currently managed.

Returns
The number of channels currently managed.
See Also
setNumberOfChannels

Definition at line 252 of file ChannelManager.h.

long Hoa2D::ChannelManager::getNumberOfSelectedChannels ( )

Retrieve the number of selected channels.

Returns
The number of selected channels.
See Also
setSelected

Definition at line 313 of file ChannelManager.cpp.

double Hoa2D::ChannelManager::getOrdinate ( const int  index) const
inline

Retrieve the ordinate of a channel.

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

Definition at line 317 of file ChannelManager.h.

bool Hoa2D::ChannelManager::isSelected ( const int  index) const
inline

Retrieve the selection state of a channel.

Parameters
indexThe index of the channel.
Returns
The selection state of the channel.
See Also
setSelected

Definition at line 267 of file ChannelManager.h.

void Hoa2D::ChannelManager::resetAzimuth ( const int  index = -1)

Reset one or each channel azimuth value.

Reset one or each channel to the default azimuth value.

If you want to reset all of the channels azimuth value, pass -1 in the index parameter.

Parameters
indexThe index of the channel (pass -1 to reset all of them).
See Also
setAzimuth, setAzimuthList

Definition at line 56 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::resetDirectivity ( const int  index = -1)

Reset one or each channel directivity to 1.

If you want to reset all of the channels directivity value, pass -1 in the index parameter.

Parameters
indexThe index of the channel (pass -1 to reset all of them).
See Also
setDirectivity, setDirectivityList

Definition at line 70 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::rotateSelectedChannels ( double  newRadian,
int  channelBeingDragged,
int  magnet = 0 
)

Rotate all of the currently selected channels relative to one channel azimuth rotation.

Parameters
newRadianThe new azimuth of the channel which is being dragged
channelBeingDraggedThe index of the channel which is being dragged.
magnetPass 1 to magnetize the channel to one of the default azimuth positions

Definition at line 138 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setAzimuth ( const int  index,
double  azimuth 
)

Set one or each channel azimuth value.

If you want to reset all of the channels azimuth value, pass -1 in the index parameter.

Parameters
indexThe index of the channel (pass -1 to reset all of them).
azimuthThe new azimuth value in radians.
See Also
resetAzimuth, setAzimuthList

Definition at line 90 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setAzimuthList ( double *  azimuths,
long  size 
)

Set several channel azimuth with a list.

Parameters
azimuthsAn array of azimuth values in radians.
sizeThe size of the array.
See Also
setAzimuth, setDirectivity

Definition at line 84 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setAzimuthToClosestDefChannelAzimuth ( const int  index)

Set channel azimuth value to the closest default azimuth position value.

Parameters
indexThe index of the channel.
See Also
resetAzimuth, setAzimuth

Definition at line 307 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setDirectivity ( const int  index,
const double  directivity 
)

Set one or each channel directivity value.

If you want to reset all of the channels azimuth value, pass -1 in the index parameter.

Parameters
indexThe index of the channel (pass -1 to reset all of them).
directivityThe new directivity value (between 0 and 1).
See Also
resetDirectivity, setDirectivityList

Definition at line 110 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setDirectivityList ( double *  directivities,
long  size 
)

Set several channel directivity value with a list.

Parameters
directivitiesAn array of directivity (between 0 and 1).
sizeThe size of the array.
See Also
setDirectivity, resetDirectivity

Definition at line 104 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setFisheyeDestAzimuth ( double  azimuth)

Set fisheye destination azimuth.

Parameters
azimuthThe azimuth value of the fisheye destination in radians.
See Also
getFisheyeDestAzimuth, setFisheyeStartAzimuth

Definition at line 168 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setFisheyeStartAzimuth ( const int  index)

Set the fisheye start azimuth of one or several channel with current azimuth.

Parameters
indexThe index of the channel if greather than -1, pass -2 to affect all selected channels, pass -1 to affect all channels
See Also

Definition at line 202 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setFisheyeStartAzimuth ( const int  index,
double  radian 
)

Set the fisheye start azimuth of one or several channel.

Parameters
indexThe index of the channel if greather than -1, pass -2 to affect all selected channels, pass -1 to affect all channels

Definition at line 222 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setFisheyeStepDirect ( const int  index,
double  fisheyeStep 
)

Set the fisheye step directly.

Parameters
indexThe index of the channel if greather than -1, pass -2 to affect all selected channels, pass -1 to affect all channels
fisheyeStepThe fisheye step (between 0 and 1).
See Also
setFisheyeStepWithDelta

Definition at line 180 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setFisheyeStepWithDelta ( const int  index,
double  delta 
)

Increment or decrement the fisheye step by a value.

Parameters
indexThe index of the channel if greather than -1, pass -2 to affect all selected channels, pass -1 to affect all channels
See Also
setFisheyeStepDirect

Definition at line 174 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setNumberOfChannels ( unsigned int  number_of_channels)

Set the number of channels you want to manage.

Parameters
number_of_channelsThe number of channels you need to manage.

Definition at line 24 of file ChannelManager.cpp.

void Hoa2D::ChannelManager::setSelected ( const int  index,
int  selectedState 
)

Set the selected state of one or each channel.

If you want to reset all of the channels selected state, pass -1 in the index parameter.

Parameters
indexThe index of the channel (pass -1 to reset all of them).
selectedStateThe selected state, pass 0 to unselect, 1 to select and -1 to toggle the state.
See Also
getNumberOfSelectedChannels

Definition at line 124 of file ChannelManager.cpp.