#include <aubio.h>
#include "config.h"
-#if HAVE_JACK
+#ifdef HAVE_JACK
#include "utils.h" // for aubio_process_func_t
#include "jackio.h"
#include "aubio_priv.h"
#if HAVE_JACK
aubio_jack_t *jack_setup;
-#endif
+#endif /* HAVE_JACK */
void examples_common_init (int argc, char **argv);
void examples_common_del (void);
jack_setup = new_aubio_jack (hop_size, 1, 1, 0, 1);
samplerate = aubio_jack_get_samplerate (jack_setup);
source_uri = "jack";
-#endif
+#endif /* HAVE_JACK */
}
ibuf = new_fvec (hop_size);
obuf = new_fvec (hop_size);
uint_t read = 0;
if (usejack) {
-#if HAVE_JACK
+#ifdef HAVE_JACK
debug ("Jack activation ...\n");
aubio_jack_activate (jack_setup, process_func);
debug ("Processing (Ctrl+C to quit) ...\n");
pause ();
aubio_jack_close (jack_setup);
-#else
+#else /* HAVE_JACK */
usage (stderr, 1);
outmsg ("Compiled without jack output, exiting.\n");
-#endif
+#endif /* HAVE_JACK */
} else {
send_noteon (int pitch, int velo)
{
smpl_t mpitch = floor (aubio_freqtomidi (pitch) + .5);
-#if HAVE_JACK
+#ifdef HAVE_JACK
jack_midi_event_t ev;
ev.size = 3;
ev.buffer = malloc (3 * sizeof (jack_midi_data_t)); // FIXME
s->length, t->length);
return;
}
-#if HAVE_MEMCPY_HACKS
+#ifdef HAVE_MEMCPY_HACKS
memcpy(t->norm, s->norm, t->length * sizeof(smpl_t));
memcpy(t->phas, s->phas, t->length * sizeof(smpl_t));
-#else
+#else /* HAVE_MEMCPY_HACKS */
uint_t j;
for (j=0; j< t->length; j++) {
t->norm[j] = s->norm[j];
t->phas[j] = s->phas[j];
}
-#endif
+#endif /* HAVE_MEMCPY_HACKS */
}
void cvec_norm_set_all (cvec_t *s, smpl_t val) {
}
void cvec_norm_zeros(cvec_t *s) {
-#if HAVE_MEMCPY_HACKS
+#ifdef HAVE_MEMCPY_HACKS
memset(s->norm, 0, s->length * sizeof(smpl_t));
-#else
+#else /* HAVE_MEMCPY_HACKS */
cvec_norm_set_all (s, 0.);
-#endif
+#endif /* HAVE_MEMCPY_HACKS */
}
void cvec_norm_ones(cvec_t *s) {
}
void cvec_phas_zeros(cvec_t *s) {
-#if HAVE_MEMCPY_HACKS
+#ifdef HAVE_MEMCPY_HACKS
memset(s->phas, 0, s->length * sizeof(smpl_t));
#else
cvec_phas_set_all (s, 0.);
}
void fmat_zeros(fmat_t *s) {
-#if HAVE_MEMCPY_HACKS
+#ifdef HAVE_MEMCPY_HACKS
uint_t i;
for (i=0; i< s->height; i++) {
memset(s->data[i], 0, s->length * sizeof(smpl_t));
}
-#else
+#else /* HAVE_MEMCPY_HACKS */
fmat_set(s, 0.);
-#endif
+#endif /* HAVE_MEMCPY_HACKS */
}
void fmat_ones(fmat_t *s) {
void fmat_copy(const fmat_t *s, fmat_t *t) {
uint_t i;
-#if !HAVE_MEMCPY_HACKS
+#ifndef HAVE_MEMCPY_HACKS
uint_t j;
-#endif
+#endif /* HAVE_MEMCPY_HACKS */
if (s->height != t->height) {
AUBIO_ERR("trying to copy %d rows to %d rows \n",
s->height, t->height);
s->length, t->length);
return;
}
-#if HAVE_MEMCPY_HACKS
+#ifdef HAVE_MEMCPY_HACKS
for (i=0; i< s->height; i++) {
memcpy(t->data[i], s->data[i], t->length * sizeof(smpl_t));
}
-#else
+#else /* HAVE_MEMCPY_HACKS */
for (i=0; i< t->height; i++) {
for (j=0; j< t->length; j++) {
t->data[i][j] = s->data[i][j];
}
}
-#endif
+#endif /* HAVE_MEMCPY_HACKS */
}
void fmat_vecmul(const fmat_t *s, const fvec_t *scale, fvec_t *output) {
smpl_t * data = pv->data->data;
smpl_t * dataold = pv->dataold->data;
smpl_t * datanew = new->data;
-#if !HAVE_MEMCPY_HACKS
+#ifndef HAVE_MEMCPY_HACKS
uint_t i;
for (i = 0; i < pv->end; i++)
data[i] = dataold[i];