zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

PaEngine.h (1250B)


      1 /*
      2   ZynAddSubFX - a software synthesizer
      3 
      4   PAaudiooutput.h - Audio output for PortAudio
      5   Copyright (C) 2002 Nasca Octavian Paul
      6   Author: Nasca Octavian Paul
      7 
      8   This program is free software; you can redistribute it and/or
      9   modify it under the terms of the GNU General Public License
     10   as published by the Free Software Foundation; either version 2
     11   of the License, or (at your option) any later version.
     12 */
     13 #ifndef PA_ENGINE_H
     14 #define PA_ENGINE_H
     15 
     16 #include <portaudio.h>
     17 
     18 #include "../globals.h"
     19 #include "AudioOut.h"
     20 
     21 namespace zyn {
     22 
     23 class PaEngine:public AudioOut
     24 {
     25     public:
     26         PaEngine(const SYNTH_T &synth);
     27         ~PaEngine();
     28 
     29         bool Start();
     30         void Stop();
     31 
     32         void setAudioEn(bool nval);
     33         bool getAudioEn() const;
     34 
     35     protected:
     36         static int PAprocess(const void *inputBuffer,
     37                              void *outputBuffer,
     38                              unsigned long framesPerBuffer,
     39                              const PaStreamCallbackTimeInfo *outTime,
     40                              PaStreamCallbackFlags flags,
     41                              void *userData);
     42         int process(float *out, unsigned long framesPerBuffer);
     43     private:
     44         PaStream *stream;
     45 };
     46 
     47 void PAfinish();
     48 
     49 }
     50 
     51 #endif