mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 13:45:43 +01:00
Improve the readability of Session::import_audiofile
git-svn-id: svn://localhost/ardour2/trunk@2675 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
c6062e8828
commit
b5e959cc4c
1 changed files with 22 additions and 13 deletions
|
|
@ -156,6 +156,26 @@ create_mono_sources_for_writing (const vector<string>& new_paths, Session& sess,
|
|||
return true;
|
||||
}
|
||||
|
||||
Glib::ustring
|
||||
compose_status_message (const string& path,
|
||||
uint file_samplerate,
|
||||
uint session_samplerate,
|
||||
uint current_file,
|
||||
uint total_files)
|
||||
{
|
||||
if (file_samplerate != session_samplerate) {
|
||||
return string_compose (_("converting %1\n(resample from %2KHz to %3KHz)\n(%4 of %5)"),
|
||||
sys::path(path).leaf(),
|
||||
file_samplerate/1000.0f,
|
||||
session_samplerate/1000.0f,
|
||||
current_file, total_files);
|
||||
}
|
||||
|
||||
return string_compose (_("converting %1\n(%2 of %3)"),
|
||||
sys::path(path).leaf(),
|
||||
current_file, total_files);
|
||||
}
|
||||
|
||||
void
|
||||
write_audio_data_to_new_files (ImportableSource* source, Session::import_status& status,
|
||||
vector<boost::shared_ptr<AudioFileSource> >& newfiles)
|
||||
|
|
@ -254,19 +274,8 @@ Session::import_audiofile (import_status& status)
|
|||
(*i)->prepare_for_peakfile_writes ();
|
||||
}
|
||||
|
||||
if ((nframes_t) source->samplerate() != frame_rate()) {
|
||||
status.doing_what = string_compose (_("converting %1\n(resample from %2KHz to %3KHz)\n(%4 of %5)"),
|
||||
sys::path(*p).leaf(),
|
||||
source->samplerate()/1000.0f,
|
||||
frame_rate()/1000.0f,
|
||||
cnt, status.paths.size());
|
||||
|
||||
} else {
|
||||
status.doing_what = string_compose (_("converting %1\n(%2 of %3)"),
|
||||
sys::path(*p).leaf(),
|
||||
cnt, status.paths.size());
|
||||
|
||||
}
|
||||
status.doing_what = compose_status_message (*p, source->samplerate(),
|
||||
frame_rate(), cnt, status.paths.size());
|
||||
|
||||
write_audio_data_to_new_files (source.get(), status, newfiles);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue