don't always adjust note range in a MidiView after a model change
This commit is contained in:
@@ -1063,6 +1063,8 @@ AutomationLine::get_inverted_selectables (Selection&, list<Selectable*>& /*resul
|
||||
void
|
||||
AutomationLine::set_selected_points (PointSelection const & points)
|
||||
{
|
||||
std::cerr << this << " AL::ssp\n";
|
||||
|
||||
for (auto & cp : control_points) {
|
||||
cp->set_selected (false);
|
||||
}
|
||||
|
||||
@@ -1096,8 +1096,6 @@ MidiView::model_changed()
|
||||
|
||||
NoteBase* cne;
|
||||
|
||||
std::cerr << "Now looking at a model with " << notes.size() << std::endl;
|
||||
|
||||
if (_midi_context.visibility_range_style() == MidiViewBackground::ContentsRange) {
|
||||
|
||||
uint8_t low_note = std::numeric_limits<uint8_t>::max();
|
||||
@@ -1112,7 +1110,7 @@ MidiView::model_changed()
|
||||
}
|
||||
}
|
||||
|
||||
set_note_range (low_note, hi_note);
|
||||
maybe_set_note_range (low_note, hi_note);
|
||||
}
|
||||
|
||||
for (MidiModel::Notes::iterator n = notes.begin(); n != notes.end(); ++n) {
|
||||
@@ -5155,6 +5153,12 @@ MidiView::set_note_range (uint8_t low, uint8_t high)
|
||||
_midi_context.apply_note_range (low, high, true);
|
||||
}
|
||||
|
||||
void
|
||||
MidiView::maybe_set_note_range (uint8_t low, uint8_t high)
|
||||
{
|
||||
_midi_context.maybe_apply_note_range (low, high, true);
|
||||
}
|
||||
|
||||
void
|
||||
MidiView::set_visibility_note_range (MidiViewBackground::VisibleNoteRange nvr, bool)
|
||||
{
|
||||
|
||||
@@ -323,6 +323,7 @@ class MidiView : public virtual sigc::trackable, public LineMerger
|
||||
void show_list_editor ();
|
||||
|
||||
void set_note_range (uint8_t low, uint8_t high);
|
||||
void maybe_set_note_range (uint8_t low, uint8_t high);
|
||||
virtual void set_visibility_note_range (MidiViewBackground::VisibleNoteRange, bool);
|
||||
|
||||
typedef std::set<NoteBase*> Selection;
|
||||
|
||||
@@ -232,11 +232,24 @@ MidiViewBackground::maybe_extend_note_range (uint8_t note_num)
|
||||
apply_note_range (_data_note_min, _data_note_max, true);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MidiViewBackground::maybe_apply_note_range (uint8_t lowest, uint8_t highest, bool to_children)
|
||||
{
|
||||
if (_lowest_note <= lowest && _highest_note >= highest) {
|
||||
/* already large enough */
|
||||
return;
|
||||
}
|
||||
|
||||
apply_note_range (lowest, highest, to_children);
|
||||
}
|
||||
|
||||
void
|
||||
MidiViewBackground::apply_note_range (uint8_t lowest, uint8_t highest, bool to_children)
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
|
||||
if (_highest_note != highest) {
|
||||
_highest_note = highest;
|
||||
changed = true;
|
||||
|
||||
@@ -91,6 +91,7 @@ class MidiViewBackground : public virtual ViewBackground
|
||||
|
||||
sigc::signal<void> NoteRangeChanged;
|
||||
void apply_note_range (uint8_t lowest, uint8_t highest, bool to_children);
|
||||
void maybe_apply_note_range (uint8_t lowest, uint8_t highest, bool to_children);
|
||||
|
||||
/** @return y position, or -1 if hidden */
|
||||
virtual double y_position () const { return 0.; }
|
||||
|
||||
Reference in New Issue
Block a user