comparison plugin/DSSIPluginInstance.cpp @ 11:cb05ba39664a

* Fixes to playback of short looped files, of synthesised content within looped sections, and a few other fixes
author Chris Cannam
date Thu, 26 Jan 2006 11:56:09 +0000
parents ec6886f0e673
children 2fb933f88604
comparison
equal deleted inserted replaced
10:ec6886f0e673 11:cb05ba39664a
787 787
788 void 788 void
789 DSSIPluginInstance::sendEvent(const RealTime &eventTime, 789 DSSIPluginInstance::sendEvent(const RealTime &eventTime,
790 const void *e) 790 const void *e)
791 { 791 {
792 #ifdef DEBUG_DSSI_PROCESS
793 std::cerr << "DSSIPluginInstance::sendEvent: last was " << m_lastEventSendTime << " (valid " << m_haveLastEventSendTime << "), this is " << eventTime << std::endl;
794 #endif
795
796 // The process mechanism only works correctly if the events are
797 // sorted. It's the responsibility of the caller to ensure that:
798 // we will happily drop events here if we find the timeline going
799 // backwards.
792 if (m_haveLastEventSendTime && 800 if (m_haveLastEventSendTime &&
793 m_lastEventSendTime > eventTime) { 801 m_lastEventSendTime > eventTime) {
802 #ifdef DEBUG_DSSI_PROCESS
803 std::cerr << "... clearing down" << std::endl;
804 #endif
805 m_haveLastEventSendTime = false;
794 clearEvents(); 806 clearEvents();
795 } 807 }
796 808
797 snd_seq_event_t *event = (snd_seq_event_t *)e; 809 snd_seq_event_t *event = (snd_seq_event_t *)e;
798 #ifdef DEBUG_DSSI_PROCESS 810 #ifdef DEBUG_DSSI_PROCESS
805 817
806 // DSSI doesn't use MIDI channels, it uses run_multiple_synths instead. 818 // DSSI doesn't use MIDI channels, it uses run_multiple_synths instead.
807 ev.data.note.channel = 0; 819 ev.data.note.channel = 0;
808 820
809 m_eventBuffer.write(&ev, 1); 821 m_eventBuffer.write(&ev, 1);
822
823 m_lastEventSendTime = eventTime;
824 m_haveLastEventSendTime = true;
810 } 825 }
811 826
812 void 827 void
813 DSSIPluginInstance::clearEvents() 828 DSSIPluginInstance::clearEvents()
814 { 829 {