Mercurial > spc_convert
view snes_spc/SPC_Filter.h @ 8:a37863126396
reordered error messages
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 21 Oct 2011 07:26:53 -0700 |
parents | e38dacceb958 |
children |
line wrap: on
line source
1 // Simple low-pass and high-pass filter to better match sound output of a SNES3 // snes_spc 0.9.04 #ifndef SPC_FILTER_H5 #define SPC_FILTER_H7 #include "blargg_common.h"9 struct SPC_Filter {10 public:12 // Filters count samples of stereo sound in place. Count must be a multiple of 2.13 typedef short sample_t;14 void run( sample_t* io, int count );16 // Optional features18 // Clears filter to silence19 void clear();21 // Sets gain (volume), where gain_unit is normal. Gains greater than gain_unit22 // are fine, since output is clamped to 16-bit sample range.23 enum { gain_unit = 0x100 };24 void set_gain( int gain );26 // Sets amount of bass (logarithmic scale)27 enum { bass_none = 0 };28 enum { bass_norm = 8 }; // normal amount29 enum { bass_max = 31 };30 void set_bass( int bass );32 public:33 SPC_Filter();34 BLARGG_DISABLE_NOTHROW35 private:36 enum { gain_bits = 8 };37 int gain;38 int bass;39 struct chan_t { int p1, pp1, sum; };40 chan_t ch [2];41 };43 inline void SPC_Filter::set_gain( int g ) { gain = g; }45 inline void SPC_Filter::set_bass( int b ) { bass = b; }47 #endif