20 #ifndef ARDOUR_ZITA_CONVOLVER_H
21 #define ARDOUR_ZITA_CONVOLVER_H
32 #ifdef ZCSEMA_IS_IMPLEMENTED
33 #undef ZCSEMA_IS_IMPLEMENTED
37 #if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(PTW32_VERSION) || defined (__WINPTHREADS_VERSION)
39 #include <semaphore.h>
54 int init (
int s,
int v)
56 return sem_init (&_sema, s, v);
61 return sem_post (&_sema);
66 return sem_wait (&_sema);
71 return sem_trywait (&_sema);
75 ZCsema (
const ZCsema&);
76 ZCsema& operator= (
const ZCsema&);
81 #define ZCSEMA_IS_IMPLEMENTED
83 #elif defined (__APPLE__)
95 ZCsema (
void) : _count (0)
102 pthread_mutex_destroy (&_mutex);
103 pthread_cond_destroy (&_cond);
106 ZCsema (
const ZCsema&);
107 ZCsema& operator= (
const ZCsema&);
109 int init (
int s,
int v)
112 return pthread_mutex_init (&_mutex, 0) || pthread_cond_init (&_cond, 0);
117 pthread_mutex_lock (&_mutex);
120 pthread_cond_signal (&_cond);
122 pthread_mutex_unlock (&_mutex);
128 pthread_mutex_lock (&_mutex);
130 pthread_cond_wait (&_cond, &_mutex);
133 pthread_mutex_unlock (&_mutex);
139 if (pthread_mutex_trylock (&_mutex)) {
143 pthread_mutex_unlock (&_mutex);
147 pthread_mutex_unlock (&_mutex);
153 pthread_mutex_t _mutex;
154 pthread_cond_t _cond;
157 #define ZCSEMA_IS_IMPLEMENTED
160 #ifndef ZCSEMA_IS_IMPLEMENTED
161 #error "The ZCsema class is not implemented."
234 OPT_FFTW_MEASURE = 1,
270 void start (
int absprio,
int policy);
335 FL_LATE = 0x0000FFFF,
363 return _inpbuff[inp] + _inpoffs;
368 return _outbuff[out] + _outoffs;
409 float* _inpbuff[MAXINP];
410 float* _outbuff[MAXOUT];
void start(int absprio, int policy)
fftwf_complex * _freq_data
void configure(int prio, uint32_t offs, uint32_t npar, uint32_t parsize, uint32_t options)
void impdata_write(uint32_t inp, uint32_t out, int32_t step, float *data, int32_t ind0, int32_t ind1, bool create)
Macnode * findmacnode(uint32_t inp, uint32_t out, bool create)
int readtail(uint32_t n_samples)
void fftswap(fftwf_complex *p)
void impdata_clear(uint32_t inp, uint32_t out)
static void * static_main(void *arg)
void reset(uint32_t inpsize, uint32_t outsize, float **inpbuff, float **outbuff)
float * inpdata(uint32_t inp) const
bool check_started(uint32_t)
void set_options(uint32_t options)
int start_process(int abspri, int policy)
float * outdata(uint32_t out) const
int configure(uint32_t ninp, uint32_t nout, uint32_t maxsize, uint32_t quantum, uint32_t minpart, uint32_t maxpart, float density)
int impdata_create(uint32_t inp, uint32_t out, int32_t step, float *data, int32_t ind0, int32_t ind1)
void print(FILE *F=stdout)
int tailonly(uint32_t n_samples)
uint32_t state(void) const
int impdata_clear(uint32_t inp, uint32_t out)
void alloc_ffta(uint16_t npar, int32_t size)
void alloc_fftb(uint16_t npar)
Outnode(uint16_t out, int32_t size)
bool init(bool try_optimization, const char *localedir, bool with_gui=false)
GTKMM_API const Gtk::BuiltinStockID FILE
#define LIBZCONVOLVER_API