Jamoma API  0.6.0.a19
MicArray.h
1 // MicArray.h
2 /***************************************************/
3 /*! \class MicArray
4  \brief MicArray class
5 
6  This class implements a collection of mics that allows
7  position changes to be applied to all its members.
8 
9  by Tristan Matthews and Nils Peters, 2007-2008.
10  */
11 /***************************************************/
12 
13 #ifndef _MICARRAY_H_
14 #define _MICARRAY_H_
15 
16 #include <vector>
17 #include "Properties.h"
18 
19 class Mic; // forward class declaration
20 
21 class MicArray {
22  public:
23  //! Class constructor.
24  MicArray(short numMics);
25 
26  //! True if the channel num >= 0 and < the total number of channels.
27  bool validChannel(short channelNum = 8);
28 
29  //! Set center in x.
30  void centerLR(double newCenterLR);
31  //! Set center in y.
32  void centerFB(double newCenterFB);
33  //! Set center in z.
34  void centerUD(double newCenterUD);
35 
36  //! Sets all of the MicArray's mics' x positions to x.
37  void xPos(double x);
38  //! Sets all of the MicArray's mics' y positions to y.
39  void yPos(double y);
40  //! Sets all of the MicArray's mics' z positions to z.
41  void zPos(double z);
42 
43  //! Sets all of the MicArray's mics' azimuth angles.
44  void azi(double azi);
45  //! Sets all of the MicArray's mics' elevation angles.
46  void ele(double ele);
47  //! Set mic array's radius.
48  void centerDistance(double rad);
49  //! Sets all of the MicArray's mics' distance powers.
50  void distPow(double pow);
51  //! Sets all of the MicArray's mics' dB unit
52  void dbUnit(double dbUnit);
53  //! Sets all of the MicArray's mics' directivity gains.
54  void dirGain(double gain);
55  //! Sets all of the MicArray's mics' gain.
56  void gain(double gain);
57  //! Sets all of the MicArray's mics' directivity powers.
58  void dirPow(double pow);
59  //! Returns the size of the mic array.
60  short numChannels() const;
61  //! Updates the specified mic.
62  void renderMic(int mic);
63  //! Updates all mics.
64  void renderMics();
65 
66  //! Returns the mic at the given index.
67  Mic& operator[](const int idx);
68  //! Returns a constant refernce to the mic at the given index.
69  const Mic& operator[](const int i) const;
70  //! Prints information about all of the mics.
71  void print();
72  //! Returns true if the mic array has changed, false otherwise.
73  bool flag() const;
74  //! Sets the mics flag.
75  void flag(bool changed);
76  //! Checks that new room width will not exclude any mics.
77  bool checkWidth(double newWidth);
78  //! Checks that new room depth will not exclude any mics.
79  bool checkDepth(double newDepth);
80  //! Checks that new room height will not exclude any mics.
81  bool checkHeight(double newHeight);
82 
83  //! Class destructor.
84  ~MicArray();
85 
86  private:
87  double centerLR_, centerFB_, centerUD_, centerDistance_;
88  short numChannels_;
89  std::vector<Mic> mics;
90  static int AziAngle[Properties::MAXNUMCHANNELS][Properties::MAXNUMCHANNELS]; // defined in MicArray.cpp
91  bool flag_;
92 };
93 
94 #endif
95 
96 // vim:sw=4:et:cindent:
~MicArray()
Class destructor.
Definition: MicArray.cpp:62
void distPow(double pow)
Sets all of the MicArray's mics' distance powers.
Definition: MicArray.cpp:144
void dirPow(double pow)
Sets all of the MicArray's mics' directivity powers.
Definition: MicArray.cpp:172
void centerUD(double newCenterUD)
Set center in z.
Definition: MicArray.cpp:76
void dirGain(double gain)
Sets all of the MicArray's mics' directivity gains.
Definition: MicArray.cpp:158
short numChannels() const
Returns the size of the mic array.
Definition: MicArray.cpp:254
void azi(double azi)
Sets all of the MicArray's mics' azimuth angles.
Definition: MicArray.cpp:200
void ele(double ele)
Sets all of the MicArray's mics' elevation angles.
Definition: MicArray.cpp:207
void xPos(double x)
Sets all of the MicArray's mics' x positions to x.
Definition: MicArray.cpp:179
bool flag() const
Returns true if the mic array has changed, false otherwise.
Definition: MicArray.cpp:219
bool checkDepth(double newDepth)
Checks that new room depth will not exclude any mics.
Definition: MicArray.cpp:234
MicArray(short numMics)
Class constructor.
Definition: MicArray.cpp:45
bool validChannel(short channelNum=8)
True if the channel num >= 0 and < the total number of channels.
Definition: MicArray.cpp:136
bool checkHeight(double newHeight)
Checks that new room height will not exclude any mics.
Definition: MicArray.cpp:244
void centerDistance(double rad)
Set mic array's radius.
Definition: MicArray.cpp:82
void gain(double gain)
Sets all of the MicArray's mics' gain.
Definition: MicArray.cpp:165
void renderMics()
Updates all mics.
Definition: MicArray.cpp:89
void renderMic(int mic)
Updates the specified mic.
Definition: MicArray.cpp:97
Microphone class.
Definition: Mic.h:22
Mic & operator[](const int idx)
Returns the mic at the given index.
Definition: MicArray.cpp:111
void zPos(double z)
Sets all of the MicArray's mics' z positions to z.
Definition: MicArray.cpp:193
void centerFB(double newCenterFB)
Set center in y.
Definition: MicArray.cpp:70
void centerLR(double newCenterLR)
Set center in x.
Definition: MicArray.cpp:64
void yPos(double y)
Sets all of the MicArray's mics' y positions to y.
Definition: MicArray.cpp:186
bool checkWidth(double newWidth)
Checks that new room width will not exclude any mics.
Definition: MicArray.cpp:224
void dbUnit(double dbUnit)
Sets all of the MicArray's mics' dB unit.
Definition: MicArray.cpp:151
MicArray class.
Definition: MicArray.h:21
void print()
Prints information about all of the mics.
Definition: MicArray.cpp:124