summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_ops.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-05-01 18:10:56 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-05-01 18:10:56 +0000
commit18048013beed99eab8b97738f29662a7aea01602 (patch)
tree31bf0f154a9aba55ea9f452231f2a1d09399b811 /gtk2_ardour/editor_ops.cc
parente4fceee69f66a62e0a706c1be4159c8953aa046d (diff)
allow insert-time to move markers too
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3301 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r--gtk2_ardour/editor_ops.cc36
1 files changed, 32 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index a67a5f4557..1884bac9ec 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -5739,7 +5739,8 @@ Editor::do_insert_time ()
RadioButton move_button (group, _("Move"));
RadioButton split_button (group, _("Split & Later Section Moves"));
Label intersect_option_label (_("Intersected regions should:"));
- ToggleButton glue_button (_("Move Glued Regions"));
+ CheckButton glue_button (_("Move Glued Regions"));
+ CheckButton marker_button (_("Move Markers"));
AudioClock clock ("insertTimeClock", true, X_("InsertTimeClock"), true, true, true);
HBox clock_box;
@@ -5753,6 +5754,7 @@ Editor::do_insert_time ()
option_box.pack_start (intersect_option_label, false, false);
option_box.pack_start (button_box, false, false);
option_box.pack_start (glue_button, false, false);
+ option_box.pack_start (marker_button, false, false);
button_box.pack_start (leave_button, false, false);
button_box.pack_start (move_button, false, false);
@@ -5771,6 +5773,7 @@ Editor::do_insert_time ()
glue_button.show ();
clock.show_all();
clock_box.show ();
+ marker_button.show ();
d.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
d.add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK);
@@ -5798,11 +5801,12 @@ Editor::do_insert_time ()
opt = SplitIntersected;
}
- insert_time (pos, distance, opt, glue_button.get_active());
+ insert_time (pos, distance, opt, glue_button.get_active(), marker_button.get_active());
}
-
+
void
-Editor::insert_time (nframes64_t pos, nframes64_t frames, InsertTimeOption opt, bool ignore_music_glue)
+Editor::insert_time (nframes64_t pos, nframes64_t frames, InsertTimeOption opt,
+ bool ignore_music_glue, bool markers_too)
{
bool commit = false;
@@ -5833,6 +5837,30 @@ Editor::insert_time (nframes64_t pos, nframes64_t frames, InsertTimeOption opt,
commit = true;
}
+ if (markers_too) {
+ bool moved = false;
+ XMLNode& before (session->locations()->get_state());
+ Locations::LocationList copy (session->locations()->list());
+
+ for (Locations::LocationList::iterator i = copy.begin(); i != copy.end(); ++i) {
+
+ Locations::LocationList::const_iterator tmp;
+
+ if ((*i)->start() >= pos) {
+ (*i)->set_start ((*i)->start() + frames);
+ if (!(*i)->is_mark()) {
+ (*i)->set_start ((*i)->end() + frames);
+ }
+ moved = true;
+ }
+ }
+
+ if (moved) {
+ XMLNode& after (session->locations()->get_state());
+ session->add_command (new MementoCommand<Locations>(*session->locations(), &before, &after));
+ }
+ }
+
if (commit) {
commit_reversible_command ();
}