import_pt: Update session range to largest audio extents imported
Tested before and after on a small audio-only PT8 session; session range gets set to [0 to max] extent with this change.
This commit is contained in:
parent
295dbd8e1e
commit
a27a88f9f2
@ -277,6 +277,7 @@ Session::import_pt_rest (PTFFormat& ptf)
|
|||||||
vector<string> to_import;
|
vector<string> to_import;
|
||||||
string fullpath;
|
string fullpath;
|
||||||
uint32_t srate = sample_rate ();
|
uint32_t srate = sample_rate ();
|
||||||
|
timepos_t latest = timepos_t (0);
|
||||||
|
|
||||||
vector<struct ptflookup> ptfregpair;
|
vector<struct ptflookup> ptfregpair;
|
||||||
|
|
||||||
@ -386,9 +387,17 @@ Session::import_pt_rest (PTFFormat& ptf)
|
|||||||
playlist->clear_changes ();
|
playlist->clear_changes ();
|
||||||
playlist->add_region (copy, timepos_t (a->reg.startpos));
|
playlist->add_region (copy, timepos_t (a->reg.startpos));
|
||||||
//add_command (new StatefulDiffCommand (playlist));
|
//add_command (new StatefulDiffCommand (playlist));
|
||||||
|
|
||||||
|
/* Collect latest end of all regions */
|
||||||
|
timepos_t end_of_region = timepos_t (a->reg.startpos + a->reg.length);
|
||||||
|
if (latest < end_of_region) {
|
||||||
|
latest = end_of_region;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maybe_update_session_range (timepos_t (0), latest);
|
||||||
|
|
||||||
/* Playlist::thaw() all tracks */
|
/* Playlist::thaw() all tracks */
|
||||||
for (pl = playlists.begin(); pl != playlists.end(); ++pl) {
|
for (pl = playlists.begin(); pl != playlists.end(); ++pl) {
|
||||||
|
Loading…
Reference in New Issue
Block a user