@erikronstrom Similar, I was trying to get on the fly PunchInOut recording working. I did bump into something that might be what you want, though.
My Punch In/Out Problem: - Continuous playback with on demand start/stop recording
Using the supplied Recording Demo I found that if it’s already playing, hitting record would trigger the creation of hundreds of tiny (784bytes) wav files whilst grinding everything to a halt.
What I tried:
1. Rapidly stop playback and start recording
edit.getTransport().stop (false, false); //Sneakily stopping before recording.
edit.getTransport().record (false); //Starts playback and recording again.
This kind of works, but clearly isn’t right and also results in a tiny blip in audio playback.
2. Playing, then hitting record with PunchInOut
I also experimented with setting edit.recordingPunchInOut.setValue(true, nullptr), where I set the in and out points slightly later than the start time. By pressing play, then record, it would play fine until it got to the record in-point, then it would all grind to a halt again. So clearly thats not the answer for me either.
3. Moving punchInOut during record.
Finally I tried replacing Play with Record+PunchInOut and EditTimeRange(1000.f,1001.f). Then whilst it was playing having a test button suddenly move the EditTimeRange to 2.f and 4.f. I was hoping TE would notice this change and start recording in the newly moved range - kind of like a fake punchInOut recording. That didn’t happen so sadly this idea didn’t work at all.
I don’t know what else to try. I’m pretty sure I must be missing something obvious but I can’t see what.
@erikronstrom I might be misunderstanding but it seems like what you need is:
edit.recordingPunchInOut.setValue(true, nullptr);
edit.getTransport().setLoopRange(te::EditTimeRange(double start, double end))
edit.getTransport().record (false);
Note the lack of play command. It will still play though, and when it gets to the in point it should start recording.
Cheers,
Jeff
