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 - 2008 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 * |
27 |
#include "../common/Event.h" |
#include "../common/Event.h" |
28 |
#include "../EngineChannel.h" |
#include "../EngineChannel.h" |
29 |
#include "../../common/RingBuffer.h" |
#include "../../common/RingBuffer.h" |
30 |
|
#include "../../common/ArrayList.h" |
31 |
#include "../../drivers/audio/AudioChannel.h" |
#include "../../drivers/audio/AudioChannel.h" |
32 |
|
#include "../../drivers/midi/VirtualMidiDevice.h" |
33 |
#include "EngineGlobals.h" |
#include "EngineGlobals.h" |
34 |
#include "Engine.h" |
#include "Engine.h" |
35 |
#include "Voice.h" |
#include "Voice.h" |
92 |
virtual void ResourceUpdated(::gig::Instrument* pOldResource, ::gig::Instrument* pNewResource, void* pUpdateArg); |
virtual void ResourceUpdated(::gig::Instrument* pOldResource, ::gig::Instrument* pNewResource, void* pUpdateArg); |
93 |
virtual void OnResourceProgress(float fProgress); |
virtual void OnResourceProgress(float fProgress); |
94 |
|
|
95 |
|
void Connect(VirtualMidiDevice* pDevice); |
96 |
|
void Disconnect(VirtualMidiDevice* pDevice); |
97 |
|
|
98 |
//protected: |
//protected: |
99 |
Engine* pEngine; |
Engine* pEngine; |
100 |
AudioChannel* pChannelLeft; ///< encapsulates the audio rendering buffer (left) |
AudioChannel* pChannelLeft; ///< encapsulates the audio rendering buffer (left) |
130 |
int iEngineIndexSelf; ///< Reflects the index of this EngineChannel in the Engine's ArrayList. |
int iEngineIndexSelf; ///< Reflects the index of this EngineChannel in the Engine's ArrayList. |
131 |
bool bStatusChanged; ///< true in case an engine parameter has changed (e.g. new instrument, another volumet) |
bool bStatusChanged; ///< true in case an engine parameter has changed (e.g. new instrument, another volumet) |
132 |
std::vector<FxSend*> fxSends; |
std::vector<FxSend*> fxSends; |
133 |
|
int GlobalTranspose; ///< amount of semi tones all notes should be transposed |
134 |
|
|
135 |
|
/// Command used by the instrument loader thread to |
136 |
|
/// request an instrument change on a channel. |
137 |
|
struct instrument_change_command_t { |
138 |
|
bool bChangeInstrument; ///< Set to true by the loader when the channel should change instrument. |
139 |
|
::gig::Instrument* pInstrument; ///< The new instrument. Also used by the loader to read the previously loaded instrument. |
140 |
|
RTList< ::gig::DimensionRegion*>* pDimRegionsInUse; ///< List of dimension regions in use by the currently loaded instrument. Continuously updated by the audio thread. |
141 |
|
}; |
142 |
|
SynchronizedConfig<instrument_change_command_t> InstrumentChangeCommand; |
143 |
|
SynchronizedConfig<instrument_change_command_t>::Reader InstrumentChangeCommandReader; |
144 |
|
|
145 |
|
RTList< ::gig::DimensionRegion*>* pDimRegionsInUse; ///< temporary pointer into the instrument change command, used by the audio thread |
146 |
|
|
147 |
|
SynchronizedConfig< ArrayList<VirtualMidiDevice*> > virtualMidiDevices; |
148 |
|
SynchronizedConfig< ArrayList<VirtualMidiDevice*> >::Reader virtualMidiDevicesReader; |
149 |
|
|
150 |
void ResetControllers(); |
void ResetControllers(); |
151 |
void ClearEventLists(); |
void ClearEventLists(); |
158 |
private: |
private: |
159 |
void ResetInternal(); |
void ResetInternal(); |
160 |
void RemoveAllFxSends(); |
void RemoveAllFxSends(); |
161 |
|
instrument_change_command_t& ChangeInstrument(::gig::Instrument* pInstrument); |
162 |
}; |
}; |
163 |
|
|
164 |
}} // namespace LinuxSampler::gig |
}} // namespace LinuxSampler::gig |