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 Christian Schoenebeck * |
* Copyright (C) 2005, 2006 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 * |
48 |
pMidiInputPort = NULL; |
pMidiInputPort = NULL; |
49 |
midiChannel = midi_chan_all; |
midiChannel = midi_chan_all; |
50 |
ResetControllers(); |
ResetControllers(); |
51 |
|
SoloMode = false; |
52 |
|
PortamentoMode = false; |
53 |
|
PortamentoTime = CONFIG_PORTAMENTO_TIME_DEFAULT; |
54 |
} |
} |
55 |
|
|
56 |
EngineChannel::~EngineChannel() { |
EngineChannel::~EngineChannel() { |
111 |
pMIDIKeyInfo[i].itSelf = Pool<uint>::Iterator(); |
pMIDIKeyInfo[i].itSelf = Pool<uint>::Iterator(); |
112 |
pMIDIKeyInfo[i].VoiceTheftsQueued = 0; |
pMIDIKeyInfo[i].VoiceTheftsQueued = 0; |
113 |
} |
} |
114 |
|
SoloKey = -1; // no solo key active yet |
115 |
|
PortamentoPos = -1.0f; // no portamento active yet |
116 |
|
|
117 |
// reset all key groups |
// reset all key groups |
118 |
std::map<uint,uint*>::iterator iter = ActiveKeyGroups.begin(); |
std::map<uint,uint*>::iterator iter = ActiveKeyGroups.begin(); |
189 |
catch (RIFF::Exception e) { |
catch (RIFF::Exception e) { |
190 |
InstrumentStat = -2; |
InstrumentStat = -2; |
191 |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message; |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message; |
192 |
throw LinuxSamplerException(msg); |
throw Exception(msg); |
193 |
} |
} |
194 |
catch (InstrumentResourceManagerException e) { |
catch (InstrumentResourceManagerException e) { |
195 |
InstrumentStat = -3; |
InstrumentStat = -3; |
196 |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message(); |
String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message(); |
197 |
throw LinuxSamplerException(msg); |
throw Exception(msg); |
198 |
} |
} |
199 |
catch (...) { |
catch (...) { |
200 |
InstrumentStat = -4; |
InstrumentStat = -4; |
201 |
throw LinuxSamplerException("gig::Engine error: Failed to load instrument, cause: Unknown exception while trying to parse gig file."); |
throw Exception("gig::Engine error: Failed to load instrument, cause: Unknown exception while trying to parse gig file."); |
202 |
} |
} |
203 |
|
|
204 |
// rebuild ActiveKeyGroups map with key groups of current instrument |
// rebuild ActiveKeyGroups map with key groups of current instrument |
215 |
} |
} |
216 |
catch (AudioOutputException e) { |
catch (AudioOutputException e) { |
217 |
String msg = "Audio output device unable to provide 2 audio channels, cause: " + e.Message(); |
String msg = "Audio output device unable to provide 2 audio channels, cause: " + e.Message(); |
218 |
throw LinuxSamplerException(msg); |
throw Exception(msg); |
219 |
} |
} |
220 |
|
|
221 |
if (pEngine) pEngine->Enable(); |
if (pEngine) pEngine->Enable(); |
271 |
AudioDeviceChannelRight = 1; |
AudioDeviceChannelRight = 1; |
272 |
pOutputLeft = pAudioOut->Channel(0)->Buffer(); |
pOutputLeft = pAudioOut->Channel(0)->Buffer(); |
273 |
pOutputRight = pAudioOut->Channel(1)->Buffer(); |
pOutputRight = pAudioOut->Channel(1)->Buffer(); |
274 |
|
MidiInputPort::AddSysexListener(pEngine); |
275 |
} |
} |
276 |
|
|
277 |
void EngineChannel::DisconnectAudioOutputDevice() { |
void EngineChannel::DisconnectAudioOutputDevice() { |
441 |
void EngineChannel::ResetControllers() { |
void EngineChannel::ResetControllers() { |
442 |
Pitch = 0; |
Pitch = 0; |
443 |
SustainPedal = false; |
SustainPedal = false; |
444 |
GlobalVolume = 1.0; |
SostenutoPedal = false; |
445 |
|
GlobalVolume = CONFIG_GLOBAL_ATTENUATION; |
446 |
GlobalPanLeft = 1.0f; |
GlobalPanLeft = 1.0f; |
447 |
GlobalPanRight = 1.0f; |
GlobalPanRight = 1.0f; |
448 |
// set all MIDI controller values to zero |
// set all MIDI controller values to zero |