140 |
for (int i = 0; i >= 0; i++) { // seek for a free place starting from the beginning |
for (int i = 0; i >= 0; i++) { // seek for a free place starting from the beginning |
141 |
if (!mMidiInputDevices[i]) { |
if (!mMidiInputDevices[i]) { |
142 |
iDeviceId = i; |
iDeviceId = i; |
143 |
|
mMidiInputDevices.erase(i); |
144 |
break; |
break; |
145 |
} |
} |
146 |
} |
} |
150 |
// now create the device using those parameters |
// now create the device using those parameters |
151 |
MidiInputDevice* pDevice = InnerFactories[DriverName]->Create(thisDeviceParams, pSampler); |
MidiInputDevice* pDevice = InnerFactories[DriverName]->Create(thisDeviceParams, pSampler); |
152 |
pDevice->setDeviceId(iDeviceId); |
pDevice->setDeviceId(iDeviceId); |
153 |
// now attach all parameters to the newely created device. |
// now attach all parameters to the newly created device. |
154 |
for (std::map<String,DeviceCreationParameter*>::iterator iter = thisDeviceParams.begin(); iter != thisDeviceParams.end(); iter++) { |
for (std::map<String,DeviceCreationParameter*>::iterator iter = thisDeviceParams.begin(); iter != thisDeviceParams.end(); iter++) { |
155 |
iter->second->Attach(pDevice); |
iter->second->Attach(pDevice); |
156 |
} |
} |