compute_fixed_ruler_scale ();
+ /* Make sure we have auto loop and auto punch ranges */
+
+ Location* loc = _session->locations()->auto_loop_location();
+ if (loc == 0) {
+ loc = new Location (*_session, 0, _session->current_end_frame(), _("Loop"),(Location::Flags) (Location::IsAutoLoop | Location::IsHidden));
+
+ if (loc->start() == loc->end()) {
+ loc->set_end (loc->start() + 1);
+ }
+
+ _session->locations()->add (loc, false);
+ _session->set_auto_loop_location (loc);
+ } else {
+ // force name
+ loc->set_name (_("Loop"));
+ }
+
+ loc = _session->locations()->auto_punch_location();
+
+ if (loc == 0) {
+ loc = new Location (*_session, 0, _session->current_end_frame(), _("Punch"), (Location::Flags) (Location::IsAutoPunch | Location::IsHidden));
+
+ if (loc->start() == loc->end()) {
+ loc->set_end (loc->start() + 1);
+ }
+
+ _session->locations()->add (loc, false);
+ _session->set_auto_punch_location (loc);
+ } else {
+ // force name
+ loc->set_name (_("Punch"));
+ }
+
+ refresh_location_display ();
+
+ /* This must happen after refresh_location_display(), as (amongst other things) we restore
+ the selected Marker; this needs the LocationMarker list to be available.
+ */
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
set_state (*node, Stateful::loading_state_version);
playhead_cursor->canvas_item.show ();
- Location* loc = _session->locations()->auto_loop_location();
- if (loc == 0) {
- loc = new Location (*_session, 0, _session->current_end_frame(), _("Loop"),(Location::Flags) (Location::IsAutoLoop | Location::IsHidden));
-
- if (loc->start() == loc->end()) {
- loc->set_end (loc->start() + 1);
- }
-
- _session->locations()->add (loc, false);
- _session->set_auto_loop_location (loc);
- } else {
- // force name
- loc->set_name (_("Loop"));
- }
-
- loc = _session->locations()->auto_punch_location();
-
- if (loc == 0) {
- loc = new Location (*_session, 0, _session->current_end_frame(), _("Punch"), (Location::Flags) (Location::IsAutoPunch | Location::IsHidden));
-
- if (loc->start() == loc->end()) {
- loc->set_end (loc->start() + 1);
- }
-
- _session->locations()->add (loc, false);
- _session->set_auto_punch_location (loc);
- } else {
- // force name
- loc->set_name (_("Punch"));
- }
-
boost::function<void (string)> pc (boost::bind (&Editor::parameter_changed, this, _1));
Config->map_parameters (pc);
_session->config.map_parameters (pc);
- refresh_location_display ();
-
restore_ruler_visibility ();
//tempo_map_changed (PropertyChange (0));
_session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks);
}
}
+ for (MarkerSelection::const_iterator i = markers.begin(); i != markers.end(); ++i) {
+ XMLNode* t = node->add_child (X_("Marker"));
+
+ bool is_start;
+ Location* loc = editor->find_location_from_marker (*i, is_start);
+
+ t->add_property (X_("id"), atoi (loc->id().to_s().c_str()));
+ t->add_property (X_("start"), is_start ? X_("yes") : X_("no"));
+ }
+
return *node;
}
add (atv.get());
}
}
+
+ } else if ((*i)->name() == X_("Marker")) {
+
+ XMLProperty* prop_id = (*i)->property (X_("id"));
+ XMLProperty* prop_start = (*i)->property (X_("start"));
+ assert (prop_id);
+ assert (prop_start);
+
+ PBD::ID id (prop_id->value ());
+ Marker* m = editor->find_marker_from_location_id (id, string_is_affirmative (prop_start->value ()));
+ if (m) {
+ add (m);
+ }
+
}
+
}
return 0;