mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
get cue editor "full zoom" button working
This commit is contained in:
parent
05a18b0cc6
commit
eafa09099a
4 changed files with 24 additions and 10 deletions
|
|
@ -258,12 +258,6 @@ CueEditor::history_changed ()
|
|||
update_undo_redo_actions (_history);
|
||||
}
|
||||
|
||||
std::pair<Temporal::timepos_t,Temporal::timepos_t>
|
||||
CueEditor::max_zoom_extent() const
|
||||
{
|
||||
return std::make_pair (Temporal::timepos_t (Temporal::Beats()), Temporal::timepos_t (Temporal::Beats (32, 0)));
|
||||
}
|
||||
|
||||
Temporal::timepos_t
|
||||
CueEditor::_get_preferred_edit_position (Editing::EditIgnoreOption ignore, bool from_context_menu, bool from_outside_canvas)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -104,8 +104,6 @@ class CueEditor : public EditingContext, public PBD::HistoryOwner, public sigc::
|
|||
void do_undo (uint32_t n);
|
||||
void do_redo (uint32_t n);
|
||||
|
||||
std::pair<Temporal::timepos_t,Temporal::timepos_t> max_zoom_extent() const;
|
||||
|
||||
Temporal::timepos_t _get_preferred_edit_position (Editing::EditIgnoreOption, bool use_context_click, bool from_outside_canvas);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2054,3 +2054,23 @@ MidiCueEditor::build_zoom_focus_menu ()
|
|||
zoom_focus_selector.set_sizing_texts (zoom_focus_strings);
|
||||
}
|
||||
|
||||
|
||||
std::pair<Temporal::timepos_t,Temporal::timepos_t>
|
||||
MidiCueEditor::max_zoom_extent() const
|
||||
{
|
||||
if (view && view->midi_region()) {
|
||||
return std::make_pair (Temporal::timepos_t (Temporal::Beats()), Temporal::timepos_t (view->midi_region()->midi_source()->length().beats()));
|
||||
}
|
||||
|
||||
return std::make_pair (Temporal::timepos_t (Temporal::Beats()), Temporal::timepos_t (Temporal::Beats (32, 0)));
|
||||
}
|
||||
|
||||
void
|
||||
MidiCueEditor::full_zoom_clicked()
|
||||
{
|
||||
/* XXXX NEED LOCAL TEMPO MAP */
|
||||
|
||||
std::pair<Temporal::timepos_t,Temporal::timepos_t> dur (max_zoom_extent());
|
||||
samplecnt_t s = dur.second.samples() - dur.first.samples();
|
||||
reposition_and_zoom (0, (s / (double) _visible_canvas_width));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ class MidiCueEditor : public CueEditor
|
|||
void set_trigger_length (Temporal::timecnt_t const &);
|
||||
void set_trigger_bounds (Temporal::timepos_t const &, Temporal::timepos_t const &);
|
||||
|
||||
void full_zoom_clicked();
|
||||
|
||||
protected:
|
||||
void register_actions ();
|
||||
|
||||
|
|
@ -264,6 +266,6 @@ class MidiCueEditor : public CueEditor
|
|||
void automation_state_changed ();
|
||||
|
||||
void build_zoom_focus_menu ();
|
||||
|
||||
std::pair<Temporal::timepos_t,Temporal::timepos_t> max_zoom_extent() const;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue