63 |
pMainFilterParameters = NULL; |
pMainFilterParameters = NULL; |
64 |
|
|
65 |
InstrumentIdx = -1; |
InstrumentIdx = -1; |
66 |
|
InstrumentStat = -1; |
67 |
|
|
68 |
ResetInternal(); |
ResetInternal(); |
69 |
} |
} |
198 |
Instruments.HandBack(pInstrument, this); |
Instruments.HandBack(pInstrument, this); |
199 |
} |
} |
200 |
|
|
201 |
InstrumentIdx = -1; |
InstrumentFile = FileName; |
202 |
|
InstrumentIdx = Instrument; |
203 |
|
InstrumentStat = 0; |
204 |
|
|
205 |
// request gig instrument from instrument manager |
// request gig instrument from instrument manager |
206 |
try { |
try { |
209 |
instrid.iInstrument = Instrument; |
instrid.iInstrument = Instrument; |
210 |
pInstrument = Instruments.Borrow(instrid, this); |
pInstrument = Instruments.Borrow(instrid, this); |
211 |
if (!pInstrument) { |
if (!pInstrument) { |
212 |
|
InstrumentStat = -1; |
213 |
dmsg(1,("no instrument loaded!!!\n")); |
dmsg(1,("no instrument loaded!!!\n")); |
214 |
exit(EXIT_FAILURE); |
exit(EXIT_FAILURE); |
215 |
} |
} |
216 |
} |
} |
217 |
catch (RIFF::Exception e) { |
catch (RIFF::Exception e) { |
218 |
|
InstrumentStat = -2; |
219 |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message; |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message; |
220 |
throw LinuxSamplerException(msg); |
throw LinuxSamplerException(msg); |
221 |
} |
} |
222 |
catch (InstrumentResourceManagerException e) { |
catch (InstrumentResourceManagerException e) { |
223 |
|
InstrumentStat = -3; |
224 |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message(); |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message(); |
225 |
throw LinuxSamplerException(msg); |
throw LinuxSamplerException(msg); |
226 |
} |
} |
227 |
catch (...) { |
catch (...) { |
228 |
|
InstrumentStat = -4; |
229 |
throw LinuxSamplerException("gig::Engine error: Failed to load instrument, cause: Unknown exception while trying to parse gig file."); |
throw LinuxSamplerException("gig::Engine error: Failed to load instrument, cause: Unknown exception while trying to parse gig file."); |
230 |
} |
} |
231 |
|
|
232 |
InstrumentFile = FileName; |
InstrumentStat = 100; |
|
InstrumentIdx = Instrument; |
|
233 |
|
|
234 |
// inform audio driver for the need of two channels |
// inform audio driver for the need of two channels |
235 |
try { |
try { |
715 |
return InstrumentIdx; |
return InstrumentIdx; |
716 |
} |
} |
717 |
|
|
718 |
|
int Engine::InstrumentStatus() { |
719 |
|
return InstrumentStat; |
720 |
|
} |
721 |
|
|
722 |
String Engine::Description() { |
String Engine::Description() { |
723 |
return "Gigasampler Engine"; |
return "Gigasampler Engine"; |
724 |
} |
} |
725 |
|
|
726 |
String Engine::Version() { |
String Engine::Version() { |
727 |
String s = "$Revision: 1.6 $"; |
String s = "$Revision: 1.7 $"; |
728 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
729 |
} |
} |
730 |
|
|