- find_matching_files_in_directory (path_to_patches, pattern, result);
-
- info << "Loading " << result.size() << " MIDI patches from " << path_to_patches << endmsg;
-
- for (vector<std::string>::iterator i = result.begin(); i != result.end(); ++i) {
- boost::shared_ptr<MIDINameDocument> document(new MIDINameDocument(*i));
- for (MIDINameDocument::MasterDeviceNamesList::const_iterator device =
- document->master_device_names_by_model().begin();
- device != document->master_device_names_by_model().end();
- ++device) {
- //cerr << "got model " << device->first << endl;
- // have access to the documents by model name
- _documents[device->first] = document;
- // build a list of all master devices from all documents
- _master_devices_by_model[device->first] = device->second;
- _all_models.insert(device->first);
-
- // make sure there are no double model names
- // TODO: handle this gracefully.
- assert(_documents.count(device->first) == 1);
- assert(_master_devices_by_model.count(device->first) == 1);