Jack2 1.9.6

JackPortAudioAdapter.h

00001 /*
00002 Copyright (C) 2008 Grame
00003 
00004 This program is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation; either version 2 of the License, or
00007 (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 
00018 */
00019 
00020 #ifndef __JackPortAudioAdapter__
00021 #define __JackPortAudioAdapter__
00022 
00023 #include "JackAudioAdapter.h"
00024 #include "JackPortAudioDevices.h"
00025 #include "jslist.h"
00026 
00027 namespace Jack
00028 {
00029 
00034     class JackPortAudioAdapter : public JackAudioAdapterInterface
00035     {
00036 
00037     private:
00038 
00039         PortAudioDevices fPaDevices;
00040         PaStream* fStream;
00041         PaDeviceIndex fInputDevice;
00042         PaDeviceIndex fOutputDevice;
00043 
00044         static int Render ( const void* inputBuffer, void* outputBuffer,
00045                             unsigned long framesPerBuffer,
00046                             const PaStreamCallbackTimeInfo* timeInfo,
00047                             PaStreamCallbackFlags statusFlags,
00048                             void* userData );
00049 
00050     public:
00051 
00052         JackPortAudioAdapter ( jack_nframes_t buffer_size, jack_nframes_t sample_rate, const JSList* params );
00053         ~JackPortAudioAdapter()
00054         {}
00055 
00056         int Open();
00057         int Close();
00058 
00059         int SetSampleRate ( jack_nframes_t sample_rate );
00060         int SetBufferSize ( jack_nframes_t buffer_size );
00061 
00062     };
00063 
00064 }
00065 
00066 #ifdef __cplusplus
00067 extern "C"
00068 {
00069 #endif
00070 
00071 #include "JackCompilerDeps.h"
00072 #include "driver_interface.h"
00073 
00074     EXPORT jack_driver_desc_t* jack_get_descriptor();
00075 
00076 #ifdef __cplusplus
00077 }
00078 #endif
00079 
00080 #endif