<menu action="MarkerMenu">
<menuitem action='add-location-from-playhead'/>
<menuitem action='remove-location-from-playhead'/>
+ <menuitem action='toggle-location-at-playhead'/>
<separator/>
<menuitem action='goto-mark-1'/>
<menuitem action='goto-mark-2'/>
void set_loop_range (framepos_t start, framepos_t end, std::string cmd);
void set_punch_range (framepos_t start, framepos_t end, std::string cmd);
+ void toggle_location_at_playhead_cursor ();
void add_location_from_playhead_cursor ();
+ bool do_remove_location_at_playhead_cursor ();
void remove_location_at_playhead_cursor ();
bool select_new_marker;
reg_sens (editor_actions, "set-session-start-from-playhead", _("Set Session Start from Playhead"), sigc::mem_fun(*this, &Editor::set_session_start_from_playhead));
reg_sens (editor_actions, "set-session-end-from-playhead", _("Set Session End from Playhead"), sigc::mem_fun(*this, &Editor::set_session_end_from_playhead));
+ reg_sens (editor_actions, "toggle-location-at-playhead", _("Toggle Mark at Playhead"), sigc::mem_fun(*this, &Editor::toggle_location_at_playhead_cursor));
reg_sens (editor_actions, "add-location-from-playhead", _("Add Mark from Playhead"), sigc::mem_fun(*this, &Editor::add_location_from_playhead_cursor));
reg_sens (editor_actions, "alternate-add-location-from-playhead", _("Add Mark from Playhead"), sigc::mem_fun(*this, &Editor::add_location_from_playhead_cursor));
_session->set_end_is_free (false);
}
+
+void
+Editor::toggle_location_at_playhead_cursor ()
+{
+ if (!do_remove_location_at_playhead_cursor())
+ {
+ add_location_from_playhead_cursor();
+ }
+}
+
void
Editor::add_location_from_playhead_cursor ()
{
add_location_mark (_session->audible_frame());
}
-void
-Editor::remove_location_at_playhead_cursor ()
+bool
+Editor::do_remove_location_at_playhead_cursor ()
{
+ bool removed = false;
if (_session) {
//set up for undo
XMLNode &before = _session->locations()->get_state();
- bool removed = false;
//find location(s) at this time
Locations::LocationList locs;
commit_reversible_command ();
}
}
+ return removed;
+}
+
+void
+Editor::remove_location_at_playhead_cursor ()
+{
+ do_remove_location_at_playhead_cursor ();
}
/** Add a range marker around each selected region */