- if (!session) return;
-
- begin_reversible_command (_("set loop range"));
-
- Location* tll;
-
- if ((tll = transport_loop_location()) == 0) {
- Location* loc = new Location (temp_location->start(), temp_location->end(), _("Loop"), Location::IsAutoLoop);
- XMLNode &before = session->locations()->get_state();
- session->locations()->add (loc, true);
- session->set_auto_loop_location (loc);
- XMLNode &after = session->locations()->get_state();
- session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
- }
- else {
- XMLNode &before = tll->get_state();
- tll->set_hidden (false, this);
- tll->set (temp_location->start(), temp_location->end());
- XMLNode &after = tll->get_state();
- session->add_command (new MementoCommand<Location>(*tll, &before, &after));
- }
-
- commit_reversible_command ();