diff --git a/common/JackIOAdapter.cpp b/common/JackIOAdapter.cpp index 71ec2367..4938943d 100644 --- a/common/JackIOAdapter.cpp +++ b/common/JackIOAdapter.cpp @@ -32,4 +32,4 @@ int JackIOAdapterInterface::Close() return 0; } -} // namespace \ No newline at end of file +} // namespace diff --git a/common/JackNetIOAdapter.cpp b/common/JackNetIOAdapter.cpp index aa13ec45..54cb5f0c 100644 --- a/common/JackNetIOAdapter.cpp +++ b/common/JackNetIOAdapter.cpp @@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "JackError.h" #include "JackExports.h" #include +#include #include using namespace std; @@ -106,6 +107,10 @@ extern "C" #include "JackCallbackNetIOAdapter.h" +#ifdef __linux__ +#include "JackAlsaIOAdapter.h" +#endif + #ifdef __APPLE__ #include "JackCoreAudioIOAdapter.h" #endif @@ -138,6 +143,11 @@ extern "C" if (ports) free(ports); + #ifdef __linux__ + adapter = new Jack::JackCallbackNetIOAdapter(jack_client, + new Jack::JackAlsaIOAdapter(input, output, jack_get_buffer_size(jack_client), jack_get_sample_rate(jack_client)), input, output); + #endif + #ifdef WIN32 adapter = new Jack::JackCallbackNetIOAdapter(jack_client, new Jack::JackPortAudioIOAdapter(input, output, jack_get_buffer_size(jack_client), jack_get_sample_rate(jack_client)), input, output); diff --git a/common/wscript b/common/wscript index b832657b..520c47fb 100644 --- a/common/wscript +++ b/common/wscript @@ -41,7 +41,7 @@ def subst_func(tsk): def create_jack_process_obj(bld, target, sources, uselib = None): process = bld.create_obj('cpp', 'shlib') process.env['shlib_PATTERN'] = '%s.so' - process.includes = ['./jack', '.', '../macosx','../windows'] + process.includes = ['./jack', '.', '../macosx','../windows', '../linux/alsa'] process.name = target process.target = target process.source = sources @@ -198,7 +198,7 @@ def build(bld): process = create_jack_process_obj(bld, 'netioadapter','JackResampler.cpp JackLibSampleRateResampler.cpp JackIOAdapter.cpp JackNetIOAdapter.cpp JackCallbackNetIOAdapter.cpp ../macosx/JackCoreAudioIOAdapter.cpp', serverlib) if bld.env()['IS_LINUX']: - process = create_jack_process_obj(bld, 'netioadapter','JackResampler.cpp JackLibSampleRateResampler.cpp JackIOAdapter.cpp JackNetIOAdapter.cpp JackCallbackNetIOAdapter.cpp', serverlib) + process = create_jack_process_obj(bld, 'netioadapter','JackResampler.cpp JackLibSampleRateResampler.cpp JackIOAdapter.cpp JackNetIOAdapter.cpp JackCallbackNetIOAdapter.cpp ../linux/alsa/JackAlsaIOAdapter.cpp', serverlib) #process = create_jack_process_obj(bld, 'netioadapter', 'JackResampler.cpp JackLibSampleRateResampler.cpp JackIOAdapter.cpp JackNetIOAdapter.cpp JackCallbackNetIOAdapter.cpp ../windows/JackPortAudioIOAdapter.cpp', serverlib) diff --git a/linux/alsa/JackAlsaIOAdapter.cpp b/linux/alsa/JackAlsaIOAdapter.cpp new file mode 100644 index 00000000..5718340e --- /dev/null +++ b/linux/alsa/JackAlsaIOAdapter.cpp @@ -0,0 +1,41 @@ +/* +Copyright (C) 2008 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. + +*/ + +#include "JackAlsaIOAdapter.h" + +namespace Jack +{ + + +int JackAlsaIOAdapter::Open() +{ + return 0; +} +int JackAlsaIOAdapter::Close() +{ + return 0; +} + +int JackAlsaIOAdapter::SetBufferSize(jack_nframes_t buffer_size) +{ + return 0; +} + + +} diff --git a/linux/alsa/JackAlsaIOAdapter.h b/linux/alsa/JackAlsaIOAdapter.h new file mode 100644 index 00000000..14f17f3b --- /dev/null +++ b/linux/alsa/JackAlsaIOAdapter.h @@ -0,0 +1,50 @@ +/* +Copyright (C) 2008 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 __JackAlsaIOAdapter__ +#define __JackAlsaIOAdapter__ + +#include "JackIOAdapter.h" +#include "jack.h" + +namespace Jack +{ + + class JackAlsaIOAdapter : public JackIOAdapterInterface + { + + private: + + public: + + JackAlsaIOAdapter(int input, int output, jack_nframes_t buffer_size, jack_nframes_t sample_rate) + :JackIOAdapterInterface(input, output, buffer_size, sample_rate) + {} + ~JackAlsaIOAdapter() + {} + + virtual int Open(); + virtual int Close(); + + virtual int SetBufferSize(jack_nframes_t buffer_size); + + }; +} + +#endif