summaryrefslogtreecommitdiff
path: root/gtk2_ardour/sfdb_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-12-13 16:48:20 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2016-12-14 11:46:26 +0000
commiteb58c4108f9ab7ab04fda7913042a0350dff68c7 (patch)
tree1532f35dfb176e39b4515027f638ff21e1516105 /gtk2_ardour/sfdb_ui.cc
parentdd525d1613c30e212a8c529cdf3500ce88ab4885 (diff)
improving logic/flow for SMF type 1 files part 1:
check num tracks for type1 and offer multichannel option if appropriate
Diffstat (limited to 'gtk2_ardour/sfdb_ui.cc')
-rw-r--r--gtk2_ardour/sfdb_ui.cc35
1 files changed, 17 insertions, 18 deletions
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc
index b2f96ed8a6..5a8de6c550 100644
--- a/gtk2_ardour/sfdb_ui.cc
+++ b/gtk2_ardour/sfdb_ui.cc
@@ -1436,7 +1436,7 @@ SoundFileOmega::reset_options ()
vector<string> channel_strings;
if (mode == ImportAsTrack || mode == ImportAsTapeTrack || mode == ImportToTrack) {
- /// XXX needs special casing for MIDI type-1 files
+
channel_strings.push_back (_("one track per file"));
if (selection_includes_multichannel) {
@@ -1578,24 +1578,23 @@ SoundFileOmega::check_info (const vector<string>& paths, bool& same_size, bool&
} else if (SMFSource::valid_midi_file (*i)) {
Evoral::SMF reader;
- reader.open(*i);
- if (reader.num_tracks() > 1) {
- /* NOTE: we cannot merge midi-tracks.
- * they will always be on separate tracks
- * "one track per file" is not possible.
- */
- //multichannel = true; // "channel" == track here...
- }
- if (reader.is_type0 () && reader.channels().size() > 1) {
- /* for type-0 files, we can split
- * "one track per channel"
- */
- multichannel = true;
- }
- /* XXX we need err = true handling here in case
- we can't check the file
- */
+ if (reader.open (*i)) {
+ err = true;
+ } else {
+ if (reader.is_type0 ()) {
+ if (reader.channels().size() > 1) {
+ /* for type-0 files, we can split
+ * "one track per channel"
+ */
+ multichannel = true;
+ }
+ } else {
+ if (reader.num_tracks() > 1) {
+ multichannel = true;
+ }
+ }
+ }
} else {
err = true;