14#include <unordered_set>
134 std::optional<TimelineClip>
clip;
Makes element IDs: per-frame dynamic / ranged IDs (hashed from the call site or a hint and the parent...
Definition gui_id_manager.h:31
static ID ScopedID(ID scope, ID key)
The ID of the item key names (a node's stableID, say) inside scope (the container showing it): the sa...
Definition gui_id_manager.h:120
TimelineEdit DeleteSelectedKeysEdit(ConstTimelineViewRef view)
The edit that deletes the view's selected keys and events from the tracks that aren't locked; none wh...
bool PruneTimelineSelection(TimelineViewRef view)
After an edit (through this view or another): lets go of the selected tracks, keys and events that ar...
ID TimelineRowID(const TimelineViewState &view, ID track)
The element of track track's row in a view: rows are scoped to their editor, so each view of the trac...
Definition gui_timeline_types.h:272
bool IsTrackLocked(const TimelineData &data, int track)
Whether track is locked: it, or a group holding it, is.
TimelineEdit RemoveTrackEdit(const TimelineData &data, int track)
The edit that removes track and, for a group, the tracks it holds.
TimelineEdit AddTrackEdit(const TimelineData &data, TimelineTrack track, int index=-1)
The edit that adds track at index (the end when out of range).
void ApplyTimelineEdit(TimelineData &data, const TimelineEdit &edit, bool undo=false)
Does (or with undo, undoes) edit on the tracks, and raises their revision.
TimelineTrackKind
What a track holds, and how its row looks.
Definition gui_timeline_types.h:72
BasicViewRef< TimelineData, TimelineViewState > TimelineViewRef
A timeline and one view of it, as TimelineEditor and the helpers take them.
Definition gui_timeline_types.h:259
std::span< const TimelineTrack > TracksInGroup(const TimelineData &data, int track)
The tracks a group at track holds: the ones after it indented further, up to the next one that isn't.
void CommitTimelineEdit(TimelineData &data, const TimelineEdit &edit)
Applies edit and hands it to data.onEdit; does nothing for an empty one.
float SourceLengthOf(const TimelineClip &clip)
The whole sound's length: TimelineClip::sourceLength, or its offset and length.
Definition gui_timeline_types.h:115
bool AdvanceTimeline(TimelineState &state, const TimelineOptions &options, float deltaSecs)
Moves state on by deltaSecs while it plays: call it once a frame with the frame's time.
TimelineEdit AddKeyEdit(const TimelineData &data, int track, float time, ID keyID)
The edit that sets a key on track at time (on a frame when the timeline snaps), or none when there's ...
BasicViewRef< const TimelineData, const TimelineViewState > ConstTimelineViewRef
Definition gui_timeline_types.h:260
void ReleaseTimelineEditIDs(IDManager &ids, const TimelineEdit &edit, bool undone)
Releases the static IDs of the tracks, keys and events only the side of edit not in effect holds: don...
@ Group
a heading for the tracks after it that are indented further: a chevron, a color chip,...
Definition gui_timeline_types.h:73
@ Property
an animated value: keys on its lane, and a button to key it at the playhead
Definition gui_timeline_types.h:74
@ Events
named moments: a flag and a label each on its lane
Definition gui_timeline_types.h:76
@ Audio
a sound: its clip and waveform on its lane, mute and solo
Definition gui_timeline_types.h:75
@ None
Definition gui_element_flags.h:18
@ Start
Horizontal: the language's start (left for LTR, right for RTL). Vertical: top.
Definition gui_style_text.h:69
Definition gui_logging.h:24
What a control shows and one view of it, as the control takes them.
Definition gui_view_ref.h:20
One press that may become a drag, with what every control does around it: the focus and the capture o...
Definition gui_gesture.h:60
The part of a drawn control under the pointer (a key, a handle, a clip's end), for its hover look.
Definition gui_gesture.h:115
A 64-bit element ID whose bit layout depends on its IDMode.
Definition gui_id.h:23
static constexpr ID Invalid()
The "no element" ID (all bits zero); also the default for optional ID parameters.
Definition gui_id.h:66
An audio track's sound on its lane.
Definition gui_timeline_types.h:101
float length
how long it plays, in seconds
Definition gui_timeline_types.h:103
bool operator==(const TimelineClip &) const =default
float start
where it starts, in seconds
Definition gui_timeline_types.h:102
float sourceLength
The whole sound's length, in seconds, which peaks cover; 0: offset + length.
Definition gui_timeline_types.h:107
std::vector< float > peaks
The sound's loudness over its whole length, 0 to 1, evenly spaced: the waveform's bars.
Definition gui_timeline_types.h:109
float offset
How far into the sound it starts playing, in seconds: trimming its start moves it on.
Definition gui_timeline_types.h:105
A timeline's tracks and playback, kept by the app from frame to frame.
Definition gui_timeline_types.h:162
TimelineState playback
the playhead; AdvanceTimeline moves it on
Definition gui_timeline_types.h:164
std::function< void(const TimelineEdit &)> onEdit
A change the user made, already applied: put it in the undo history.
Definition gui_timeline_types.h:171
float duration
the length, in seconds
Definition gui_timeline_types.h:165
bool snap
dragged keys and the loop range land on frames
Definition gui_timeline_types.h:168
uint32_t revision
Raised by each edit applied, so every view of the tracks can tell they changed.
Definition gui_timeline_types.h:176
TimelineRange loopRange
where looping playback goes round; empty: the whole length
Definition gui_timeline_types.h:167
std::vector< TimelineTrack > tracks
Definition gui_timeline_types.h:163
std::function< void()> onPlaybackChanged
The playhead was moved, or playback started or stopped, by the user.
Definition gui_timeline_types.h:173
float fps
frames per second: keys snap to frames, steps go a frame
Definition gui_timeline_types.h:166
A track changed: its keys, clip, events or flags.
Definition gui_timeline_types.h:146
TimelineTrack to
Definition gui_timeline_types.h:146
TimelineTrack from
Definition gui_timeline_types.h:146
int track
Definition gui_timeline_types.h:146
A track added (at index) or removed (from it).
Definition gui_timeline_types.h:148
bool added
Definition gui_timeline_types.h:148
TimelineTrack track
Definition gui_timeline_types.h:148
int index
Definition gui_timeline_types.h:148
A change to a TimelineView, for undo: what each changed track was before and after,...
Definition gui_timeline_types.h:144
std::vector< Change > changes
Definition gui_timeline_types.h:150
std::optional< TimelineRange > loopFrom
Definition gui_timeline_types.h:152
std::vector< Track > tracks
applied in order; undone in reverse
Definition gui_timeline_types.h:151
std::optional< TimelineRange > loopTo
the loop range, when it changed
Definition gui_timeline_types.h:152
bool empty() const
Definition gui_timeline_types.h:154
A named moment on an events track: "Spawn", "Explode".
Definition gui_timeline_types.h:91
bool operator==(const TimelineEvent &) const =default
std::string name
Definition gui_timeline_types.h:94
ID stableID
assigned once on creation, as a key's
Definition gui_timeline_types.h:92
float time
Definition gui_timeline_types.h:93
A key on a property track: a time where the value is set.
Definition gui_timeline_types.h:81
bool operator==(const TimelineKey &) const =default
float time
seconds from the start
Definition gui_timeline_types.h:84
ID stableID
Assigned once on creation: the key's ID for its selection.
Definition gui_timeline_types.h:83
What a Timeline covers. The markers are only read during the call.
Definition gui_timeline_types.h:46
float fps
frames per second: a step's length, and the frame number shown; 0 or less: no frames
Definition gui_timeline_types.h:48
float progress
How far the content is ready, in seconds: a simulation's frames computed so far, drawn as a fill alon...
Definition gui_timeline_types.h:51
float duration
the length, in seconds: the scrubber's right end
Definition gui_timeline_types.h:47
TimelineRange loopRange
Where looping playback goes round: from its end back to its start.
Definition gui_timeline_types.h:55
std::span< const float > markers
checkpoints, in seconds: a line each on the scrubber
Definition gui_timeline_types.h:52
A stretch of time, in seconds: from start up to end.
Definition gui_timeline_types.h:36
bool empty() const
Definition gui_timeline_types.h:40
float end
Definition gui_timeline_types.h:38
bool operator==(const TimelineRange &) const =default
float start
Definition gui_timeline_types.h:37
Where playback is: what a Timeline shows and edits.
Definition gui_timeline_types.h:25
bool playing
moving on by itself (AdvanceTimeline)
Definition gui_timeline_types.h:27
bool loop
at the end, back to the start instead of stopping
Definition gui_timeline_types.h:28
float time
the playhead, in seconds from the start
Definition gui_timeline_types.h:26
bool operator==(const TimelineState &) const =default
A row of the timeline: its name and controls in the track list, its lane beside them.
Definition gui_timeline_types.h:119
ID stableID
Assigned once on creation: the ID of its row, lane and selection.
Definition gui_timeline_types.h:121
std::string name
Definition gui_timeline_types.h:122
std::vector< TimelineEvent > events
an events track's events, in time order
Definition gui_timeline_types.h:135
bool solo
an audio track: heard alone (with the others solo)
Definition gui_timeline_types.h:131
bool muted
an audio track: not heard
Definition gui_timeline_types.h:130
bool visible
a group's eye: what it animates shown in the app
Definition gui_timeline_types.h:128
std::optional< TimelineClip > clip
an audio track's sound
Definition gui_timeline_types.h:134
TimelineTrackKind kind
Definition gui_timeline_types.h:123
int depth
How far it's indented: a group holds the tracks after it that are indented further,...
Definition gui_timeline_types.h:126
std::vector< TimelineKey > keys
a property's keys, in time order
Definition gui_timeline_types.h:133
color4f color
a group's chip; alpha 0 uses the theme's accent
Definition gui_timeline_types.h:132
bool expanded
a group: its tracks shown
Definition gui_timeline_types.h:127
bool operator==(const TimelineTrack &) const =default
bool locked
a group's lock: its tracks' keys can't be moved, added or deleted
Definition gui_timeline_types.h:129
What's under the pointer on the lanes, for its hover look.
Definition gui_timeline_types.h:212
int track
the track whose key, event or summary key it is ...
Definition gui_timeline_types.h:213
ClipPart clipPart
... and which part
Definition gui_timeline_types.h:216
bool operator==(const LaneHover &) const =default
float time
... and its time
Definition gui_timeline_types.h:214
int clipTrack
the track whose clip it is ...
Definition gui_timeline_types.h:215
How one TimelineEditor shows a TimelineData: the part in view, the selection, the track filter,...
Definition gui_timeline_types.h:182
int clipTrack
the track whose clip is dragged ...
Definition gui_timeline_types.h:206
int zoomShown
the slider as last drawn, to tell its moves
Definition gui_timeline_types.h:239
ID selectedTrack
highlighted in the list and on its lane
Definition gui_timeline_types.h:188
Gesture< float > scrub
on the ruler; the playhead as it was
Definition gui_timeline_types.h:229
Gesture< std::vector< TimelineTrack > > keyDrag
moving the selected keys; the tracks as they were (all of them)
Definition gui_timeline_types.h:200
Gesture< std::unordered_set< ID > > boxSelect
the selection to go back to: before a Shift / Ctrl box, else none
Definition gui_timeline_types.h:220
HoverPart< LaneHover > hover
A clip's parts: its body moves it, its ends trim it.
Definition gui_timeline_types.h:219
int loopEdge
0 a new range, 1 its start, 2 its end, 3 the whole of it
Definition gui_timeline_types.h:226
uint32_t seenRevision
the tracks' revision this view last built
Definition gui_timeline_types.h:248
bool menuByPointer
a right press set the above since the menu last opened
Definition gui_timeline_types.h:246
bool clipMoved
A clip's parts: its body moves it, its ends trim it.
Definition gui_timeline_types.h:209
std::unordered_set< ID > selectedKeys
keys and events, by stableID
Definition gui_timeline_types.h:189
int boxFromRow
A clip's parts: its body moves it, its ends trim it.
Definition gui_timeline_types.h:222
ID editorID
the editor's ID last frame: its rows' and lanes' IDs are scoped to it
Definition gui_timeline_types.h:249
std::function< void(int track)> onTrackContextMenu
Builds the menu for a track's row (right click, or the Menu key on the selected one),...
Definition gui_timeline_types.h:196
std::function< void()> onAddTrack
The "+" over the track list: add a track.
Definition gui_timeline_types.h:193
int boxToRow
A clip's parts: its body moves it, its ends trim it.
Definition gui_timeline_types.h:224
std::string filter
the track list shows the tracks whose name has it (and their groups)
Definition gui_timeline_types.h:190
float clipPressTime
the time under the clip drag's press
Definition gui_timeline_types.h:208
ClipPart
A clip's parts: its body moves it, its ends trim it.
Definition gui_timeline_types.h:204
@ None
Definition gui_timeline_types.h:204
int zoom
the zoom slider, 0 (all of it) to 100
Definition gui_timeline_types.h:238
float viewLength
Definition gui_timeline_types.h:186
float boxFrom
the box's anchor: time and row
Definition gui_timeline_types.h:221
float viewStart
The part of the timeline in view: from viewStart, viewLength seconds wide.
Definition gui_timeline_types.h:185
uint32_t menuOpening
the context menu opening it was worked out for
Definition gui_timeline_types.h:247
int lanesWidth
the lanes' width last frame, in pixels
Definition gui_timeline_types.h:240
HoverPart< int > loopEdgeHover
the loop edge under the pointer on the ruler: 0 none, 1 start, 2 end
Definition gui_timeline_types.h:228
int menuTrack
the row's track
Definition gui_timeline_types.h:244
Gesture< TimelineRange > loopDrag
the loop range as it was
Definition gui_timeline_types.h:225
float loopPressTime
A clip's parts: its body moves it, its ends trim it.
Definition gui_timeline_types.h:227
ClipPart clipPart
... and by which part
Definition gui_timeline_types.h:207
float keyPressTime
the time under the key drag's press
Definition gui_timeline_types.h:201
std::vector< ID > menuKeys
The lanes' menu: what was right-clicked, or from the keyboard the selection and the playhead.
Definition gui_timeline_types.h:243
float boxTo
A clip's parts: its body moves it, its ends trim it.
Definition gui_timeline_types.h:223
Gesture< DragScrollFrom > dragScroll
the middle button (or Alt + left) held over the ruler or lanes
Definition gui_timeline_types.h:237
Gesture< float > pan
the scroll bar's thumb; the view's start as it was
Definition gui_timeline_types.h:230
Gesture< std::vector< TimelineTrack > > clipDrag
moving or trimming a clip; the tracks as they were
Definition gui_timeline_types.h:205
bool keyMoved
A clip's parts: its body moves it, its ends trim it.
Definition gui_timeline_types.h:202
float menuTime
the time under the right click
Definition gui_timeline_types.h:245
A timeline shown in one place: the tracks and the one view of them together.
Definition gui_timeline_types.h:255
Definition gui_base_types.h:394