if (!choose_new_marker_name(markername)) {
return;
}
- Location *location = new Location (*_session, where, where, markername, (Location::Flags) flags);
+ Location *location = new Location (*_session, where, where, markername, (Location::Flags) flags, get_grid_music_divisions (0));
begin_reversible_command (_("add marker"));
XMLNode &before = _session->locations()->get_state();
if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range ()) {
- if (transport_marker_menu == 0) {
- build_range_marker_menu (loc == transport_loop_location() || loc == transport_punch_location(), loc->is_session_range());
- }
+ delete transport_marker_menu;
+ build_range_marker_menu (loc, loc == transport_loop_location() || loc == transport_punch_location(), loc->is_session_range());
marker_menu_item = item;
transport_marker_menu->popup (1, ev->time);
marker_menu->popup (1, ev->time);
} else if (loc->is_range_marker()) {
- if (range_marker_menu == 0) {
- build_range_marker_menu (false, false);
- }
+ delete range_marker_menu;
+ build_range_marker_menu (loc, false, false);
+
marker_menu_item = item;
range_marker_menu->popup (1, ev->time);
}
items.push_back (CheckMenuElem (_("Glue to Bars and Beats")));
Gtk::CheckMenuItem* glue_item = static_cast<Gtk::CheckMenuItem*> (&items.back());
- if (loc->position_lock_style() == MusicTime) {
- glue_item->set_active ();
- }
+ glue_item->set_active (loc->position_lock_style() == MusicTime);
+
glue_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_glue));
items.push_back (SeparatorElem());
}
void
-Editor::build_range_marker_menu (bool loop_or_punch, bool session)
+Editor::build_range_marker_menu (Location* loc, bool loop_or_punch, bool session)
{
using namespace Menu_Helpers;
- bool const loop_or_punch_or_session = loop_or_punch | session;
+ bool const loop_or_punch_or_session = loop_or_punch || session;
Menu *markerMenu = new Menu;
if (loop_or_punch_or_session) {
items.push_back (MenuElem (_("Zoom to Range"), sigc::mem_fun (*this, &Editor::marker_menu_zoom_to_range)));
+ items.push_back (SeparatorElem());
+ items.push_back (CheckMenuElem (_("Glue to Bars and Beats")));
+
+ Gtk::CheckMenuItem* glue_item = static_cast<Gtk::CheckMenuItem*> (&items.back());
+ glue_item->set_active (loc->position_lock_style() == MusicTime);
+ glue_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_glue));
+
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_range)));
items.push_back (SeparatorElem());
Location* l;
bool is_start;
+ const int32_t divisions = get_grid_music_divisions (0);
if ((l = find_location_from_marker (marker, is_start)) != 0) {
if (l->is_mark()) {
- l->set_start (_session->audible_frame ());
+ l->set_start (_session->audible_frame (), false, true, divisions);
}
else {
if (is_start) {
- l->set_start (_session->audible_frame ());
+ l->set_start (_session->audible_frame (), false, true, divisions);
} else {
- l->set_end (_session->audible_frame ());
+ l->set_end (_session->audible_frame (), false, true, divisions);
}
}
}
const Timecode::BBT_Time bbt (msp->bbt());
const PositionLockStyle pls = (msp->position_lock_style() == AudioTime) ? MusicTime : AudioTime;
- _session->tempo_map().replace_meter (*msp, meter, bbt, pls);
+ _session->tempo_map().replace_meter (*msp, meter, bbt, msp->frame(), pls);
XMLNode &after = _session->tempo_map().get_state();
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
return;
}
+ begin_reversible_command (_("change marker lock style"));
+ XMLNode &before = _session->locations()->get_state();
+
if (loc->position_lock_style() == MusicTime) {
loc->set_position_lock_style (AudioTime);
} else {
loc->set_position_lock_style (MusicTime);
}
+ XMLNode &after = _session->locations()->get_state();
+ _session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after));
+ commit_reversible_command ();
}
void