233 |
} |
} |
234 |
} |
} |
235 |
|
|
236 |
void InstrumentResourceManager::LaunchInstrumentEditor(instrument_id_t ID) throw (InstrumentManagerException) { |
InstrumentEditor* InstrumentResourceManager::LaunchInstrumentEditor(instrument_id_t ID) throw (InstrumentManagerException) { |
237 |
const String sDataType = GetInstrumentDataStructureName(ID); |
const String sDataType = GetInstrumentDataStructureName(ID); |
238 |
const String sDataVersion = GetInstrumentDataStructureVersion(ID); |
const String sDataVersion = GetInstrumentDataStructureVersion(ID); |
239 |
// find instrument editors capable to handle given instrument |
// find instrument editors capable to handle given instrument |
267 |
dynamic_cast<VirtualMidiDevice*>(pEditor); |
dynamic_cast<VirtualMidiDevice*>(pEditor); |
268 |
if (!pVirtualMidiDevice) { |
if (!pVirtualMidiDevice) { |
269 |
std::cerr << "Instrument editor not a virtual MIDI device\n" << std::flush; |
std::cerr << "Instrument editor not a virtual MIDI device\n" << std::flush; |
270 |
return; |
return pEditor; |
271 |
} |
} |
272 |
// NOTE: for now connect the virtual MIDI keyboard of the instrument editor (if any) with all engine channels that have the same instrument as the editor was opened for ( other ideas ? ) |
// NOTE: for now connect the virtual MIDI keyboard of the instrument editor (if any) with all engine channels that have the same instrument as the editor was opened for ( other ideas ? ) |
273 |
Lock(); |
Lock(); |
277 |
std::set<gig::EngineChannel*>::iterator end = engineChannels.end(); |
std::set<gig::EngineChannel*>::iterator end = engineChannels.end(); |
278 |
for (; iter != end; ++iter) (*iter)->Connect(pVirtualMidiDevice); |
for (; iter != end; ++iter) (*iter)->Connect(pVirtualMidiDevice); |
279 |
Unlock(); |
Unlock(); |
280 |
|
|
281 |
|
return pEditor; |
282 |
} |
} |
283 |
|
|
284 |
/** |
/** |