feat(player): exact timestamp input for loop start/end (#246) - #252
Merged
Conversation
Add two editable timestamp fields in the transport footer for setting the loop region precisely, alongside the existing drag/click select. Fields display mm:ss.mmm and accept either mm:ss.mmm or plain decimal seconds. - utils.js: fmtTimeMs (integer-ms math, no rounding carry) and parseTimecode (mm:ss.mmm or plain seconds, null on invalid). - transport.js: syncLoopInputs keeps the fields in sync on drag/toggle (never clobbering a field being edited, disabled when no track loaded); commitLoopInput parses, clamps to [0, totalDuration], enforces the MIN_LOOP_SEC ordering, then updates the loop via the existing setters + updateLoopRegionVisual. Enter/blur commit, Escape reverts. Invalid input reverts the field in place (showError belongs to the import form). - player.js: refresh loop UI on track load so the inputs enable + reset once the duration is known. Values flow through the existing loopStart/loopEnd setters and audioEngine.setLoop, so the model and engine are unchanged.
Move the exact loop start/end fields inline into .footer-transport, directly after the loop button, instead of a separate row below the time readout. Drop the redundant LOOP label now that the fields sit next to the loop control.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #246.
What
Two editable timestamp fields in the transport footer (right of the loop button) for setting the loop region precisely, additive to the existing drag/click select. Fields display
mm:ss.mmmand accept eithermm:ss.mmmor plain decimal seconds.Changes
utils.js:fmtTimeMs(integer-ms math, no rounding carry) +parseTimecode(mm:ss.mmmor plain seconds, null on invalid).index.html/daw.css: the two inputs inline in.footer-transport, styled to match the footer.state.js: element refs.transport.js:syncLoopInputskeeps the fields live on drag/toggle (never clobbering a field being edited, disabled when no track loaded);commitLoopInputparses, clamps to[0, totalDuration], enforcesMIN_LOOP_SECordering, then updates the loop via the existing setters +updateLoopRegionVisual. Enter/blur commit, Escape reverts, invalid reverts in place.player.js: refresh loop UI on track load so the inputs enable + reset once duration is known.Values flow through the existing
setLoopStart/setLoopEnd+audioEngine.setLoop, so the loop model and engine are unchanged.Testing
node --checkon all edited JS: pass.Known limitation (unchanged from today)
Looping is a no-op on the streaming
chunkedAudioEngine(LAN path): fields + visual region update, but audio won't audibly loop there, same as drag-select today.