-
Notifications
You must be signed in to change notification settings - Fork 159
tape: add pause/resume and loop control with threading improvements #1857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add Tape::Reader setLoopFile/getLoopFile - Add Tape::setLooping/isLooping - Add MixerClient::setTapeLoop - Add OSC /tape/play/loop (int 0/1) to set loop value - Expose loop control to Lua
3a44b54 to
1a1c394
Compare
|
I worked out a patch to tape.lua last night. It takes into account the discussed UI/UX changes in #1789. I will amend it to this PR later tonight. |
|
Thank you Colin! I'll get this tested shortly, it's been a much desired feature by several people. |
|
Didn't get the tape.lua changes pushed out last night. I will have time tonight! |
|
Ok. I've pushed up the changes to tape.lua, that allow testing from the UI. There are a few considerations still that I can either get around to now or later. Open to other feedback!
|
|
reviewed the code, looks great! still haven't had a chance to test on device. agreed that it makes sense to maybe not unload the file on EOF. if complete, an issued PLAY command should just play it again, right? |
Yes. An optimization would be to prevent the underlying Tape class from unloading the file until explicitly told to. This is not blocking the merge of this work in my opinion. |
|
I've added a debounce to |
|
Come to think of it once #1528 is resolved (Tape state getter), fileselect preview thrashing should not be an issue. The issue at this point is the state synchronization and not a race condition within Tape. I've guarded the Tape command queue and API thoroughly against transport state race conditions in this PR. |
cc9ad25 to
574a93a
Compare
I've updated the UI to address this. I will attach screenshots shortly. |
|
This looks great! Tested on device, code looks good to me. Thank you! |





what:
Adds pause/resume functionality for both record and playback. Also exposes loop control API. Includes reworking of tape state machine w/threading safety improvements and additional fixes:
pauseRecord(bool),pausePlayback(bool)setLooping(bool),isLooping(),isPaused()...
/tape/record/pause→tape_record_pause()→Audio.tape_record_pause()/tape/play/pause→tape_play_pause()→Audio.tape_play_pause()/tape/play/loop→tape_play_loop()→Audio.tape_play_loop()Mostly addresses #1789, #766, and partially address #1758 with an E3 debounce in
fileselecton preview.why:
Working on exposing tape loop control, I went down a bit of a rabbit hole, and ended up adding pause as well, by way of a command queue between the tape public API and the audio thread. I also addressed some threading race conditions.
how:
notes: