Add TimecodeField and Timecode helpers - #538
Merged
Merged
Conversation
TimecodeField edits a frame count shown as SMPTE timecode, laid out as [-] HH:MM:SS:FF [+] with drop-frame labels (;FF) at 29.97 and 59.94. The buttons step a frame, or a second with Shift, and repeat while held. Dragging across the value scrubs a frame per pixel (ten with Shift), and a click that never became a drag opens it for typing. Up and Down step while the pointer rests on the value. TimecodeRate is a rational rate (30000/1001 rather than 29.97) with the usual presets, and the static Timecode class formats, parses and converts frames to and from seconds with no ImGui context. Drop-frame drops n/15 labels per minute except every tenth, so the same arithmetic covers 29.97 DF and 59.94 DF. StepperImpl.RepeatButton is now internal so both widgets share one hold-to-repeat button. The widget marks dec, value, inc and edit under its label's scope, and ships with unit tests, an isolation suite, a gallery tile and a demo section. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01To1cbNshRJb5qvkjnGtLhH
Registers the TimecodeField demo through SectionDemos rather than the main demo class, which main's new sections had already brought to the CA1506 class-coupling limit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01To1cbNshRJb5qvkjnGtLhH
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01To1cbNshRJb5qvkjnGtLhH
|
matt-edmondson
pushed a commit
that referenced
this pull request
Sep 30, 2026
Resolves the CLAUDE.md widget list against TimecodeField (#538): main's line, plus the three stereo meters. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MBhLQ3ZkoYk8s5tKQ8RTAP
This was referenced Sep 30, 2026
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.



Requested by Matt · project thread
Closes #525.
Before: there was no widget for editing a frame position as
HH:MM:SS:FFtimecode.After:
ImGuiWidgets.TimecodeFieldedits a frame number shown as timecode.TimecodeRatehas 11 presets. The staticTimecodeclass formats, parses and converts between frames, seconds and timecode text, and is usable without ImGui.How
TimecodeRateis a rational (numerator/denominator) plus a drop-frame flag. Rates below 0.5 fps are refused, because they round to 0 nominal frames and every label would divide by zero. A default rate is refused by name.TryParserejects hours that would overflow. Scrub steps saturate rather than wrap.[min, max]is left as the caller passed it. Only user edits clamp. A reversedmin/maxis swapped.ScopedId(label)aslabel/dec,label/value,label/incandlabel/edit.TextUnformatted, so a%in the text is not read as a format string.Stepper'sRepeatButtongoes from private to internal so the step buttons can use it. That is the only change toStepper.Timecodeand the field's arithmetic.SectionDemos.cs, becauseImGuiWidgetsDemois at the class-coupling limit (CA1506). It will move to aDemoSections.csregistration once Split the widgets demo into one class per section #534 lands.--checkand the full gallery render test both pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01To1cbNshRJb5qvkjnGtLhH