43 std::vector<MIDIDevice*>::iterator it;
45 it = mDevices.begin();
47 while (it!=mDevices.end())
51 it = mDevices.erase(it);
61 std::vector<MIDIDevice*>::iterator it;
63 for (it = mDevices.begin(); it!=mDevices.end(); it++)
65 if ((*it)->mName == name )
return *it;
72 std::vector<MIDIDevice*>::iterator it;
74 it = mDevices.begin();
78 while (it!=mDevices.end())
85 it = mDevices.erase(it);
94 for (it = mDevices.begin(); it!=mDevices.end(); it++)
104 std::vector<MIDIDevice*>::iterator it;
108 for (it = mDevices.begin(); it!=mDevices.end(); it++)
121 std::vector<MIDIDevice*>::iterator it;
125 for (it = mDevices.begin(); it!=mDevices.end(); it++)
134 std::string arch = name.substr(0,name.find(
":",0));
135 std::string device = name.substr(name.find(
":",0)+1,name.size());
137 if (arch ==
"" || device ==
"")
139 std::string msg =
"MIDIManager::FindOrCreateDevice(...): Invalid device name: ";
141 throw Err(msg.c_str());
144 if (arch ==
"default")
156 errstr =
"MIDIManager::FindOrCreateDevice(): "
157 "Don't have a list of \""+arch+
"\" devices";
158 throw Err((
char*) errstr.c_str());
164 errstr =
"MIDIManager::FindOrCreateDevice(): "
165 "Don't have any \""+arch+
"\" devices available";
166 throw Err((
char*) errstr.c_str());
169 if (device ==
"default")
177 std::vector<std::string>::const_iterator it;
184 if (*it == device)
break;
196 errstr =
"MIDIManager::FindOrCreateDevice(): "
197 "No device \""+device+
"\" available in architecture \""+arch+
"\".\n";
198 throw Err((
char*) errstr.c_str());
201 std::string real_name = arch+
":"+device;
211 mididevice = list->
Create(real_name,device);
216 errstr =
"MIDIManager::FindOrCreateDevice(): Don't know how to make device "+real_name;
217 throw Err((
char*) errstr.c_str());
221 mDevices.push_back(mididevice);
255 std::string tmp = arch;
257 if (tmp ==
"default")
262 for (i=0;i<DeviceLists().size();i++)
264 if (DeviceLists()[i]->ArchName() == tmp)
266 return DeviceLists()[i];