25 |
#include "DiskThread.h" |
#include "DiskThread.h" |
26 |
#include "Voice.h" |
#include "Voice.h" |
27 |
#include "EGADSR.h" |
#include "EGADSR.h" |
28 |
|
#include "../EngineFactory.h" |
29 |
|
|
30 |
#include "Engine.h" |
#include "Engine.h" |
31 |
|
|
59 |
pEngine = engines[pDevice]; |
pEngine = engines[pDevice]; |
60 |
} else { // create a new engine (and disk thread) instance for the given audio output device |
} else { // create a new engine (and disk thread) instance for the given audio output device |
61 |
dmsg(4,("Creating new gig::Engine.\n")); |
dmsg(4,("Creating new gig::Engine.\n")); |
62 |
pEngine = new Engine; |
pEngine = (Engine*) EngineFactory::Create("gig"); |
63 |
pEngine->Connect(pDevice); |
pEngine->Connect(pDevice); |
64 |
engines[pDevice] = pEngine; |
engines[pDevice] = pEngine; |
65 |
} |
} |
145 |
if (pSynthesisParameters[0]) free(pSynthesisParameters[0]); |
if (pSynthesisParameters[0]) free(pSynthesisParameters[0]); |
146 |
if (pVoiceStealingQueue) delete pVoiceStealingQueue; |
if (pVoiceStealingQueue) delete pVoiceStealingQueue; |
147 |
if (pSysexBuffer) delete pSysexBuffer; |
if (pSysexBuffer) delete pSysexBuffer; |
148 |
|
EngineFactory::Destroy(this); |
149 |
} |
} |
150 |
|
|
151 |
void Engine::Enable() { |
void Engine::Enable() { |
834 |
dmsg(4,("Engine::ContinuousController cc=%d v=%d\n", itControlChangeEvent->Param.CC.Controller, itControlChangeEvent->Param.CC.Value)); |
dmsg(4,("Engine::ContinuousController cc=%d v=%d\n", itControlChangeEvent->Param.CC.Controller, itControlChangeEvent->Param.CC.Value)); |
835 |
|
|
836 |
switch (itControlChangeEvent->Param.CC.Controller) { |
switch (itControlChangeEvent->Param.CC.Controller) { |
837 |
case 64: { |
case 7: { // volume |
838 |
|
//TODO: not sample accurate yet |
839 |
|
pEngineChannel->GlobalVolume = (float) itControlChangeEvent->Param.CC.Value / 127.0f; |
840 |
|
break; |
841 |
|
} |
842 |
|
case 10: { // panpot |
843 |
|
//TODO: not sample accurate yet |
844 |
|
const int pan = (int) itControlChangeEvent->Param.CC.Value - 64; |
845 |
|
pEngineChannel->GlobalPanLeft = 1.0f - float(RTMath::Max(pan, 0)) / 63.0f; |
846 |
|
pEngineChannel->GlobalPanRight = 1.0f - float(RTMath::Min(pan, 0)) / -64.0f; |
847 |
|
break; |
848 |
|
} |
849 |
|
case 64: { // sustain |
850 |
if (itControlChangeEvent->Param.CC.Value >= 64 && !pEngineChannel->SustainPedal) { |
if (itControlChangeEvent->Param.CC.Value >= 64 && !pEngineChannel->SustainPedal) { |
851 |
dmsg(4,("PEDAL DOWN\n")); |
dmsg(4,("PEDAL DOWN\n")); |
852 |
pEngineChannel->SustainPedal = true; |
pEngineChannel->SustainPedal = true; |
1031 |
} |
} |
1032 |
|
|
1033 |
String Engine::Version() { |
String Engine::Version() { |
1034 |
String s = "$Revision: 1.27 $"; |
String s = "$Revision: 1.29 $"; |
1035 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
1036 |
} |
} |
1037 |
|
|