mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
fix interference between timer-based update in CueEditors and scroll-drag
This commit is contained in:
parent
1ff9bf3e86
commit
63db3d3736
4 changed files with 24 additions and 2 deletions
|
|
@ -721,7 +721,7 @@ AudioClipEditor::maybe_update ()
|
||||||
_playhead_cursor->set_position (0);
|
_playhead_cursor->set_position (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (follow_playhead()) {
|
if (_session->transport_rolling() && follow_playhead() && !_scroll_drag) {
|
||||||
reset_x_origin_to_follow_playhead ();
|
reset_x_origin_to_follow_playhead ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,13 @@ CueEditor::CueEditor (std::string const & name, bool with_transport)
|
||||||
, zoom_in_allocate (false)
|
, zoom_in_allocate (false)
|
||||||
, timebar_height (15.)
|
, timebar_height (15.)
|
||||||
, n_timebars (0)
|
, n_timebars (0)
|
||||||
|
, _scroll_drag (false)
|
||||||
{
|
{
|
||||||
_canvas_hscrollbar = manage (new Gtk::HScrollbar (horizontal_adjustment));
|
_canvas_hscrollbar = manage (new Gtk::HScrollbar (horizontal_adjustment));
|
||||||
_canvas_hscrollbar->show ();
|
_canvas_hscrollbar->show ();
|
||||||
|
_canvas_hscrollbar->signal_button_press_event().connect (sigc::mem_fun (*this, &CueEditor::hscroll_press), false);
|
||||||
|
_canvas_hscrollbar->signal_button_release_event().connect (sigc::mem_fun (*this, &CueEditor::hscroll_release), false);
|
||||||
|
|
||||||
horizontal_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &CueEditor::scrolled));
|
horizontal_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &CueEditor::scrolled));
|
||||||
|
|
||||||
_history.Changed.connect (history_connection, invalidator (*this), std::bind (&CueEditor::history_changed, this), gui_context());
|
_history.Changed.connect (history_connection, invalidator (*this), std::bind (&CueEditor::history_changed, this), gui_context());
|
||||||
|
|
@ -68,6 +72,20 @@ CueEditor::~CueEditor ()
|
||||||
delete own_bindings;
|
delete own_bindings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
CueEditor::hscroll_press (GdkEventButton* ev)
|
||||||
|
{
|
||||||
|
_scroll_drag = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
CueEditor::hscroll_release (GdkEventButton* ev)
|
||||||
|
{
|
||||||
|
_scroll_drag = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CueEditor::set_snapped_cursor_position (Temporal::timepos_t const & pos)
|
CueEditor::set_snapped_cursor_position (Temporal::timepos_t const & pos)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -258,5 +258,9 @@ class CueEditor : public EditingContext, public PBD::HistoryOwner
|
||||||
virtual void set_from_rsu (RegionUISettings&);
|
virtual void set_from_rsu (RegionUISettings&);
|
||||||
|
|
||||||
void metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>&, samplepos_t, samplepos_t, gint);
|
void metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>&, samplepos_t, samplepos_t, gint);
|
||||||
|
|
||||||
|
bool _scroll_drag;
|
||||||
|
bool hscroll_press (GdkEventButton*);
|
||||||
|
bool hscroll_release (GdkEventButton*);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -573,7 +573,7 @@ Pianoroll::maybe_update ()
|
||||||
_playhead_cursor->set_position (0);
|
_playhead_cursor->set_position (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (follow_playhead()) {
|
if (_session->transport_rolling() && follow_playhead() && !_scroll_drag) {
|
||||||
reset_x_origin_to_follow_playhead ();
|
reset_x_origin_to_follow_playhead ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue