diff options
author | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2006-09-03 07:39:10 +0000 |
---|---|---|
committer | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2006-09-03 07:39:10 +0000 |
commit | 73e2d7a6d35779cb92a17ae98b27dd752eea02c9 (patch) | |
tree | 3a23f6217af15439947ab650f0ef60e28541ba2b /common/JackAudioDriver.h | |
parent | e33aa60c7095c11075995bcca6b35a92c719f9e7 (diff) | |
download | jack2-73e2d7a6d35779cb92a17ae98b27dd752eea02c9.tar.gz |
First import
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1195 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'common/JackAudioDriver.h')
-rw-r--r-- | common/JackAudioDriver.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/common/JackAudioDriver.h b/common/JackAudioDriver.h new file mode 100644 index 00000000..13de9096 --- /dev/null +++ b/common/JackAudioDriver.h @@ -0,0 +1,88 @@ +/* +Copyright (C) 2001 Paul Davis +Copyright (C) 2004-2006 Grame + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __JackAudioDriver__ +#define __JackAudioDriver__ + +#include "JackDriver.h" + + +namespace Jack +{ + +/*! +\brief The base class for audio drivers: drivers with audio ports. +*/ + +class EXPORT JackAudioDriver : public JackDriver +{ + + protected: + + int fCaptureChannels; + int fPlaybackChannels; + + // static tables since the actual number of ports may be changed by the real driver + // thus dynamic allocation is more difficult to handle + jack_port_id_t fCapturePortList[PORT_NUM]; + jack_port_id_t fPlaybackPortList[PORT_NUM]; + jack_port_id_t fMonitorPortList[PORT_NUM]; + + bool fWithMonitorPorts; + + jack_default_audio_sample_t* GetInputBuffer(int port_index); + jack_default_audio_sample_t* GetOutputBuffer(int port_index); + jack_default_audio_sample_t* GetMonitorBuffer(int port_index); + + private: + + int ProcessAsync(); + int ProcessSync(); + + public: + + JackAudioDriver(const char* name, JackEngine* engine, JackSynchro** table); + virtual ~JackAudioDriver(); + + virtual int Process(); + + virtual int Open(jack_nframes_t nframes, + jack_nframes_t samplerate, + int capturing, + int playing, + int inchannels, + int outchannels, + bool monitor, + const char* capture_driver_name, + const char* playback_driver_name, + jack_nframes_t capture_latency, + jack_nframes_t playback_latency); + + virtual int Attach(); + virtual int Detach(); + virtual int Write(); + + virtual void NotifyXRun(jack_time_t callback_usecs); // XRun notification sent by the driver + +}; + +} // end of namespace + +#endif |