summaryrefslogtreecommitdiff
path: root/gtk2_ardour/sfdb_ui.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-10-05 21:01:21 +0200
committerRobin Gareus <robin@gareus.org>2016-10-05 21:01:21 +0200
commit2a27cc475867612afd261e5bf3b2a1a42b9c75cc (patch)
treea31a1b59bd806f8239e47b08016ee1faf99ba2fc /gtk2_ardour/sfdb_ui.cc
parentaa4343a18c043450e00e08701676d166b6a66830 (diff)
GUI support for type-0/1 SMF import (display channel/track count)
This needs further work: Type-1 SMF are always "One [Ardour] track per [MIDI] track" Only type-0 SMF have the option "One [Ardour] track per [MIDI] channel" and "One [Ardour] track per [MIDI] file" This is ambiguous with multi-channel audio or multiple selection, mixed audio+midi and worse with mixed type0/1 .mid selection. This calls for a dedicated dropdown to select MIDI Import Disposition for type-0 SMF.
Diffstat (limited to 'gtk2_ardour/sfdb_ui.cc')
-rw-r--r--gtk2_ardour/sfdb_ui.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc
index f94c584019..b2f96ed8a6 100644
--- a/gtk2_ardour/sfdb_ui.cc
+++ b/gtk2_ardour/sfdb_ui.cc
@@ -303,7 +303,15 @@ SoundFileBox::setup_labels (const string& filename)
tags_entry.set_sensitive (false);
if (ms) {
- channels_value.set_text (to_string(ms->num_tracks(), std::dec));
+ if (ms->is_type0()) {
+ channels_value.set_text (to_string(ms->channels().size(), std::dec));
+ } else {
+ if (ms->num_tracks() > 1) {
+ channels_value.set_text (to_string(ms->num_tracks(), std::dec) + _("(Tracks)"));
+ } else {
+ channels_value.set_text (to_string(ms->num_tracks(), std::dec));
+ }
+ }
length_clock.set (ms->length(ms->timeline_position()));
} else {
channels_value.set_text ("");
@@ -1428,6 +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) {
@@ -1571,7 +1580,17 @@ SoundFileOmega::check_info (const vector<string>& paths, bool& same_size, bool&
Evoral::SMF reader;
reader.open(*i);
if (reader.num_tracks() > 1) {
- multichannel = true; // "channel" == track here...
+ /* 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