24 |
#include "EngineChannel.h" |
#include "EngineChannel.h" |
25 |
|
|
26 |
#include "../../common/global_private.h" |
#include "../../common/global_private.h" |
27 |
|
#include "../../Sampler.h" |
28 |
|
|
29 |
namespace LinuxSampler { namespace gig { |
namespace LinuxSampler { namespace gig { |
30 |
|
|
60 |
SoloMode = false; |
SoloMode = false; |
61 |
PortamentoMode = false; |
PortamentoMode = false; |
62 |
PortamentoTime = CONFIG_PORTAMENTO_TIME_DEFAULT; |
PortamentoTime = CONFIG_PORTAMENTO_TIME_DEFAULT; |
63 |
|
|
64 |
|
// reset the instrument change command struct (need to be done |
65 |
|
// twice, as it is double buffered) |
66 |
|
{ |
67 |
|
instrument_change_command_t& cmd = InstrumentChangeCommand.GetConfigForUpdate(); |
68 |
|
cmd.pDimRegionsInUse = NULL; |
69 |
|
cmd.pInstrument = NULL; |
70 |
|
cmd.bChangeInstrument = false; |
71 |
|
} |
72 |
|
{ |
73 |
|
instrument_change_command_t& cmd = InstrumentChangeCommand.SwitchConfig(); |
74 |
|
cmd.pDimRegionsInUse = NULL; |
75 |
|
cmd.pInstrument = NULL; |
76 |
|
cmd.bChangeInstrument = false; |
77 |
|
} |
78 |
} |
} |
79 |
|
|
80 |
EngineChannel::~EngineChannel() { |
EngineChannel::~EngineChannel() { |
81 |
DisconnectAudioOutputDevice(); |
DisconnectAudioOutputDevice(); |
82 |
|
|
83 |
|
// In case the channel was removed before the instrument was |
84 |
|
// fully loaded, try to give back instrument again (see bug #113) |
85 |
|
instrument_change_command_t& cmd = ChangeInstrument(NULL); |
86 |
|
if (cmd.pInstrument) { |
87 |
|
Engine::instruments.HandBack(cmd.pInstrument, this); |
88 |
|
} |
89 |
|
/////// |
90 |
|
|
91 |
if (pEventQueue) delete pEventQueue; |
if (pEventQueue) delete pEventQueue; |
92 |
if (pActiveKeys) delete pActiveKeys; |
if (pActiveKeys) delete pActiveKeys; |
93 |
if (pMIDIKeyInfo) delete[] pMIDIKeyInfo; |
if (pMIDIKeyInfo) delete[] pMIDIKeyInfo; |
354 |
// release the currently loaded instrument |
// release the currently loaded instrument |
355 |
Engine::instruments.HandBackInstrument(cmd.pInstrument, this, d); |
Engine::instruments.HandBackInstrument(cmd.pInstrument, this, d); |
356 |
} |
} |
357 |
|
|
358 |
if (d) delete d; |
if (d) delete d; |
359 |
|
|
360 |
// release all active dimension regions to resource |
// release all active dimension regions to resource |
477 |
} |
} |
478 |
fxSends.push_back(pFxSend); |
fxSends.push_back(pFxSend); |
479 |
if (pEngine) pEngine->Enable(); |
if (pEngine) pEngine->Enable(); |
480 |
fireFxSendCountChanged(iSamplerChannelIndex, GetFxSendCount()); |
fireFxSendCountChanged(GetSamplerChannel()->Index(), GetFxSendCount()); |
481 |
|
|
482 |
return pFxSend; |
return pFxSend; |
483 |
} |
} |
516 |
} |
} |
517 |
} |
} |
518 |
if (pEngine) pEngine->Enable(); |
if (pEngine) pEngine->Enable(); |
519 |
fireFxSendCountChanged(iSamplerChannelIndex, GetFxSendCount()); |
fireFxSendCountChanged(GetSamplerChannel()->Index(), GetFxSendCount()); |
520 |
} |
} |
521 |
|
|
522 |
/** |
/** |