call a spade a spade (or rather, a MidiView a view)
This commit is contained in:
@@ -1780,7 +1780,7 @@ EditingContext::popup_note_context_menu (ArdourCanvas::Item* item, GdkEvent* eve
|
||||
popping up the menu will cause a region leave event which clears
|
||||
entered_regionview. */
|
||||
|
||||
MidiView& mrv = note->region_view();
|
||||
MidiView& mrv = note->midi_view();
|
||||
const RegionSelection rs = region_selection ();
|
||||
const uint32_t sel_size = mrv.selection_size ();
|
||||
|
||||
|
||||
@@ -2394,7 +2394,7 @@ NoteResizeDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*ignored*/)
|
||||
|
||||
Drag::start_grab (event, cursor);
|
||||
|
||||
midi_view = &cnote->region_view ();
|
||||
midi_view = &cnote->midi_view ();
|
||||
|
||||
double temp;
|
||||
temp = midi_view->snap_to_pixel (cnote->x0 (), true);
|
||||
@@ -6130,7 +6130,7 @@ NoteDrag::NoteDrag (EditingContext& ec, ArdourCanvas::Item* i)
|
||||
|
||||
_primary = reinterpret_cast<NoteBase*> (_item->get_data ("notebase"));
|
||||
assert (_primary);
|
||||
_view = &_primary->region_view ();
|
||||
_view = &_primary->midi_view ();
|
||||
_note_height = _view->midi_context().note_height ();
|
||||
}
|
||||
|
||||
|
||||
@@ -512,9 +512,9 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
|
||||
if (press && event->button.button == 3) {
|
||||
NoteBase* cnote = reinterpret_cast<NoteBase*> (item->get_data ("notebase"));
|
||||
assert (cnote);
|
||||
if (cnote->region_view().selection_size() == 0 || !cnote->selected()) {
|
||||
if (cnote->midi_view().selection_size() == 0 || !cnote->selected()) {
|
||||
selection->clear_points();
|
||||
cnote->region_view().unique_select (cnote);
|
||||
cnote->midi_view().unique_select (cnote);
|
||||
/* we won't get the release, so store the selection change now */
|
||||
begin_reversible_selection_op (X_("Button 3 Note Selection"));
|
||||
commit_reversible_selection_op ();
|
||||
@@ -2361,7 +2361,7 @@ Editor::remove_midi_note (ArdourCanvas::Item* item, GdkEvent *)
|
||||
NoteBase* e = reinterpret_cast<NoteBase*> (item->get_data ("notebase"));
|
||||
assert (e);
|
||||
|
||||
e->region_view().delete_note (e->note ());
|
||||
e->midi_view().delete_note (e->note ());
|
||||
}
|
||||
|
||||
/** Obtain the pointer position in canvas coordinates */
|
||||
|
||||
@@ -67,8 +67,8 @@ NoteBase::set_colors ()
|
||||
color_modifier = UIConfiguration::instance().modifier ("midi note");
|
||||
}
|
||||
|
||||
NoteBase::NoteBase(MidiView& region, bool with_events, const std::shared_ptr<NoteType> note)
|
||||
: _region(region)
|
||||
NoteBase::NoteBase(MidiView& v, bool with_events, const std::shared_ptr<NoteType> note)
|
||||
: _view (v)
|
||||
, _item (0)
|
||||
, _text(0)
|
||||
, _state(None)
|
||||
@@ -87,7 +87,7 @@ NoteBase::NoteBase(MidiView& region, bool with_events, const std::shared_ptr<Not
|
||||
|
||||
NoteBase::~NoteBase()
|
||||
{
|
||||
_region.note_deleted (this);
|
||||
_view.note_deleted (this);
|
||||
|
||||
delete _text;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ NoteBase::set_selected(bool selected)
|
||||
uint32_t
|
||||
NoteBase::base_color ()
|
||||
{
|
||||
return base_color (_note->velocity(), _region.midi_context().color_mode(), _region.midi_context().region_color(), _note->channel(), selected());
|
||||
return base_color (_note->velocity(), _view.midi_context().color_mode(), _view.midi_context().region_color(), _note->channel(), selected());
|
||||
}
|
||||
|
||||
uint32_t
|
||||
@@ -274,12 +274,12 @@ NoteBase::set_mouse_fractions (GdkEvent* ev)
|
||||
|
||||
if (notify) {
|
||||
if (big_enough_to_trim()) {
|
||||
_region.note_mouse_position (_mouse_x_fraction, _mouse_y_fraction, set_cursor);
|
||||
_view.note_mouse_position (_mouse_x_fraction, _mouse_y_fraction, set_cursor);
|
||||
} else {
|
||||
/* pretend the mouse is in the middle, because this is not big enough
|
||||
to trim right now.
|
||||
*/
|
||||
_region.note_mouse_position (0.5, 0.5, set_cursor);
|
||||
_view.note_mouse_position (0.5, 0.5, set_cursor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -287,13 +287,13 @@ NoteBase::set_mouse_fractions (GdkEvent* ev)
|
||||
bool
|
||||
NoteBase::event_handler (GdkEvent* ev)
|
||||
{
|
||||
EditingContext& editor = _region.editing_context();
|
||||
EditingContext& editor = _view.editing_context();
|
||||
if (!editor.internal_editing()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
RegionView* rv;
|
||||
if ((rv = dynamic_cast<RegionView*> (&_region))) {
|
||||
if ((rv = dynamic_cast<RegionView*> (&_view))) {
|
||||
if (rv->get_time_axis_view ().layer_display () == Stacked) {
|
||||
/* only allow edting notes in the topmost layer */
|
||||
if (rv->region()->layer() != rv->region()->playlist()->top_layer ()) {
|
||||
@@ -305,13 +305,13 @@ NoteBase::event_handler (GdkEvent* ev)
|
||||
|
||||
switch (ev->type) {
|
||||
case GDK_ENTER_NOTIFY:
|
||||
_region.note_entered (this);
|
||||
_view.note_entered (this);
|
||||
set_mouse_fractions (ev);
|
||||
break;
|
||||
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
set_mouse_fractions (ev);
|
||||
_region.note_left (this);
|
||||
_view.note_left (this);
|
||||
break;
|
||||
|
||||
case GDK_MOTION_NOTIFY:
|
||||
|
||||
@@ -111,7 +111,7 @@ class NoteBase : public sigc::trackable
|
||||
float mouse_y_fraction() const { return _mouse_y_fraction; }
|
||||
|
||||
const std::shared_ptr<NoteType> note() const { return _note; }
|
||||
MidiView& region_view() const { return _region; }
|
||||
MidiView& midi_view() const { return _view; }
|
||||
|
||||
static void set_colors ();
|
||||
|
||||
@@ -135,7 +135,7 @@ class NoteBase : public sigc::trackable
|
||||
protected:
|
||||
enum State { None, Pressed, Dragging };
|
||||
|
||||
MidiView& _region;
|
||||
MidiView& _view;
|
||||
ArdourCanvas::Item* _item;
|
||||
ArdourCanvas::Text* _text;
|
||||
State _state;
|
||||
|
||||
Reference in New Issue
Block a user