diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-11-09 03:36:24 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-11-09 03:36:24 +0000 |
commit | 96fa1cd0b636d47d4b0787281fc9401693a77af9 (patch) | |
tree | a722434f290aab01b28b090f5b20bda0d7ad15cd /gtk2_ardour/editor_markers.cc | |
parent | a8d2605f9a6f48f3afb09c212de9486c75856287 (diff) |
the edit cursor is dead, long live the edit point; plus a few fixes; plus location locking
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2610 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r-- | gtk2_ardour/editor_markers.cc | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 6d09dc6135..772e5fd038 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -299,6 +299,14 @@ Editor::mouse_add_new_marker (nframes_t where) XMLNode &after = session->locations()->get_state(); session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after)); session->commit_reversible_command (); + + /* find the marker we just added */ + + LocationMarkers *lam = find_location_markers (location); + if (lam) { + /* make it the selected marker */ + selection->set (lam->start); + } } } @@ -464,17 +472,21 @@ Editor::build_marker_menu (bool start_or_end) MenuList& items = markerMenu->items(); markerMenu->set_name ("ArdourContextMenu"); - items.push_back (MenuElem (_("Locate to Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead))); - items.push_back (MenuElem (_("Play from Mark"), mem_fun(*this, &Editor::marker_menu_play_from))); - items.push_back (MenuElem (_("Set Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead))); + items.push_back (MenuElem (_("Locate to here"), mem_fun(*this, &Editor::marker_menu_set_playhead))); + items.push_back (MenuElem (_("Play from here"), mem_fun(*this, &Editor::marker_menu_play_from))); + items.push_back (MenuElem (_("Move Mark to Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead))); items.push_back (SeparatorElem()); - items.push_back (MenuElem (_("Hide Mark"), mem_fun(*this, &Editor::marker_menu_hide))); + items.push_back (MenuElem (_("Hide"), mem_fun(*this, &Editor::marker_menu_hide))); if (start_or_end) return; - items.push_back (MenuElem (_("Rename Mark"), mem_fun(*this, &Editor::marker_menu_rename))); - items.push_back (MenuElem (_("Remove Mark"), mem_fun(*this, &Editor::marker_menu_remove))); + items.push_back (MenuElem (_("Rename"), mem_fun(*this, &Editor::marker_menu_rename))); + items.push_back (MenuElem (_("Lock"), bind (mem_fun(*this, &Editor::marker_menu_lock), true))); + items.push_back (MenuElem (_("Unlock"), bind (mem_fun(*this, &Editor::marker_menu_lock), false))); + items.push_back (SeparatorElem()); + + items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::marker_menu_remove))); } void @@ -838,6 +850,31 @@ Editor::marker_menu_remove () } void +Editor::marker_menu_lock (bool yn) +{ + + Marker* marker; + + if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) { + fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg; + /*NOTREACHED*/ + } + + Location* loc; + bool ignored; + + loc = find_location_from_marker (marker, ignored); + + if (!loc) return; + + if (yn) { + loc->lock(); + } else { + loc->unlock (); + } +} + +void Editor::marker_menu_rename () { Marker* marker; |