Merge upstream changes.

This commit is contained in:
Rüdiger Ranft
2014-12-19 17:21:16 +01:00
85 changed files with 2058 additions and 371 deletions

View File

@@ -290,7 +290,13 @@ void ConfigManager::loadConfigFile()
node = node.nextSibling();
}
if( value( "paths", "artwork" ) != "" )
// don't use dated theme folders as they break the UI (i.e. 0.4 != 1.0, etc)
bool use_artwork_path =
root.attribute( "version" ).startsWith(
QString::number( LMMS_VERSION_MAJOR ) + "." +
QString::number( LMMS_VERSION_MINOR ) );
if( use_artwork_path && value( "paths", "artwork" ) != "" )
{
m_artworkDir = value( "paths", "artwork" );
if( !QDir( m_artworkDir ).exists() )

View File

@@ -115,6 +115,7 @@ void Engine::init( const bool _has_gui )
void Engine::destroy()
{
s_projectJournal->stopAllJournalling();
s_mixer->stopProcessing();
deleteHelper( &s_projectNotes );

View File

@@ -100,11 +100,10 @@ inline void FxChannel::processed()
void FxChannel::incrementDeps()
{
m_dependenciesMet.ref();
if( m_dependenciesMet >= m_receives.size() )
if( m_dependenciesMet >= m_receives.size() && ! m_queued )
{
m_queued = true;
MixerWorkerThread::addJob( this );
m_dependenciesMet = 0;
}
}
@@ -174,7 +173,7 @@ void FxChannel::doProcessing()
// only start fxchain when we have input...
m_fxChain.startRunning();
}
m_stillRunning = m_fxChain.processAudioBuffer( m_buffer, fpp, m_hasInput );
m_peakLeft = qMax( m_peakLeft, Engine::mixer()->peakValueLeft( m_buffer, fpp ) * v );
@@ -184,8 +183,8 @@ void FxChannel::doProcessing()
{
m_peakLeft = m_peakRight = 0.0f;
}
// increment dependency counter of all receivers
// increment dependency counter of all receivers
processed();
}
@@ -430,7 +429,7 @@ FxRoute * FxMixer::createRoute( FxChannel * from, FxChannel * to, float amount )
// add us to fxmixer's list
Engine::fxMixer()->m_fxRoutes.append( route );
m_sendsMutex.unlock();
return route;
}
@@ -601,9 +600,6 @@ void FxMixer::masterMix( sampleFrame * _buf )
: m_fxChannels[0]->m_volumeModel.value();
MixHelpers::addSanitizedMultiplied( _buf, m_fxChannels[0]->m_buffer, v, fpp );
m_fxChannels[0]->m_peakLeft *= Engine::mixer()->masterGain();
m_fxChannels[0]->m_peakRight *= Engine::mixer()->masterGain();
// clear all channel buffers and
// reset channel process state
for( int i = 0; i < numChannels(); ++i)
@@ -613,6 +609,7 @@ void FxMixer::masterMix( sampleFrame * _buf )
m_fxChannels[i]->m_queued = false;
// also reset hasInput
m_fxChannels[i]->m_hasInput = false;
m_fxChannels[i]->m_dependenciesMet = 0;
}
}
@@ -688,7 +685,7 @@ void FxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this )
ch->m_sends[si]->amount()->saveSettings( _doc, sendsDom, "amount" );
}
}
}
}
// make sure we have at least num channels
void FxMixer::allocateChannelsTo(int num)

View File

@@ -70,14 +70,19 @@ void JournallingObject::addJournalCheckPoint()
QDomElement JournallingObject::saveState( QDomDocument & _doc,
QDomElement & _parent )
{
QDomElement _this = SerializingObject::saveState( _doc, _parent );
if( isJournalling() )
{
QDomElement _this = SerializingObject::saveState( _doc, _parent );
QDomElement journalNode = _doc.createElement( "journallingObject" );
journalNode.setAttribute( "id", id() );
journalNode.setAttribute( "metadata", true );
_this.appendChild( journalNode );
QDomElement journalNode = _doc.createElement( "journallingObject" );
journalNode.setAttribute( "id", id() );
journalNode.setAttribute( "metadata", true );
_this.appendChild( journalNode );
return _this;
return _this;
} else {
return QDomElement();
}
}

View File

@@ -168,5 +168,17 @@ void ProjectJournal::clearJournal()
}
}
void ProjectJournal::stopAllJournalling()
{
for( JoIdMap::Iterator it = m_joIDs.begin(); it != m_joIDs.end(); ++it)
{
if( it.value() != NULL )
{
it.value()->setJournalling(false);
}
}
setJournalling(false);
}

View File

@@ -957,6 +957,7 @@ void SampleBuffer::visualize( QPainter & _p, const QRect & _dr,
_p.drawPolyline( l, nb_frames / fpp );
_p.drawPolyline( r, nb_frames / fpp );
delete[] l;
delete[] r;
}

View File

@@ -473,7 +473,7 @@ void Song::playBB()
void Song::playPattern( Pattern* patternToPlay, bool _loop )
void Song::playPattern( const Pattern* patternToPlay, bool _loop )
{
if( isStopped() == false )
{

View File

@@ -2141,7 +2141,7 @@ TrackContentObject * Track::getTCO( int _tco_num )
* \param _tco The TrackContentObject to search for.
* \return its number in our array.
*/
int Track::getTCONum( TrackContentObject * _tco )
int Track::getTCONum( const TrackContentObject * _tco )
{
// for( int i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i )
tcoVector::iterator it = qFind( m_trackContentObjects.begin(),

View File

@@ -1934,7 +1934,7 @@ void AutomationEditor::play()
if( Engine::getSong()->playMode() != Song::Mode_PlayPattern )
{
Engine::getSong()->stop();
Engine::getSong()->playPattern( (Pattern *) Engine::pianoRoll()->currentPattern() );
Engine::getSong()->playPattern( Engine::pianoRoll()->currentPattern() );
}
else if( Engine::getSong()->isStopped() == false )
{
@@ -1942,7 +1942,7 @@ void AutomationEditor::play()
}
else
{
Engine::getSong()->playPattern( (Pattern *) Engine::pianoRoll()->currentPattern() );
Engine::getSong()->playPattern( Engine::pianoRoll()->currentPattern() );
}
}
else if( inBBEditor() )

View File

@@ -194,12 +194,13 @@ void FxMixerView::refreshDisplay()
for( int i = 1; i<m_fxChannelViews.size(); ++i )
{
chLayout->removeWidget(m_fxChannelViews[i]->m_fxLine);
m_racksLayout->removeWidget( m_fxChannelViews[i]->m_rackView );
delete m_fxChannelViews[i]->m_fader;
delete m_fxChannelViews[i]->m_muteBtn;
delete m_fxChannelViews[i]->m_soloBtn;
delete m_fxChannelViews[i]->m_fxLine;
delete m_fxChannelViews[i]->m_rackView;
delete m_fxChannelViews[i];
m_racksLayout->removeWidget( m_fxChannelViews[i]->m_rackView );
}
m_channelAreaWidget->adjustSize();
@@ -363,16 +364,15 @@ void FxMixerView::deleteChannel(int index)
// delete the view
chLayout->removeWidget(m_fxChannelViews[index]->m_fxLine);
m_racksLayout->removeWidget( m_fxChannelViews[index]->m_rackView );
delete m_fxChannelViews[index]->m_fader;
delete m_fxChannelViews[index]->m_muteBtn;
delete m_fxChannelViews[index]->m_soloBtn;
delete m_fxChannelViews[index]->m_fxLine;
delete m_fxChannelViews[index]->m_rackView;
delete m_fxChannelViews[index];
m_channelAreaWidget->adjustSize();
// delete the fx rack
m_racksLayout->removeWidget( m_fxChannelViews[index]->m_rackView );
// make sure every channel knows what index it is
for(int i=0; i<m_fxChannelViews.size(); ++i)
{
@@ -503,6 +503,11 @@ void FxMixerView::clear()
void FxMixerView::updateFaders()
{
FxMixer * m = Engine::fxMixer();
// apply master gain
m->m_fxChannels[0]->m_peakLeft *= Engine::mixer()->masterGain();
m->m_fxChannels[0]->m_peakRight *= Engine::mixer()->masterGain();
for( int i = 0; i < m_fxChannelViews.size(); ++i )
{
const float opl = m_fxChannelViews[i]->m_fader->getPeak_L();

View File

@@ -75,14 +75,14 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent
m_baseKnob = new Knob( knobBright_26, this );
m_baseKnob->setLabel( tr( "BASE" ) );
m_baseKnob->move( CD_LFO_BASE_CD_KNOB_X, CD_LFO_CD_KNOB_Y );
m_baseKnob->setHintText( tr( "Base amount:" ) + " ", "" );
m_baseKnob->setHintText( tr( "Base amount:" ), "" );
m_baseKnob->setWhatsThis( tr("todo") );
m_speedKnob = new TempoSyncKnob( knobBright_26, this );
m_speedKnob->setLabel( tr( "SPD" ) );
m_speedKnob->move( CD_LFO_SPEED_CD_KNOB_X, CD_LFO_CD_KNOB_Y );
m_speedKnob->setHintText( tr( "LFO-speed:" ) + " ", "" );
m_speedKnob->setHintText( tr( "LFO-speed:" ), "" );
m_speedKnob->setWhatsThis(
tr( "Use this knob for setting speed of the LFO. The "
"bigger this value the faster the LFO oscillates and "
@@ -92,7 +92,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent
m_amountKnob = new Knob( knobBright_26, this );
m_amountKnob->setLabel( tr( "AMT" ) );
m_amountKnob->move( CD_LFO_AMOUNT_CD_KNOB_X, CD_LFO_CD_KNOB_Y );
m_amountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" );
m_amountKnob->setHintText( tr( "Modulation amount:" ), "" );
m_amountKnob->setWhatsThis(
tr( "Use this knob for setting modulation amount of the "
"LFO. The bigger this value, the more the connected "
@@ -102,7 +102,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent
m_phaseKnob = new Knob( knobBright_26, this );
m_phaseKnob->setLabel( tr( "PHS" ) );
m_phaseKnob->move( CD_LFO_PHASE_CD_KNOB_X, CD_LFO_CD_KNOB_Y );
m_phaseKnob->setHintText( tr( "Phase offset:" ) + " ", "" + tr( "degrees" ) );
m_phaseKnob->setHintText( tr( "Phase offset:" ) , "" + tr( "degrees" ) );
m_phaseKnob->setWhatsThis(
tr( "With this knob you can set the phase offset of "
"the LFO. That means you can move the "

View File

@@ -70,6 +70,11 @@
#include "TextFloat.h"
#if QT_VERSION < 0x040800
#define MiddleButton MidButton
#endif
typedef AutomationPattern::timeMap timeMap;

View File

@@ -29,6 +29,8 @@
#include <QScrollArea>
#include "PluginBrowser.h"
#include <algorithm> // for std::sort
#include "embed.h"
#include "debug.h"
#include "templates.h"

View File

@@ -1,5 +1,5 @@
/*
* AutomatableSlider.cpp - implementation of class automatableSlider
* AutomatableSlider.cpp - implementation of class AutomatableSlider
*
* Copyright (c) 2006-2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
* Copyright (c) 2007-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>

View File

@@ -67,7 +67,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
m_wetDry->setLabel( tr( "W/D" ) );
m_wetDry->move( 27, 5 );
m_wetDry->setEnabled( isEnabled );
m_wetDry->setHintText( tr( "Wet Level:" ) + " ", "" );
m_wetDry->setHintText( tr( "Wet Level:" ), "" );
m_wetDry->setWhatsThis( tr( "The Wet/Dry knob sets the ratio between "
"the input signal and the effect signal that "
"forms the output." ) );
@@ -77,7 +77,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
m_autoQuit->setLabel( tr( "DECAY" ) );
m_autoQuit->move( 60, 5 );
m_autoQuit->setEnabled( isEnabled );
m_autoQuit->setHintText( tr( "Time:" ) + " ", "ms" );
m_autoQuit->setHintText( tr( "Time:" ), "ms" );
m_autoQuit->setWhatsThis( tr(
"The Decay knob controls how many buffers of silence must pass before the "
"plugin stops processing. Smaller values will reduce the CPU overhead but "
@@ -88,7 +88,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
m_gate->setLabel( tr( "GATE" ) );
m_gate->move( 93, 5 );
m_gate->setEnabled( isEnabled );
m_gate->setHintText( tr( "Gate:" ) + " ", "" );
m_gate->setHintText( tr( "Gate:" ), "" );
m_gate->setWhatsThis( tr(
"The Gate knob controls the signal level that is considered to be 'silence' "
"while deciding when to stop processing signals." ) );

View File

@@ -97,7 +97,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_predelayKnob = new Knob( knobBright_26, this );
m_predelayKnob->setLabel( tr( "DEL" ) );
m_predelayKnob->move( PREDELAY_KNOB_X, ENV_KNOBS_Y );
m_predelayKnob->setHintText( tr( "Predelay:" ) + " ", "" );
m_predelayKnob->setHintText( tr( "Predelay:" ), "" );
m_predelayKnob->setWhatsThis(
tr( "Use this knob for setting predelay of the current "
"envelope. The bigger this value the longer the time "
@@ -107,7 +107,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_attackKnob = new Knob( knobBright_26, this );
m_attackKnob->setLabel( tr( "ATT" ) );
m_attackKnob->move( ATTACK_KNOB_X, ENV_KNOBS_Y );
m_attackKnob->setHintText( tr( "Attack:" )+" ", "" );
m_attackKnob->setHintText( tr( "Attack:" ), "" );
m_attackKnob->setWhatsThis(
tr( "Use this knob for setting attack-time of the current "
"envelope. The bigger this value the longer the "
@@ -118,7 +118,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_holdKnob = new Knob( knobBright_26, this );
m_holdKnob->setLabel( tr( "HOLD" ) );
m_holdKnob->move( HOLD_KNOB_X, ENV_KNOBS_Y );
m_holdKnob->setHintText( tr( "Hold:" ) + " ", "" );
m_holdKnob->setHintText( tr( "Hold:" ), "" );
m_holdKnob->setWhatsThis(
tr( "Use this knob for setting hold-time of the current "
"envelope. The bigger this value the longer the "
@@ -128,7 +128,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_decayKnob = new Knob( knobBright_26, this );
m_decayKnob->setLabel( tr( "DEC" ) );
m_decayKnob->move( DECAY_KNOB_X, ENV_KNOBS_Y );
m_decayKnob->setHintText( tr( "Decay:" ) + " ", "" );
m_decayKnob->setHintText( tr( "Decay:" ), "" );
m_decayKnob->setWhatsThis(
tr( "Use this knob for setting decay-time of the current "
"envelope. The bigger this value the longer the "
@@ -140,7 +140,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_sustainKnob = new Knob( knobBright_26, this );
m_sustainKnob->setLabel( tr( "SUST" ) );
m_sustainKnob->move( SUSTAIN_KNOB_X, ENV_KNOBS_Y );
m_sustainKnob->setHintText( tr( "Sustain:" ) + " ", "" );
m_sustainKnob->setHintText( tr( "Sustain:" ), "" );
m_sustainKnob->setWhatsThis(
tr( "Use this knob for setting sustain-level of the current "
"envelope. The bigger this value the higher the level "
@@ -151,7 +151,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_releaseKnob = new Knob( knobBright_26, this );
m_releaseKnob->setLabel( tr( "REL" ) );
m_releaseKnob->move( RELEASE_KNOB_X, ENV_KNOBS_Y );
m_releaseKnob->setHintText( tr( "Release:" ) + " ", "" );
m_releaseKnob->setHintText( tr( "Release:" ), "" );
m_releaseKnob->setWhatsThis(
tr( "Use this knob for setting release-time of the current "
"envelope. The bigger this value the longer the "
@@ -163,7 +163,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_amountKnob = new Knob( knobBright_26, this );
m_amountKnob->setLabel( tr( "AMT" ) );
m_amountKnob->move( AMOUNT_KNOB_X, ENV_GRAPH_Y );
m_amountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" );
m_amountKnob->setHintText( tr( "Modulation amount:" ), "" );
m_amountKnob->setWhatsThis(
tr( "Use this knob for setting modulation amount of the "
"current envelope. The bigger this value the more the "
@@ -176,7 +176,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_lfoPredelayKnob = new Knob( knobBright_26, this );
m_lfoPredelayKnob->setLabel( tr( "DEL" ) );
m_lfoPredelayKnob->move( LFO_PREDELAY_KNOB_X, LFO_KNOB_Y );
m_lfoPredelayKnob->setHintText( tr( "LFO predelay:" ) + " ", "" );
m_lfoPredelayKnob->setHintText( tr( "LFO predelay:" ), "" );
m_lfoPredelayKnob->setWhatsThis(
tr( "Use this knob for setting predelay-time of the current "
"LFO. The bigger this value the the time until the "
@@ -186,7 +186,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_lfoAttackKnob = new Knob( knobBright_26, this );
m_lfoAttackKnob->setLabel( tr( "ATT" ) );
m_lfoAttackKnob->move( LFO_ATTACK_KNOB_X, LFO_KNOB_Y );
m_lfoAttackKnob->setHintText( tr( "LFO- attack:" ) + " ", "" );
m_lfoAttackKnob->setHintText( tr( "LFO- attack:" ), "" );
m_lfoAttackKnob->setWhatsThis(
tr( "Use this knob for setting attack-time of the current LFO. "
"The bigger this value the longer the LFO needs to "
@@ -196,7 +196,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_lfoSpeedKnob = new TempoSyncKnob( knobBright_26, this );
m_lfoSpeedKnob->setLabel( tr( "SPD" ) );
m_lfoSpeedKnob->move( LFO_SPEED_KNOB_X, LFO_KNOB_Y );
m_lfoSpeedKnob->setHintText( tr( "LFO speed:" ) + " ", "" );
m_lfoSpeedKnob->setHintText( tr( "LFO speed:" ), "" );
m_lfoSpeedKnob->setWhatsThis(
tr( "Use this knob for setting speed of the current LFO. The "
"bigger this value the faster the LFO oscillates and "
@@ -206,7 +206,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
m_lfoAmountKnob = new Knob( knobBright_26, this );
m_lfoAmountKnob->setLabel( tr( "AMT" ) );
m_lfoAmountKnob->move( LFO_AMOUNT_KNOB_X, LFO_KNOB_Y );
m_lfoAmountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" );
m_lfoAmountKnob->setHintText( tr( "Modulation amount:" ), "" );
m_lfoAmountKnob->setWhatsThis(
tr( "Use this knob for setting modulation amount of the "
"current LFO. The bigger this value the more the "

View File

@@ -74,6 +74,7 @@ Fader::Fader( FloatModel * _model, const QString & _name, QWidget * _parent ) :
m_persistentPeak_R( 0.0 ),
m_fMinPeak( 0.01f ),
m_fMaxPeak( 1.1 ),
m_displayConversion( true ),
m_moveStartPoint( -1 ),
m_startValue( 0 ),
m_peakGreen( 0, 0, 0 ),
@@ -95,16 +96,55 @@ Fader::Fader( FloatModel * _model, const QString & _name, QWidget * _parent ) :
{
s_knob = new QPixmap( embed::getIconPixmap( "fader_knob" ) );
}
m_back = s_back;
m_leds = s_leds;
m_knob = s_knob;
setWindowTitle( _name );
setAttribute( Qt::WA_OpaquePaintEvent, false );
setMinimumSize( 23, 116 );
setMaximumSize( 23, 116);
resize( 23, 116 );
setModel( _model );
setHintText( "Volume:","%");
}
Fader::Fader( FloatModel * model, const QString & name, QWidget * parent, QPixmap * back, QPixmap * leds, QPixmap * knob ) :
QWidget( parent ),
FloatModelView( model, this ),
m_model( model ),
m_fPeakValue_L( 0.0 ),
m_fPeakValue_R( 0.0 ),
m_persistentPeak_L( 0.0 ),
m_persistentPeak_R( 0.0 ),
m_fMinPeak( 0.01f ),
m_fMaxPeak( 1.1 ),
m_displayConversion( false ),
m_moveStartPoint( -1 ),
m_startValue( 0 ),
m_peakGreen( 0, 0, 0 ),
m_peakRed( 0, 0, 0 )
{
if( s_textFloat == NULL )
{
s_textFloat = new TextFloat;
}
m_back = back;
m_leds = leds;
m_knob = knob;
setWindowTitle( name );
setAttribute( Qt::WA_OpaquePaintEvent, false );
setMinimumSize( m_back->width(), m_back->height() );
setMaximumSize( m_back->width(), m_back->height() );
resize( m_back->width(), m_back->height() );
setModel( model );
setHintText( "Volume:","%");
}
Fader::~Fader()
{
@@ -130,7 +170,7 @@ void Fader::mouseMoveEvent( QMouseEvent *mouseEvent )
{
int dy = m_moveStartPoint - mouseEvent->globalY();
float delta = dy * ( m_model->maxValue() - m_model->minValue() ) / (float) ( height() - ( *s_knob ).height() );
float delta = dy * ( m_model->maxValue() - m_model->minValue() ) / (float) ( height() - ( *m_knob ).height() );
model()->setValue( m_startValue + delta );
@@ -146,7 +186,7 @@ void Fader::mousePressEvent( QMouseEvent* mouseEvent )
if( mouseEvent->button() == Qt::LeftButton &&
! ( mouseEvent->modifiers() & Qt::ControlModifier ) )
{
if( mouseEvent->y() >= knobPosY() - ( *s_knob ).height() && mouseEvent->y() < knobPosY() )
if( mouseEvent->y() >= knobPosY() - ( *m_knob ).height() && mouseEvent->y() < knobPosY() )
{
updateTextFloat();
s_textFloat->show();
@@ -172,19 +212,33 @@ void Fader::mousePressEvent( QMouseEvent* mouseEvent )
void Fader::mouseDoubleClickEvent( QMouseEvent* mouseEvent )
{
bool ok;
float newValue;
// TODO: dbV handling
int newValue = QInputDialog::getInt( this, windowTitle(),
tr( "Please enter a new value between %1 and %2:" ).
arg( model()->minValue()*100 ).
arg( model()->maxValue()*100 ),
model()->value()*100,
model()->minValue()*100,
model()->maxValue()*100, 1, &ok );
if( m_displayConversion )
{
newValue = QInputDialog::getDouble( this, windowTitle(),
tr( "Please enter a new value between %1 and %2:" ).
arg( model()->minValue() * 100 ).
arg( model()->maxValue() * 100 ),
model()->value() * 100,
model()->minValue() * 100,
model()->maxValue() * 100, 4, &ok ) * 0.01f;
}
else
{
newValue = QInputDialog::getDouble( this, windowTitle(),
tr( "Please enter a new value between %1 and %2:" ).
arg( model()->minValue() ).
arg( model()->maxValue() ),
model()->value(),
model()->minValue(),
model()->maxValue(), 4, &ok );
}
if( ok )
{
model()->setValue( newValue / 100.0f );
model()->setValue( newValue );
}
}
@@ -265,25 +319,24 @@ void Fader::setPeak_R( float fPeak )
// update tooltip showing value and adjust position while changing fader value
void Fader::updateTextFloat()
{
if( ConfigManager::inst()->value( "app", "displaydbv" ).toInt() )
if( ConfigManager::inst()->value( "app", "displaydbv" ).toInt() && m_displayConversion )
{
s_textFloat->setText( QString("Volume: %1 dBV").
arg( 20.0 * log10( model()->value() ), 3, 'f', 2 ) );
}
else
{
s_textFloat->setText( QString("Volume: %1 %").arg( m_model->value() * 100 ) );
s_textFloat->setText( m_description + " " + QString("%1 ").arg( m_displayConversion ? m_model->value() * 100 : m_model->value() ) + " " + m_unit );
}
s_textFloat->moveGlobal( this, QPoint( width() - ( *s_knob ).width() - 5, knobPosY() - 46 ) );
s_textFloat->moveGlobal( this, QPoint( width() - ( *m_knob ).width() - 5, knobPosY() - 46 ) );
}
inline int Fader::calculateDisplayPeak( float fPeak )
{
int peak = (int)( 116 - ( fPeak / ( m_fMaxPeak - m_fMinPeak ) ) * 116.0 );
int peak = (int)( m_back->height() - ( fPeak / ( m_fMaxPeak - m_fMinPeak ) ) * m_back->height() );
if ( peak > 116 ) return 116;
else return peak;
return qMin( peak, m_back->height() );
}
void Fader::paintEvent( QPaintEvent * ev)
@@ -291,36 +344,39 @@ void Fader::paintEvent( QPaintEvent * ev)
QPainter painter(this);
// background
painter.drawPixmap( ev->rect(), *s_back, ev->rect() );
painter.drawPixmap( ev->rect(), *m_back, ev->rect() );
// peak leds
//float fRange = abs( m_fMaxPeak ) + abs( m_fMinPeak );
int height = m_back->height();
int width = m_back->width() / 2;
int center = m_back->width() - width;
int peak_L = calculateDisplayPeak( m_fPeakValue_L - m_fMinPeak );
int persistentPeak_L = qMax<int>( 3, calculateDisplayPeak( m_persistentPeak_L - m_fMinPeak ) );
painter.drawPixmap( QRect( 0, peak_L, 11, 116 - peak_L ), *s_leds, QRect( 0, peak_L, 11, 116 - peak_L ) );
painter.drawPixmap( QRect( 0, peak_L, width, height - peak_L ), *m_leds, QRect( 0, peak_L, width, height - peak_L ) );
if( m_persistentPeak_L > 0.05 )
{
painter.fillRect( QRect( 2, persistentPeak_L, 7, 1 ), ( m_persistentPeak_L < 1.0 )
? peakGreen()
? peakGreen()
: peakRed() );
}
int peak_R = calculateDisplayPeak( m_fPeakValue_R - m_fMinPeak );
int persistentPeak_R = qMax<int>( 3, calculateDisplayPeak( m_persistentPeak_R - m_fMinPeak ) );
painter.drawPixmap( QRect( 11, peak_R, 11, 116 - peak_R ), *s_leds, QRect( 11, peak_R, 11, 116 - peak_R ) );
painter.drawPixmap( QRect( center, peak_R, width, height - peak_R ), *m_leds, QRect( center, peak_R, width, height - peak_R ) );
if( m_persistentPeak_R > 0.05 )
{
painter.fillRect( QRect( 14, persistentPeak_R, 7, 1 ), ( m_persistentPeak_R < 1.0 )
? peakGreen()
? peakGreen()
: peakRed() );
}
// knob
painter.drawPixmap( 0, knobPosY() - ( *s_knob ).height(), *s_knob );
painter.drawPixmap( 0, knobPosY() - m_knob->height(), *m_knob );
}
@@ -333,12 +389,12 @@ QColor Fader::peakRed() const
{
return m_peakRed;
}
void Fader::setPeakGreen( const QColor & c )
{
m_peakGreen = c;
}
void Fader::setPeakRed( const QColor & c )
{
m_peakRed = c;

View File

@@ -60,7 +60,7 @@ InstrumentFunctionNoteStackingView::InstrumentFunctionNoteStackingView( Instrume
chordLabel->setFont( pointSize<8>( chordLabel->font() ) );
m_chordRangeKnob->setLabel( tr( "RANGE" ) );
m_chordRangeKnob->setHintText( tr( "Chord range:" ) + " ", " " + tr( "octave(s)" ) );
m_chordRangeKnob->setHintText( tr( "Chord range:" ), " " + tr( "octave(s)" ) );
m_chordRangeKnob->setWhatsThis(
tr( "Use this knob for setting the chord range in octaves. "
"The selected chord will be played within specified "
@@ -130,7 +130,7 @@ InstrumentFunctionArpeggioView::InstrumentFunctionArpeggioView( InstrumentFuncti
m_arpRangeKnob->setLabel( tr( "RANGE" ) );
m_arpRangeKnob->setHintText( tr( "Arpeggio range:" ) + " ", " " + tr( "octave(s)" ) );
m_arpRangeKnob->setHintText( tr( "Arpeggio range:" ), " " + tr( "octave(s)" ) );
m_arpRangeKnob->setWhatsThis(
tr( "Use this knob for setting the arpeggio range in octaves. "
"The selected arpeggio will be played within specified "
@@ -138,7 +138,7 @@ InstrumentFunctionArpeggioView::InstrumentFunctionArpeggioView( InstrumentFuncti
m_arpTimeKnob->setLabel( tr( "TIME" ) );
m_arpTimeKnob->setHintText( tr( "Arpeggio time:" ) + " ", " " + tr( "ms" ) );
m_arpTimeKnob->setHintText( tr( "Arpeggio time:" ), " " + tr( "ms" ) );
m_arpTimeKnob->setWhatsThis(
tr( "Use this knob for setting the arpeggio time in "
"milliseconds. The arpeggio time specifies how long "
@@ -146,7 +146,7 @@ InstrumentFunctionArpeggioView::InstrumentFunctionArpeggioView( InstrumentFuncti
m_arpGateKnob->setLabel( tr( "GATE" ) );
m_arpGateKnob->setHintText( tr( "Arpeggio gate:" ) + " ", tr( "%" ) );
m_arpGateKnob->setHintText( tr( "Arpeggio gate:" ), tr( "%" ) );
m_arpGateKnob->setWhatsThis(
tr( "Use this knob for setting the arpeggio gate. The "
"arpeggio gate specifies the percent of a whole "

View File

@@ -99,7 +99,7 @@ InstrumentSoundShapingView::InstrumentSoundShapingView( QWidget * _parent ) :
m_filterCutKnob = new Knob( knobBright_26, m_filterGroupBox );
m_filterCutKnob->setLabel( tr( "FREQ" ) );
m_filterCutKnob->move( 140, 18 );
m_filterCutKnob->setHintText( tr( "cutoff frequency:" ) + " ", " " + tr( "Hz" ) );
m_filterCutKnob->setHintText( tr( "cutoff frequency:" ), " " + tr( "Hz" ) );
m_filterCutKnob->setWhatsThis(
tr( "Use this knob for setting the cutoff frequency for the "
"selected filter. The cutoff frequency specifies the "
@@ -112,7 +112,7 @@ InstrumentSoundShapingView::InstrumentSoundShapingView( QWidget * _parent ) :
m_filterResKnob = new Knob( knobBright_26, m_filterGroupBox );
m_filterResKnob->setLabel( tr( "RESO" ) );
m_filterResKnob->move( 196, 18 );
m_filterResKnob->setHintText( tr( "Resonance:" ) + " ", "" );
m_filterResKnob->setHintText( tr( "Resonance:" ), "" );
m_filterResKnob->setWhatsThis(
tr( "Use this knob for setting Q/Resonance for the selected "
"filter. Q/Resonance tells the filter how much it "

View File

@@ -100,7 +100,7 @@ LadspaControlView::LadspaControlView( QWidget * _parent,
knb->setModel( m_ctl->tempoSyncKnobModel() );
}
knb->setLabel( m_ctl->port()->name );
knb->setHintText( tr( "Value:" ) + " ", "" );
knb->setHintText( tr( "Value:" ), "" );
knb->setWhatsThis( tr( "Sorry, no help available." ) );
layout->addWidget( knb );
if( link != NULL )

View File

@@ -87,7 +87,7 @@ const char * volume_help = QT_TRANSLATE_NOOP( "InstrumentTrack",
const int INSTRUMENT_WIDTH = 254;
const int INSTRUMENT_HEIGHT = INSTRUMENT_WIDTH;
const int PIANO_HEIGHT = 84;
const int PIANO_HEIGHT = 82;
const int INSTRUMENT_WINDOW_CACHE_SIZE = 8;
@@ -849,7 +849,7 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV
tr( "Volume" ) );
m_volumeKnob->setVolumeKnob( true );
m_volumeKnob->setModel( &_it->m_volumeModel );
m_volumeKnob->setHintText( tr( "Volume:" ) + " ", "%" );
m_volumeKnob->setHintText( tr( "Volume:" ), "%" );
m_volumeKnob->move( widgetWidth-2*24, 2 );
m_volumeKnob->setLabel( tr( "VOL" ) );
m_volumeKnob->show();
@@ -858,7 +858,7 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV
m_panningKnob = new Knob( knobSmall_17, getTrackSettingsWidget(),
tr( "Panning" ) );
m_panningKnob->setModel( &_it->m_panningModel );
m_panningKnob->setHintText( tr( "Panning:" ) + " ", "%" );
m_panningKnob->setHintText( tr( "Panning:" ), "%" );
m_panningKnob->move( widgetWidth-24, 2 );
m_panningKnob->setLabel( tr( "PAN" ) );
m_panningKnob->show();
@@ -1176,7 +1176,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
// set up volume knob
m_volumeKnob = new Knob( knobBright_26, NULL, tr( "Instrument volume" ) );
m_volumeKnob->setVolumeKnob( true );
m_volumeKnob->setHintText( tr( "Volume:" ) + " ", "%" );
m_volumeKnob->setHintText( tr( "Volume:" ), "%" );
m_volumeKnob->setLabel( tr( "VOL" ) );
m_volumeKnob->setWhatsThis( tr( volume_help ) );
@@ -1185,7 +1185,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
// set up panning knob
m_panningKnob = new Knob( knobBright_26, NULL, tr( "Panning" ) );
m_panningKnob->setHintText( tr( "Panning:" ) + " ", "" );
m_panningKnob->setHintText( tr( "Panning:" ), "" );
m_panningKnob->setLabel( tr( "PAN" ) );
basicControlsLayout->addWidget( m_panningKnob );
@@ -1193,7 +1193,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
// set up pitch knob
m_pitchKnob = new Knob( knobBright_26, NULL, tr( "Pitch" ) );
m_pitchKnob->setHintText( tr( "Pitch:" ) + " ", " " + tr( "cents" ) );
m_pitchKnob->setHintText( tr( "Pitch:" ), " " + tr( "cents" ) );
m_pitchKnob->setLabel( tr( "PITCH" ) );
basicControlsLayout->addWidget( m_pitchKnob );

View File

@@ -537,7 +537,7 @@ SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) :
tr( "Track volume" ) );
m_volumeKnob->setVolumeKnob( true );
m_volumeKnob->setModel( &_t->m_volumeModel );
m_volumeKnob->setHintText( tr( "Channel volume:" ) + " ", "%" );
m_volumeKnob->setHintText( tr( "Channel volume:" ), "%" );
if( ConfigManager::inst()->value( "ui",
"compacttrackbuttons" ).toInt() )
{