diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-17 20:54:03 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-17 20:54:03 +0000 |
commit | 997e4b1f9cd7ccfc704b7c035051da7f60d831e7 (patch) | |
tree | 1236e40183b677abf4a2882e4cfe8e0a345eb24d /gtk2_ardour/sfdb_ui.cc | |
parent | 19a4b990325577fc949ccd5d5fbad4520eb1df56 (diff) |
merge with 2.0-ongoing @ rev 3147
git-svn-id: svn://localhost/ardour2/branches/3.0@3152 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/sfdb_ui.cc')
-rw-r--r-- | gtk2_ardour/sfdb_ui.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 0104daea7c..6f7f655d8e 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -874,10 +874,10 @@ SoundFileOmega::bad_file_message() bool SoundFileOmega::check_info (const vector<ustring>& paths, bool& same_size, bool& src_needed, bool& multichannel) { - SNDFILE* sf; - SF_INFO info; + SoundFileInfo info; nframes64_t sz = 0; bool err = false; + string errmsg; same_size = true; src_needed = false; @@ -885,19 +885,16 @@ SoundFileOmega::check_info (const vector<ustring>& paths, bool& same_size, bool& for (vector<ustring>::const_iterator i = paths.begin(); i != paths.end(); ++i) { - info.format = 0; // libsndfile says to clear this before sf_open(). + if (AudioFileSource::get_soundfile_info (*i, info, errmsg)) { - if ((sf = sf_open ((char*) (*i).c_str(), SFM_READ, &info)) != 0) { - sf_close (sf); - if (info.channels > 1) { multichannel = true; } - + if (sz == 0) { - sz = info.frames; + sz = info.length; } else { - if (sz != info.frames) { + if (sz != info.length) { same_size = false; } } @@ -907,10 +904,16 @@ SoundFileOmega::check_info (const vector<ustring>& paths, bool& same_size, bool& } } else if (SMFSource::safe_file_extension (*i)) { + SMFReader reader(*i); if (reader.num_tracks() > 1) { multichannel = true; // "channel" == track here... } + + /* XXX we need err = true handling here in case + we can't check the file + */ + } else { err = true; } |