CSL  6.0
ShoeBox.h
Go to the documentation of this file.
1 //
2 // ShoeBox.h
3 // ShoeBox
4 //
5 // Created by Jorge Castellanos & Will Wolcott on 4/29/05.
6 // Copyright 2005 Jorge Castellanos & Will Wolcott. All rights reserved.
7 //
8 
9 
10 #ifndef SHOEBOX_H
11 #define SHOEBOX_H
12 
13 #include "CPoint.h"
14 
15 namespace csl {
16 
17 enum {
18  kMarble = 0,
23 };
24 
25 // This class calculates the reflection time and amplitude of a sound
26 // assuming the space is rectangulsr, in other words, a shoe box.
27 
28 class ShoeBox {
29 public:
30  // Defaults to a listener positioned at the center of the room.
31  ShoeBox();
32  ~ShoeBox();
33 
34  void setSourceLocation(float x, float y, float z);
35  void setListenerLocation(float x, float y, float z);
36  void setRoomSize(float x, float y, float z);
37  CPoint roomSize() { return mRoomSize; };
38  CPoint source() { return mSource; };
40  void setWallMaterialsDamp(int dampX, int dampY, int dampZ);
41  void setDuration(int ms);
42  void getReflections(float *ref, float *gains, float *angles, int num);
43  void calculateReflections();
45 
46 private:
47 
51  int mDuration, mNumReflections, mMaxBouncesX, mMaxBouncesY, mMaxBouncesZ; // The miliseconds that will be calculated reflections.
52 
53  void shellSort();
54  bool checkPositionValues();
55 
56 };
57 
58 
59 }
60 
61 #endif
void findNumReflectionsFromTime()
Definition: ShoeBox.cpp:182
void setWallMaterialsDamp(int dampX, int dampY, int dampZ)
Definition: ShoeBox.cpp:47
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
Definition: Accessor.h:17
float * mGainsArray
Definition: ShoeBox.h:50
void getReflections(float *ref, float *gains, float *angles, int num)
Definition: ShoeBox.cpp:357
int mMaxBouncesX
Definition: ShoeBox.h:51
float mDampY
Definition: ShoeBox.h:49
CPoint listener()
Definition: ShoeBox.h:39
float mDampX
Definition: ShoeBox.h:49
void setSourceLocation(float x, float y, float z)
Definition: ShoeBox.cpp:103
CPoint roomSize()
Definition: ShoeBox.h:37
float * mReflectionsArray
Definition: ShoeBox.h:50
float * mAnglesArray
Definition: ShoeBox.h:50
void setRoomSize(float x, float y, float z)
Definition: ShoeBox.cpp:123
void calculateReflections()
Definition: ShoeBox.cpp:211
bool checkPositionValues()
Definition: ShoeBox.cpp:132
int mMaxBouncesZ
Definition: ShoeBox.h:51
CPoint source()
Definition: ShoeBox.h:38
void setListenerLocation(float x, float y, float z)
Definition: ShoeBox.cpp:114
CPoint mSource
Definition: ShoeBox.h:48
float mDampZ
Definition: ShoeBox.h:49
void shellSort()
Definition: ShoeBox.cpp:144
CPoint mRoomSize
Definition: ShoeBox.h:48
int mMaxBouncesY
Definition: ShoeBox.h:51
void setDuration(int ms)
Definition: ShoeBox.cpp:179
int mDuration
Definition: ShoeBox.h:51
CPoint mListenerPosition
Definition: ShoeBox.h:48
int mNumReflections
Definition: ShoeBox.h:51