3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005, 2006 Christian Schoenebeck * |
* Copyright (C) 2005 - 2007 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
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 |
InstrumentStat = -1; |
throw InstrumentManagerException("resource was not created"); |
|
dmsg(1,("no instrument loaded!!!\n")); |
|
|
exit(EXIT_FAILURE); |
|
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); |
387 |
} |
} |
388 |
fxSends.push_back(pFxSend); |
fxSends.push_back(pFxSend); |
389 |
if (pEngine) pEngine->Enable(); |
if (pEngine) pEngine->Enable(); |
390 |
|
fireFxSendCountChanged(iSamplerChannelIndex, GetFxSendCount()); |
391 |
|
|
392 |
return pFxSend; |
return pFxSend; |
393 |
} |
} |
394 |
|
|
426 |
} |
} |
427 |
} |
} |
428 |
if (pEngine) pEngine->Enable(); |
if (pEngine) pEngine->Enable(); |
429 |
|
fireFxSendCountChanged(iSamplerChannelIndex, GetFxSendCount()); |
430 |
} |
} |
431 |
|
|
432 |
/** |
/** |
633 |
MidiVolume = 1.0; |
MidiVolume = 1.0; |
634 |
GlobalPanLeft = 1.0f; |
GlobalPanLeft = 1.0f; |
635 |
GlobalPanRight = 1.0f; |
GlobalPanRight = 1.0f; |
636 |
|
GlobalTranspose = 0; |
637 |
// set all MIDI controller values to zero |
// set all MIDI controller values to zero |
638 |
memset(ControllerTable, 0x00, 129); |
memset(ControllerTable, 0x00, 129); |
639 |
|
// reset all FX Send levels |
640 |
|
for ( |
641 |
|
std::vector<FxSend*>::iterator iter = fxSends.begin(); |
642 |
|
iter != fxSends.end(); iter++ |
643 |
|
) { |
644 |
|
(*iter)->Reset(); |
645 |
|
} |
646 |
} |
} |
647 |
|
|
648 |
/** |
/** |