mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 17:11:40 -05:00
-Fixed master fader, working on master return
This commit is contained in:
parent
36092a0a34
commit
860a2d4501
6 changed files with 46 additions and 4 deletions
|
@ -25,9 +25,14 @@ namespace Event
|
|||
SEND_SIDE,
|
||||
SEND_POST,
|
||||
};
|
||||
enum RETURN_TYPE
|
||||
{
|
||||
RETURN_REV = 0,
|
||||
};
|
||||
|
||||
enum {
|
||||
MASTER_VOL,
|
||||
MASTER_RETURN,
|
||||
RECORD,
|
||||
|
||||
STATE_SAVE, // save action
|
||||
|
@ -92,6 +97,19 @@ class EventMasterVol : public EventBase
|
|||
}
|
||||
};
|
||||
|
||||
class EventMasterReturn : public EventBase
|
||||
{
|
||||
public:
|
||||
int type() { return int(MASTER_RETURN); }
|
||||
uint32_t size() { return sizeof(EventMasterReturn); }
|
||||
|
||||
RETURN_TYPE ret;
|
||||
float value;
|
||||
|
||||
EventMasterReturn(){};
|
||||
EventMasterReturn(RETURN_TYPE s, float v): ret(s), value(v){}
|
||||
};
|
||||
|
||||
class EventTrackVol : public EventBase
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -47,11 +47,18 @@ void handleDspEvents()
|
|||
jack->getState()->reset();
|
||||
} break; }
|
||||
|
||||
// ========= MASTER ===
|
||||
case Event::MASTER_VOL: {
|
||||
if ( availableRead >= sizeof(EventMasterVol) ) {
|
||||
EventMasterVol ev(0);
|
||||
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventMasterVol) );
|
||||
//jack->masterVolume = ev.vol;
|
||||
jack->masterVolume( ev.vol );
|
||||
} break; }
|
||||
case Event::MASTER_RETURN: {
|
||||
if ( availableRead >= sizeof(EventMasterReturn) ) {
|
||||
EventMasterReturn ev;
|
||||
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventMasterReturn) );
|
||||
//jack->getLogic()->trackSend( ev.track, ev.send, ev.value );
|
||||
} break; }
|
||||
|
||||
// ========= GRID =====
|
||||
|
@ -141,6 +148,7 @@ void handleDspEvents()
|
|||
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventTrackSend) );
|
||||
jack->getLogic()->trackSend( ev.track, ev.send, ev.value );
|
||||
} break; }
|
||||
|
||||
|
||||
// ========= LUPPP INTERNAL =====
|
||||
case Event::LOOPER_REQUEST_BUFFER: {
|
||||
|
|
|
@ -9,6 +9,14 @@ static void gmastertrack_tempoDial_callback(Fl_Widget *w, void *data)
|
|||
writeToDspRingbuffer( &e );
|
||||
}
|
||||
|
||||
static void gmastertrack_volume_callback(Fl_Widget *w, void *data)
|
||||
{
|
||||
Avtk::Volume* b = (Avtk::Volume*)w;
|
||||
float v = b->value();
|
||||
EventMasterVol e( v );
|
||||
writeToDspRingbuffer( &e );
|
||||
}
|
||||
|
||||
static void gmastertrack_recordVol_callback(Fl_Widget *w, void *data)
|
||||
{
|
||||
//Avtk::Dial* b = (Avtk::Dial*)w;
|
||||
|
@ -129,6 +137,7 @@ GMasterTrack::GMasterTrack(int x, int y, int w, int h, const char* l ) :
|
|||
source.color( FL_BLACK );
|
||||
|
||||
volume.amplitude( 0.0, 0.0 );
|
||||
volume.callback( gmastertrack_volume_callback, 0 );
|
||||
|
||||
end(); // close the group
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ Jack::Jack() :
|
|||
JackPortIsInput,
|
||||
0 );
|
||||
|
||||
masterVol = 0.77;
|
||||
masterVol = 0.0f;
|
||||
|
||||
/// prepare internal buffers
|
||||
buffers.audio[Buffers::SEND] = new float[ buffers.nframes ];
|
||||
|
@ -326,7 +326,6 @@ int Jack::process (jack_nframes_t nframes)
|
|||
// memcpy the internal MASTER_OUTPUT buffer to the JACK_MASTER_OUTPUT
|
||||
memcpy( buffers.audio[Buffers::JACK_MASTER_OUT_L],
|
||||
buffers.audio[Buffers::MASTER_OUT_L],
|
||||
//buffers.audio[Buffers::TRACK_7],
|
||||
sizeof(float)*nframes);
|
||||
|
||||
memcpy( buffers.audio[Buffers::JACK_MASTER_OUT_R],
|
||||
|
@ -338,6 +337,12 @@ int Jack::process (jack_nframes_t nframes)
|
|||
return false;
|
||||
}
|
||||
|
||||
void Jack::masterVolume(float vol)
|
||||
{
|
||||
masterVol = vol;
|
||||
printf("%f\n", masterVol);
|
||||
}
|
||||
|
||||
int Jack::getBuffersize()
|
||||
{
|
||||
return jack_get_buffer_size( client );
|
||||
|
|
|
@ -60,7 +60,7 @@ class Jack
|
|||
void midiObserverWriteMIDI( int portIndex, unsigned char* data );
|
||||
|
||||
/// set the master volume
|
||||
void masterVolume( float vol ){masterVol = vol;}
|
||||
void masterVolume( float vol );
|
||||
|
||||
|
||||
private:
|
||||
|
|
|
@ -26,6 +26,8 @@ class Logic
|
|||
|
||||
void metronomeEnable(bool b);
|
||||
|
||||
void masterReturn(int t, int send, float v);
|
||||
|
||||
void trackVolume(int t, float v);
|
||||
void trackRecordArm(int t, bool v);
|
||||
void trackSend(int t, int send, float v);
|
||||
|
|
Loading…
Add table
Reference in a new issue