Panda3D

filterProperties.I

00001 // Filename: filterProperties.I
00002 // Created by: jyelon (01Aug2007)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //    Function: FilterProperties::clear
00018 //      Access: Published
00019 // Description: Removes all DSP postprocessing.
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE void FilterProperties::
00022 clear() {
00023   _config.clear();
00024 }
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //    Function: FilterProperties::apply_lowpass
00028 //      Access: Published
00029 // Description: Add a lowpass filter to the end of the DSP chain.
00030 ////////////////////////////////////////////////////////////////////
00031 INLINE void FilterProperties::
00032 add_lowpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q) {
00033   add_filter(FT_lowpass, cutoff_freq, resonance_q);
00034 }
00035 
00036 ////////////////////////////////////////////////////////////////////
00037 //    Function: FilterProperties::add_highpass
00038 //      Access: Published
00039 // Description: Add a highpass filter to the end of the DSP chain.
00040 ////////////////////////////////////////////////////////////////////
00041 INLINE void FilterProperties::
00042 add_highpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q) {
00043   add_filter(FT_highpass, cutoff_freq, resonance_q);
00044 }
00045 
00046 ////////////////////////////////////////////////////////////////////
00047 //    Function: FilterProperties::add_echo
00048 //      Access: Published
00049 // Description: Add a echo filter to the end of the DSP chain.
00050 ////////////////////////////////////////////////////////////////////
00051 INLINE void FilterProperties::
00052 add_echo(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat delay, PN_stdfloat decayratio) {
00053   add_filter(FT_echo, drymix, wetmix, delay, decayratio);
00054 }
00055 
00056 ////////////////////////////////////////////////////////////////////
00057 //    Function: FilterProperties::add_flange
00058 //      Access: Published
00059 // Description: Add a flange filter to the end of the DSP chain.
00060 ////////////////////////////////////////////////////////////////////
00061 INLINE void FilterProperties::
00062 add_flange(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat depth, PN_stdfloat rate) {
00063   add_filter(FT_flange, drymix, wetmix, depth, rate);
00064 }
00065 
00066 ////////////////////////////////////////////////////////////////////
00067 //    Function: FilterProperties::add_distort
00068 //      Access: Published
00069 // Description: Add a distort filter to the end of the DSP chain.
00070 ////////////////////////////////////////////////////////////////////
00071 INLINE void FilterProperties::
00072 add_distort(PN_stdfloat level) {
00073   add_filter(FT_distort, level);
00074 }
00075 
00076 ////////////////////////////////////////////////////////////////////
00077 //    Function: FilterProperties::add_normalize
00078 //      Access: Published
00079 // Description: Add a normalize filter to the end of the DSP chain.
00080 ////////////////////////////////////////////////////////////////////
00081 INLINE void FilterProperties::
00082 add_normalize(PN_stdfloat fadetime, PN_stdfloat threshold, PN_stdfloat maxamp) {
00083   add_filter(FT_normalize, fadetime, threshold, maxamp);
00084 }
00085 
00086 ////////////////////////////////////////////////////////////////////
00087 //    Function: FilterProperties::add_parameq
00088 //      Access: Published
00089 // Description: Add a parameq filter to the end of the DSP chain.
00090 ////////////////////////////////////////////////////////////////////
00091 INLINE void FilterProperties::
00092 add_parameq(PN_stdfloat center_freq, PN_stdfloat bandwidth, PN_stdfloat gain) {
00093   add_filter(FT_parameq, center_freq, bandwidth, gain);
00094 }
00095 
00096 ////////////////////////////////////////////////////////////////////
00097 //    Function: FilterProperties::add_pitchshift
00098 //      Access: Published
00099 // Description: Add a pitchshift filter to the end of the DSP chain.
00100 ////////////////////////////////////////////////////////////////////
00101 INLINE void FilterProperties::
00102 add_pitchshift(PN_stdfloat pitch, PN_stdfloat fftsize, PN_stdfloat overlap) {
00103   add_filter(FT_pitchshift, pitch, fftsize, overlap);
00104 }
00105 
00106 ////////////////////////////////////////////////////////////////////
00107 //    Function: FilterProperties::add_chorus
00108 //      Access: Published
00109 // Description: Add a chorus filter to the end of the DSP chain.
00110 ////////////////////////////////////////////////////////////////////
00111 INLINE void FilterProperties::
00112 add_chorus(PN_stdfloat drymix, PN_stdfloat wet1, PN_stdfloat wet2, PN_stdfloat wet3, PN_stdfloat delay, PN_stdfloat rate, PN_stdfloat depth, PN_stdfloat feedback) {
00113   add_filter(FT_chorus, drymix, wet1, wet2, wet3, delay, rate, depth, feedback);
00114 }
00115 
00116 ////////////////////////////////////////////////////////////////////
00117 //    Function: FilterProperties::add_reverb
00118 //      Access: Published
00119 // Description: Add a reverb filter to the end of the DSP chain.
00120 ////////////////////////////////////////////////////////////////////
00121 INLINE void FilterProperties::
00122 add_reverb(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat roomsize, PN_stdfloat damp, PN_stdfloat width) {
00123   add_filter(FT_reverb, drymix, wetmix, roomsize, damp, width);
00124 }
00125 
00126 ////////////////////////////////////////////////////////////////////
00127 //    Function: FilterProperties::add_compress
00128 //      Access: Published
00129 // Description: Add a compress filter to the end of the DSP chain.
00130 ////////////////////////////////////////////////////////////////////
00131 INLINE void FilterProperties::
00132 add_compress(PN_stdfloat threshold, PN_stdfloat attack, PN_stdfloat release, PN_stdfloat gainmakeup) {
00133   add_filter(FT_compress, threshold, attack, release, gainmakeup);
00134 }
00135 
00136 ////////////////////////////////////////////////////////////////////
00137 //    Function: FilterProperties::get_config
00138 //      Access: Published
00139 // Description: Intended for use by AudioManager and AudioSound
00140 //              implementations: allows access to the config vector.
00141 ////////////////////////////////////////////////////////////////////
00142 INLINE const FilterProperties::ConfigVector &FilterProperties::
00143 get_config() {
00144   return _config;
00145 }
00146 
00147 
 All Classes Functions Variables Enumerations