25 #ifndef SRC_HEADERS_GX_CONVOLVER_H_ 26 #define SRC_HEADERS_GX_CONVOLVER_H_ 28 #include <zita-convolver.h> 29 #include <gxwmm/gainline.h> 70 int type(
void)
const {
return _type; }
71 int form(
void)
const {
return _form; }
72 int rate(
void)
const {
return _rate; }
73 int chan(
void)
const {
return _chan; }
74 unsigned int size(
void)
const {
return _size; }
79 int seek(
unsigned int posit);
80 int read(
float *data,
unsigned int frames);
94 bool read_audio(
const std::string& filename,
unsigned int *audio_size,
int *audio_chan,
95 int *audio_type,
int *audio_form,
int *audio_rate,
float **buffer);
101 void adjust_values(
unsigned int audio_size,
unsigned int& count,
unsigned int& offset,
102 unsigned int& delay,
unsigned int& ldelay,
unsigned int& length,
103 unsigned int&
size,
unsigned int& bufsize);
114 using Convproc::state;
117 bool start(
int policy,
int priority);
118 using Convproc::stop_process;
125 bool read_sndfile(
Audiofile& audio,
int nchan,
int samplerate,
const float *gain,
126 unsigned int *delay,
unsigned int offset,
unsigned int length,
127 const Gainline& points);
131 string fname,
float gain,
float lgain,
132 unsigned int delay,
unsigned int ldelay,
unsigned int offset,
133 unsigned int length,
unsigned int size,
unsigned int bufsize,
134 const Gainline& gainline);
135 bool compute(
int count,
float* input1,
float *input2,
float *output1,
float *output2);
136 bool configure(
string fname,
float gain,
unsigned int delay,
unsigned int offset,
137 unsigned int length,
unsigned int size,
unsigned int bufsize,
138 const Gainline& gainline);
139 bool compute(
int count,
float* input,
float *output);
140 static void compute_interpolation(
double& fct,
double& gp,
unsigned int& idx,
141 const Gainline& points,
int offset);
145 double& fct,
double& gp,
unsigned int& idx,
const Gainline& points,
int offset) {
146 fct = (points[idx+1].g-points[idx].g)/(20*(points[idx+1].i-points[idx].i));
147 gp = points[idx].g/20 + fct * (offset-points[idx].i);
158 bool configure(
int count,
float *impresp,
unsigned int imprate);
159 bool update(
int count,
float *impresp,
unsigned int imprate);
160 bool compute(
int count,
float* input,
float *output);
162 return is_runnable() ?
compute(count, buffer, buffer) :
true;
165 bool configure_stereo(
int count,
float *impresp,
unsigned int imprate);
166 bool update_stereo(
int count,
float *impresp,
unsigned int imprate);
167 bool compute_stereo(
int count,
float* input,
float* input1,
float *output,
float *output1);
170 return is_runnable() ? compute_stereo(count, buffer, buffer1, buffer, buffer1) :
true;
175 #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)