Yippie! fixed block size rendering, slower but way more flexibe - Alex
[terminatorX.git] / src / tX_audiodevice.h
index 1d5c29156f481802678a521f38cf4dd991e6ed38..b9efb8b2ede436d1624e5260c610f636cb1c50e6 100644 (file)
 #include <alsa/asoundlib.h>
 #endif
 
+class tX_engine;
+
 class tX_audiodevice
 {
        protected:
        int samples_per_buffer;
+       int16_t *sample_buffer[2];
+       int current_buffer;
+       int buffer_pos;
+       tX_engine *engine;
+       
        int sample_rate;
-       void init();
+       tX_audiodevice();
        
        public:
        virtual double get_latency()=0; /* call only valid *after* open() */
@@ -51,7 +58,10 @@ class tX_audiodevice
        
        virtual int open()=0;
        virtual int close()=0;
-               
+       
+       void fill_buffer(int16_t *target_buffer, int16_t *next_target_buffer);
+
+       virtual void start();   
        virtual void play(int16_t*)=0; /* play blocked */
 };