string lpnc = lpn;
lpnc += ':';
- const char ** ports = 0;
- ports = AudioEngine::instance()->get_ports ("", type, inputs ? IsInput : IsOutput);
+ vector<string> ports;
+ if (AudioEngine::instance()->get_ports ("", type, inputs ? IsInput : IsOutput, ports) > 0) {
- if (ports) {
+ for (vector<string>::const_iterator s = ports.begin(); s != ports.end(); ) {
- int n = 0;
-
- while (ports[n]) {
-
- std::string const p = ports[n];
+ std::string const p = *s;
if (!system->has_port(p) &&
!bus->has_port(p) &&
*/
if (p.find ("Midi-Through") != string::npos) {
- ++n;
+ ++s;
continue;
}
if ((lp.find (N_(":monitor")) != string::npos) &&
(lp.find (lpn) != string::npos)) {
- ++n;
+ ++s;
continue;
}
}
}
- ++n;
+ ++s;
}
-
- free (ports);
}
for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {