#include "radio-api.h"
#include "radio-rtlsdr.h"
+static audioCtxHandleT *actx = NULL;
+
/* ------------- RADIO RTLSDR IMPLEMENTATION ---------------- */
/* --- PUBLIC FUNCTIONS --- */
dev_ctx[num]->output = NULL;
_radio_dev_init(dev_ctx[num], num);
+ actx = malloc (sizeof(audioCtxHandleT));
+ actx->idx = -1;
+ actx->volume = 25;
+ actx->channels = 2;
+ actx->mute = 0;
+ _alsa_init ("default", actx);
+
return 1;
}
_radio_dev_free(dev_ctx[num]);
free(dev_ctx[num]);
}
+
/* free(dev_ctx); */
+
+ _alsa_free ("default");
+ free (actx);
}
PUBLIC void _radio_set_mode (unsigned int num, Mode mode) {
while (dev_ctx->should_run) {
pthread_wait(&output->ok, &output->ok_m);
pthread_rwlock_rdlock(&output->lck);
- //if (!dev_ctx->mute)
- // mRadio->PlayAlsa((void*)&output->buf, output->buf_len);
+ if (!dev_ctx->mute)
+ _alsa_play(actx->idx, (void*)&output->buf, output->buf_len);
pthread_rwlock_unlock(&output->lck);
}