added some VST preparations

This commit is contained in:
Volker Fischer 2010-03-31 20:11:01 +00:00
parent f39834457c
commit 7540ca9d63
3 changed files with 45 additions and 8 deletions

View File

@ -51,7 +51,7 @@ CLlconVST::CLlconVST ( audioMasterCallback AudioMaster ) :
// we want a single shot timer to shut down the connection if no // we want a single shot timer to shut down the connection if no
// processing is done anymore (VST host has stopped the stream) // processing is done anymore (VST host has stopped the stream)
TimerOnOff.setSingleShot ( true ); TimerOnOff.setSingleShot ( true );
TimerOnOff.setInterval ( VST_STOP_TIMER_INTERVAL ); TimerOnOff.setInterval ( VST_STOP_TIMER_INTERVAL );
// connect timer event // connect timer event
connect ( &TimerOnOff, SIGNAL ( timeout() ), connect ( &TimerOnOff, SIGNAL ( timeout() ),
@ -76,21 +76,46 @@ void CLlconVST::processReplacing ( float** pvIn,
float** pvOut, float** pvOut,
VstInt32 iNumSamples ) VstInt32 iNumSamples )
{ {
int i, j;
// reset stop timer // reset stop timer
TimerOnOff.start(); 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 // get pointers to actual buffers
float* pfIn0 = pvIn[0]; float* pfIn0 = pvIn[0];
float* pfIn1 = pvIn[1]; float* pfIn1 = pvIn[1];
float* pfOut0 = pvOut[0]; float* pfOut0 = pvOut[0];
float* pfOut1 = pvOut[1]; float* pfOut1 = pvOut[1];
// copy input data
// TODO here we just copy the data -> add llcon processing here! for ( i = 0, j = 0; i < iNumSamples; i++, j += 2 )
for ( int i = 0; i < iNumSamples; i++ )
{ {
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];
*/
} }
} }

View File

@ -40,6 +40,18 @@ public:
// TODO // TODO
} }
virtual ~CSound() {} 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_ ) #endif // !defined ( _VSTSOUND_H__9518A346345768_11D3_8C0D_EEBF182CF549__INCLUDED_ )

View File

@ -460,7 +460,7 @@ int CSound::Init ( const int iNewPrefMonoBufferSize )
iASIOBufferSizeMono = iASIOBufferSizeMono =
GetActualBufferSize ( iNewPrefMonoBufferSize ); GetActualBufferSize ( iNewPrefMonoBufferSize );
// init base clasee // init base class
CSoundBase::Init ( iASIOBufferSizeMono ); CSoundBase::Init ( iASIOBufferSizeMono );
// set internal buffer size value and calculate stereo buffer size // set internal buffer size value and calculate stereo buffer size