-Fixed input section MIDI binding: working as normal

This commit is contained in:
Harry van Haaren 2013-11-09 22:11:45 +00:00
parent 52c73d787c
commit d5d54fa3ea
10 changed files with 32 additions and 10 deletions

View file

@ -39,6 +39,7 @@ class Controller
virtual std::string getName() = 0;
/// master
virtual void masterInputVol(float f){}
virtual void masterInputTo(int to,float f){}
virtual void masterInputToActive(int to,float f){}
virtual void masterVolume(float f){}

View file

@ -447,10 +447,12 @@ void GenericMIDI::midi(unsigned char* midi)
jack->getLogic()->masterInputVol( value );
break;
case Event::MASTER_INPUT_TO:
jack->getLogic()->masterInputTo( static_cast<Event::INPUT_TO>(b->send) , value );
LUPPP_NOTE("GenMidi event INPUT_TO %i", b->send );
jack->getLogic()->masterInputTo( b->send, value );
break;
case Event::MASTER_INPUT_TO_ACTIVE:
jack->getLogic()->masterInputToActive( static_cast<Event::INPUT_TO>(b->send), b->active );
LUPPP_NOTE("GenMidi event INPUT_TO_ACTIVE %i", b->send );
jack->getLogic()->masterInputToActive( b->send, b->active );
break;
case Event::METRONOME_ACTIVE:

View file

@ -17,6 +17,12 @@ LupppGUI::LupppGUI() :
{
}
void LupppGUI::masterInputVol(float f)
{
EventMasterInputVol e( f );
writeToGuiRingbuffer( &e );
}
void LupppGUI::masterInputTo(int to,float f)
{
EventMasterInputTo e( (Event::INPUT_TO)to, f );

View file

@ -15,6 +15,7 @@ class LupppGUI : public Controller
std::string getName(){return "Luppp GUI";}
void masterVolume(float f);
void masterInputVol(float v);
void masterInputTo(int to,float f);
void masterInputToActive(int to,float f);

View file

@ -71,6 +71,11 @@ void ControllerUpdater::masterInputTo( int to, float v )
for(unsigned int i = 0; i < c.size(); i++)
c.at(i)->masterInputTo( to, v);
}
void ControllerUpdater::masterInputVol( float v )
{
for(unsigned int i = 0; i < c.size(); i++)
c.at(i)->masterInputVol( v );
}
void ControllerUpdater::launchScene( int scene )
{

View file

@ -40,6 +40,7 @@ class ControllerUpdater
void masterVolume(float v);
void masterInputToActive(int to, bool v);
void masterInputTo( int inputTo, float vol );
void masterInputVol( float vol );
void setTrackSceneProgress(int t, int s, float p);
void setTrackSendActive(int t, int send, bool v);

View file

@ -203,10 +203,9 @@ class EventMasterInputTo : public EventBase
static const char* prettyName;
const char* name(){ return prettyName; }
INPUT_TO place;
int place;
float value;
EventMasterInputTo() : value(-1){}
EventMasterInputTo(INPUT_TO p, float v) : place(p), value(v){}
EventMasterInputTo(int p=-1, float v=0) : place(p), value(v){}
};
class EventMasterInputToActive : public EventBase
@ -217,10 +216,9 @@ class EventMasterInputToActive : public EventBase
static const char* prettyName;
const char* name(){ return prettyName; }
INPUT_TO place;
int place;
bool active;
EventMasterInputToActive() : active(false){}
EventMasterInputToActive(INPUT_TO p, bool a) : place(p), active(a){}
EventMasterInputToActive(int p=-1, bool a=false) : place(p), active(a){}
};
class EventMasterVol : public EventBase

View file

@ -102,12 +102,15 @@ void handleDspEvents()
if ( availableRead >= sizeof(EventMasterInputTo) ) {
EventMasterInputTo ev;
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventMasterInputTo) );
jack->bindingSend = ev.place;
jack->getLogic()->masterInputTo( ev.place, ev.value );
} break; }
case Event::MASTER_INPUT_TO_ACTIVE: {
if ( availableRead >= sizeof(EventMasterInputToActive) ) {
EventMasterInputToActive ev;
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventMasterInputToActive) );
jack->bindingSend = ev.place;
jack->bindingActive = ev.active;
jack->getLogic()->masterInputToActive( ev.place, ev.active );
} break; }

View file

@ -197,14 +197,16 @@ void GMasterTrack::setBpm( int b )
void GMasterTrack::setInputVol(float f)
{
LUPPP_NOTE(" gmtrck, inputVol %f", f );
inputVolume.value( f );
}
void GMasterTrack::setInputTo(int to, float f)
{
LUPPP_NOTE(" gmtrck, inputTO %i, %f", to, f );
if ( to == Event::INPUT_TO_MIX )
inputToMixVol.value( f );
else if ( to == Event::INPUT_TO_MIX )
else if ( to == Event::INPUT_TO_SEND )
inputToSendVol.value( f );
else if ( to == Event::INPUT_TO_XSIDE )
inputToSidechainSignalVol.value( f );
@ -212,9 +214,11 @@ void GMasterTrack::setInputTo(int to, float f)
void GMasterTrack::setInputToActive(int to, bool f)
{
LUPPP_NOTE(" gmtrck, inputToActive %i, %i", to, int(f) );
if ( to == Event::INPUT_TO_MIX )
inputToMix.value( f );
else if ( to == Event::INPUT_TO_MIX )
else if ( to == Event::INPUT_TO_SEND )
inputToSend.value( f );
else if ( to == Event::INPUT_TO_SIDE_KEY )
inputToSidechainKey.value( f );

View file

@ -28,6 +28,7 @@ void Logic::metronomeEnable(bool b)
void Logic::masterInputVol( float v )
{
jack->inputVolume( v );
jack->getControllerUpdater()->masterInputVol( v );
}
void Logic::masterInputTo( int to, float v )