Panda3D

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