mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Expose EditorCursor via public editor API
This is in preparation to subscribe to playhead cursor position changes in the recorder-UI. This change also clean up the API, replacing a public variable with a const access method and follows #12 of https://ardour.org/styleguide.html
This commit is contained in:
parent
8ba7df9105
commit
4769c387f3
9 changed files with 99 additions and 92 deletions
|
|
@ -119,7 +119,7 @@ EditorSummary::set_session (Session* s)
|
|||
if (_session) {
|
||||
Region::RegionPropertyChanged.connect (region_property_connection, invalidator (*this), boost::bind (&EditorSummary::set_background_dirty, this), gui_context());
|
||||
PresentationInfo::Change.connect (route_ctrl_id_connection, invalidator (*this), boost::bind (&EditorSummary::set_background_dirty, this), gui_context());
|
||||
_editor->playhead_cursor->PositionChanged.connect (position_connection, invalidator (*this), boost::bind (&EditorSummary::playhead_position_changed, this, _1), gui_context());
|
||||
_editor->playhead_cursor()->PositionChanged.connect (position_connection, invalidator (*this), boost::bind (&EditorSummary::playhead_position_changed, this, _1), gui_context());
|
||||
_session->StartTimeChanged.connect (_session_connections, invalidator (*this), boost::bind (&EditorSummary::set_background_dirty, this), gui_context());
|
||||
_session->EndTimeChanged.connect (_session_connections, invalidator (*this), boost::bind (&EditorSummary::set_background_dirty, this), gui_context());
|
||||
_editor->selection->RegionsChanged.connect (sigc::mem_fun(*this, &EditorSummary::set_background_dirty));
|
||||
|
|
@ -301,7 +301,7 @@ EditorSummary::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle
|
|||
double r,g,b,a; Gtkmm2ext::color_to_rgba(_phead_color, r,g,b,a);
|
||||
cairo_set_source_rgb (cr, r,g,b); // playhead color
|
||||
|
||||
const double ph= playhead_sample_to_position (_editor->playhead_cursor->current_sample());
|
||||
const double ph= playhead_sample_to_position (_editor->playhead_cursor ()->current_sample());
|
||||
cairo_move_to (cr, ph, 0);
|
||||
cairo_line_to (cr, ph, get_height());
|
||||
cairo_stroke (cr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue