mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-27 07:28:17 +01:00
store the count of imported files in the import_status record, and initialize it before the import loop, so the count works correctly
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5827 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
933bf42a99
commit
114b511413
3 changed files with 8 additions and 3 deletions
|
|
@ -284,6 +284,9 @@ Editor::get_nth_selected_audio_track (int nth) const
|
|||
void
|
||||
Editor::do_import (vector<ustring> paths, ImportDisposition chns, ImportMode mode, SrcQuality quality, nframes64_t& pos)
|
||||
{
|
||||
//this is where an import "starts" so initialize the count here ... the rest gets initialized in import_sndfiles()
|
||||
import_status.count = 0;
|
||||
|
||||
boost::shared_ptr<AudioTrack> track;
|
||||
vector<ustring> to_import;
|
||||
int nth = 0;
|
||||
|
|
|
|||
|
|
@ -606,6 +606,7 @@ class Session : public PBD::StatefulDestructible
|
|||
|
||||
/* control info */
|
||||
uint32_t total;
|
||||
uint32_t count;
|
||||
SrcQuality quality;
|
||||
volatile bool freeze;
|
||||
std::vector<Glib::ustring> paths;
|
||||
|
|
|
|||
|
|
@ -307,7 +307,6 @@ remove_file_source (boost::shared_ptr<AudioFileSource> file_source)
|
|||
void
|
||||
Session::import_audiofiles (import_status& status)
|
||||
{
|
||||
uint32_t cnt = 1;
|
||||
typedef vector<boost::shared_ptr<AudioFileSource> > AudioSources;
|
||||
AudioSources all_new_sources;
|
||||
|
||||
|
|
@ -315,8 +314,10 @@ Session::import_audiofiles (import_status& status)
|
|||
|
||||
for (vector<Glib::ustring>::iterator p = status.paths.begin();
|
||||
p != status.paths.end() && !status.cancel;
|
||||
++p, ++cnt)
|
||||
++p)
|
||||
{
|
||||
status.count++;
|
||||
|
||||
boost::shared_ptr<ImportableSource> source;
|
||||
|
||||
try
|
||||
|
|
@ -355,7 +356,7 @@ Session::import_audiofiles (import_status& status)
|
|||
}
|
||||
|
||||
status.doing_what = compose_status_message (*p, source->samplerate(),
|
||||
frame_rate(), cnt, status.total);
|
||||
frame_rate(), status.count, status.total);
|
||||
|
||||
write_audio_data_to_new_files (source.get(), status, newfiles);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue