mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-19 05:06:31 +01:00
Simplify finalization code in Session::import_audiofile
git-svn-id: svn://localhost/ardour2/trunk@2670 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
7976efd071
commit
20d6a70b15
1 changed files with 17 additions and 19 deletions
|
|
@ -162,7 +162,6 @@ Session::import_audiofile (import_status& status)
|
||||||
string basepath;
|
string basepath;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
vector<string> new_paths;
|
vector<string> new_paths;
|
||||||
struct tm* now;
|
|
||||||
uint32_t cnt = 1;
|
uint32_t cnt = 1;
|
||||||
|
|
||||||
status.sources.clear ();
|
status.sources.clear ();
|
||||||
|
|
@ -238,26 +237,25 @@ Session::import_audiofile (import_status& status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
status.freeze = true;
|
if (!status.cancel) {
|
||||||
|
struct tm* now;
|
||||||
time_t xnow;
|
time_t xnow;
|
||||||
time (&xnow);
|
time (&xnow);
|
||||||
now = localtime (&xnow);
|
now = localtime (&xnow);
|
||||||
|
status.freeze = true;
|
||||||
|
|
||||||
/* flush the final length(s) to the header(s) */
|
/* flush the final length(s) to the header(s) */
|
||||||
|
|
||||||
for (SourceList::iterator x = status.sources.begin(); x != status.sources.end() && !status.cancel; ++x) {
|
for (SourceList::iterator x = status.sources.begin(); x != status.sources.end(); ++x) {
|
||||||
boost::dynamic_pointer_cast<AudioFileSource>(*x)->update_header(0, *now, xnow);
|
boost::dynamic_pointer_cast<AudioFileSource>(*x)->update_header(0, *now, xnow);
|
||||||
boost::dynamic_pointer_cast<AudioSource>(*x)->done_with_peakfile_writes ();
|
boost::dynamic_pointer_cast<AudioSource>(*x)->done_with_peakfile_writes ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save state so that we don't lose these new Sources */
|
/* save state so that we don't lose these new Sources */
|
||||||
|
|
||||||
if (!status.cancel) {
|
|
||||||
save_state (_name);
|
save_state (_name);
|
||||||
}
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue