ExportTimespanPtr span = _session->get_export_handler()->add_timespan();
std::string id;
- if (loc == state->session_range.get()) {
- id = "session";
- } else if (loc == state->selection_range.get()) {
+ if (loc == state->selection_range.get()) {
id = "selection";
} else {
id = loc->id().to_s();
if (!state) { return; }
std::string id;
- if (!range_id.compare (X_("session"))) {
- id = state->session_range->id().to_s();
- } else if (!range_id.compare (X_("selection"))) {
+ if (!range_id.compare (X_("selection"))) {
id = state->selection_range->id().to_s();
} else {
id = range_id;
for (tree_it = range_list->children().begin(); tree_it != range_list->children().end(); ++tree_it) {
Location * loc = tree_it->get_value (range_cols.location);
- if ((!id.compare ("session") && loc == state->session_range.get()) ||
- (!id.compare ("selection") && loc == state->selection_range.get()) ||
- (!id.compare (loc->id().to_s()))) {
+ if ((id == "selection" && loc == state->selection_range.get()) ||
+ (id == loc->id().to_s())) {
tree_it->set_value (range_cols.selected, true);
}
}
TimespanListPtr timespans;
TimeFormat time_format;
- boost::shared_ptr<Location> session_range;
boost::shared_ptr<Location> selection_range;
boost::shared_ptr<LocationList> ranges;
- TimespanState (boost::shared_ptr<Location> session_range,
- boost::shared_ptr<Location> selection_range,
+ TimespanState (boost::shared_ptr<Location> selection_range,
boost::shared_ptr<LocationList> ranges)
: timespans (new TimespanList ())
, time_format (Timecode)
- , session_range (session_range)
, selection_range (selection_range)
, ranges (ranges)
{}
void update_ranges ();
- boost::shared_ptr<Location> session_range;
boost::shared_ptr<Location> selection_range;
boost::shared_ptr<LocationList> ranges;
, handler (s.get_export_handler())
, session (s)
- , session_range (new Location (s))
, ranges (new LocationList ())
, single_range_mode (false)
}
if (timespans.empty()) {
- TimespanStatePtr state (new TimespanState (session_range, selection_range, ranges));
+ TimespanStatePtr state (new TimespanState (selection_range, ranges));
timespans.push_back (state);
// Add session as default selection
+ Location * session_range = session.locations()->session_range_location();
+ if (!session_range) { return false; }
+
ExportTimespanPtr timespan = handler->add_timespan();
timespan->set_name (session_range->name());
- timespan->set_range_id ("session");
+ timespan->set_range_id (session_range->id().to_s());
timespan->set_range (session_range->start(), session_range->end());
state->timespans->push_back (timespan);
return false;
ExportProfileManager::TimespanStatePtr
ExportProfileManager::deserialize_timespan (XMLNode & root)
{
- TimespanStatePtr state (new TimespanState (session_range, selection_range, ranges));
+ TimespanStatePtr state (new TimespanState (selection_range, ranges));
XMLProperty const * prop;
XMLNodeList spans = root.children ("Range");
if (!prop) { continue; }
string id = prop->value();
+ Location * location = 0;
for (LocationList::iterator it = ranges->begin(); it != ranges->end(); ++it) {
- if ((!id.compare ("session") && *it == session_range.get()) ||
- (!id.compare ("selection") && *it == selection_range.get()) ||
- (!id.compare ((*it)->id().to_s()))) {
- ExportTimespanPtr timespan = handler->add_timespan();
- timespan->set_name ((*it)->name());
- timespan->set_range_id (id);
- timespan->set_range ((*it)->start(), (*it)->end());
- state->timespans->push_back (timespan);
+ if ((id == "selection" && *it == selection_range.get()) ||
+ (id == (*it)->id().to_s())) {
+ location = *it;
+ break;
}
}
+
+ if (!location) { continue; }
+
+ ExportTimespanPtr timespan = handler->add_timespan();
+ timespan->set_name (location->name());
+ timespan->set_range_id (location->id().to_s());
+ timespan->set_range (location->start(), location->end());
+ state->timespans->push_back (timespan);
}
if ((prop = root.property ("format"))) {
XMLNode * span;
update_ranges ();
-
for (TimespanList::iterator it = state->timespans->begin(); it != state->timespans->end(); ++it) {
if ((span = root.add_child ("Range"))) {
span->add_property ("id", (*it)->range_id());
/* Session */
- session_range->set_name (_("Session"));
- session_range->set (session.current_start_frame(), session.current_end_frame());
- ranges->push_back (session_range.get());
+ Location * session_range = session.locations()->session_range_location();
+ if (session_range) {
+ ranges->push_back (session_range);
+ }
/* Selection */