reverse logic in plugin GUI key handling
[ardour.git] / gtk2_ardour / location_ui.cc
index 689706ba01bb141e32027b980da4ab9bb94b9ef4..f56006e5ceb0b26ff8797ce6fc81371197ea796d 100644 (file)
@@ -33,6 +33,7 @@
 #include "location_ui.h"
 #include "prompter.h"
 #include "utils.h"
+#include "public_editor.h"
 
 #include "i18n.h"
 
@@ -838,7 +839,9 @@ LocationUI::LocationUI ()
 
 LocationUI::~LocationUI()
 {
-        delete _clock_group;
+       loop_edit_row.unset_clock_group ();
+       punch_edit_row.unset_clock_group ();
+       delete _clock_group;
 }
 
 gint
@@ -853,12 +856,12 @@ LocationUI::do_location_remove (ARDOUR::Location *loc)
                return FALSE;
        }
 
-       _session->begin_reversible_command (_("remove marker"));
+       PublicEditor::instance().begin_reversible_command (_("remove marker"));
        XMLNode &before = _session->locations()->get_state();
        _session->locations()->remove (loc);
        XMLNode &after = _session->locations()->get_state();
        _session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after));
-       _session->commit_reversible_command ();
+       PublicEditor::instance().commit_reversible_command ();
 
        return FALSE;
 }
@@ -1014,15 +1017,15 @@ LocationUI::add_new_location()
                framepos_t where = _session->audible_frame();
                _session->locations()->next_available_name(markername,"mark");
                Location *location = new Location (*_session, where, where, markername, Location::IsMark);
-               if (Config->get_name_new_markers()) {
+               if (ARDOUR_UI::config()->get_name_new_markers()) {
                        newest_location = location;
                }
-               _session->begin_reversible_command (_("add marker"));
+               PublicEditor::instance().begin_reversible_command (_("add marker"));
                XMLNode &before = _session->locations()->get_state();
                _session->locations()->add (location, true);
                XMLNode &after = _session->locations()->get_state();
                _session->add_command (new MementoCommand<Locations>(*(_session->locations()), &before, &after));
-               _session->commit_reversible_command ();
+               PublicEditor::instance().commit_reversible_command ();
        }
 
 }
@@ -1036,12 +1039,12 @@ LocationUI::add_new_range()
                framepos_t where = _session->audible_frame();
                _session->locations()->next_available_name(rangename,"unnamed");
                Location *location = new Location (*_session, where, where, rangename, Location::IsRangeMarker);
-               _session->begin_reversible_command (_("add range marker"));
+               PublicEditor::instance().begin_reversible_command (_("add range marker"));
                XMLNode &before = _session->locations()->get_state();
                _session->locations()->add (location, true);
                XMLNode &after = _session->locations()->get_state();
                _session->add_command (new MementoCommand<Locations>(*(_session->locations()), &before, &after));
-               _session->commit_reversible_command ();
+               PublicEditor::instance().commit_reversible_command ();
        }
 }