Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SourceTemplate.h
Go to the documentation of this file.
1 //
2 // C++ Interface: Audio::SourceTemplate
3 //
4 #ifndef __AUDIO_SOURCETEMPLATE_H__INCLUDED__
5 #define __AUDIO_SOURCETEMPLATE_H__INCLUDED__
6 
7 #include <string>
8 #include "Exceptions.h"
9 #include "Types.h"
10 
11 #include "vsfilesystem.h"
12 
13 
14 namespace Audio {
15 
16 
35  {
36  private:
37  std::string soundName;
38  VSFileSystem::VSFileType soundType;
39 
40  Range<Scalar> cosAngleRange;
41 
42  PerFrequency<Scalar> pfRadiusRatios;
43  PerFrequency<Scalar> referenceFreqs;
44 
45  Scalar gain;
46 
47  struct {
48  int looping : 1;
49  int streaming : 1;
50  int attenuated : 1;
51  int relative : 1;
52  } flags;
53 
54  public:
59  const std::string &soundName,
61  bool looping = false) throw();
62 
63  ~SourceTemplate();
64 
66  std::string getSoundName() const throw() { return soundName; }
67 
69  void setSoundName(const std::string &newName) throw() { soundName = newName; }
70 
72  VSFileSystem::VSFileType getSoundType() const throw() { return soundType; }
73 
75  void setSoundType(VSFileSystem::VSFileType type) throw() { soundType = type; }
76 
82  Range<Scalar> getAngleRange() const throw();
83 
85  void setAngleRange(Range<Scalar> r) throw();
86 
88  Range<Scalar> getCosAngleRange() const throw() { return cosAngleRange; }
89 
91  void setCosAngleRange(Range<Scalar> r) throw() { cosAngleRange = r; }
92 
99  PerFrequency<Scalar> getPerFrequencyRadiusRatios() const throw() { return pfRadiusRatios; }
100 
104  void setPerFrequencyRadiusRatios(PerFrequency<Scalar> val) throw() { pfRadiusRatios = val; }
105 
107  PerFrequency<Scalar> getReferenceFreqs() const throw() { return referenceFreqs; }
108 
110  void setReferenceFreqs(PerFrequency<Scalar> val) throw() { referenceFreqs = val; }
111 
113  Scalar getGain() const throw() { return gain; }
114 
116  void setGain(Scalar g) throw() { gain = g; }
117 
119  bool isLooping() const throw() { return flags.looping != 0; }
120 
122  void setLooping(bool loop) throw() { flags.looping = loop ? 1 : 0; }
123 
127  bool isRelative() const throw() { return flags.relative != 0; }
128 
130  void setRelative(bool relative) throw() { flags.relative = relative ? 1 : 0; }
131 
133  bool isAttenuated() const throw() { return flags.attenuated != 0; }
134 
136  void setAttenuated(bool loop) throw() { flags.attenuated = (loop ? 1 : 0); }
137 
139  bool isStreaming() const throw() { return flags.streaming != 0; }
140 
142  void setStreaming(bool stream) throw() { flags.streaming = stream ? 1 : 0; }
143 
144  };
145 
146 };
147 
148 #endif//__AUDIO_SOURCETEMPLATE_H__INCLUDED__