Skip to content

Commit

Permalink
#1160 Incorporate PDC read-ahead into position calculation
Browse files Browse the repository at this point in the history
by deriving all positions from the logical rising position
  • Loading branch information
helgoboss committed Sep 3, 2024
1 parent c1c6329 commit dac53d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions main/src/domain/targets/playtime_slot_seek_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,13 @@ mod playtime_impl {
fn position_in_seconds(&self, context: ControlContext) -> Option<PositionInSeconds> {
Backbone::get()
.with_clip_matrix(context.instance(), |matrix| {
let slot = matrix.find_slot(self.slot_coordinates)?;
let column = matrix.find_column(self.slot_coordinates.column_index)?;
let slot = column.find_slot(self.slot_coordinates.row_index)?;
let play_lookahead = column.play_lookahead().get();
let timeline = matrix.timeline();
let tempo = timeline.next_block().tempo_entry.props.tempo;
slot.relevant_clip_employments()
.primary_position_in_seconds(tempo)
.primary_logical_pos_latency_corrected_timeline_secs(tempo, play_lookahead)
.ok()
})
.ok()?
Expand All @@ -204,11 +206,14 @@ mod playtime_impl {
fn current_value(&self, context: ControlContext<'a>) -> Option<AbsoluteValue> {
let val = Backbone::get()
.with_clip_matrix(context.instance(), |matrix| {
let relevant_content = matrix
.find_slot(self.slot_coordinates)?
.relevant_clip_employments();
let column = matrix.find_column(self.slot_coordinates.column_index)?;
let slot = column.find_slot(self.slot_coordinates.row_index)?;
let relevant_content = slot.relevant_clip_employments();
let play_lookahead = column.play_lookahead().get();
let timeline = matrix.timeline();
let tempo = timeline.next_block().tempo_entry.props.tempo;
let val = relevant_content
.primary_logical_proportional_position()
.primary_logical_pos_latency_corrected_proportional(tempo, play_lookahead)
.ok()?;
Some(AbsoluteValue::Continuous(val))
})
Expand Down
2 changes: 1 addition & 1 deletion playtime-clip-engine

0 comments on commit dac53d8

Please sign in to comment.