# HG changeset patch # User Chris Cannam # Date 1138276569 0 # Node ID cb05ba39664ae3e56d6c2d266a1fdca3d2d6d919 # Parent ec6886f0e6736abfc38b9112b11959f250395f61 * Fixes to playback of short looped files, of synthesised content within looped sections, and a few other fixes diff -r ec6886f0e673 -r cb05ba39664a plugin/DSSIPluginInstance.cpp --- a/plugin/DSSIPluginInstance.cpp Wed Jan 25 17:46:28 2006 +0000 +++ b/plugin/DSSIPluginInstance.cpp Thu Jan 26 11:56:09 2006 +0000 @@ -789,8 +789,20 @@ DSSIPluginInstance::sendEvent(const RealTime &eventTime, const void *e) { +#ifdef DEBUG_DSSI_PROCESS + std::cerr << "DSSIPluginInstance::sendEvent: last was " << m_lastEventSendTime << " (valid " << m_haveLastEventSendTime << "), this is " << eventTime << std::endl; +#endif + + // The process mechanism only works correctly if the events are + // sorted. It's the responsibility of the caller to ensure that: + // we will happily drop events here if we find the timeline going + // backwards. if (m_haveLastEventSendTime && m_lastEventSendTime > eventTime) { +#ifdef DEBUG_DSSI_PROCESS + std::cerr << "... clearing down" << std::endl; +#endif + m_haveLastEventSendTime = false; clearEvents(); } @@ -807,6 +819,9 @@ ev.data.note.channel = 0; m_eventBuffer.write(&ev, 1); + + m_lastEventSendTime = eventTime; + m_haveLastEventSendTime = true; } void