CSL 5.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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,
19 kConcrete,
20 kBrick,
21 kGlass,
22 kWood
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; };
39 CPoint listener() { return mListenerPosition; };
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();
44 void findNumReflectionsFromTime();
45
46 private:
47
48 CPoint mRoomSize, mSource, mListenerPosition;
49 float mDampX, mDampY,mDampZ;
50 float *mReflectionsArray, *mGainsArray, *mAnglesArray;
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