-Updated GUI feedback of TrackSend events

This commit is contained in:
Harry van Haaren 2013-08-04 18:49:27 +01:00
parent eb94b51162
commit b50b3d05eb
6 changed files with 58 additions and 5 deletions

View file

@ -87,10 +87,29 @@ void ccChange( int track, int cc, float value )
{
switch( cc )
{
/// Track faders
case 7: {
EventTrackVol e( track, value );
writeToGuiRingbuffer( &e ); }
break;
case 14: { // master
EventTrackVol e( -1, value );
writeToGuiRingbuffer( &e ); }
break;
/// Device Control
case 16: {
EventTrackSend e( track, SEND_SIDE, value );
writeToGuiRingbuffer( &e ); }
break;
case 17: {
EventTrackSend e( track, SEND_POST, value );
writeToGuiRingbuffer( &e ); }
break;
case 18: {
EventTrackSend e( track, SEND_REV, value );
writeToGuiRingbuffer( &e ); }
break;
}
}

View file

@ -16,6 +16,12 @@ class Controller
/// name string to show in UI
virtual std::string getName() = 0;
/// master
virtual void masterVolume(float f){};
/// FX
virtual void fxReverbSend(int t, float r){};
/// track functionality
virtual void mute(int t, bool b){};
virtual void volume(int t, float f){};

View file

@ -5,6 +5,7 @@
#include <iostream>
#include "../jack.hxx"
#include "../event.hxx"
#include "../gridlogic.hxx"
extern Jack* jack;
@ -15,11 +16,23 @@ LupppGUI::LupppGUI() :
}
void LupppGUI::masterVolume(float f)
{
EventTrackVol e( -1, f );
writeToGuiRingbuffer( &e );
}
void LupppGUI::recordArm(int t, bool enabled)
{
}
void LupppGUI::fxReverbSend(int t, float r)
{
EventTrackSend e( t, SEND_REV, r );
writeToGuiRingbuffer( &e );
}
void LupppGUI::setSceneState(int t, int clip, GridLogic::State s)
{
@ -30,10 +43,10 @@ void LupppGUI::mute(int t, bool b)
}
void LupppGUI::volume(int t, float f)
{
EventTrackVol e( t, f );
writeToGuiRingbuffer( &e );
}
void LupppGUI::progress(int t, int s, float f)

View file

@ -14,6 +14,10 @@ class LupppGUI : public Controller
std::string getName(){return "Luppp GUI";}
void masterVolume(float f);
void fxReverbSend(int t, float r);
void mute(int t, bool b);
void volume(int t, float f);
void progress(int t, int s, float p);

View file

@ -116,7 +116,7 @@ class EventTrackSend : public EventBase
float value;
EventTrackSend(){};
EventTrackSend(int t, SEND_TYPE s, int v): track(t), send(s), value(v){}
EventTrackSend(int t, SEND_TYPE s, float v): track(t), send(s), value(v){}
};
class EventLooperState : public EventBase
@ -152,7 +152,7 @@ class EventLooperLoopLength : public EventBase
uint32_t size() { return sizeof(EventLooperLoopLength); }
int track;
float scale; // multiply length by this
float scale;
EventLooperLoopLength(){}
EventLooperLoopLength(int t, float s) : track(t), scale(s){}
};

View file

@ -88,7 +88,18 @@ void handleGuiEvents()
else
gui->getTrack(ev.track)->getVolume()->value( ev.vol );
} break; }
case Event::TRACK_SEND: {
if ( availableRead >= sizeof(EventTrackSend) ) {
EventTrackSend ev;
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventTrackSend) );
if ( ev.send == SEND_REV )
gui->getTrack(ev.track)->rev.value( ev.value );
if ( ev.send == SEND_POST )
gui->getTrack(ev.track)->post.value( ev.value );
if ( ev.send == SEND_SIDE )
gui->getTrack(ev.track)->side.value( ev.value );
} break; }
case Event::GUI_PRINT: {
if ( availableRead >= sizeof(EventGuiPrint) ) {
EventGuiPrint ev;