mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-05 05:05:43 +01:00
just one timeout callback for step editing, not one per track
git-svn-id: svn://localhost/ardour2/branches/3.0@5635 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
b7fe417f70
commit
c3c5c9a559
6 changed files with 34 additions and 8 deletions
|
|
@ -5087,3 +5087,27 @@ Editor::hide_region_from_region_list ()
|
|||
_regions->selection_mapover (mem_fun (*this, &Editor::hide_a_region));
|
||||
}
|
||||
|
||||
void
|
||||
Editor::start_step_editing ()
|
||||
{
|
||||
step_edit_connection = Glib::signal_timeout().connect (mem_fun (*this, &Editor::check_step_edit), 20);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::stop_step_editing ()
|
||||
{
|
||||
step_edit_connection.disconnect ();
|
||||
}
|
||||
|
||||
bool
|
||||
Editor::check_step_edit ()
|
||||
{
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*> (*i);
|
||||
if (mtv) {
|
||||
mtv->check_step_edit ();
|
||||
}
|
||||
}
|
||||
|
||||
return true; // do it again, till we stop
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2034,6 +2034,11 @@ public:
|
|||
EditorGroupTabs* _group_tabs;
|
||||
void fit_route_group (ARDOUR::RouteGroup *);
|
||||
|
||||
void start_step_editing ();
|
||||
void stop_step_editing ();
|
||||
bool check_step_edit ();
|
||||
sigc::connection step_edit_connection;
|
||||
|
||||
friend class Drag;
|
||||
friend class RegionDrag;
|
||||
friend class RegionMoveDrag;
|
||||
|
|
|
|||
|
|
@ -2565,10 +2565,12 @@ Editor::set_internal_edit (bool yn)
|
|||
mtv->start_step_editing ();
|
||||
}
|
||||
}
|
||||
start_step_editing ();
|
||||
|
||||
} else {
|
||||
|
||||
mouse_select_button.set_image (*(manage (new Image (::get_xpm("tool_range.xpm")))));
|
||||
stop_step_editing ();
|
||||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*> (*i);
|
||||
|
|
|
|||
|
|
@ -2252,7 +2252,6 @@ MidiRegionView::add_note (uint8_t channel, uint8_t number, uint8_t velocity,
|
|||
nframes64_t region_end = _region->position() + _region->length() - 1;
|
||||
|
||||
if (end_frame > region_end) {
|
||||
cerr << "Resize region!\n";
|
||||
_region->set_length (end_frame, this);
|
||||
} else {
|
||||
redisplay_model ();
|
||||
|
|
|
|||
|
|
@ -562,7 +562,6 @@ MidiTimeAxisView::route_active_changed ()
|
|||
void
|
||||
MidiTimeAxisView::start_step_editing ()
|
||||
{
|
||||
step_edit_connection = Glib::signal_timeout().connect (mem_fun (*this, &MidiTimeAxisView::check_step_edit), 20);
|
||||
step_edit_insert_position = _editor.get_preferred_edit_position ();
|
||||
step_edit_beat_pos = 0;
|
||||
step_edit_region = playlist()->top_region_at (step_edit_insert_position);
|
||||
|
|
@ -580,11 +579,10 @@ MidiTimeAxisView::start_step_editing ()
|
|||
void
|
||||
MidiTimeAxisView::stop_step_editing ()
|
||||
{
|
||||
step_edit_connection.disconnect ();
|
||||
midi_track()->set_step_editing (false);
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
MidiTimeAxisView::check_step_edit ()
|
||||
{
|
||||
MidiRingBuffer<nframes_t>& incoming (midi_track()->step_edit_ring_buffer());
|
||||
|
|
@ -641,8 +639,6 @@ MidiTimeAxisView::check_step_edit ()
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
return true; /* keep checking */
|
||||
}
|
||||
|
||||
boost::shared_ptr<Region>
|
||||
|
|
|
|||
|
|
@ -90,6 +90,8 @@ class MidiTimeAxisView : public RouteTimeAxisView
|
|||
|
||||
void start_step_editing ();
|
||||
void stop_step_editing ();
|
||||
void check_step_edit ();
|
||||
|
||||
|
||||
private:
|
||||
sigc::signal<void, std::string, std::string> _midi_patch_settings_changed;
|
||||
|
|
@ -127,14 +129,12 @@ class MidiTimeAxisView : public RouteTimeAxisView
|
|||
Gtk::ComboBoxText _custom_device_mode_selector;
|
||||
|
||||
Gtk::CheckMenuItem* _step_edit_item;
|
||||
sigc::connection step_edit_connection;
|
||||
|
||||
nframes64_t step_edit_insert_position;
|
||||
Evoral::MusicalTime step_edit_beat_pos;
|
||||
boost::shared_ptr<ARDOUR::Region> step_edit_region;
|
||||
MidiRegionView* step_edit_region_view;
|
||||
|
||||
bool check_step_edit ();
|
||||
};
|
||||
|
||||
#endif /* __ardour_midi_time_axis_h__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue