--- linuxsampler/trunk/src/engines/gig/EngineChannel.cpp 2005/08/16 17:14:25 738 +++ linuxsampler/trunk/src/engines/gig/EngineChannel.cpp 2006/06/27 22:57:37 880 @@ -3,7 +3,7 @@ * LinuxSampler - modular, streaming capable sampler * * * * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * - * Copyright (C) 2005 Christian Schoenebeck * + * Copyright (C) 2005, 2006 Christian Schoenebeck * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -48,6 +48,9 @@ pMidiInputPort = NULL; midiChannel = midi_chan_all; ResetControllers(); + SoloMode = false; + PortamentoMode = false; + PortamentoTime = CONFIG_PORTAMENTO_TIME_DEFAULT; } EngineChannel::~EngineChannel() { @@ -108,6 +111,8 @@ pMIDIKeyInfo[i].itSelf = Pool::Iterator(); pMIDIKeyInfo[i].VoiceTheftsQueued = 0; } + SoloKey = -1; // no solo key active yet + PortamentoPos = -1.0f; // no portamento active yet // reset all key groups std::map::iterator iter = ActiveKeyGroups.begin(); @@ -184,16 +189,16 @@ catch (RIFF::Exception e) { InstrumentStat = -2; String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message; - throw LinuxSamplerException(msg); + throw Exception(msg); } catch (InstrumentResourceManagerException e) { InstrumentStat = -3; String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message(); - throw LinuxSamplerException(msg); + throw Exception(msg); } catch (...) { InstrumentStat = -4; - 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."); } // rebuild ActiveKeyGroups map with key groups of current instrument @@ -210,7 +215,7 @@ } catch (AudioOutputException e) { String msg = "Audio output device unable to provide 2 audio channels, cause: " + e.Message(); - throw LinuxSamplerException(msg); + throw Exception(msg); } if (pEngine) pEngine->Enable(); @@ -266,6 +271,7 @@ AudioDeviceChannelRight = 1; pOutputLeft = pAudioOut->Channel(0)->Buffer(); pOutputRight = pAudioOut->Channel(1)->Buffer(); + MidiInputPort::AddSysexListener(pEngine); } void EngineChannel::DisconnectAudioOutputDevice() { @@ -435,7 +441,8 @@ void EngineChannel::ResetControllers() { Pitch = 0; SustainPedal = false; - GlobalVolume = 1.0; + SostenutoPedal = false; + GlobalVolume = CONFIG_GLOBAL_ATTENUATION; GlobalPanLeft = 1.0f; GlobalPanRight = 1.0f; // set all MIDI controller values to zero