25 #ifndef SRC_HEADERS_GX_CONVOLVER_H_ 26 #define SRC_HEADERS_GX_CONVOLVER_H_ 28 #include <zita-convolver.h> 29 #include <gxwmm/gainline.h> 71 int type(
void)
const {
return _type; }
72 int form(
void)
const {
return _form; }
73 int rate(
void)
const {
return _rate; }
74 int chan(
void)
const {
return _chan; }
75 unsigned int size(
void)
const {
return _size; }
80 int seek(
unsigned int posit);
81 int read(
float *data,
unsigned int frames);
95 bool read_audio(
const std::string& filename,
unsigned int *audio_size,
int *audio_chan,
96 int *audio_type,
int *audio_form,
int *audio_rate,
float **buffer);
102 void adjust_values(
unsigned int audio_size,
unsigned int& count,
unsigned int& offset,
103 unsigned int& delay,
unsigned int& ldelay,
unsigned int& length,
104 unsigned int&
size,
unsigned int& bufsize);
115 using Convproc::state;
118 bool start(
int policy,
int priority);
119 using Convproc::stop_process;
126 bool read_sndfile(
Audiofile& audio,
int nchan,
int samplerate,
const float *gain,
127 unsigned int *delay,
unsigned int offset,
unsigned int length,
128 const Gainline& points);
132 string fname,
float gain,
float lgain,
133 unsigned int delay,
unsigned int ldelay,
unsigned int offset,
134 unsigned int length,
unsigned int size,
unsigned int bufsize,
135 const Gainline& gainline);
136 bool compute(
int count,
float* input1,
float *input2,
float *output1,
float *output2);
137 bool configure(
string fname,
float gain,
unsigned int delay,
unsigned int offset,
138 unsigned int length,
unsigned int size,
unsigned int bufsize,
139 const Gainline& gainline);
140 bool compute(
int count,
float* input,
float *output);
141 static void compute_interpolation(
double& fct,
double& gp,
unsigned int& idx,
142 const Gainline& points,
int offset);
146 double& fct,
double& gp,
unsigned int& idx,
const Gainline& points,
int offset) {
147 fct = (points[idx+1].g-points[idx].g)/(20*(points[idx+1].i-points[idx].i));
148 gp = points[idx].g/20 + fct * (offset-points[idx].i);
159 bool configure(
int count,
float *impresp,
unsigned int imprate);
160 bool update(
int count,
float *impresp,
unsigned int imprate);
161 bool compute(
int count,
float* input,
float *output);
163 return is_runnable() ?
compute(count, buffer, buffer) :
true;
166 bool configure_stereo(
int count,
float *impresp,
unsigned int imprate);
167 bool update_stereo(
int count,
float *impresp,
unsigned int imprate);
168 bool compute_stereo(
int count,
float* input,
float* input1,
float *output,
float *output1);
171 return is_runnable() ? compute_stereo(count, buffer, buffer1, buffer, buffer1) :
true;
176 #endif // SRC_HEADERS_GX_CONVOLVER_H_
GxSimpleConvolver(gx_resample::BufferResampler &resamp_)
unsigned int get_buffersize()
CmdConnection::msg_type start
bool compute_stereo(int count, float *buffer, float *buffer1)
int open_read(string name)
bool read_audio(const std::string &filename, unsigned int *audio_size, int *audio_chan, int *audio_type, int *audio_form, int *audio_rate, float **buffer)
unsigned int get_samplerate()
unsigned int size(void) const
int seek(unsigned int posit)
bool compute(int count, float *buffer)
void set_buffersize(unsigned int sz)
int read(float *data, unsigned int frames)
void set_samplerate(unsigned int sr)
static void compute_interpolation(double &fct, double &gp, unsigned int &idx, const Gainline &points, int offset)