feat[playback]: add per-section playback speed control#688
feat[playback]: add per-section playback speed control#6880xjuanma wants to merge 5 commits intocharmbracelet:mainfrom
Conversation
| - [`Backspace`](#backspace) [`Enter`](#enter) [`Tab`](#tab) [`Space`](#space): special keys | ||
| - [`Ctrl[+Alt][+Shift]+<char>`](#ctrl): press control + key and/or modifier | ||
| - [`Sleep <time>`](#sleep): wait for a certain amount of time | ||
| - [`Playback@<speed>`](#playback): change playback speed for subsequent commands |
There was a problem hiding this comment.
Why not use the existing SET PlaybackSpeed inline like SET TypingSpeed?
There was a problem hiding this comment.
@cwarden Great question! I wanted to leave the existing implementation as is, specially because "PlaybackSpeed" is a global setting.
This was a compromise on my part to ensure "PlaybackSpeed" remains global and the new "Playback@*" commands become anchors/markers for this section-base speed configuration.
There was a problem hiding this comment.
I didn't check for an existing pull request before adding the same feature, but reusing SET PlaybackSpeek. I don't feel that strongly about it, but making playback speed congruent with typing speed makes sense to me. There's an alternative implementation in 5b1c930 using this approach.
There was a problem hiding this comment.
Yeah, as you pointed out I also went with the "Playback@" approach to try to follow what "TypingSpeed" and "Type@*" are currently doing.
I also don't have strong opinions about this, so I'll let the maintainers decide whats the better choice for this 👍🏽
CONTRIBUTING.md.Summary
#685
Adds new playback speed control feature to VHS, allowing users to vary playback speed at different points in their recordings using the
Playback@<speed>command. The value can be either an integer or float with 1 decimal place.This enables speeding through setup sections while slowing down for important demonstrations, providing more control over the final output than the global
Set PlaybackSpeedsetting(which defines a single speed for the full GIF). Its effectively a way to set up multiple playback speeds as part of the tape file or commands being run.Output GIF:
Here is the
demo.tapeused to generate the GIF above:Updates
Playback@<speed>command with@syntax for section-based speed control(follows similar patterns a Type@Xms)