From 36630b0fa3d29c54a666d3bb00a2fac804fa7df9 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 6 Nov 2014 08:03:56 +0100 Subject: Make cli output modules work with new samplerate() design. --- drumgizmo/output/alsa/alsa.cc | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'drumgizmo/output/alsa/alsa.cc') diff --git a/drumgizmo/output/alsa/alsa.cc b/drumgizmo/output/alsa/alsa.cc index 7b3a395..dc2ac73 100644 --- a/drumgizmo/output/alsa/alsa.cc +++ b/drumgizmo/output/alsa/alsa.cc @@ -49,6 +49,7 @@ public: void pre(size_t size); void run(int channel, sample_t* data, size_t size); void post(size_t size); + size_t samplerate(); private: snd_pcm_t *handle; @@ -157,6 +158,11 @@ void Alsa::post(size_t size) snd_pcm_writei(handle, data, size); } +size_t Alsa::samplerate() +{ + return srate; +} + extern "C" { void *create() { @@ -210,21 +216,10 @@ extern "C" { Alsa *alsa = (Alsa*)h; alsa->post(s); } -} - -#ifdef TEST_AUDIOOUTPUTENGINEALSA -//Additional dependency files -//deps: -//Required cflags (autoconf vars may be used) -//cflags: -//Required link options (autoconf vars may be used) -//libs: -#include "test.h" - -TEST_BEGIN; -// TODO: Put some testcode here (see test.h for usable macros). - -TEST_END; - -#endif/*TEST_AUDIOOUTPUTENGINEALSA*/ + size_t samplerate(void *h) + { + Alsa *alsa = (Alsa*)h; + return alsa->samplerate(); + } +} -- cgit v1.2.3