Skip to content

Commit

Permalink
Probability 2.0: Add knobs for fill value and fill probability
Browse files Browse the repository at this point in the history
  • Loading branch information
elpescado committed Oct 8, 2018
1 parent 3237302 commit 3e93408
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/gui/src/Mixer/MixerLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,17 +686,25 @@ MasterMixerLine::MasterMixerLine(QWidget* parent)
m_pPeakLCD->setPalette( lcdPalette );

m_pHumanizeVelocityRotary = new Rotary( this, Rotary::TYPE_NORMAL, trUtf8( "Humanize velocity" ), false, false );
m_pHumanizeVelocityRotary->move( 74, 88 );
m_pHumanizeVelocityRotary->move( 74, 88 -64 );
connect( m_pHumanizeVelocityRotary, SIGNAL( valueChanged(Rotary*) ), this, SLOT( rotaryChanged(Rotary*) ) );

m_pHumanizeTimeRotary = new Rotary( this, Rotary::TYPE_NORMAL, trUtf8( "Humanize time" ), false, false );
m_pHumanizeTimeRotary->move( 74, 125 );
m_pHumanizeTimeRotary->move( 74, 125 -64);
connect( m_pHumanizeTimeRotary, SIGNAL( valueChanged(Rotary*) ), this, SLOT( rotaryChanged(Rotary*) ) );

m_pSwingRotary = new Rotary( this, Rotary::TYPE_NORMAL, trUtf8( "Swing" ), false, false );
m_pSwingRotary->move( 74, 162 );
m_pSwingRotary->move( 74, 162 -64);
connect( m_pSwingRotary, SIGNAL( valueChanged(Rotary*) ), this, SLOT( rotaryChanged(Rotary*) ) );

m_pFillValueRotary = new Rotary( this, Rotary::TYPE_NORMAL, trUtf8( "Fill" ), false, false );
m_pFillValueRotary->move( 74, 162 );
connect( m_pFillValueRotary, SIGNAL( valueChanged(Rotary*) ), this, SLOT( rotaryChanged(Rotary*) ) );

m_pFillRandomizeRotary = new Rotary( this, Rotary::TYPE_NORMAL, trUtf8( "Randomize" ), false, false );
m_pFillRandomizeRotary->move( 74, 162 +64);
connect( m_pFillRandomizeRotary, SIGNAL( valueChanged(Rotary*) ), this, SLOT( rotaryChanged(Rotary*) ) );

// Mute btn
m_pMuteBtn = new ToggleButton(
this,
Expand Down Expand Up @@ -824,6 +832,8 @@ void MasterMixerLine::updateMixerLine()
m_pHumanizeTimeRotary->setValue( pSong->get_humanize_time_value() );
m_pHumanizeVelocityRotary->setValue( pSong->get_humanize_velocity_value() );
m_pSwingRotary->setValue( pSong->get_swing_factor() );
m_pFillValueRotary->setValue( pSong->get_fill_value() );
m_pFillRandomizeRotary->setValue( pSong->get_fill_randomize() );
m_pMuteBtn->setPressed( pSong->__is_muted );
}
else {
Expand Down Expand Up @@ -851,6 +861,14 @@ void MasterMixerLine::rotaryChanged( Rotary *pRef )
pEngine->getSong()->set_swing_factor( fVal );
sMsg = trUtf8( "Set swing factor [%1]").arg( fVal, 0, 'f', 2 );
}
else if ( pRef == m_pFillValueRotary ) {
pEngine->getSong()->set_fill_value( fVal );
sMsg = trUtf8( "Set fill value [%1]").arg( fVal, 0, 'f', 2 );
}
else if ( pRef == m_pFillRandomizeRotary ) {
pEngine->getSong()->set_fill_randomize( fVal );
sMsg = trUtf8( "Set fill randomize [%1]").arg( fVal, 0, 'f', 2 );
}
else {
ERRORLOG( "[knobChanged] Unhandled knob" );
}
Expand Down
3 changes: 3 additions & 0 deletions src/gui/src/Mixer/MixerLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ class MasterMixerLine: public PixmapWidget
Rotary * m_pHumanizeTimeRotary;
Rotary * m_pHumanizeVelocityRotary;

Rotary * m_pFillValueRotary;
Rotary * m_pFillRandomizeRotary;

ToggleButton * m_pMuteBtn;
};

Expand Down

0 comments on commit 3e93408

Please sign in to comment.