+ if (key == GlobalSettings::Key_View_TriggerIsZeroTime)
+ on_settingViewTriggerIsZeroTime_changed(value);
+}
+
+void View::trigger_event(int segment_id, util::Timestamp location)
+{
+ // TODO This doesn't work if we're showing multiple segments at once
+ if ((uint32_t)segment_id != current_segment_)
+ return;
+
+ // Set zero location if the Key_View_TriggerIsZeroTime setting is set and
+ // if this is the first trigger for this segment.
+ GlobalSettings settings;
+ bool trigger_is_zero_time = settings.value(GlobalSettings::Key_View_TriggerIsZeroTime).toBool();
+
+ size_t trigger_count = session_.get_triggers(current_segment_).size();
+
+ if (trigger_is_zero_time && trigger_count == 1)
+ set_zero_position(location);
+