49 |
InstrumentStat = -1; |
InstrumentStat = -1; |
50 |
AudioDeviceChannelLeft = -1; |
AudioDeviceChannelLeft = -1; |
51 |
AudioDeviceChannelRight = -1; |
AudioDeviceChannelRight = -1; |
52 |
|
ResetControllers(); |
53 |
} |
} |
54 |
|
|
55 |
EngineChannel::~EngineChannel() { |
EngineChannel::~EngineChannel() { |
66 |
* check if some engine channel parameter has changed since the last |
* check if some engine channel parameter has changed since the last |
67 |
* StatusChanged() call. |
* StatusChanged() call. |
68 |
* |
* |
69 |
|
* This method can also be used to mark the engine channel as changed |
70 |
|
* from outside, e.g. by a MIDI input device. The optional argument |
71 |
|
* \a nNewStatus can be used for this. |
72 |
|
* |
73 |
* TODO: This "poll method" is just a lazy solution and might be |
* TODO: This "poll method" is just a lazy solution and might be |
74 |
* replaced in future. |
* replaced in future. |
75 |
* |
* @param bNewStatus - (optional, default: false) sets the new status flag |
76 |
* @returns true if engine channel status has changed since last |
* @returns true if engine channel status has changed since last |
77 |
* StatusChanged() call |
* StatusChanged() call |
78 |
*/ |
*/ |
79 |
bool EngineChannel::StatusChanged() { |
bool EngineChannel::StatusChanged(bool bNewStatus) { |
80 |
bool b = bStatusChanged; |
bool b = bStatusChanged; |
81 |
bStatusChanged = false; |
bStatusChanged = bNewStatus; |
82 |
return b; |
return b; |
83 |
} |
} |
84 |
|
|
85 |
|
void EngineChannel::Reset() { |
86 |
|
if (pEngine) pEngine->DisableAndLock(); |
87 |
|
ResetInternal(); |
88 |
|
ResetControllers(); |
89 |
|
if (pEngine) { |
90 |
|
pEngine->Enable(); |
91 |
|
pEngine->Reset(); |
92 |
|
} |
93 |
|
} |
94 |
|
|
95 |
/** |
/** |
96 |
* This method is not thread safe! |
* This method is not thread safe! |
97 |
*/ |
*/ |
98 |
void EngineChannel::ResetInternal() { |
void EngineChannel::ResetInternal() { |
|
Pitch = 0; |
|
|
SustainPedal = false; |
|
|
GlobalVolume = 1.0; |
|
|
GlobalPanLeft = 1.0f; |
|
|
GlobalPanRight = 1.0f; |
|
99 |
CurrentKeyDimension = 0; |
CurrentKeyDimension = 0; |
100 |
|
|
|
ResetControllers(); |
|
|
|
|
101 |
// reset key info |
// reset key info |
102 |
for (uint i = 0; i < 128; i++) { |
for (uint i = 0; i < 128; i++) { |
103 |
if (pMIDIKeyInfo[i].pActiveVoices) |
if (pMIDIKeyInfo[i].pActiveVoices) |
431 |
} |
} |
432 |
|
|
433 |
void EngineChannel::ResetControllers() { |
void EngineChannel::ResetControllers() { |
434 |
|
Pitch = 0; |
435 |
|
SustainPedal = false; |
436 |
|
GlobalVolume = 1.0; |
437 |
|
GlobalPanLeft = 1.0f; |
438 |
|
GlobalPanRight = 1.0f; |
439 |
// set all MIDI controller values to zero |
// set all MIDI controller values to zero |
440 |
memset(ControllerTable, 0x00, 128); |
memset(ControllerTable, 0x00, 128); |
441 |
} |
} |