On 01/09/2012 04:00 PM, Rui Nuno Capela wrote:
applied. qtractor svn trunk rev.2659 (v0.5.3.4)

Thanks a bunch. :) Attached is another suggested patch against the current trunk (r2660) to make qtractor send an MMC locate after jumping back to the beginning of a loop. It's not perfect, but I'm posting it anyway in case someone may find it useful.

As you can see I handled this in the timer callback of the main form which isn't 100% accurate, but I never found it to be off by more than 1 frame, which I guess is good enough for my purposes. There are surely better ways to do this, but I wasn't able to figure that out without investing much more time reading the source code. Ideally, this should be handled on the spot somewhere in the MIDI engine. I tried to add it directly in qtractorMidiOutputThread::process(), but the read-ahead gets in the way there, so I couldn't find a proper way to make that work. (Is there a way in qtractor to schedule a callback exactly at the *real* time when the play head reaches a given position? Then this would be easy.)

There are a few other situations where an MMC locate is still missing, specifically after ending a rewind or fast-forward, but I have no idea how to fix this without diving into the qtractor sources much more than I did. :(

Cheers,
Albert

--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email:  dr.gr...@t-online.de, a...@muwiinfa.geschichte.uni-mainz.de
WWW:    http://www.musikinformatik.uni-mainz.de/ag
Index: src/qtractorMainForm.cpp
===================================================================
--- src/qtractorMainForm.cpp	(revision 2660)
+++ src/qtractorMainForm.cpp	(working copy)
@@ -6167,6 +6167,7 @@
 	// Currrent state...
 	bool bPlaying  = m_pSession->isPlaying();
 	long iPlayHead = long(m_pSession->playHead());
+	bool bRelocate = iPlayHead < (long)m_iPlayHead;
 
 	qtractorAudioEngine *pAudioEngine = m_pSession->audioEngine();
 	qtractorMidiEngine  *pMidiEngine  = m_pSession->midiEngine();
@@ -6194,6 +6195,10 @@
 					m_pSession->songPosFromFrame(iPlayHead));
 			}
 		}
+		else if (bRelocate) {
+			// MMC locate for loop start - ag
+			pMidiEngine->sendMmcLocate(m_pSession->locateFromFrame(iPlayHead));
+		}
 	}
 
 	// Transport status...
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Reply via email to