summaryrefslogtreecommitdiff
path: root/gtk2_ardour/region_editor.cc
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2015-07-16 16:13:24 -0500
committerBen Loftis <ben@harrisonconsoles.com>2015-07-16 16:13:24 -0500
commit46c83693284ece4a732d26e62113ea4ac584d539 (patch)
tree6e191e809b84b1c4d2aa36af6e8878996a109332 /gtk2_ardour/region_editor.cc
parentedce75973c076ab1fa66cc6d601a30fcbbcd5dd4 (diff)
parentd9c0aa4236796d981a5d939bbc5d0d5a2e1910fe (diff)
merge fix
Diffstat (limited to 'gtk2_ardour/region_editor.cc')
-rw-r--r--gtk2_ardour/region_editor.cc33
1 files changed, 22 insertions, 11 deletions
diff --git a/gtk2_ardour/region_editor.cc b/gtk2_ardour/region_editor.cc
index 16888fb688..e41e012ce6 100644
--- a/gtk2_ardour/region_editor.cc
+++ b/gtk2_ardour/region_editor.cc
@@ -270,33 +270,41 @@ RegionEditor::connect_editor_events ()
void
RegionEditor::position_clock_changed ()
{
- PublicEditor::instance().begin_reversible_command (_("change region start position"));
-
+ bool in_command = false;
boost::shared_ptr<Playlist> pl = _region->playlist();
if (pl) {
+ PublicEditor::instance().begin_reversible_command (_("change region start position"));
+ in_command = true;
+
_region->clear_changes ();
_region->set_position (position_clock.current_time());
_session->add_command(new StatefulDiffCommand (_region));
}
- PublicEditor::instance().commit_reversible_command ();
+ if (in_command) {
+ PublicEditor::instance().commit_reversible_command ();
+ }
}
void
RegionEditor::end_clock_changed ()
{
- PublicEditor::instance().begin_reversible_command (_("change region end position"));
-
+ bool in_command = false;
boost::shared_ptr<Playlist> pl = _region->playlist();
if (pl) {
+ PublicEditor::instance().begin_reversible_command (_("change region end position"));
+ in_command = true;
+
_region->clear_changes ();
_region->trim_end (end_clock.current_time());
_session->add_command(new StatefulDiffCommand (_region));
}
- PublicEditor::instance().commit_reversible_command ();
+ if (in_command) {
+ PublicEditor::instance().commit_reversible_command ();
+ }
end_clock.set (_region->position() + _region->length() - 1, true);
}
@@ -305,18 +313,21 @@ void
RegionEditor::length_clock_changed ()
{
framecnt_t frames = length_clock.current_time();
-
- PublicEditor::instance().begin_reversible_command (_("change region length"));
-
+ bool in_command = false;
boost::shared_ptr<Playlist> pl = _region->playlist();
if (pl) {
- _region->clear_changes ();
+ PublicEditor::instance().begin_reversible_command (_("change region length"));
+ in_command = true;
+
+ _region->clear_changes ();
_region->trim_end (_region->position() + frames - 1);
_session->add_command(new StatefulDiffCommand (_region));
}
- PublicEditor::instance().commit_reversible_command ();
+ if (in_command) {
+ PublicEditor::instance().commit_reversible_command ();
+ }
length_clock.set (_region->length());
}