summaryrefslogtreecommitdiff
path: root/libs/midi++2
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-06-11 22:59:35 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-06-11 22:59:35 +0000
commitd97312d438a813985916dd35f613510e9448441f (patch)
tree5be2844fc16359c2eb550b72c9f84737c534d614 /libs/midi++2
parentc81691741118ab34c5f6f458c2d84f431e481ada (diff)
lots more work trying to create a common structure for accessing plugin and MIDNAME patch/preset/program names. still not done
git-svn-id: svn://localhost/ardour2/branches/3.0@12665 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2')
-rw-r--r--libs/midi++2/midi++/midnam_patch.h4
-rw-r--r--libs/midi++2/midnam_patch.cc152
2 files changed, 156 insertions, 0 deletions
diff --git a/libs/midi++2/midi++/midnam_patch.h b/libs/midi++2/midi++/midnam_patch.h
index cbf64299ea..276b402086 100644
--- a/libs/midi++2/midi++/midnam_patch.h
+++ b/libs/midi++2/midi++/midnam_patch.h
@@ -200,6 +200,8 @@ public:
XMLNode& get_state (void);
int set_state (const XMLTree&, const XMLNode&);
+ void set_patch_banks (const PatchBanks&);
+
private:
std::string _name;
AvailableForChannels _available_for_channels;
@@ -352,6 +354,8 @@ private:
MasterDeviceNames::Models _all_models;
};
+extern const char* general_midi_program_names[128]; /* 0 .. 127 */
+
}
}
diff --git a/libs/midi++2/midnam_patch.cc b/libs/midi++2/midnam_patch.cc
index 66d3219310..1ad5cf9dc5 100644
--- a/libs/midi++2/midnam_patch.cc
+++ b/libs/midi++2/midnam_patch.cc
@@ -262,6 +262,28 @@ PatchBank::set_patch_name_list (const PatchNameList& pnl)
return 0;
}
+void
+ChannelNameSet::set_patch_banks (const ChannelNameSet::PatchBanks& pb)
+{
+ _patch_banks = pb;
+
+ _patch_map.clear ();
+ _patch_list.clear ();
+ _patch_list_name = "";
+ _available_for_channels.clear ();
+
+ for (PatchBanks::const_iterator pbi = _patch_banks.begin(); pbi != _patch_banks.end(); ++pbi) {
+ for (PatchBank::PatchNameList::const_iterator pni = (*pbi)->patch_name_list().begin(); pni != (*pbi)->patch_name_list().end(); ++pni) {
+ _patch_map[(*pni)->patch_primary_key()] = (*pni);
+ _patch_list.push_back ((*pni)->patch_primary_key());
+ }
+ }
+
+ for (uint8_t n = 0; n < 16; ++n) {
+ _available_for_channels.insert (n);
+ }
+}
+
XMLNode&
ChannelNameSet::get_state (void)
{
@@ -526,6 +548,136 @@ MIDINameDocument::get_state(void)
return nothing;
}
+const char* general_midi_program_names[128] = {
+ "Acoustic Grand Piano",
+ "Bright Acoustic Piano",
+ "Electric Grand Piano",
+ "Honky-tonk Piano",
+ "Rhodes Piano",
+ "Chorused Piano",
+ "Harpsichord",
+ "Clavinet",
+ "Celesta",
+ "Glockenspiel",
+ "Music Box",
+ "Vibraphone",
+ "Marimba",
+ "Xylophone",
+ "Tubular Bells",
+ "Dulcimer",
+ "Hammond Organ",
+ "Percussive Organ",
+ "Rock Organ",
+ "Church Organ",
+ "Reed Organ",
+ "Accordion",
+ "Harmonica",
+ "Tango Accordion",
+ "Acoustic Guitar (nylon)",
+ "Acoustic Guitar (steel)",
+ "Electric Guitar (jazz)",
+ "Electric Guitar (clean)",
+ "Electric Guitar (muted)",
+ "Overdriven Guitar",
+ "Distortion Guitar",
+ "Guitar Harmonics",
+ "Acoustic Bass",
+ "Electric Bass (finger)",
+ "Electric Bass (pick)",
+ "Fretless Bass",
+ "Slap Bass 1",
+ "Slap Bass 2",
+ "Synth Bass 1",
+ "Synth Bass 2",
+ "Violin",
+ "Viola",
+ "Cello",
+ "Contrabass",
+ "Tremolo Strings",
+ "Pizzicato Strings",
+ "Orchestral Harp",
+ "Timpani",
+ "String Ensemble 1",
+ "String Ensemble 2",
+ "SynthStrings 1",
+ "SynthStrings 2",
+ "Choir Aahs",
+ "Voice Oohs",
+ "Synth Voice",
+ "Orchestra Hit",
+ "Trumpet",
+ "Trombone",
+ "Tuba",
+ "Muted Trumpet",
+ "French Horn",
+ "Brass Section",
+ "Synth Brass 1",
+ "Synth Brass 2",
+ "Soprano Sax",
+ "Alto Sax",
+ "Tenor Sax",
+ "Baritone Sax",
+ "Oboe",
+ "English Horn",
+ "Bassoon",
+ "Clarinet",
+ "Piccolo",
+ "Flute",
+ "Recorder",
+ "Pan Flute",
+ "Bottle Blow",
+ "Shakuhachi",
+ "Whistle",
+ "Ocarina",
+ "Lead 1 (square)",
+ "Lead 2 (sawtooth)",
+ "Lead 3 (calliope lead)",
+ "Lead 4 (chiff lead)",
+ "Lead 5 (charang)",
+ "Lead 6 (voice)",
+ "Lead 7 (fifths)",
+ "Lead 8 (bass + lead)",
+ "Pad 1 (new age)",
+ "Pad 2 (warm)",
+ "Pad 3 (polysynth)",
+ "Pad 4 (choir)",
+ "Pad 5 (bowed)",
+ "Pad 6 (metallic)",
+ "Pad 7 (halo)",
+ "Pad 8 (sweep)",
+ "FX 1 (rain)",
+ "FX 2 (soundtrack)",
+ "FX 3 (crystal)",
+ "FX 4 (atmosphere)",
+ "FX 5 (brightness)",
+ "FX 6 (goblins)",
+ "FX 7 (echoes)",
+ "FX 8 (sci-fi)",
+ "Sitar",
+ "Banjo",
+ "Shamisen",
+ "Koto",
+ "Kalimba",
+ "Bagpipe",
+ "Fiddle",
+ "Shanai",
+ "Tinkle Bell",
+ "Agogo",
+ "Steel Drums",
+ "Woodblock",
+ "Taiko Drum",
+ "Melodic Tom",
+ "Synth Drum",
+ "Reverse Cymbal",
+ "Guitar Fret Noise",
+ "Breath Noise",
+ "Seashore",
+ "Bird Tweet",
+ "Telephone Ring",
+ "Helicopter",
+ "Applause",
+ "Gunshot",
+};
} //namespace Name