"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/vst_base/RemoteVstPlugin.cpp" between
lmms-1.2.0-rc7.tar.gz and lmms-1.2.0-rc8.tar.gz

About: LMMS (Linux MultiMedia Studio) is a sound generation system (creation of melodies and beats, synthesis and mixing of sounds, arranging of samples; full MIDI support). Release candidate.

RemoteVstPlugin.cpp  (lmms-1.2.0-rc7):RemoteVstPlugin.cpp  (lmms-1.2.0-rc8)
skipping to change at line 65 skipping to change at line 65
#include <sched.h> #include <sched.h>
#endif #endif
#include <wine/exception.h> #include <wine/exception.h>
#endif #endif
#define USE_WS_PREFIX #define USE_WS_PREFIX
#include <windows.h> #include <windows.h>
#include <algorithm>
#include <vector> #include <vector>
#include <queue> #include <queue>
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <aeffectx.h> #include <aeffectx.h>
#if kVstVersion < 2400 #if kVstVersion < 2400
#define OLD_VST_SDK #define OLD_VST_SDK
skipping to change at line 387 skipping to change at line 388
typedef std::vector<VstMidiEvent> VstMidiEventList; typedef std::vector<VstMidiEvent> VstMidiEventList;
VstMidiEventList m_midiEvents; VstMidiEventList m_midiEvents;
bpm_t m_bpm; bpm_t m_bpm;
double m_currentSamplePos; double m_currentSamplePos;
int m_currentProgram; int m_currentProgram;
// host to plugin synchronisation data structure // host to plugin synchronisation data structure
struct in struct in
{ {
float lastppqPos; double lastppqPos;
float m_Timestamp; double m_Timestamp;
int32_t m_lastFlags; int32_t m_lastFlags;
} ; } ;
in * m_in; in * m_in;
int m_shmID; int m_shmID;
VstSyncData* m_vstSyncData; VstSyncData* m_vstSyncData;
} ; } ;
skipping to change at line 854 skipping to change at line 855
if( m_midiEvents.size() ) if( m_midiEvents.size() )
{ {
// since MIDI-events are not received immediately, we // since MIDI-events are not received immediately, we
// have to have them stored somewhere even after // have to have them stored somewhere even after
// dispatcher-call, so we create static copies of the // dispatcher-call, so we create static copies of the
// data and post them // data and post them
#define MIDI_EVENT_BUFFER_COUNT 1024 #define MIDI_EVENT_BUFFER_COUNT 1024
static char eventsBuffer[sizeof( VstEvents ) + sizeof( VstMidiEve nt * ) * MIDI_EVENT_BUFFER_COUNT]; static char eventsBuffer[sizeof( VstEvents ) + sizeof( VstMidiEve nt * ) * MIDI_EVENT_BUFFER_COUNT];
static VstMidiEvent vme[MIDI_EVENT_BUFFER_COUNT]; static VstMidiEvent vme[MIDI_EVENT_BUFFER_COUNT];
// first sort events chronologically, since some plugins
// (e.g. Sinnah) can hang if they're out of order
std::stable_sort( m_midiEvents.begin(), m_midiEvents.end(),
[]( const VstMidiEvent &a, const VstMidiEvent &b
)
{
return a.deltaFrames < b.deltaFrames;
} );
VstEvents* events = (VstEvents *) eventsBuffer; VstEvents* events = (VstEvents *) eventsBuffer;
events->reserved = 0; events->reserved = 0;
events->numEvents = m_midiEvents.size(); events->numEvents = m_midiEvents.size();
int idx = 0; int idx = 0;
for( VstMidiEventList::iterator it = m_midiEvents.begin(); it != m_midiEvents.end(); ++it, ++idx ) for( VstMidiEventList::iterator it = m_midiEvents.begin(); it != m_midiEvents.end(); ++it, ++idx )
{ {
memcpy( &vme[idx], &*it, sizeof( VstMidiEvent ) ); memcpy( &vme[idx], &*it, sizeof( VstMidiEvent ) );
events->events[idx] = (VstEvent *) &vme[idx]; events->events[idx] = (VstEvent *) &vme[idx];
} }
skipping to change at line 1501 skipping to change at line 1510
if( __plugin->m_vstSyncData->ppqPos != if( __plugin->m_vstSyncData->ppqPos !=
__plugin->m_in->m_Timesta mp ) __plugin->m_in->m_Timesta mp )
{ {
_timeInfo.ppqPos = __plugin->m_vstSyncData->ppqPo s; _timeInfo.ppqPos = __plugin->m_vstSyncData->ppqPo s;
__plugin->m_in->lastppqPos = __plugin->m_vstSyncD ata->ppqPos; __plugin->m_in->lastppqPos = __plugin->m_vstSyncD ata->ppqPos;
__plugin->m_in->m_Timestamp = __plugin->m_vstSync Data->ppqPos; __plugin->m_in->m_Timestamp = __plugin->m_vstSync Data->ppqPos;
} }
else if( __plugin->m_vstSyncData->isPlaying ) else if( __plugin->m_vstSyncData->isPlaying )
{ {
__plugin->m_in->lastppqPos += ( if( __plugin->m_vstSyncData->hasSHM )
__plugin->m_vstSyncData-> {
hasSHM ? __plugin->m_in->lastppqPos +=
__plugin->m_vstSyncData-> __plugin->m_vstSyncData->m_bpm /
m_bpm : 60.0
__plugin->m_bpm ) / (floa * __plugin->m_vstSyncData->m_buff
t)10340; erSize
/ __plugin->m_vstSyncData->m_samp
leRate;
}
else
{
__plugin->m_in->lastppqPos +=
__plugin->m_bpm / 60.0
* __plugin->bufferSize()
/ __plugin->sampleRate();
}
_timeInfo.ppqPos = __plugin->m_in->lastppqPos; _timeInfo.ppqPos = __plugin->m_in->lastppqPos;
} }
// _timeInfo.ppqPos = __plugin->m_vstSyncData->ppqPos; // _timeInfo.ppqPos = __plugin->m_vstSyncData->ppqPos;
_timeInfo.flags |= kVstPpqPosValid; _timeInfo.flags |= kVstPpqPosValid;
if( __plugin->m_vstSyncData->isPlaying ) if( __plugin->m_vstSyncData->isPlaying )
{ {
_timeInfo.flags |= kVstTransportPlaying; _timeInfo.flags |= kVstTransportPlaying;
} }
_timeInfo.barStartPos = ( (int) ( _timeInfo.ppqPos / _timeInfo.barStartPos = ( (int) ( _timeInfo.ppqPos /
skipping to change at line 1832 skipping to change at line 1851
DWORD WINAPI RemoteVstPlugin::processingThread( LPVOID _param ) DWORD WINAPI RemoteVstPlugin::processingThread( LPVOID _param )
{ {
__processingThreadId = GetCurrentThreadId(); __processingThreadId = GetCurrentThreadId();
RemoteVstPlugin * _this = static_cast<RemoteVstPlugin *>( _param ); RemoteVstPlugin * _this = static_cast<RemoteVstPlugin *>( _param );
RemotePluginClient::message m; RemotePluginClient::message m;
while( ( m = _this->receiveMessage() ).id != IdQuit ) while( ( m = _this->receiveMessage() ).id != IdQuit )
{ {
if( m.id == IdStartProcessing || m.id == IdMidiEvent ) if( m.id == IdStartProcessing
|| m.id == IdMidiEvent
|| m.id == IdVstSetParameter )
{ {
_this->processMessage( m ); _this->processMessage( m );
} }
else if( m.id == IdChangeSharedMemoryKey ) else if( m.id == IdChangeSharedMemoryKey )
{ {
_this->processMessage( m ); _this->processMessage( m );
_this->setShmIsValid( true ); _this->setShmIsValid( true );
} }
else else
{ {
 End of changes. 5 change blocks. 
10 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)