-Input metering finished
This commit is contained in:
parent
c84cb91013
commit
c2b965cf26
6 changed files with 13 additions and 5 deletions
|
@ -128,8 +128,6 @@ void Volume::draw()
|
|||
// audio level
|
||||
if ( orientationHorizontal )
|
||||
{
|
||||
ampL = 0.75;
|
||||
ampR = 0.95;
|
||||
cairo_rectangle(cr, x, y+h*0.15, w * ampL, 9.9 );
|
||||
cairo_rectangle(cr, x, y+h*0.56, w * ampR, 9.9 );
|
||||
}
|
||||
|
|
|
@ -76,8 +76,9 @@ void handleGuiEvents()
|
|||
if ( availableRead >= sizeof(EventTrackSignalLevel) ) {
|
||||
EventTrackSignalLevel ev;
|
||||
jack_ringbuffer_read( rbToGui, (char*)&ev, sizeof(EventTrackSignalLevel) );
|
||||
if ( ev.track < 0 ) {
|
||||
//printf("%f\t%f\n", ev.left, ev.right);
|
||||
if ( ev.track < 1 ) {
|
||||
gui->getMasterTrack()->getInputVolume()->amplitude( ev.left, ev.right );
|
||||
} else if ( ev.track == -1 ) {
|
||||
gui->getMasterTrack()->getVolume()->amplitude( ev.left, ev.right );
|
||||
} else {
|
||||
gui->getTrack(ev.track)->getVolume()->amplitude( ev.left, ev.right ); }
|
||||
|
|
|
@ -170,6 +170,10 @@ class GMasterTrack : public Fl_Group
|
|||
// FIXME: refactor into time class?
|
||||
int bpm;
|
||||
|
||||
Avtk::Volume* getInputVolume()
|
||||
{
|
||||
return &inputVolume;
|
||||
}
|
||||
Avtk::Volume* getVolume()
|
||||
{
|
||||
return &volume;
|
||||
|
|
|
@ -93,6 +93,7 @@ Jack::Jack() :
|
|||
|
||||
reverbMeter = new DBMeter( buffers.samplerate );
|
||||
masterMeter = new DBMeter( buffers.samplerate );
|
||||
inputMeter = new DBMeter( buffers.samplerate );
|
||||
|
||||
/// setup JACK callbacks
|
||||
if ( jack_set_process_callback( client,
|
||||
|
@ -307,13 +308,16 @@ int Jack::process (jack_nframes_t nframes)
|
|||
}
|
||||
|
||||
|
||||
/// db meter on master
|
||||
/// db meter on master input & output
|
||||
inputMeter->process( nframes, buffers.audio[Buffers::MASTER_INPUT], buffers.audio[Buffers::MASTER_INPUT]);
|
||||
masterMeter->process(nframes, buffers.audio[Buffers::MASTER_OUT_L], buffers.audio[Buffers::MASTER_OUT_R] );
|
||||
|
||||
if ( uiUpdateCounter > uiUpdateConstant )
|
||||
{
|
||||
EventTrackSignalLevel e(-1, masterMeter->getLeftDB(), masterMeter->getRightDB() );
|
||||
writeToGuiRingbuffer( &e );
|
||||
EventTrackSignalLevel e2(-2, inputMeter->getLeftDB(), inputMeter->getRightDB() );
|
||||
writeToGuiRingbuffer( &e2 );
|
||||
|
||||
uiUpdateCounter = 0;
|
||||
}
|
||||
|
|
|
@ -89,6 +89,7 @@ class Jack
|
|||
Reverb* reverb;
|
||||
SidechainGain* sidechainGain;
|
||||
DBMeter* reverbMeter;
|
||||
DBMeter* inputMeter;
|
||||
DBMeter* masterMeter;
|
||||
float masterVol;
|
||||
|
||||
|
|
Loading…
Reference in a new issue