mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 04:06:26 +01:00
Remove the temporary note group in MidiRegionView, update start trim during drag.
This commit is contained in:
parent
43bdfa7197
commit
6e49ca61a4
3 changed files with 7 additions and 26 deletions
|
|
@ -2856,7 +2856,6 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
|
||||||
|
|
||||||
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
|
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
|
||||||
RegionView* rv = i->view;
|
RegionView* rv = i->view;
|
||||||
rv->enable_display (false);
|
|
||||||
rv->region()->playlist()->clear_owned_changes ();
|
rv->region()->playlist()->clear_owned_changes ();
|
||||||
|
|
||||||
if (_operation == StartTrim) {
|
if (_operation == StartTrim) {
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,6 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
||||||
, _step_edit_cursor_width (1.0)
|
, _step_edit_cursor_width (1.0)
|
||||||
, _step_edit_cursor_position (0.0)
|
, _step_edit_cursor_position (0.0)
|
||||||
, _channel_selection_scoped_note (0)
|
, _channel_selection_scoped_note (0)
|
||||||
, _temporary_note_group (0)
|
|
||||||
, _mouse_state(None)
|
, _mouse_state(None)
|
||||||
, _pressed_button(0)
|
, _pressed_button(0)
|
||||||
, _sort_needed (true)
|
, _sort_needed (true)
|
||||||
|
|
@ -155,7 +154,6 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
||||||
, _step_edit_cursor_width (1.0)
|
, _step_edit_cursor_width (1.0)
|
||||||
, _step_edit_cursor_position (0.0)
|
, _step_edit_cursor_position (0.0)
|
||||||
, _channel_selection_scoped_note (0)
|
, _channel_selection_scoped_note (0)
|
||||||
, _temporary_note_group (0)
|
|
||||||
, _mouse_state(None)
|
, _mouse_state(None)
|
||||||
, _pressed_button(0)
|
, _pressed_button(0)
|
||||||
, _sort_needed (true)
|
, _sort_needed (true)
|
||||||
|
|
@ -204,7 +202,6 @@ MidiRegionView::MidiRegionView (const MidiRegionView& other)
|
||||||
, _step_edit_cursor_width (1.0)
|
, _step_edit_cursor_width (1.0)
|
||||||
, _step_edit_cursor_position (0.0)
|
, _step_edit_cursor_position (0.0)
|
||||||
, _channel_selection_scoped_note (0)
|
, _channel_selection_scoped_note (0)
|
||||||
, _temporary_note_group (0)
|
|
||||||
, _mouse_state(None)
|
, _mouse_state(None)
|
||||||
, _pressed_button(0)
|
, _pressed_button(0)
|
||||||
, _sort_needed (true)
|
, _sort_needed (true)
|
||||||
|
|
@ -237,7 +234,6 @@ MidiRegionView::MidiRegionView (const MidiRegionView& other, boost::shared_ptr<M
|
||||||
, _step_edit_cursor_width (1.0)
|
, _step_edit_cursor_width (1.0)
|
||||||
, _step_edit_cursor_position (0.0)
|
, _step_edit_cursor_position (0.0)
|
||||||
, _channel_selection_scoped_note (0)
|
, _channel_selection_scoped_note (0)
|
||||||
, _temporary_note_group (0)
|
|
||||||
, _mouse_state(None)
|
, _mouse_state(None)
|
||||||
, _pressed_button(0)
|
, _pressed_button(0)
|
||||||
, _sort_needed (true)
|
, _sort_needed (true)
|
||||||
|
|
@ -1402,7 +1398,6 @@ MidiRegionView::~MidiRegionView ()
|
||||||
delete _note_group;
|
delete _note_group;
|
||||||
delete _note_diff_command;
|
delete _note_diff_command;
|
||||||
delete _step_edit_cursor;
|
delete _step_edit_cursor;
|
||||||
delete _temporary_note_group;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1421,10 +1416,13 @@ MidiRegionView::region_resized (const PropertyChange& what_changed)
|
||||||
what_changed.contains (ARDOUR::Properties::position)) {
|
what_changed.contains (ARDOUR::Properties::position)) {
|
||||||
_source_relative_time_converter.set_origin_b (_region->position() - _region->start());
|
_source_relative_time_converter.set_origin_b (_region->position() - _region->start());
|
||||||
}
|
}
|
||||||
/* catch an end trim so we can live update */
|
/* catch end and start trim so we can update the view*/
|
||||||
if (!what_changed.contains (ARDOUR::Properties::start) &&
|
if (!what_changed.contains (ARDOUR::Properties::start) &&
|
||||||
what_changed.contains (ARDOUR::Properties::length)) {
|
what_changed.contains (ARDOUR::Properties::length)) {
|
||||||
enable_display (true);
|
enable_display (true);
|
||||||
|
} else if (what_changed.contains (ARDOUR::Properties::start) &&
|
||||||
|
what_changed.contains (ARDOUR::Properties::length)) {
|
||||||
|
enable_display (true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3980,29 +3978,18 @@ MidiRegionView::data_recorded (boost::weak_ptr<MidiSource> w)
|
||||||
void
|
void
|
||||||
MidiRegionView::trim_front_starting ()
|
MidiRegionView::trim_front_starting ()
|
||||||
{
|
{
|
||||||
/* Reparent the note group to the region view's parent, so that it doesn't change
|
/* We used to eparent the note group to the region view's parent, so that it didn't change.
|
||||||
when the region view is trimmed.
|
now we update it.
|
||||||
*/
|
*/
|
||||||
_temporary_note_group = new ArdourCanvas::Container (group->parent ());
|
|
||||||
_temporary_note_group->move (group->position ());
|
|
||||||
_note_group->reparent (_temporary_note_group);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MidiRegionView::trim_front_ending ()
|
MidiRegionView::trim_front_ending ()
|
||||||
{
|
{
|
||||||
_note_group->reparent (group);
|
|
||||||
delete _temporary_note_group;
|
|
||||||
_temporary_note_group = 0;
|
|
||||||
|
|
||||||
if (_region->start() < 0) {
|
if (_region->start() < 0) {
|
||||||
/* Trim drag made start time -ve; fix this */
|
/* Trim drag made start time -ve; fix this */
|
||||||
midi_region()->fix_negative_start ();
|
midi_region()->fix_negative_start ();
|
||||||
}
|
}
|
||||||
/* until _start is modified on the fly during front trim,
|
|
||||||
we have to redisplay the model when a start trim has finished.
|
|
||||||
*/
|
|
||||||
enable_display (true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -427,11 +427,6 @@ private:
|
||||||
Evoral::Beats _step_edit_cursor_position;
|
Evoral::Beats _step_edit_cursor_position;
|
||||||
NoteBase* _channel_selection_scoped_note;
|
NoteBase* _channel_selection_scoped_note;
|
||||||
|
|
||||||
/** A group used to temporarily reparent _note_group to during start trims, so
|
|
||||||
* that the notes don't move with the parent region view.
|
|
||||||
*/
|
|
||||||
ArdourCanvas::Container* _temporary_note_group;
|
|
||||||
|
|
||||||
MouseState _mouse_state;
|
MouseState _mouse_state;
|
||||||
int _pressed_button;
|
int _pressed_button;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue