Commit 52417e69 authored by sletz's avatar sletz
Browse files

Cleanup JackAudioAdapterInterface class.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3446 0c269be4-1314-0410-8aa9-9f06e86f4224
parent e38e78f0
......@@ -45,14 +45,12 @@ namespace Jack
memset(inputBuffer[i], 0, frames * sizeof(float));
}
if (adapter->fAudioAdapter->IsRunning()) {
for (int i = 0; i < adapter->fAudioAdapter->GetOutputs(); i++) {
outputBuffer[i] = (float*)jack_port_get_buffer(adapter->fPlaybackPortList[i], frames);
}
adapter->fAudioAdapter->PullAndPush(inputBuffer, outputBuffer, frames);
for (int i = 0; i < adapter->fAudioAdapter->GetOutputs(); i++) {
outputBuffer[i] = (float*)jack_port_get_buffer(adapter->fPlaybackPortList[i], frames);
}
return 0;
adapter->fAudioAdapter->PullAndPush(inputBuffer, outputBuffer, frames);
return 0;
}
int JackAudioAdapter::BufferSize ( jack_nframes_t buffer_size, void* arg )
......
......@@ -261,9 +261,12 @@ namespace Jack
int JackAudioAdapterInterface::PullAndPush(float** inputBuffer, float** outputBuffer, unsigned int frames)
{
int res = 0;
fPullAndPushTime = GetMicroSeconds();
if (!fRunning)
return 0;
int res = 0;
// Push/pull from ringbuffer
for (int i = 0; i < fCaptureChannels; i++) {
if (fCaptureRingBuffer[i]->Read(inputBuffer[i], frames) < frames)
......
......@@ -92,7 +92,7 @@ namespace Jack
unsigned int fQuality;
unsigned int fRingbufferCurSize;
jack_time_t fPullAndPushTime;
bool fRunning;
bool fAdaptative;
......@@ -121,11 +121,6 @@ namespace Jack
virtual ~JackAudioAdapterInterface()
{}
bool IsRunning()
{
return fRunning;
}
virtual void Reset();
void Create();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment