forge
Explore
Log in

Don't you dare go Hollow

The transport clock reads the preview, not the timeline, while one is up

Browse files at this commit

c60633d7129275b076727420a26d1c2dbe593783Ahmet Kaan GümüşParent: a7d8eab
  • fix
    • the transport clock reads the preview, not the timeline, while one is up
Show full message
🐛 fix(app): the transport clock reads the preview, not the timeline, while one is up

The toolbar's timecode/duration readout took position and duration
from the timeline's own playhead unconditionally, so opening a
library preview kept showing the timeline's time underneath it. It
now reads active_session()/active_fps() like the rest of the
transport does, so the clock tracks whichever session is actually
playing; Escape still hands it back to the timeline the moment the
preview closes. The ruler's own clock (timeline.rs) and the timeline
context-menu timecodes are untouched -- they are timeline-bed reads
and must keep following self.session regardless of a preview.
crates/app/src/render.rsmodified+1 -6
@@ -687,12 +687,7 @@ impl Render for Player {
687 .child(height_probe(self.notice_h.clone())),687 .child(height_probe(self.notice_h.clone())),
688 ),688 ),
689 )689 )
690- .child(self.transport_bar(690+ .child(self.transport_bar(state, window.viewport_size(), cx)),
691- position,
692- state,
693- window.viewport_size(),
694- cx,
695- )),
696 )691 )
697 .child(divider(Split::Inspector, cx))692 .child(divider(Split::Inspector, cx))
698 // The settings cards live in here rather than over the693 // The settings cards live in here rather than over the
crates/app/src/ui/toolbar.rsmodified+6 -5
@@ -148,7 +148,6 @@ impl Player {
148 /// and the reason the edit toolbar below is nothing but edit tools.148 /// and the reason the edit toolbar below is nothing but edit tools.
149 pub(crate) fn transport_bar(149 pub(crate) fn transport_bar(
150 &self,150 &self,
151- position: f64,
152 state: Transport,151 state: Transport,
153 viewport: Size<Pixels>,152 viewport: Size<Pixels>,
154 cx: &mut Context<Self>,153 cx: &mut Context<Self>,
@@ -209,12 +208,14 @@ impl Player {
209 .text_color(rgb(FG_PRIMARY()))208 .text_color(rgb(FG_PRIMARY()))
210 .child(format!(209 .child(format!(
211 "{} / {}",210 "{} / {}",
212- timecode(position, self.fps),
213 timecode(211 timecode(
214- self.session212+ self.active_session().map_or(0., PlaybackSession::now),
215- .as_ref()213+ self.active_fps()
214+ ),
215+ timecode(
216+ self.active_session()
216 .map_or(0., PlaybackSession::timeline_duration),217 .map_or(0., PlaybackSession::timeline_duration),
217- self.fps218+ self.active_fps()
218 )219 )
219 )),220 )),
220 )221 )