git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2691 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.90
| @@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| */ | |||
| #include "JackAudioAdapter.h" | |||
| #include "JackLibSampleRateResampler.h" | |||
| #include "JackError.h" | |||
| #include "JackExports.h" | |||
| #include "JackTools.h" | |||
| @@ -31,70 +32,157 @@ using namespace std; | |||
| namespace Jack | |||
| { | |||
| JackAudioAdapter::JackAudioAdapter(jack_client_t* jack_client, | |||
| JackAudioAdapterInterface* audio_io) | |||
| { | |||
| int i; | |||
| char name[32]; | |||
| fJackClient = jack_client; | |||
| fCaptureChannels = audio_io->GetInputs(); | |||
| fPlaybackChannels = audio_io->GetOutputs(); | |||
| fAudioAdapter = audio_io; | |||
| fCapturePortList = new jack_port_t* [fCaptureChannels]; | |||
| fPlaybackPortList = new jack_port_t* [fPlaybackChannels]; | |||
| for (i = 0; i < fCaptureChannels; i++) { | |||
| sprintf(name, "capture_%d", i+1); | |||
| if ((fCapturePortList[i] = jack_port_register(fJackClient, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0)) == NULL) | |||
| goto fail; | |||
| int JackAudioAdapter::Process(jack_nframes_t frames, void* arg) | |||
| { | |||
| JackAudioAdapter* adapter = static_cast<JackAudioAdapter*>(arg); | |||
| float* buffer; | |||
| bool failure = false; | |||
| int i; | |||
| if (!adapter->fAudioAdapter->IsRunning()) | |||
| return 0; | |||
| // DLL | |||
| adapter->fAudioAdapter->SetCallbackTime(jack_get_time()); | |||
| // Push/pull from ringbuffer | |||
| for (i = 0; i < adapter->fCaptureChannels; i++) | |||
| { | |||
| buffer = static_cast<float*>(jack_port_get_buffer(adapter->fCapturePortList[i], frames)); | |||
| if (adapter->fCaptureRingBuffer[i]->Read(buffer, frames) < frames) | |||
| failure = true; | |||
| } | |||
| for (i = 0; i < adapter->fPlaybackChannels; i++) | |||
| { | |||
| buffer = static_cast<float*>(jack_port_get_buffer(adapter->fPlaybackPortList[i], frames)); | |||
| if (adapter->fPlaybackRingBuffer[i]->Write(buffer, frames) < frames) | |||
| failure = true; | |||
| } | |||
| // Reset all ringbuffers in case of failure | |||
| if (failure) | |||
| { | |||
| jack_error("JackCallbackAudioAdapter::Process ringbuffer failure... reset"); | |||
| adapter->Reset(); | |||
| } | |||
| return 0; | |||
| } | |||
| for (i = 0; i < fPlaybackChannels; i++) { | |||
| sprintf(name, "playback_%d", i+1); | |||
| if ((fPlaybackPortList[i] = jack_port_register(fJackClient, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0)) == NULL) | |||
| goto fail; | |||
| int JackAudioAdapter::BufferSize(jack_nframes_t buffer_size, void* arg) | |||
| { | |||
| JackAudioAdapter* adapter = static_cast<JackAudioAdapter*>(arg); | |||
| adapter->Reset(); | |||
| adapter->fAudioAdapter->SetBufferSize(buffer_size); | |||
| return 0; | |||
| } | |||
| return; | |||
| fail: | |||
| FreePorts(); | |||
| } | |||
| JackAudioAdapter::~JackAudioAdapter() | |||
| { | |||
| // When called, Close has already been used for the client, thus ports are already unregistered. | |||
| delete fAudioAdapter; | |||
| } | |||
| int JackAudioAdapter::SampleRate(jack_nframes_t sample_rate, void* arg) | |||
| { | |||
| JackAudioAdapter* adapter = static_cast<JackAudioAdapter*>(arg); | |||
| adapter->Reset(); | |||
| adapter->fAudioAdapter->SetSampleRate(sample_rate); | |||
| return 0; | |||
| } | |||
| void JackAudioAdapter::FreePorts() | |||
| { | |||
| int i; | |||
| for (i = 0; i < fCaptureChannels; i++) { | |||
| if (fCapturePortList[i]) | |||
| jack_port_unregister(fJackClient, fCapturePortList[i]); | |||
| void JackAudioAdapter::Reset() | |||
| { | |||
| int i; | |||
| for (i = 0; i < fCaptureChannels; i++) | |||
| fCaptureRingBuffer[i]->Reset(); | |||
| for (i = 0; i < fPlaybackChannels; i++) | |||
| fPlaybackRingBuffer[i]->Reset(); | |||
| fAudioAdapter->Reset(); | |||
| } | |||
| for (i = 0; i < fCaptureChannels; i++) { | |||
| if (fPlaybackPortList[i]) | |||
| jack_port_unregister(fJackClient, fPlaybackPortList[i]); | |||
| JackAudioAdapter::~JackAudioAdapter() | |||
| { | |||
| // When called, Close has already been used for the client, thus ports are already unregistered. | |||
| int i; | |||
| for (i = 0; i < fCaptureChannels; i++) | |||
| delete(fCaptureRingBuffer[i]); | |||
| for (i = 0; i < fPlaybackChannels; i++) | |||
| delete(fPlaybackRingBuffer[i]); | |||
| delete[] fCaptureRingBuffer; | |||
| delete[] fPlaybackRingBuffer; | |||
| delete fAudioAdapter; | |||
| } | |||
| delete[] fCapturePortList; | |||
| delete[] fPlaybackPortList; | |||
| } | |||
| void JackAudioAdapter::FreePorts() | |||
| { | |||
| int i; | |||
| for (i = 0; i < fCaptureChannels; i++) | |||
| if (fCapturePortList[i]) | |||
| jack_port_unregister(fJackClient, fCapturePortList[i]); | |||
| for (i = 0; i < fCaptureChannels; i++) | |||
| if (fPlaybackPortList[i]) | |||
| jack_port_unregister(fJackClient, fPlaybackPortList[i]); | |||
| int JackAudioAdapter::Open() | |||
| { | |||
| return fAudioAdapter->Open(); | |||
| } | |||
| delete[] fCapturePortList; | |||
| delete[] fPlaybackPortList; | |||
| } | |||
| int JackAudioAdapter::Close() | |||
| { | |||
| return fAudioAdapter->Close(); | |||
| } | |||
| int JackAudioAdapter::Open() | |||
| { | |||
| jack_log("JackAudioAdapter::Open()"); | |||
| int i; | |||
| char name[32]; | |||
| fCaptureChannels = fAudioAdapter->GetInputs(); | |||
| fPlaybackChannels = fAudioAdapter->GetOutputs(); | |||
| //ringbuffers | |||
| fCaptureRingBuffer = new JackResampler*[fCaptureChannels]; | |||
| fPlaybackRingBuffer = new JackResampler*[fPlaybackChannels]; | |||
| for (i = 0; i < fCaptureChannels; i++) | |||
| fCaptureRingBuffer[i] = new JackLibSampleRateResampler(); | |||
| for (i = 0; i < fPlaybackChannels; i++) | |||
| fPlaybackRingBuffer[i] = new JackLibSampleRateResampler(); | |||
| fAudioAdapter->SetRingBuffers(fCaptureRingBuffer, fPlaybackRingBuffer); | |||
| jack_log("ReadSpace = %ld", fCaptureRingBuffer[0]->ReadSpace()); | |||
| jack_log("WriteSpace = %ld", fPlaybackRingBuffer[0]->WriteSpace()); | |||
| //jack ports | |||
| fCapturePortList = new jack_port_t* [fCaptureChannels]; | |||
| fPlaybackPortList = new jack_port_t* [fPlaybackChannels]; | |||
| for (i = 0; i < fCaptureChannels; i++) | |||
| { | |||
| sprintf(name, "capture_%d", i+1); | |||
| if ((fCapturePortList[i] = jack_port_register(fJackClient, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0)) == NULL) | |||
| goto fail; | |||
| } | |||
| for (i = 0; i < fPlaybackChannels; i++) | |||
| { | |||
| sprintf(name, "playback_%d", i+1); | |||
| if ((fPlaybackPortList[i] = jack_port_register(fJackClient, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0)) == NULL) | |||
| goto fail; | |||
| } | |||
| //callbacks and activation | |||
| if (jack_set_process_callback(fJackClient, Process, this) < 0) | |||
| goto fail; | |||
| if (jack_set_buffer_size_callback(fJackClient, BufferSize, this) < 0) | |||
| goto fail; | |||
| if (jack_set_sample_rate_callback(fJackClient, SampleRate, this) < 0) | |||
| goto fail; | |||
| if (jack_activate(fJackClient) < 0) | |||
| goto fail; | |||
| //ringbuffers and jack clients are ok, we can now open the adapter driver interface | |||
| return fAudioAdapter->Open(); | |||
| fail: | |||
| FreePorts(); | |||
| } | |||
| int JackAudioAdapter::Close() | |||
| { | |||
| return fAudioAdapter->Close(); | |||
| } | |||
| } //namespace | |||
| @@ -103,7 +191,6 @@ extern "C" | |||
| { | |||
| #endif | |||
| #include "JackCallbackAudioAdapter.h" | |||
| #include "driver_interface.h" | |||
| #ifdef __linux__ | |||
| @@ -118,63 +205,67 @@ extern "C" | |||
| #include "JackPortAudioAdapter.h" | |||
| #endif | |||
| using namespace Jack; | |||
| using namespace Jack; | |||
| EXPORT int jack_internal_initialize(jack_client_t* jack_client, const JSList* params) | |||
| { | |||
| Jack::JackAudioAdapter* adapter; | |||
| jack_log("Loading audioadapter"); | |||
| #ifdef __linux__ | |||
| adapter = new Jack::JackCallbackAudioAdapter(jack_client, | |||
| new Jack::JackAlsaAdapter(jack_get_buffer_size(jack_client), jack_get_sample_rate(jack_client), params)); | |||
| #endif | |||
| #ifdef WIN32 | |||
| adapter = new Jack::JackCallbackAudioAdapter(jack_client, | |||
| new Jack::JackPortAudioAdapter(jack_get_buffer_size(jack_client), jack_get_sample_rate(jack_client), params)); | |||
| #endif | |||
| #ifdef __APPLE__ | |||
| adapter = new Jack::JackCallbackAudioAdapter(jack_client, | |||
| new Jack::JackCoreAudioAdapter(jack_get_buffer_size(jack_client), jack_get_sample_rate(jack_client), params)); | |||
| #endif | |||
| Jack::JackAudioAdapter* adapter; | |||
| jack_nframes_t buffer_size = jack_get_buffer_size(jack_client); | |||
| jack_nframes_t sample_rate = jack_get_sample_rate(jack_client); | |||
| #ifdef __linux__ | |||
| adapter = new Jack::JackAudioAdapter(jack_client, new Jack::JackAlsaAdapter(buffer_size, sample_rate, params)); | |||
| #endif | |||
| #ifdef WIN32 | |||
| adapter = new Jack::JackAudioAdapter(jack_client, new Jack::JackPortAudioAdapter(buffer_size, sample_rate, params)); | |||
| #endif | |||
| #ifdef __APPLE__ | |||
| adapter = new Jack::JackAudioAdapter(jack_client, new Jack::JackCoreAudioAdapter(buffer_size, sample_rate, params)); | |||
| #endif | |||
| assert(adapter); | |||
| if (adapter->Open() == 0) { | |||
| if (adapter->Open() == 0) | |||
| return 0; | |||
| } else { | |||
| else | |||
| { | |||
| delete adapter; | |||
| return 1; | |||
| } | |||
| } | |||
| EXPORT int jack_initialize(jack_client_t* jack_client, const char* load_init) | |||
| { | |||
| EXPORT int jack_initialize(jack_client_t* jack_client, const char* load_init) | |||
| { | |||
| JSList* params = NULL; | |||
| jack_driver_desc_t *desc = jack_get_descriptor(); | |||
| JackArgParser parser(load_init); | |||
| if (parser.GetArgc() > 0) { | |||
| if (parser.ParseParams(desc, ¶ms) != 0) | |||
| if (parser.GetArgc() > 0) | |||
| { | |||
| if (parser.ParseParams(desc, ¶ms) != 0) | |||
| jack_error("Internal client : JackArgParser::ParseParams error."); | |||
| } | |||
| return jack_internal_initialize(jack_client, params); | |||
| } | |||
| EXPORT void jack_finish(void* arg) | |||
| { | |||
| Jack::JackCallbackAudioAdapter* adapter = static_cast<Jack::JackCallbackAudioAdapter*>(arg); | |||
| if (adapter) { | |||
| jack_log("Unloading audioadapter"); | |||
| EXPORT void jack_finish(void* arg) | |||
| { | |||
| Jack::JackAudioAdapter* adapter = static_cast<Jack::JackAudioAdapter*>(arg); | |||
| if (adapter) | |||
| { | |||
| jack_log("Unloading audioadapter"); | |||
| adapter->Close(); | |||
| delete adapter; | |||
| } | |||
| } | |||
| delete adapter; | |||
| } | |||
| } | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| @@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| #define __JackAudioAdapter__ | |||
| #include "jack.h" | |||
| #include "ringbuffer.h" | |||
| #include "JackAudioAdapterInterface.h" | |||
| namespace Jack | |||
| @@ -28,29 +29,34 @@ namespace Jack | |||
| class JackAudioAdapter | |||
| { | |||
| private: | |||
| int fCaptureChannels; | |||
| int fPlaybackChannels; | |||
| protected: | |||
| JackResampler** fCaptureRingBuffer; | |||
| JackResampler** fPlaybackRingBuffer; | |||
| int fCaptureChannels; | |||
| int fPlaybackChannels; | |||
| jack_port_t** fCapturePortList; | |||
| jack_port_t** fPlaybackPortList; | |||
| jack_port_t** fCapturePortList; | |||
| jack_port_t** fPlaybackPortList; | |||
| jack_client_t* fJackClient; | |||
| JackAudioAdapterInterface* fAudioAdapter; | |||
| jack_client_t* fJackClient; | |||
| JackAudioAdapterInterface* fAudioAdapter; | |||
| static int Process(jack_nframes_t, void* arg); | |||
| static int BufferSize(jack_nframes_t buffer_size, void *arg); | |||
| static int SampleRate(jack_nframes_t sample_rate, void *arg); | |||
| void FreePorts(); | |||
| void FreePorts(); | |||
| void Reset(); | |||
| public: | |||
| JackAudioAdapter(jack_client_t* jack_client, | |||
| JackAudioAdapterInterface* audio_io); | |||
| virtual ~JackAudioAdapter(); | |||
| int Open(); | |||
| int Close(); | |||
| public: | |||
| JackAudioAdapter(jack_client_t* jack_client, JackAudioAdapterInterface* audio_io) : | |||
| fJackClient(jack_client), fAudioAdapter(audio_io) | |||
| {} | |||
| ~JackAudioAdapter(); | |||
| int Open(); | |||
| int Close(); | |||
| }; | |||
| } | |||
| @@ -1,152 +0,0 @@ | |||
| /* | |||
| 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 "JackCallbackAudioAdapter.h" | |||
| #include "JackLibSampleRateResampler.h" | |||
| #include "JackError.h" | |||
| #include "JackExports.h" | |||
| #include <stdio.h> | |||
| #include <assert.h> | |||
| using namespace std; | |||
| namespace Jack | |||
| { | |||
| int JackCallbackAudioAdapter::Process(jack_nframes_t frames, void* arg) | |||
| { | |||
| JackCallbackAudioAdapter* adapter = static_cast<JackCallbackAudioAdapter*>(arg); | |||
| float* buffer; | |||
| bool failure = false; | |||
| int i; | |||
| if (!adapter->fAudioAdapter->IsRunning()) | |||
| return 0; | |||
| // DLL | |||
| adapter->fAudioAdapter->SetCallbackTime(jack_get_time()); | |||
| // Push/pull from ringbuffer | |||
| for (i = 0; i < adapter->fCaptureChannels; i++) { | |||
| buffer = static_cast<float*>(jack_port_get_buffer(adapter->fCapturePortList[i], frames)); | |||
| if (adapter->fCaptureRingBuffer[i]->Read(buffer, frames) < frames) | |||
| failure = true; | |||
| } | |||
| for (i = 0; i < adapter->fPlaybackChannels; i++) { | |||
| buffer = static_cast<float*>(jack_port_get_buffer(adapter->fPlaybackPortList[i], frames)); | |||
| if (adapter->fPlaybackRingBuffer[i]->Write(buffer, frames) < frames) | |||
| failure = true; | |||
| } | |||
| // Reset all ringbuffers in case of failure | |||
| if (failure) { | |||
| jack_error("JackCallbackAudioAdapter::Process ringbuffer failure... reset"); | |||
| adapter->Reset(); | |||
| } | |||
| return 0; | |||
| } | |||
| int JackCallbackAudioAdapter::BufferSize(jack_nframes_t buffer_size, void* arg) | |||
| { | |||
| JackCallbackAudioAdapter* adapter = static_cast<JackCallbackAudioAdapter*>(arg); | |||
| adapter->Reset(); | |||
| adapter->fAudioAdapter->SetBufferSize(buffer_size); | |||
| return 0; | |||
| } | |||
| int JackCallbackAudioAdapter::SampleRate(jack_nframes_t sample_rate, void* arg) | |||
| { | |||
| JackCallbackAudioAdapter* adapter = static_cast<JackCallbackAudioAdapter*>(arg); | |||
| adapter->Reset(); | |||
| adapter->fAudioAdapter->SetSampleRate(sample_rate); | |||
| return 0; | |||
| } | |||
| void JackCallbackAudioAdapter::Reset() | |||
| { | |||
| int i; | |||
| for (i = 0; i < fCaptureChannels; i++) { | |||
| fCaptureRingBuffer[i]->Reset(); | |||
| } | |||
| for (i = 0; i < fPlaybackChannels; i++) { | |||
| fPlaybackRingBuffer[i]->Reset(); | |||
| } | |||
| fAudioAdapter->Reset(); | |||
| } | |||
| JackCallbackAudioAdapter::JackCallbackAudioAdapter(jack_client_t* jack_client, JackAudioAdapterInterface* audio_io) | |||
| : JackAudioAdapter(jack_client, audio_io) | |||
| { | |||
| int i; | |||
| fCaptureRingBuffer = new JackResampler*[fCaptureChannels]; | |||
| fPlaybackRingBuffer = new JackResampler*[fPlaybackChannels]; | |||
| for (i = 0; i < fCaptureChannels; i++) { | |||
| fCaptureRingBuffer[i] = new JackLibSampleRateResampler(); | |||
| } | |||
| for (i = 0; i < fPlaybackChannels; i++) { | |||
| fPlaybackRingBuffer[i] = new JackLibSampleRateResampler(); | |||
| } | |||
| fAudioAdapter->SetRingBuffers(fCaptureRingBuffer, fPlaybackRingBuffer); | |||
| jack_log("ReadSpace = %ld", fCaptureRingBuffer[0]->ReadSpace()); | |||
| jack_log("WriteSpace = %ld", fPlaybackRingBuffer[0]->WriteSpace()); | |||
| if (jack_set_process_callback(fJackClient, Process, this) < 0) | |||
| goto fail; | |||
| if (jack_set_buffer_size_callback(fJackClient, BufferSize, this) < 0) | |||
| goto fail; | |||
| if (jack_set_sample_rate_callback(fJackClient, SampleRate, this) < 0) | |||
| goto fail; | |||
| if (jack_activate(fJackClient) < 0) | |||
| goto fail; | |||
| return; | |||
| fail: | |||
| FreePorts(); | |||
| } | |||
| JackCallbackAudioAdapter::~JackCallbackAudioAdapter() | |||
| { | |||
| int i; | |||
| for (i = 0; i < fCaptureChannels; i++) { | |||
| delete(fCaptureRingBuffer[i]); | |||
| } | |||
| for (i = 0; i < fPlaybackChannels; i++) { | |||
| delete(fPlaybackRingBuffer[i]); | |||
| } | |||
| delete[] fCaptureRingBuffer; | |||
| delete[] fPlaybackRingBuffer; | |||
| } | |||
| } //namespace | |||
| @@ -1,52 +0,0 @@ | |||
| /* | |||
| 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 __JackCallbackAudioAdapter__ | |||
| #define __JackCallbackAudioAdapter__ | |||
| #include "JackAudioAdapter.h" | |||
| #include "ringbuffer.h" | |||
| namespace Jack | |||
| { | |||
| class JackCallbackAudioAdapter : public JackAudioAdapter | |||
| { | |||
| private: | |||
| JackResampler** fCaptureRingBuffer; | |||
| JackResampler** fPlaybackRingBuffer; | |||
| static int Process(jack_nframes_t, void* arg); | |||
| static int BufferSize(jack_nframes_t buffer_size, void *arg); | |||
| static int SampleRate(jack_nframes_t sample_rate, void *arg); | |||
| void Reset(); | |||
| public: | |||
| JackCallbackAudioAdapter(jack_client_t* jack_client, | |||
| JackAudioAdapterInterface* audio_io); | |||
| ~JackCallbackAudioAdapter(); | |||
| }; | |||
| } | |||
| #endif | |||
| @@ -1,21 +1,21 @@ | |||
| /* | |||
| Copyright (C) 2000 Paul Davis | |||
| Copyright (C) 2003 Rohan Drape | |||
| This program is free software; you can redistribute it and/or modify | |||
| it under the terms of the GNU Lesser General Public License as published by | |||
| the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. | |||
| You should have received a copy of the GNU Lesser General Public License | |||
| along with this program; if not, write to the Free Software | |||
| along with this program; if not, write to the Free Software | |||
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
| ISO/POSIX C version of Paul Davis's lock free ringbuffer C++ code. | |||
| This is safe for the case of one read thread and one write thread. | |||
| */ | |||
| @@ -41,7 +41,7 @@ jack_ringbuffer_create (size_t sz) | |||
| int power_of_two; | |||
| jack_ringbuffer_t *rb; | |||
| rb = malloc (sizeof (jack_ringbuffer_t)); | |||
| rb = (jack_ringbuffer_t*)malloc (sizeof (jack_ringbuffer_t)); | |||
| for (power_of_two = 1; 1 << power_of_two < sz; power_of_two++); | |||
| @@ -50,7 +50,7 @@ jack_ringbuffer_create (size_t sz) | |||
| rb->size_mask -= 1; | |||
| rb->write_ptr = 0; | |||
| rb->read_ptr = 0; | |||
| rb->buf = malloc (rb->size); | |||
| rb->buf = (char*)malloc (rb->size); | |||
| memset(rb->buf, 0, rb->size); | |||
| rb->mlocked = 0; | |||
| @@ -175,8 +175,8 @@ jack_ringbuffer_read (jack_ringbuffer_t * rb, char *dest, size_t cnt) | |||
| return to_read; | |||
| } | |||
| /* The copying data reader w/o read pointer advance. Copy at most | |||
| `cnt' bytes from `rb' to `dest'. Returns the actual number of bytes | |||
| /* The copying data reader w/o read pointer advance. Copy at most | |||
| `cnt' bytes from `rb' to `dest'. Returns the actual number of bytes | |||
| copied. */ | |||
| EXPORT size_t | |||
| @@ -34,10 +34,10 @@ int JackPortAudioAdapter::Render(const void* inputBuffer, void* outputBuffer, | |||
| float** paBuffer; | |||
| float* buffer; | |||
| bool failure = false; | |||
| jack_nframes_t time1, time2; | |||
| jack_nframes_t time1, time2; | |||
| adapter->ResampleFactor(time1, time2); | |||
| paBuffer = (float**)inputBuffer; | |||
| for (int i = 0; i < adapter->fCaptureChannels; i++) { | |||
| buffer = (float*)paBuffer[i]; | |||
| @@ -45,7 +45,7 @@ int JackPortAudioAdapter::Render(const void* inputBuffer, void* outputBuffer, | |||
| if (adapter->fCaptureRingBuffer[i]->WriteResample(buffer, framesPerBuffer) < framesPerBuffer) | |||
| failure = true; | |||
| } | |||
| paBuffer = (float**)outputBuffer; | |||
| for (int i = 0; i < adapter->fPlaybackChannels; i++) { | |||
| buffer = (float*)paBuffer[i]; | |||
| @@ -53,9 +53,9 @@ int JackPortAudioAdapter::Render(const void* inputBuffer, void* outputBuffer, | |||
| if (adapter->fPlaybackRingBuffer[i]->ReadResample(buffer, framesPerBuffer) < framesPerBuffer) | |||
| failure = true; | |||
| } | |||
| #ifdef DEBUG | |||
| adapter->fTable.Write(time1, time2, double(time1) / double(time2), double(time2) / double(time1), | |||
| #ifdef DEBUG | |||
| adapter->fTable.Write(time1, time2, double(time1) / double(time2), double(time2) / double(time1), | |||
| adapter->fCaptureRingBuffer[0]->ReadSpace(), adapter->fPlaybackRingBuffer[0]->WriteSpace()); | |||
| #endif | |||
| @@ -70,93 +70,111 @@ int JackPortAudioAdapter::Render(const void* inputBuffer, void* outputBuffer, | |||
| JackPortAudioAdapter::JackPortAudioAdapter(jack_nframes_t buffer_size, jack_nframes_t sample_rate, const JSList* params) | |||
| :JackAudioAdapterInterface(buffer_size, sample_rate) | |||
| { | |||
| jack_log ( "JackPortAudioAdapter::JackPortAudioAdapter buffer_size = %d, sample_rate = %d", buffer_size, sample_rate ); | |||
| const JSList* node; | |||
| const jack_driver_param_t* param; | |||
| fCaptureChannels = 2; | |||
| fPlaybackChannels = 2; | |||
| int in_max = 0; | |||
| int out_max = 0; | |||
| fCaptureChannels = 0; | |||
| fPlaybackChannels = 0; | |||
| fInputDevice = Pa_GetDefaultInputDevice(); | |||
| fOutputDevice = Pa_GetDefaultOutputDevice(); | |||
| for (node = params; node; node = jack_slist_next(node)) { | |||
| param = (const jack_driver_param_t*) node->data; | |||
| switch (param->character) { | |||
| case 'c' : | |||
| break; | |||
| case 'i': | |||
| fCaptureChannels = param->value.ui; | |||
| break; | |||
| case 'o': | |||
| fPlaybackChannels = param->value.ui; | |||
| break; | |||
| case 'C': | |||
| if ( fPaDevices.GetInputDeviceFromName(param->value.str, fInputDevice, in_max) < 0 ) { | |||
| jack_error ( "Can't use %s, taking default input device", param->value.str ); | |||
| fInputDevice = Pa_GetDefaultInputDevice(); | |||
| } | |||
| break; | |||
| case 'P': | |||
| if ( fPaDevices.GetOutputDeviceFromName(param->value.str, fOutputDevice, out_max) < 0 ) { | |||
| jack_error ( "Can't use %s, taking default output device", param->value.str ); | |||
| fOutputDevice = Pa_GetDefaultOutputDevice(); | |||
| } | |||
| break; | |||
| case 'D': | |||
| break; | |||
| case 'r': | |||
| SetSampleRate(param->value.ui); | |||
| break; | |||
| case 'd': | |||
| if ( fPaDevices.GetInputDeviceFromName(param->value.str, fInputDevice, in_max) < 0 ) { | |||
| jack_error ( "Can't use %s, taking default input device", param->value.str ); | |||
| } | |||
| if ( fPaDevices.GetOutputDeviceFromName(param->value.str, fOutputDevice, out_max) < 0 ) { | |||
| jack_error ( "Can't use %s, taking default output device", param->value.str ); | |||
| } | |||
| break; | |||
| case 'l': | |||
| fPaDevices.DisplayDevicesNames(); | |||
| break; | |||
| } | |||
| } | |||
| //max channels | |||
| if ( in_max == 0 ) | |||
| in_max = fPaDevices.GetDeviceInfo(fInputDevice)->maxInputChannels; | |||
| if ( out_max == 0 ) | |||
| out_max = fPaDevices.GetDeviceInfo(fOutputDevice)->maxOutputChannels; | |||
| //effective channels | |||
| if ( ( fCaptureChannels == 0 ) || ( fCaptureChannels > in_max ) ) | |||
| fCaptureChannels = in_max; | |||
| if ( ( fPlaybackChannels == 0 ) || ( fPlaybackChannels > out_max ) ) | |||
| fPlaybackChannels = out_max; | |||
| } | |||
| int JackPortAudioAdapter::Open() | |||
| { | |||
| PaError err; | |||
| PaStreamParameters inputParameters; | |||
| PaStreamParameters outputParameters; | |||
| PaDeviceIndex inputDevice; | |||
| PaDeviceIndex outputDevice; | |||
| if (JackAudioAdapterInterface::Open() < 0) | |||
| return -1; | |||
| err = Pa_Initialize(); | |||
| if (err != paNoError) { | |||
| jack_error("JackPortAudioAdapter::Pa_Initialize error = %s\n", Pa_GetErrorText(err)); | |||
| goto error; | |||
| } | |||
| jack_log("JackPortAudioAdapter::Pa_GetDefaultInputDevice %ld", Pa_GetDefaultInputDevice()); | |||
| jack_log("JackPortAudioAdapter::Pa_GetDefaultOutputDevice %ld", Pa_GetDefaultOutputDevice()); | |||
| jack_log("JackPortAudioAdapter::Open fBufferSize = %ld fSampleRate %f", fBufferSize, fSampleRate); | |||
| inputDevice = Pa_GetDefaultInputDevice(); | |||
| outputDevice = Pa_GetDefaultOutputDevice(); | |||
| inputParameters.device = inputDevice; | |||
| jack_log("JackPortAudioAdapter::Open fInputDevice = %d DeviceName %s", fInputDevice, fPaDevices.GetFullName(fInputDevice).c_str()); | |||
| jack_log("JackPortAudioAdapter::Open fOutputDevice = %d DeviceName %s", fOutputDevice, fPaDevices.GetFullName(fOutputDevice).c_str()); | |||
| jack_log("JackPortAudioAdapter::Open fBufferSize = %u fSampleRate %u", fBufferSize, fSampleRate); | |||
| inputParameters.device = fInputDevice; | |||
| inputParameters.channelCount = fCaptureChannels; | |||
| inputParameters.sampleFormat = paFloat32 | paNonInterleaved; // 32 bit floating point output | |||
| inputParameters.suggestedLatency = (inputDevice != paNoDevice) // TODO: check how to setup this on ASIO | |||
| ? Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency | |||
| inputParameters.suggestedLatency = (fInputDevice != paNoDevice) // TODO: check how to setup this on ASIO | |||
| ? fPaDevices.GetDeviceInfo(fInputDevice)->defaultLowInputLatency | |||
| : 0; | |||
| inputParameters.hostApiSpecificStreamInfo = NULL; | |||
| outputParameters.device = outputDevice; | |||
| outputParameters.device = fOutputDevice; | |||
| outputParameters.channelCount = fPlaybackChannels; | |||
| outputParameters.sampleFormat = paFloat32 | paNonInterleaved; // 32 bit floating point output | |||
| outputParameters.suggestedLatency = (outputDevice != paNoDevice) // TODO: check how to setup this on ASIO | |||
| ? Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency | |||
| outputParameters.suggestedLatency = (fOutputDevice != paNoDevice) // TODO: check how to setup this on ASIO | |||
| ? fPaDevices.GetDeviceInfo(fOutputDevice)->defaultLowOutputLatency | |||
| : 0; | |||
| outputParameters.hostApiSpecificStreamInfo = NULL; | |||
| err = Pa_OpenStream(&fStream, | |||
| (inputDevice == paNoDevice) ? 0 : &inputParameters, | |||
| (outputDevice == paNoDevice) ? 0 : &outputParameters, | |||
| (fInputDevice == paNoDevice) ? 0 : &inputParameters, | |||
| (fOutputDevice == paNoDevice) ? 0 : &outputParameters, | |||
| fSampleRate, | |||
| fBufferSize, | |||
| paNoFlag, // Clipping is on... | |||
| @@ -164,20 +182,17 @@ int JackPortAudioAdapter::Open() | |||
| this); | |||
| if (err != paNoError) { | |||
| jack_error("Pa_OpenStream error = %s", Pa_GetErrorText(err)); | |||
| goto error; | |||
| return -1; | |||
| } | |||
| err = Pa_StartStream(fStream); | |||
| if (err != paNoError) { | |||
| jack_error("Pa_StartStream error = %s", Pa_GetErrorText(err)); | |||
| goto error; | |||
| return -1; | |||
| } | |||
| jack_log("JackPortAudioAdapter::Open OK"); | |||
| return 0; | |||
| error: | |||
| Pa_Terminate(); | |||
| return -1; | |||
| } | |||
| int JackPortAudioAdapter::Close() | |||
| @@ -190,8 +205,6 @@ int JackPortAudioAdapter::Close() | |||
| jack_log("JackPortAudioAdapter:: Pa_StopStream"); | |||
| Pa_CloseStream(fStream); | |||
| jack_log("JackPortAudioAdapter:: Pa_CloseStream"); | |||
| Pa_Terminate(); | |||
| jack_log("JackPortAudioAdapter:: Pa_Terminate"); | |||
| return JackAudioAdapterInterface::Close(); | |||
| } | |||
| @@ -216,18 +229,10 @@ extern "C" | |||
| desc = (jack_driver_desc_t*)calloc(1, sizeof(jack_driver_desc_t)); | |||
| strcpy(desc->name, "portaudio-adapter"); | |||
| desc->nparams = 9; | |||
| desc->nparams = 7; | |||
| desc->params = (jack_driver_param_desc_t*)calloc(desc->nparams, sizeof(jack_driver_param_desc_t)); | |||
| i = 0; | |||
| strcpy(desc->params[i].name, "channels"); | |||
| desc->params[i].character = 'c'; | |||
| desc->params[i].type = JackDriverParamInt; | |||
| desc->params[i].value.ui = 0; | |||
| strcpy(desc->params[i].short_desc, "Maximum number of channels"); | |||
| strcpy(desc->params[i].long_desc, desc->params[i].short_desc); | |||
| i++; | |||
| strcpy(desc->params[i].name, "inchannels"); | |||
| desc->params[i].character = 'i'; | |||
| desc->params[i].type = JackDriverParamInt; | |||
| @@ -247,7 +252,7 @@ extern "C" | |||
| strcpy(desc->params[i].name, "capture"); | |||
| desc->params[i].character = 'C'; | |||
| desc->params[i].type = JackDriverParamString; | |||
| strcpy(desc->params[i].value.str, "will take default PortAudio input device"); | |||
| strcpy(desc->params[i].value.str, "default input device"); | |||
| strcpy(desc->params[i].short_desc, "Provide capture ports. Optionally set PortAudio device name"); | |||
| strcpy(desc->params[i].long_desc, desc->params[i].short_desc); | |||
| @@ -255,18 +260,10 @@ extern "C" | |||
| strcpy(desc->params[i].name, "playback"); | |||
| desc->params[i].character = 'P'; | |||
| desc->params[i].type = JackDriverParamString; | |||
| strcpy(desc->params[i].value.str, "will take default PortAudio output device"); | |||
| strcpy(desc->params[i].value.str, "default output device"); | |||
| strcpy(desc->params[i].short_desc, "Provide playback ports. Optionally set PortAudio device name"); | |||
| strcpy(desc->params[i].long_desc, desc->params[i].short_desc); | |||
| i++; | |||
| strcpy(desc->params[i].name, "duplex"); | |||
| desc->params[i].character = 'D'; | |||
| desc->params[i].type = JackDriverParamBool; | |||
| desc->params[i].value.i = TRUE; | |||
| strcpy(desc->params[i].short_desc, "Provide both capture and playback ports"); | |||
| strcpy(desc->params[i].long_desc, desc->params[i].short_desc); | |||
| i++; | |||
| strcpy(desc->params[i].name, "rate"); | |||
| desc->params[i].character = 'r'; | |||
| @@ -274,13 +271,13 @@ extern "C" | |||
| desc->params[i].value.ui = 44100U; | |||
| strcpy(desc->params[i].short_desc, "Sample rate"); | |||
| strcpy(desc->params[i].long_desc, desc->params[i].short_desc); | |||
| i++; | |||
| strcpy(desc->params[i].name, "device"); | |||
| desc->params[i].character = 'd'; | |||
| desc->params[i].type = JackDriverParamString; | |||
| desc->params[i].value.ui = 128U; | |||
| strcpy(desc->params[i].value.str, "will take default PortAudio device name"); | |||
| strcpy(desc->params[i].value.str, "default device"); | |||
| strcpy(desc->params[i].short_desc, "PortAudio device name"); | |||
| strcpy(desc->params[i].long_desc, desc->params[i].short_desc); | |||
| @@ -294,7 +291,7 @@ extern "C" | |||
| return desc; | |||
| } | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| @@ -21,7 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| #define __JackPortAudioAdapter__ | |||
| #include "JackAudioAdapter.h" | |||
| #include "portaudio.h" | |||
| #include "JackPortAudioDevices.h" | |||
| #include "jslist.h" | |||
| namespace Jack | |||
| @@ -29,30 +29,31 @@ namespace Jack | |||
| class JackPortAudioAdapter : public JackAudioAdapterInterface | |||
| { | |||
| private: | |||
| PortAudioDevices fPaDevices; | |||
| PaStream* fStream; | |||
| PaDeviceIndex fInputDevice; | |||
| PaDeviceIndex fOutputDevice; | |||
| static int Render(const void* inputBuffer, void* outputBuffer, | |||
| unsigned long framesPerBuffer, | |||
| const PaStreamCallbackTimeInfo* timeInfo, | |||
| PaStreamCallbackFlags statusFlags, | |||
| void* userData); | |||
| public: | |||
| JackPortAudioAdapter(jack_nframes_t buffer_size, jack_nframes_t sample_rate, const JSList* params); | |||
| ~JackPortAudioAdapter() | |||
| {} | |||
| int Open(); | |||
| int Close(); | |||
| int SetBufferSize(jack_nframes_t buffer_size); | |||
| }; | |||
| } | |||
| @@ -25,7 +25,8 @@ using namespace std; | |||
| PortAudioDevices::PortAudioDevices() | |||
| { | |||
| PaError err; | |||
| PaDeviceIndex id; | |||
| PaDeviceIndex id; | |||
| printf("Initializing PortAudio...\n"); | |||
| if ( ( err = Pa_Initialize() ) == paNoError ) | |||
| { | |||
| fNumHostApi = Pa_GetHostApiCount(); | |||
| @@ -200,11 +201,12 @@ int PortAudioDevices::GetOutputDeviceFromName(const char* devicename, PaDeviceIn | |||
| void PortAudioDevices::DisplayDevicesNames() | |||
| { | |||
| int def_display; | |||
| int def_display; | |||
| PaDeviceIndex id; | |||
| PaStreamParameters inputParameters, outputParameters; | |||
| printf ( "********************** Devices list, %d detected **********************\n", fNumDevice ); | |||
| for ( PaDeviceIndex id = 0; id < fNumDevice; id++ ) | |||
| for ( id = 0; id < fNumDevice; id++ ) | |||
| { | |||
| printf ( "-------- device #%d ------------------------------------------------\n", id ); | |||
| @@ -20,11 +20,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
| #ifndef __PortAudioDevices__ | |||
| #define __PortAudioDevices__ | |||
| #include <iostream> | |||
| #include <cstring> | |||
| #include <cstdio> | |||
| #include <string> | |||
| #include <cstdlib> | |||
| #include "portaudio.h" | |||
| #include "pa_asio.h" | |||
| @@ -57,18 +57,14 @@ namespace Jack | |||
| int JackPortAudioDriver::Read() | |||
| { | |||
| for (int i = 0; i < fCaptureChannels; i++) | |||
| { | |||
| memcpy(GetInputBuffer(i), fInputBuffer[i], sizeof(float) * fEngineControl->fBufferSize); | |||
| } | |||
| return 0; | |||
| } | |||
| int JackPortAudioDriver::Write() | |||
| { | |||
| for (int i = 0; i < fPlaybackChannels; i++) | |||
| { | |||
| memcpy(fOutputBuffer[i], GetOutputBuffer(i), sizeof(float) * fEngineControl->fBufferSize); | |||
| } | |||
| return 0; | |||
| } | |||
| @@ -95,9 +91,7 @@ namespace Jack | |||
| // Generic JackAudioDriver Open | |||
| if (JackAudioDriver::Open(buffer_size, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_uid, playback_driver_uid, capture_latency, playback_latency) != 0) | |||
| { | |||
| return -1; | |||
| } | |||
| //get devices | |||
| if (capturing) | |||
| @@ -123,24 +117,24 @@ namespace Jack | |||
| outchannels = out_max; | |||
| } | |||
| //doesn't have enough in/out channels...exit | |||
| //too many channels required, take max available | |||
| if (inchannels > in_max) | |||
| { | |||
| jack_error("This device hasn't required input channels inchannels = %ld in_max = %ld", inchannels, in_max); | |||
| goto error; | |||
| jack_error("This device has only %d available input channels.", in_max); | |||
| inchannels = in_max; | |||
| } | |||
| if (outchannels > out_max) | |||
| { | |||
| jack_error("This device hasn't required output channels outchannels = %ld out_max = %ld", outchannels, out_max); | |||
| goto error; | |||
| jack_error("This device has only %d available output channels.", out_max); | |||
| outchannels = out_max; | |||
| } | |||
| //in/output streams parametering | |||
| //in/out streams parametering | |||
| inputParameters.device = fInputDevice; | |||
| inputParameters.channelCount = inchannels; | |||
| inputParameters.sampleFormat = paFloat32 | paNonInterleaved; // 32 bit floating point output | |||
| inputParameters.suggestedLatency = (fInputDevice != paNoDevice) // TODO: check how to setup this on ASIO | |||
| ? Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency | |||
| ? fPaDevices->GetDeviceInfo(fInputDevice)->defaultLowInputLatency | |||
| : 0; | |||
| inputParameters.hostApiSpecificStreamInfo = NULL; | |||
| @@ -148,7 +142,7 @@ namespace Jack | |||
| outputParameters.channelCount = outchannels; | |||
| outputParameters.sampleFormat = paFloat32 | paNonInterleaved; // 32 bit floating point output | |||
| outputParameters.suggestedLatency = (fOutputDevice != paNoDevice) // TODO: check how to setup this on ASIO | |||
| ? Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency | |||
| ? fPaDevices->GetDeviceInfo(fOutputDevice)->defaultLowOutputLatency | |||
| : 0; | |||
| outputParameters.hostApiSpecificStreamInfo = NULL; | |||
| @@ -156,7 +150,7 @@ namespace Jack | |||
| (fInputDevice == paNoDevice) ? 0 : &inputParameters, | |||
| (fOutputDevice == paNoDevice) ? 0 : &outputParameters, | |||
| samplerate, | |||
| nframes, | |||
| buffer_size, | |||
| paNoFlag, // Clipping is on... | |||
| Render, | |||
| this); | |||
| @@ -69,6 +69,7 @@ | |||
| <_><src>..\Release\bin\libsamplerate-0.dll</><dest>inst</><custom></><ifexist>overnewer</><recurs>0</></> | |||
| <_><src>..\Release\bin\portaudio_x86.dll</><dest>inst</><custom></><ifexist>overnewer</><recurs>0</></> | |||
| <_><src>..\Release\bin\jackmp\jack_net.dll</><dest>inst</><custom>jackmp</><ifexist>overnewer</><recurs>0</></> | |||
| <_><src>..\Release\bin\jackmp\jack_dummy.dll</><dest>inst</><custom>jackmp</><ifexist>overnewer</><recurs>0</></> | |||
| <_><src>..\Release\bin\jackmp\jack_portaudio.dll</><dest>inst</><custom>jackmp</><ifexist>overnewer</><recurs>0</></> | |||
| <_><src>..\Release\bin\jackmp\netmanager.dll</><dest>inst</><custom>jackmp</><ifexist>overnewer</><recurs>0</></> | |||
| <_><src>..\Release\bin\jackmp\audioadapter.dll</><dest>inst</><custom>jackmp</><ifexist>overnewer</><recurs>0</></> | |||
| @@ -40,23 +40,22 @@ | |||
| </Linker> | |||
| </Target> | |||
| <Target title="Win32 Debug"> | |||
| <Option output="Debug\bin\jackmp\netioadapter" prefix_auto="1" extension_auto="1" /> | |||
| <Option output="Debug\bin\jackmp\audioadapter" prefix_auto="1" extension_auto="1" /> | |||
| <Option object_output="Debug\" /> | |||
| <Option type="3" /> | |||
| <Option compiler="gcc" /> | |||
| <Option createDefFile="1" /> | |||
| <Option createStaticLib="1" /> | |||
| <Compiler> | |||
| <Add option="-Wall" /> | |||
| <Add option="-g" /> | |||
| <Add option="-DBUILD_DLL" /> | |||
| <Add option="-D__SMP__" /> | |||
| <Add directory="..\common" /> | |||
| <Add directory="..\common\jack" /> | |||
| <Add directory="..\windows" /> | |||
| </Compiler> | |||
| <Linker> | |||
| <Add library="user32" /> | |||
| <Add library="kernel32" /> | |||
| <Add library="user32" /> | |||
| <Add library="gdi32" /> | |||
| <Add library="winspool" /> | |||
| <Add library="comdlg32" /> | |||
| @@ -68,19 +67,21 @@ | |||
| <Add library="odbc32" /> | |||
| <Add library="odbccp32" /> | |||
| <Add library="portaudio_x86" /> | |||
| <Add library="libsamplerate" /> | |||
| <Add library="libjackservermp" /> | |||
| <Add library="libsamplerate-0" /> | |||
| <Add directory="Release\bin" /> | |||
| <Add library="libjackservermp" /> | |||
| <Add directory="Debug\bin" /> | |||
| </Linker> | |||
| </Target> | |||
| </Build> | |||
| <Compiler> | |||
| <Add option="-Wall" /> | |||
| </Compiler> | |||
| <Unit filename="..\common\JackAudioAdapter.cpp" /> | |||
| <Unit filename="..\common\JackAudioAdapterInterface.cpp" /> | |||
| <Unit filename="..\common\JackCallbackAudioAdapter.cpp" /> | |||
| <Unit filename="..\common\JackLibSampleRateResampler.cpp" /> | |||
| <Unit filename="..\common\JackResampler.cpp" /> | |||
| <Unit filename="JackPortAudioAdapter.cpp" /> | |||
| <Unit filename="JackPortAudioDevices.cpp" /> | |||
| <Unit filename="jackaudioadapter.rc"> | |||
| <Option compilerVar="WINDRES" /> | |||
| </Unit> | |||
| @@ -32,7 +32,7 @@ | |||
| <Add library="odbc32" /> | |||
| <Add library="odbccp32" /> | |||
| <Add library="libjackmp" /> | |||
| <Add directory="Release\bin" /> | |||
| <Add directory="Debug\bin" /> | |||
| </Linker> | |||
| </Target> | |||
| <Target title="Win32 Debug"> | |||
| @@ -43,7 +43,8 @@ | |||
| <Compiler> | |||
| <Add option="-Wall" /> | |||
| <Add option="-g" /> | |||
| <Add directory="..\windows" /> | |||
| <Add directory="..\common" /> | |||
| <Add directory="..\common\jack" /> | |||
| <Add directory="..\example-clients" /> | |||
| </Compiler> | |||
| <Linker> | |||
| @@ -0,0 +1,85 @@ | |||
| <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | |||
| <CodeBlocks_project_file> | |||
| <FileVersion major="1" minor="6" /> | |||
| <Project> | |||
| <Option title="jack_dummy" /> | |||
| <Option pch_mode="2" /> | |||
| <Option compiler="gcc" /> | |||
| <Build> | |||
| <Target title="Win32 Release"> | |||
| <Option output="Release\bin\jackmp\jack_dummy" prefix_auto="1" extension_auto="1" /> | |||
| <Option object_output="Release\" /> | |||
| <Option type="3" /> | |||
| <Option compiler="gcc" /> | |||
| <Compiler> | |||
| <Add option="-O2" /> | |||
| <Add option="-Wall" /> | |||
| <Add option="-DBUILD_DLL" /> | |||
| <Add directory="..\common" /> | |||
| <Add directory="..\common\jack" /> | |||
| <Add directory="..\windows" /> | |||
| </Compiler> | |||
| <Linker> | |||
| <Add library="kernel32" /> | |||
| <Add library="user32" /> | |||
| <Add library="gdi32" /> | |||
| <Add library="winspool" /> | |||
| <Add library="comdlg32" /> | |||
| <Add library="advapi32" /> | |||
| <Add library="shell32" /> | |||
| <Add library="ole32" /> | |||
| <Add library="oleaut32" /> | |||
| <Add library="uuid" /> | |||
| <Add library="odbc32" /> | |||
| <Add library="odbccp32" /> | |||
| <Add library="libjackservermp" /> | |||
| <Add directory="Release\bin" /> | |||
| </Linker> | |||
| </Target> | |||
| <Target title="Win32 Debug"> | |||
| <Option output="Debug\bin\jackmp\jack_dummy" prefix_auto="1" extension_auto="1" /> | |||
| <Option object_output="Debug\" /> | |||
| <Option type="3" /> | |||
| <Option compiler="gcc" /> | |||
| <Compiler> | |||
| <Add option="-Wall" /> | |||
| <Add option="-g" /> | |||
| <Add option="-DBUILD_DLL" /> | |||
| <Add directory="..\common" /> | |||
| <Add directory="..\common\jack" /> | |||
| <Add directory="..\windows" /> | |||
| </Compiler> | |||
| <Linker> | |||
| <Add library="kernel32" /> | |||
| <Add library="user32" /> | |||
| <Add library="gdi32" /> | |||
| <Add library="winspool" /> | |||
| <Add library="comdlg32" /> | |||
| <Add library="advapi32" /> | |||
| <Add library="shell32" /> | |||
| <Add library="ole32" /> | |||
| <Add library="oleaut32" /> | |||
| <Add library="uuid" /> | |||
| <Add library="odbc32" /> | |||
| <Add library="odbccp32" /> | |||
| <Add library="libjackservermp" /> | |||
| <Add directory="Debug\bin" /> | |||
| </Linker> | |||
| </Target> | |||
| </Build> | |||
| <Compiler> | |||
| <Add option="-Wall" /> | |||
| </Compiler> | |||
| <Unit filename="..\common\JackDummyDriver.cpp" /> | |||
| <Extensions> | |||
| <AutoVersioning> | |||
| <Scheme minor_max="10" build_max="0" rev_max="0" rev_rand_max="10" build_times_to_increment_minor="100" /> | |||
| <Settings autoincrement="1" date_declarations="1" do_auto_increment="0" ask_to_increment="0" language="C++" svn="0" svn_directory="" header_path="version.h" /> | |||
| <Changes_Log show_changes_editor="0" app_title="released version %M.%m.%b of %p" changeslog_path="ChangesLog.txt" /> | |||
| </AutoVersioning> | |||
| <code_completion /> | |||
| <envvars /> | |||
| <debugger /> | |||
| </Extensions> | |||
| </Project> | |||
| </CodeBlocks_project_file> | |||
| @@ -72,6 +72,11 @@ | |||
| <code_completion /> | |||
| <envvars /> | |||
| <debugger /> | |||
| <AutoVersioning> | |||
| <Scheme minor_max="10" build_max="0" rev_max="0" rev_rand_max="10" build_times_to_increment_minor="100" /> | |||
| <Settings autoincrement="1" date_declarations="1" do_auto_increment="0" ask_to_increment="0" language="C++" svn="0" svn_directory="" header_path="version.h" /> | |||
| <Changes_Log show_changes_editor="0" app_title="released version %M.%m.%b of %p" changeslog_path="ChangesLog.txt" /> | |||
| </AutoVersioning> | |||
| </Extensions> | |||
| </Project> | |||
| </CodeBlocks_project_file> | |||
| @@ -38,12 +38,10 @@ | |||
| </Linker> | |||
| </Target> | |||
| <Target title="Win32 Debug"> | |||
| <Option output="Debug\bin\jackmp\jack_netdriver" prefix_auto="1" extension_auto="1" /> | |||
| <Option output="Debug\bin\jackmp\jack_net" prefix_auto="1" extension_auto="1" /> | |||
| <Option object_output="Debug\" /> | |||
| <Option type="3" /> | |||
| <Option compiler="gcc" /> | |||
| <Option createDefFile="1" /> | |||
| <Option createStaticLib="1" /> | |||
| <Compiler> | |||
| <Add option="-Wall" /> | |||
| <Add option="-g" /> | |||
| @@ -41,8 +41,6 @@ | |||
| <Option object_output="Debug\" /> | |||
| <Option type="3" /> | |||
| <Option compiler="gcc" /> | |||
| <Option createDefFile="1" /> | |||
| <Option createStaticLib="1" /> | |||
| <Compiler> | |||
| <Add option="-Wall" /> | |||
| <Add option="-g" /> | |||
| @@ -44,7 +44,7 @@ | |||
| </Linker> | |||
| </Target> | |||
| <Target title="Win32 Debug"> | |||
| <Option output="Debug\bin\jackmp\jack_portaudio_debug" prefix_auto="1" extension_auto="1" /> | |||
| <Option output="Debug\bin\jackmp\jack_portaudio" prefix_auto="1" extension_auto="1" /> | |||
| <Option object_output="Debug" /> | |||
| <Option type="3" /> | |||
| <Option compiler="gcc" /> | |||
| @@ -4,7 +4,6 @@ | |||
| <Project> | |||
| <Option title="jackdmp" /> | |||
| <Option pch_mode="2" /> | |||
| <Option default_target="Win32 Debug" /> | |||
| <Option compiler="gcc" /> | |||
| <Build> | |||
| <Target title="Win32 Release"> | |||
| @@ -6,6 +6,7 @@ | |||
| <Project filename="jackdmp.cbp"> | |||
| <Depends filename="libjackservermp.cbp" /> | |||
| </Project> | |||
| <Project filename="jack_dummy.cbp" active="1" /> | |||
| <Project filename="jack_audioadapter.cbp"> | |||
| <Depends filename="libjackservermp.cbp" /> | |||
| </Project> | |||
| @@ -15,7 +16,7 @@ | |||
| <Project filename="jack_netdriver.cbp"> | |||
| <Depends filename="libjackservermp.cbp" /> | |||
| </Project> | |||
| <Project filename="jack_netmanager.cbp" active="1"> | |||
| <Project filename="jack_netmanager.cbp"> | |||
| <Depends filename="libjackservermp.cbp" /> | |||
| </Project> | |||
| <Project filename="jack_load.cbp"> | |||
| @@ -48,7 +48,6 @@ | |||
| <Option object_output="Debug" /> | |||
| <Option type="3" /> | |||
| <Option compiler="gcc" /> | |||
| <Option createDefFile="1" /> | |||
| <Option createStaticLib="1" /> | |||
| <Compiler> | |||
| <Add option="-Wall" /> | |||
| @@ -49,7 +49,6 @@ | |||
| <Option object_output="Debug" /> | |||
| <Option type="3" /> | |||
| <Option compiler="gcc" /> | |||
| <Option createDefFile="1" /> | |||
| <Option createStaticLib="1" /> | |||
| <Compiler> | |||
| <Add option="-Wall" /> | |||