diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-01-08 17:12:29 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-01-08 17:12:29 +0000 |
commit | 57bafcd1f4277ba9805bfb4ed05b8eaffaa7a5ce (patch) | |
tree | ac0a2f263cce8fa05034018f5cd214cf185a3ea0 /gtk2_ardour/editor_ops.cc | |
parent | caa89c121d8c133d679047d9c21adbb7d139d9a3 (diff) |
save and restore clock modes
git-svn-id: svn://localhost/ardour2/trunk@1283 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index ddcf02911a..e4de1c1e2e 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1197,6 +1197,8 @@ Editor::temporal_zoom_to_frame (bool coarser, nframes_t frame) void Editor::add_location_from_selection () { + string rangename; + if (selection->time.empty()) { return; } @@ -1208,7 +1210,8 @@ Editor::add_location_from_selection () nframes_t start = selection->time[clicked_selection].start; nframes_t end = selection->time[clicked_selection].end; - Location *location = new Location (start, end, "selection", Location::IsRangeMarker); + session->locations()->next_available_name(rangename,"selection"); + Location *location = new Location (start, end, rangename, Location::IsRangeMarker); session->begin_reversible_command (_("add marker")); XMLNode &before = session->locations()->get_state(); @@ -1221,9 +1224,12 @@ Editor::add_location_from_selection () void Editor::add_location_from_playhead_cursor () { + string markername; + nframes_t where = session->audible_frame(); - Location *location = new Location (where, where, "mark", Location::IsMark); + session->locations()->next_available_name(markername,"mark"); + Location *location = new Location (where, where, markername, Location::IsMark); session->begin_reversible_command (_("add marker")); XMLNode &before = session->locations()->get_state(); session->locations()->add (location, true); @@ -1649,6 +1655,7 @@ Editor::set_mark () nframes_t pos; float prefix; bool was_floating; + string markername; if (get_prefix (prefix, was_floating)) { pos = session->audible_frame (); @@ -1660,7 +1667,8 @@ Editor::set_mark () } } - session->locations()->add (new Location (pos, 0, "mark", Location::IsMark), true); + session->locations()->next_available_name(markername,"mark"); + session->locations()->add (new Location (pos, 0, markername, Location::IsMark), true); } void @@ -1709,6 +1717,28 @@ Editor::clear_locations () session->locations()->clear (); } +void +Editor::unhide_markers () +{ + for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) { + Location *l = (*i).first; + if (l->is_hidden() && l->is_mark()) { + l->set_hidden(false, this); + } + } +} + +void +Editor::unhide_ranges () +{ + for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) { + Location *l = (*i).first; + if (l->is_hidden() && l->is_range_marker()) { + l->set_hidden(false, this); + } + } +} + /* INSERT/REPLACE */ void |