mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 17:11:40 -05:00
-Input volume events added, UI updated
This commit is contained in:
parent
25af4824b1
commit
8813cf0852
7 changed files with 43 additions and 7 deletions
|
@ -38,6 +38,7 @@ namespace Event
|
|||
|
||||
enum {
|
||||
MASTER_VOL,
|
||||
MASTER_INPUT_VOL,
|
||||
MASTER_INPUT_TO,
|
||||
MASTER_INPUT_TO_ACTIVE,
|
||||
MASTER_RETURN,
|
||||
|
@ -122,11 +123,16 @@ class EventMasterVol : public EventBase
|
|||
int type() { return int(MASTER_VOL); }
|
||||
uint32_t size() { return sizeof(EventMasterVol); }
|
||||
float vol;
|
||||
|
||||
EventMasterVol(float v)
|
||||
{
|
||||
vol = v;
|
||||
}
|
||||
EventMasterVol(float v = 0) : vol(v){}
|
||||
};
|
||||
|
||||
class EventMasterInputVol : public EventBase
|
||||
{
|
||||
public:
|
||||
int type() { return int(MASTER_INPUT_VOL); }
|
||||
uint32_t size() { return sizeof(EventMasterInputVol); }
|
||||
float vol;
|
||||
EventMasterInputVol(float v = 0) : vol(v){}
|
||||
};
|
||||
|
||||
class EventMasterReturn : public EventBase
|
||||
|
|
|
@ -60,6 +60,12 @@ void handleDspEvents()
|
|||
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventMasterReturn) );
|
||||
//jack->getLogic()->trackSend( ev.track, ev.send, ev.value );
|
||||
} break; }
|
||||
case Event::MASTER_INPUT_VOL: {
|
||||
if ( availableRead >= sizeof(EventMasterVol) ) {
|
||||
EventMasterVol ev(0);
|
||||
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventMasterVol) );
|
||||
jack->getLogic()->masterInputVol( ev.vol );
|
||||
} break; }
|
||||
case Event::MASTER_INPUT_TO: {
|
||||
if ( availableRead >= sizeof(EventMasterInputTo) ) {
|
||||
EventMasterInputTo ev;
|
||||
|
|
|
@ -17,6 +17,14 @@ static void gmastertrack_volume_callback(Fl_Widget *w, void *data)
|
|||
writeToDspRingbuffer( &e );
|
||||
}
|
||||
|
||||
static void gmastertrack_inputVolume_callback(Fl_Widget *w, void *data)
|
||||
{
|
||||
Avtk::Volume* b = (Avtk::Volume*)w;
|
||||
float v = b->value();
|
||||
EventMasterInputVol e( v );
|
||||
writeToDspRingbuffer( &e );
|
||||
}
|
||||
|
||||
static void gmastertrack_sidchainKeyButton_callback(Fl_Widget *w, void *data)
|
||||
{
|
||||
Avtk::LightButton* b = (Avtk::LightButton*)w;
|
||||
|
@ -129,6 +137,8 @@ GMasterTrack::GMasterTrack(int x, int y, int w, int h, const char* l ) :
|
|||
inputVolume.value(0.5);
|
||||
inputVolume.setOrientationHorizontal();
|
||||
|
||||
inputVolume.callback( gmastertrack_inputVolume_callback, 0 );
|
||||
|
||||
tapTempo.callback( gmastertrack_button_callback, &ID );
|
||||
metronomeButton.callback( gmastertrack_button_callback, 0 );
|
||||
|
||||
|
|
|
@ -347,6 +347,11 @@ void Jack::masterVolume(float vol)
|
|||
masterVol = vol;
|
||||
}
|
||||
|
||||
void Jack::inputVolume(float v)
|
||||
{
|
||||
inputVol = v * 2;
|
||||
}
|
||||
|
||||
void Jack::inputTo(INPUT_TO to, float v)
|
||||
{
|
||||
switch ( to )
|
||||
|
|
|
@ -59,7 +59,8 @@ class Jack
|
|||
/// writes MIDI messages to a MidiObserver's port
|
||||
void midiObserverWriteMIDI( int portIndex, unsigned char* data );
|
||||
|
||||
/// set the master volume
|
||||
/// set the master i/o volume / sends
|
||||
void inputVolume( float vol );
|
||||
void masterVolume( float vol );
|
||||
void inputTo(INPUT_TO to, float v);
|
||||
void inputToActive(INPUT_TO to, bool a);
|
||||
|
@ -89,8 +90,10 @@ class Jack
|
|||
// FX
|
||||
DBMeter* inputMeter;
|
||||
DBMeter* masterMeter;
|
||||
float masterVol;
|
||||
|
||||
float inputVol;
|
||||
float masterVol;
|
||||
|
||||
|
||||
float inputToMixVol;
|
||||
float inputToSendVol;
|
||||
|
|
|
@ -20,6 +20,11 @@ void Logic::metronomeEnable(bool b)
|
|||
jack->getControllerUpdater()->metronomeEnable( b );
|
||||
}
|
||||
|
||||
void Logic::masterInputVol( float v )
|
||||
{
|
||||
jack->inputVolume( v );
|
||||
}
|
||||
|
||||
void Logic::masterInputTo( Event::INPUT_TO inputTo, float v)
|
||||
{
|
||||
jack->inputTo( inputTo, v );
|
||||
|
|
|
@ -28,6 +28,7 @@ class Logic
|
|||
|
||||
void metronomeEnable(bool b);
|
||||
|
||||
void masterInputVol( float v );
|
||||
void masterInputTo( Event::INPUT_TO inputTo, float v);
|
||||
void masterInputToActive( Event::INPUT_TO inputTo, bool active);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue