JackAudioDriver.h

00001 /*
00002 Copyright (C) 2001 Paul Davis 
00003 Copyright (C) 2004-2006 Grame
00004 
00005 This program is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2 of the License, or
00008 (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019 */
00020 
00021 #ifndef __JackAudioDriver__
00022 #define __JackAudioDriver__
00023 
00024 #include "JackDriver.h"
00025 
00026 
00027 namespace Jack
00028 {
00029 
00034 class EXPORT JackAudioDriver : public JackDriver
00035 {
00036 
00037     protected:
00038 
00039         int fCaptureChannels;
00040         int fPlaybackChannels;
00041 
00042         // static tables since the actual number of ports may be changed by the real driver
00043         // thus dynamic allocation is more difficult to handle
00044         jack_port_id_t fCapturePortList[PORT_NUM];
00045         jack_port_id_t fPlaybackPortList[PORT_NUM];
00046         jack_port_id_t fMonitorPortList[PORT_NUM];
00047 
00048         bool fWithMonitorPorts;
00049 
00050         jack_default_audio_sample_t* GetInputBuffer(int port_index);
00051         jack_default_audio_sample_t* GetOutputBuffer(int port_index);
00052         jack_default_audio_sample_t* GetMonitorBuffer(int port_index);
00053 
00054     private:
00055 
00056         int ProcessAsync();
00057         int ProcessSync();
00058 
00059     public:
00060 
00061         JackAudioDriver(const char* name, JackEngine* engine, JackSynchro** table);
00062         virtual ~JackAudioDriver();
00063 
00064         virtual int Process();
00065 
00066         virtual int Open(jack_nframes_t nframes,
00067                          jack_nframes_t samplerate,
00068                          int capturing,
00069                          int playing,
00070                          int inchannels,
00071                          int outchannels,
00072                          bool monitor,
00073                          const char* capture_driver_name,
00074                          const char* playback_driver_name,
00075                          jack_nframes_t capture_latency,
00076                          jack_nframes_t playback_latency);
00077 
00078         virtual int Attach();
00079         virtual int Detach();
00080         virtual int Write();
00081 
00082         virtual void NotifyXRun(jack_time_t callback_usecs); // XRun notification sent by the driver
00083 
00084 };
00085 
00086 } // end of namespace
00087 
00088 #endif

Generated on Wed Jan 10 11:42:44 2007 for Jackdmp by  doxygen 1.4.5