Panda3D
 All Classes Functions Variables Enumerations
filterProperties.I
1 // Filename: filterProperties.I
2 // Created by: jyelon (01Aug2007)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: FilterProperties::clear
18 // Access: Published
19 // Description: Removes all DSP postprocessing.
20 ////////////////////////////////////////////////////////////////////
21 INLINE void FilterProperties::
22 clear() {
23  _config.clear();
24 }
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: FilterProperties::apply_lowpass
28 // Access: Published
29 // Description: Add a lowpass filter to the end of the DSP chain.
30 ////////////////////////////////////////////////////////////////////
31 INLINE void FilterProperties::
32 add_lowpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q) {
33  add_filter(FT_lowpass, cutoff_freq, resonance_q);
34 }
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: FilterProperties::add_highpass
38 // Access: Published
39 // Description: Add a highpass filter to the end of the DSP chain.
40 ////////////////////////////////////////////////////////////////////
41 INLINE void FilterProperties::
42 add_highpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q) {
43  add_filter(FT_highpass, cutoff_freq, resonance_q);
44 }
45 
46 ////////////////////////////////////////////////////////////////////
47 // Function: FilterProperties::add_echo
48 // Access: Published
49 // Description: Add a echo filter to the end of the DSP chain.
50 ////////////////////////////////////////////////////////////////////
51 INLINE void FilterProperties::
52 add_echo(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat delay, PN_stdfloat decayratio) {
53  add_filter(FT_echo, drymix, wetmix, delay, decayratio);
54 }
55 
56 ////////////////////////////////////////////////////////////////////
57 // Function: FilterProperties::add_flange
58 // Access: Published
59 // Description: Add a flange filter to the end of the DSP chain.
60 ////////////////////////////////////////////////////////////////////
61 INLINE void FilterProperties::
62 add_flange(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat depth, PN_stdfloat rate) {
63  add_filter(FT_flange, drymix, wetmix, depth, rate);
64 }
65 
66 ////////////////////////////////////////////////////////////////////
67 // Function: FilterProperties::add_distort
68 // Access: Published
69 // Description: Add a distort filter to the end of the DSP chain.
70 ////////////////////////////////////////////////////////////////////
71 INLINE void FilterProperties::
72 add_distort(PN_stdfloat level) {
73  add_filter(FT_distort, level);
74 }
75 
76 ////////////////////////////////////////////////////////////////////
77 // Function: FilterProperties::add_normalize
78 // Access: Published
79 // Description: Add a normalize filter to the end of the DSP chain.
80 ////////////////////////////////////////////////////////////////////
81 INLINE void FilterProperties::
82 add_normalize(PN_stdfloat fadetime, PN_stdfloat threshold, PN_stdfloat maxamp) {
83  add_filter(FT_normalize, fadetime, threshold, maxamp);
84 }
85 
86 ////////////////////////////////////////////////////////////////////
87 // Function: FilterProperties::add_parameq
88 // Access: Published
89 // Description: Add a parameq filter to the end of the DSP chain.
90 ////////////////////////////////////////////////////////////////////
91 INLINE void FilterProperties::
92 add_parameq(PN_stdfloat center_freq, PN_stdfloat bandwidth, PN_stdfloat gain) {
93  add_filter(FT_parameq, center_freq, bandwidth, gain);
94 }
95 
96 ////////////////////////////////////////////////////////////////////
97 // Function: FilterProperties::add_pitchshift
98 // Access: Published
99 // Description: Add a pitchshift filter to the end of the DSP chain.
100 ////////////////////////////////////////////////////////////////////
101 INLINE void FilterProperties::
102 add_pitchshift(PN_stdfloat pitch, PN_stdfloat fftsize, PN_stdfloat overlap) {
103  add_filter(FT_pitchshift, pitch, fftsize, overlap);
104 }
105 
106 ////////////////////////////////////////////////////////////////////
107 // Function: FilterProperties::add_chorus
108 // Access: Published
109 // Description: Add a chorus filter to the end of the DSP chain.
110 ////////////////////////////////////////////////////////////////////
111 INLINE void FilterProperties::
112 add_chorus(PN_stdfloat drymix, PN_stdfloat wet1, PN_stdfloat wet2, PN_stdfloat wet3, PN_stdfloat delay, PN_stdfloat rate, PN_stdfloat depth) {
113  add_filter(FT_chorus, drymix, wet1, wet2, wet3, delay, rate, depth);
114 }
115 
116 ////////////////////////////////////////////////////////////////////
117 // Function: FilterProperties::add_sfxreverb
118 // Access: Published
119 // Description: Add a reverb filter to the end of the DSP chain.
120 ////////////////////////////////////////////////////////////////////
121 INLINE void FilterProperties::
122 add_sfxreverb(PN_stdfloat drylevel, PN_stdfloat room, PN_stdfloat roomhf, PN_stdfloat decaytime,
123  PN_stdfloat decayhfratio, PN_stdfloat reflectionslevel, PN_stdfloat reflectionsdelay,
124  PN_stdfloat reverblevel, PN_stdfloat reverbdelay, PN_stdfloat diffusion,
125  PN_stdfloat density, PN_stdfloat hfreference, PN_stdfloat roomlf, PN_stdfloat lfreference) {
126  add_filter(FT_sfxreverb, drylevel, room, roomhf, decaytime, decayhfratio, reflectionslevel, reflectionsdelay,
127  reverblevel, reverbdelay, diffusion, density, hfreference, roomlf, lfreference);
128 }
129 
130 ////////////////////////////////////////////////////////////////////
131 // Function: FilterProperties::add_compress
132 // Access: Published
133 // Description: Add a compress filter to the end of the DSP chain.
134 ////////////////////////////////////////////////////////////////////
135 INLINE void FilterProperties::
136 add_compress(PN_stdfloat threshold, PN_stdfloat attack, PN_stdfloat release, PN_stdfloat gainmakeup) {
137  add_filter(FT_compress, threshold, attack, release, gainmakeup);
138 }
139 
140 ////////////////////////////////////////////////////////////////////
141 // Function: FilterProperties::get_config
142 // Access: Published
143 // Description: Intended for use by AudioManager and AudioSound
144 // implementations: allows access to the config vector.
145 ////////////////////////////////////////////////////////////////////
148  return _config;
149 }
150 
151 
void add_sfxreverb(PN_stdfloat drylevel=0, PN_stdfloat room=-10000, PN_stdfloat roomhf=0, PN_stdfloat decaytime=1, PN_stdfloat decayhfratio=0.5, PN_stdfloat reflectionslevel=-10000, PN_stdfloat reflectionsdelay=0.02, PN_stdfloat reverblevel=0, PN_stdfloat reverbdelay=0.04, PN_stdfloat diffusion=100, PN_stdfloat density=100, PN_stdfloat hfreference=5000, PN_stdfloat roomlf=0, PN_stdfloat lfreference=250)
Add a reverb filter to the end of the DSP chain.
void add_normalize(PN_stdfloat fadetime, PN_stdfloat threshold, PN_stdfloat maxamp)
Add a normalize filter to the end of the DSP chain.
void add_echo(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat delay, PN_stdfloat decayratio)
Add a echo filter to the end of the DSP chain.
void add_compress(PN_stdfloat threshold, PN_stdfloat attack, PN_stdfloat release, PN_stdfloat gainmakeup)
Add a compress filter to the end of the DSP chain.
const ConfigVector & get_config()
Intended for use by AudioManager and AudioSound implementations: allows access to the config vector...
void add_flange(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat depth, PN_stdfloat rate)
Add a flange filter to the end of the DSP chain.
void add_lowpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q)
Add a lowpass filter to the end of the DSP chain.
void add_chorus(PN_stdfloat drymix, PN_stdfloat wet1, PN_stdfloat wet2, PN_stdfloat wet3, PN_stdfloat delay, PN_stdfloat rate, PN_stdfloat depth)
Add a chorus filter to the end of the DSP chain.
void add_highpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q)
Add a highpass filter to the end of the DSP chain.
void clear()
Removes all DSP postprocessing.
void add_pitchshift(PN_stdfloat pitch, PN_stdfloat fftsize, PN_stdfloat overlap)
Add a pitchshift filter to the end of the DSP chain.
void add_distort(PN_stdfloat level)
Add a distort filter to the end of the DSP chain.
void add_parameq(PN_stdfloat center_freq, PN_stdfloat bandwidth, PN_stdfloat gain)
Add a parameq filter to the end of the DSP chain.