summaryrefslogtreecommitdiff
path: root/drumgizmo/output/alsa/alsa.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-05-22 10:34:21 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-01-20 13:28:48 +0100
commit60cd3f9dc45b194198198591a7bf48e2d8afb16c (patch)
tree1f32bc03dbd42da23f5c4707f8aa9d51f1193eb3 /drumgizmo/output/alsa/alsa.cc
parentfd501c7dc4042ce993b16a2d079d5b05af2ecb07 (diff)
Added framesize control mechanism to the engine, and made us of it in the cachemanager and drumkitloader.
Diffstat (limited to 'drumgizmo/output/alsa/alsa.cc')
-rw-r--r--drumgizmo/output/alsa/alsa.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/drumgizmo/output/alsa/alsa.cc b/drumgizmo/output/alsa/alsa.cc
index 71e0c3d..f9a2068 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 bufsize();
size_t samplerate();
private:
@@ -158,6 +159,11 @@ void Alsa::post(size_t size)
snd_pcm_writei(handle, data, size);
}
+size_t Alsa::bufsize()
+{
+ return frames;
+}
+
size_t Alsa::samplerate()
{
return srate;
@@ -217,6 +223,12 @@ extern "C" {
alsa->post(s);
}
+ size_t bufsize(void *h)
+ {
+ Alsa *alsa = (Alsa*)h;
+ return alsa->bufsize();
+ }
+
size_t samplerate(void *h)
{
Alsa *alsa = (Alsa*)h;