diff --git a/src/vstmain.cpp b/src/vstmain.cpp index ffcc9859..b4b476dd 100755 --- a/src/vstmain.cpp +++ b/src/vstmain.cpp @@ -51,7 +51,7 @@ CLlconVST::CLlconVST ( audioMasterCallback AudioMaster ) : // we want a single shot timer to shut down the connection if no // processing is done anymore (VST host has stopped the stream) TimerOnOff.setSingleShot ( true ); - TimerOnOff.setInterval ( VST_STOP_TIMER_INTERVAL ); + TimerOnOff.setInterval ( VST_STOP_TIMER_INTERVAL ); // connect timer event connect ( &TimerOnOff, SIGNAL ( timeout() ), @@ -76,21 +76,46 @@ void CLlconVST::processReplacing ( float** pvIn, float** pvOut, VstInt32 iNumSamples ) { + int i, j; + // reset stop timer TimerOnOff.start(); + // check if client is running, if not, start it + if ( !Client.IsRunning() ) + { + +// TODO set iNumSamples in Sound class somehow + + Client.Start(); + } + // get pointers to actual buffers float* pfIn0 = pvIn[0]; float* pfIn1 = pvIn[1]; float* pfOut0 = pvOut[0]; float* pfOut1 = pvOut[1]; - -// TODO here we just copy the data -> add llcon processing here! - - for ( int i = 0; i < iNumSamples; i++ ) + // copy input data + for ( i = 0, j = 0; i < iNumSamples; i++, j += 2 ) { - pfOut0[i] = pfIn0[i]; - pfOut1[i] = pfIn1[i]; +/* + pSound->vecsTmpAudioSndCrdStereo[j] = pfIn0[i]; + pSound->vecsTmpAudioSndCrdStereo[j + 1] = pfIn1[i]; +*/ + } + +/* + // call processing callback function + pSound->ProcessCallback ( pSound->vecsTmpAudioSndCrdStereo ); +*/ + + // copy output data + for ( i = 0, j = 0; i < iNumSamples; i++, j += 2 ) + { +/* + pfOut0[i] = pSound->vecsTmpAudioSndCrdStereo[j]; + pfOut1[i] = pSound->vecsTmpAudioSndCrdStereo[j + 1]; +*/ } } diff --git a/src/vstsound.h b/src/vstsound.h index 25995c6c..b018c9ae 100755 --- a/src/vstsound.h +++ b/src/vstsound.h @@ -40,6 +40,18 @@ public: // TODO } virtual ~CSound() {} + + virtual int Init ( const int iNewPrefMonoBufferSize ) + { + // TODO we have to query the current VST frame size somehow + +const int iVSTMonoBufferSize = iNewPrefMonoBufferSize; + + // init base class + CSoundBase::Init ( iVSTMonoBufferSize ); + + return iVSTMonoBufferSize; + } }; #endif // !defined ( _VSTSOUND_H__9518A346345768_11D3_8C0D_EEBF182CF549__INCLUDED_ ) diff --git a/windows/sound.cpp b/windows/sound.cpp index 5fe3f145..3c6cb17c 100755 --- a/windows/sound.cpp +++ b/windows/sound.cpp @@ -460,7 +460,7 @@ int CSound::Init ( const int iNewPrefMonoBufferSize ) iASIOBufferSizeMono = GetActualBufferSize ( iNewPrefMonoBufferSize ); - // init base clasee + // init base class CSoundBase::Init ( iASIOBufferSizeMono ); // set internal buffer size value and calculate stereo buffer size