159 |
* This method will then actually start to load the instrument and block |
* This method will then actually start to load the instrument and block |
160 |
* the calling thread until loading was completed. |
* the calling thread until loading was completed. |
161 |
* |
* |
|
* @returns detailed description of the method call result |
|
162 |
* @see PrepareLoadInstrument() |
* @see PrepareLoadInstrument() |
163 |
*/ |
*/ |
164 |
void EngineChannel::LoadInstrument() { |
void EngineChannel::LoadInstrument() { |
191 |
instrid.Index = InstrumentIdx; |
instrid.Index = InstrumentIdx; |
192 |
newInstrument = Engine::instruments.Borrow(instrid, this); |
newInstrument = Engine::instruments.Borrow(instrid, this); |
193 |
if (!newInstrument) { |
if (!newInstrument) { |
194 |
throw InstrumentResourceManagerException("resource was not created"); |
throw InstrumentManagerException("resource was not created"); |
195 |
} |
} |
196 |
} |
} |
197 |
catch (RIFF::Exception e) { |
catch (RIFF::Exception e) { |
199 |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message; |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message; |
200 |
throw Exception(msg); |
throw Exception(msg); |
201 |
} |
} |
202 |
catch (InstrumentResourceManagerException e) { |
catch (InstrumentManagerException e) { |
203 |
InstrumentStat = -3; |
InstrumentStat = -3; |
204 |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message(); |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message(); |
205 |
throw Exception(msg); |
throw Exception(msg); |
218 |
|
|
219 |
if (pEngine) pEngine->ChangeInstrument(this, newInstrument); |
if (pEngine) pEngine->ChangeInstrument(this, newInstrument); |
220 |
else pInstrument = newInstrument; |
else pInstrument = newInstrument; |
221 |
|
|
222 |
|
StatusChanged(true); |
223 |
} |
} |
224 |
|
|
225 |
/** |
/** |
337 |
default: |
default: |
338 |
throw AudioOutputException("Invalid engine audio channel " + ToString(EngineAudioChannel)); |
throw AudioOutputException("Invalid engine audio channel " + ToString(EngineAudioChannel)); |
339 |
} |
} |
340 |
|
|
341 |
|
bStatusChanged = true; |
342 |
} |
} |
343 |
|
|
344 |
int EngineChannel::OutputChannel(uint EngineAudioChannel) { |
int EngineChannel::OutputChannel(uint EngineAudioChannel) { |