Merge pull request #463 from diizy/stable-0.4
Knob: add volumeRatio property to allow showing knobs with ratios other ...
This commit is contained in:
@@ -58,6 +58,8 @@ class EXPORT knob : public QWidget, public FloatModelView
|
||||
// correctly so we need to do this:
|
||||
Q_PROPERTY(QColor outerColor READ outerColor WRITE setOuterColor)
|
||||
mapPropertyFromModel(bool,isVolumeKnob,setVolumeKnob,m_volumeKnob);
|
||||
mapPropertyFromModel(float,volumeRatio,setVolumeRatio,m_volumeRatio);
|
||||
|
||||
public:
|
||||
knob( int _knob_num, QWidget * _parent = NULL, const QString & _name = QString() );
|
||||
virtual ~knob();
|
||||
@@ -149,6 +151,7 @@ private:
|
||||
|
||||
QPixmap * m_knobPixmap;
|
||||
BoolModel m_volumeKnob;
|
||||
FloatModel m_volumeRatio;
|
||||
|
||||
QPoint m_mouseOffset;
|
||||
QPoint m_origMousePos;
|
||||
|
||||
@@ -81,9 +81,9 @@ void BassBoosterControls::changeRatio()
|
||||
|
||||
void BassBoosterControls::loadSettings( const QDomElement& _this )
|
||||
{
|
||||
m_freqModel.setValue( _this.attribute( "freq" ).toFloat() );
|
||||
m_gainModel.setValue( _this.attribute( "gain" ).toFloat() );
|
||||
m_ratioModel.setValue( _this.attribute( "ratio" ).toFloat() );
|
||||
m_freqModel.loadSettings( _this, "freq" );
|
||||
m_gainModel.loadSettings( _this, "gain" );
|
||||
m_ratioModel.loadSettings( _this, "ratio");
|
||||
}
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@ void BassBoosterControls::loadSettings( const QDomElement& _this )
|
||||
|
||||
void BassBoosterControls::saveSettings( QDomDocument& doc, QDomElement& _this )
|
||||
{
|
||||
_this.setAttribute( "freq", m_freqModel.value() );
|
||||
_this.setAttribute( "gain", m_gainModel.value() );
|
||||
_this.setAttribute( "ratio", m_ratioModel.value() );
|
||||
m_freqModel.saveSettings( doc, _this, "freq" );
|
||||
m_gainModel.saveSettings( doc, _this, "gain" );
|
||||
m_ratioModel.saveSettings( doc, _this, "ratio");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 15 KiB |
@@ -58,12 +58,16 @@ dynProcControlDialog::dynProcControlDialog(
|
||||
waveGraph -> setMaximumSize( 204, 205 );
|
||||
|
||||
knob * inputKnob = new knob( knobBright_26, this);
|
||||
inputKnob -> setVolumeKnob( true );
|
||||
inputKnob -> setVolumeRatio( 1.0 );
|
||||
inputKnob -> move( 14, 251 );
|
||||
inputKnob->setModel( &_controls->m_inputModel );
|
||||
inputKnob->setLabel( tr( "INPUT" ) );
|
||||
inputKnob->setHintText( tr( "Input gain:" ) + " ", "" );
|
||||
|
||||
knob * outputKnob = new knob( knobBright_26, this );
|
||||
outputKnob -> setVolumeKnob( true );
|
||||
outputKnob -> setVolumeRatio( 1.0 );
|
||||
outputKnob -> move( 54, 251 );
|
||||
outputKnob->setModel( &_controls->m_outputModel );
|
||||
outputKnob->setLabel( tr( "OUTPUT" ) );
|
||||
|
||||
@@ -86,11 +86,11 @@ void dynProcControls::samplesChanged( int _begin, int _end)
|
||||
void dynProcControls::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
//load knobs, stereomode
|
||||
m_inputModel.setValue( _this.attribute( "inputGain" ).toFloat() );
|
||||
m_outputModel.setValue( _this.attribute( "outputGain" ).toFloat() );
|
||||
m_attackModel.setValue( _this.attribute( "attack" ).toFloat() );
|
||||
m_releaseModel.setValue( _this.attribute( "release" ).toFloat() );
|
||||
m_stereomodeModel.setValue( _this.attribute( "stereoMode" ).toInt() );
|
||||
m_inputModel.loadSettings( _this, "inputGain" );
|
||||
m_outputModel.loadSettings( _this, "outputGain" );
|
||||
m_attackModel.loadSettings( _this, "attack" );
|
||||
m_releaseModel.loadSettings( _this, "release" );
|
||||
m_stereomodeModel.loadSettings( _this, "stereoMode" );
|
||||
|
||||
//load waveshape
|
||||
int size = 0;
|
||||
@@ -109,11 +109,11 @@ void dynProcControls::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
//save input, output knobs
|
||||
_this.setAttribute( "inputGain", m_inputModel.value() );
|
||||
_this.setAttribute( "outputGain", m_outputModel.value() );
|
||||
_this.setAttribute( "attack", m_attackModel.value() );
|
||||
_this.setAttribute( "release", m_releaseModel.value() );
|
||||
_this.setAttribute( "stereoMode", m_stereomodeModel.value() );
|
||||
m_inputModel.saveSettings( _doc, _this, "inputGain" );
|
||||
m_outputModel.saveSettings( _doc, _this, "outputGain" );
|
||||
m_attackModel.saveSettings( _doc, _this, "attack" );
|
||||
m_releaseModel.saveSettings( _doc, _this, "release" );
|
||||
m_stereomodeModel.saveSettings( _doc, _this, "stereoMode" );
|
||||
|
||||
|
||||
//save waveshape
|
||||
|
||||
@@ -51,7 +51,7 @@ void stereoEnhancerControls::changeWideCoeff()
|
||||
|
||||
void stereoEnhancerControls::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_widthModel.setValue( _this.attribute( "width" ).toFloat() );
|
||||
m_widthModel.loadSettings( _this, "width" );
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ void stereoEnhancerControls::loadSettings( const QDomElement & _this )
|
||||
void stereoEnhancerControls::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "width", m_widthModel.value() );
|
||||
m_widthModel.saveSettings( _doc, _this, "width" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -59,10 +59,10 @@ void stereoMatrixControls::changeMatrix()
|
||||
|
||||
void stereoMatrixControls::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_llModel.setValue( _this.attribute( "l-l" ).toFloat() );
|
||||
m_lrModel.setValue( _this.attribute( "l-r" ).toFloat() );
|
||||
m_rlModel.setValue( _this.attribute( "r-l" ).toFloat() );
|
||||
m_rrModel.setValue( _this.attribute( "r-r" ).toFloat() );
|
||||
m_llModel.loadSettings( _this, "l-l" );
|
||||
m_lrModel.loadSettings( _this, "l-r" );
|
||||
m_rlModel.loadSettings( _this, "r-l" );
|
||||
m_rrModel.loadSettings( _this, "r-r" );
|
||||
}
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@ void stereoMatrixControls::loadSettings( const QDomElement & _this )
|
||||
void stereoMatrixControls::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "l-l", m_llModel.value() );
|
||||
_this.setAttribute( "l-r", m_lrModel.value() );
|
||||
_this.setAttribute( "r-l", m_rlModel.value() );
|
||||
_this.setAttribute( "r-r", m_rrModel.value() );
|
||||
m_llModel.saveSettings( _doc, _this, "l-l" );
|
||||
m_lrModel.saveSettings( _doc, _this, "l-r" );
|
||||
m_rlModel.saveSettings( _doc, _this, "r-l" );
|
||||
m_rrModel.saveSettings( _doc, _this, "r-r" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -58,12 +58,16 @@ waveShaperControlDialog::waveShaperControlDialog(
|
||||
waveGraph -> setMaximumSize( 204, 205 );
|
||||
|
||||
knob * inputKnob = new knob( knobBright_26, this);
|
||||
inputKnob -> setVolumeKnob( true );
|
||||
inputKnob -> setVolumeRatio( 1.0 );
|
||||
inputKnob -> move( 14, 251 );
|
||||
inputKnob->setModel( &_controls->m_inputModel );
|
||||
inputKnob->setLabel( tr( "INPUT" ) );
|
||||
inputKnob->setHintText( tr( "Input gain:" ) + " ", "" );
|
||||
|
||||
knob * outputKnob = new knob( knobBright_26, this );
|
||||
outputKnob -> setVolumeKnob( true );
|
||||
outputKnob -> setVolumeRatio( 1.0 );
|
||||
outputKnob -> move( 54, 251 );
|
||||
outputKnob->setModel( &_controls->m_outputModel );
|
||||
outputKnob->setLabel( tr( "OUTPUT" ) );
|
||||
|
||||
@@ -88,8 +88,8 @@ void waveShaperControls::samplesChanged( int _begin, int _end)
|
||||
void waveShaperControls::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
//load input, output knobs
|
||||
m_inputModel.setValue( _this.attribute( "inputGain" ).toFloat() );
|
||||
m_outputModel.setValue( _this.attribute( "outputGain" ).toFloat() );
|
||||
m_inputModel.loadSettings( _this, "inputGain" );
|
||||
m_outputModel.loadSettings( _this, "outputGain" );
|
||||
|
||||
m_clipModel.loadSettings( _this, "clipInput" );
|
||||
|
||||
@@ -110,9 +110,9 @@ void waveShaperControls::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
//save input, output knobs
|
||||
_this.setAttribute( "inputGain", m_inputModel.value() );
|
||||
_this.setAttribute( "outputGain", m_outputModel.value() );
|
||||
|
||||
m_inputModel.saveSettings( _doc, _this, "inputGain" );
|
||||
m_outputModel.saveSettings( _doc, _this, "outputGain" );
|
||||
|
||||
m_clipModel.saveSettings( _doc, _this, "clipInput" );
|
||||
|
||||
//save waveshape
|
||||
|
||||
@@ -61,6 +61,7 @@ knob::knob( int _knob_num, QWidget * _parent, const QString & _name ) :
|
||||
m_label( "" ),
|
||||
m_knobPixmap( NULL ),
|
||||
m_volumeKnob( false ),
|
||||
m_volumeRatio( 100.0, 0.0, 1000000.0 ),
|
||||
m_buttonPressed( false ),
|
||||
m_angle( -10 ),
|
||||
m_outerColor( NULL )
|
||||
@@ -668,7 +669,7 @@ QString knob::displayValue() const
|
||||
configManager::inst()->value( "app", "displaydbv" ).toInt() )
|
||||
{
|
||||
return m_description.trimmed() + QString( " %1 dBV" ).
|
||||
arg( 20.0 * log10( model()->value() / 100.0 ),
|
||||
arg( 20.0 * log10( model()->value() / volumeRatio() ),
|
||||
3, 'f', 2 );
|
||||
}
|
||||
return m_description.trimmed() + QString( " %1" ).
|
||||
|
||||
Reference in New Issue
Block a user