Rename Mixer to AudioEngine (#6127)

This commit is contained in:
Alexandre Almeida
2021-09-11 20:00:21 -03:00
committed by GitHub
parent fa407d2530
commit 770d2498b5
157 changed files with 794 additions and 830 deletions

View File

@@ -117,7 +117,7 @@ bool BassBoosterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
inline void BassBoosterEffect::changeFrequency()
{
const sample_t fac = Engine::mixer()->processingSampleRate() / 44100.0f;
const sample_t fac = Engine::audioEngine()->processingSampleRate() / 44100.0f;
m_bbFX.leftFX().setFrequency( m_bbControls.m_freqModel.value() * fac );
m_bbFX.rightFX().setFrequency( m_bbControls.m_freqModel.value() * fac );

View File

@@ -37,7 +37,7 @@ BassBoosterControls::BassBoosterControls( BassBoosterEffect* effect ) :
m_gainModel( 1.0f, 0.1f, 5.0f, 0.05f, this, tr( "Gain" ) ),
m_ratioModel( 2.0f, 0.1f, 10.0f, 0.1f, this, tr( "Ratio" ) )
{
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeFrequency() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( changeFrequency() ) );
}

View File

@@ -55,10 +55,10 @@ Plugin::Descriptor PLUGIN_EXPORT bitcrush_plugin_descriptor =
BitcrushEffect::BitcrushEffect( Model * parent, const Descriptor::SubPluginFeatures::Key * key ) :
Effect( &bitcrush_plugin_descriptor, parent, key ),
m_controls( this ),
m_sampleRate( Engine::mixer()->processingSampleRate() ),
m_sampleRate( Engine::audioEngine()->processingSampleRate() ),
m_filter( m_sampleRate )
{
m_buffer = MM_ALLOC( sampleFrame, Engine::mixer()->framesPerPeriod() * OS_RATE );
m_buffer = MM_ALLOC( sampleFrame, Engine::audioEngine()->framesPerPeriod() * OS_RATE );
m_filter.setLowpass( m_sampleRate * ( CUTOFF_RATIO * OS_RATIO ) );
m_needsUpdate = true;
@@ -79,7 +79,7 @@ BitcrushEffect::~BitcrushEffect()
void BitcrushEffect::sampleRateChanged()
{
m_sampleRate = Engine::mixer()->processingSampleRate();
m_sampleRate = Engine::audioEngine()->processingSampleRate();
m_filter.setSampleRate( m_sampleRate );
m_filter.setLowpass( m_sampleRate * ( CUTOFF_RATIO * OS_RATIO ) );
m_needsUpdate = true;

View File

@@ -47,7 +47,7 @@ BitcrushControls::BitcrushControls( BitcrushEffect * eff ) :
m_rate.setStrictStepSize( true );
m_levels.setStrictStepSize( true );
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) );
}
BitcrushControls::~BitcrushControls()

View File

@@ -52,7 +52,7 @@ CompressorEffect::CompressorEffect(Model* parent, const Descriptor::SubPluginFea
Effect(&compressor_plugin_descriptor, parent, key),
m_compressorControls(this)
{
m_sampleRate = Engine::mixer()->processingSampleRate();
m_sampleRate = Engine::audioEngine()->processingSampleRate();
m_yL[0] = m_yL[1] = COMP_NOISE_FLOOR;
@@ -86,7 +86,7 @@ CompressorEffect::CompressorEffect(Model* parent, const Descriptor::SubPluginFea
connect(&m_compressorControls.m_kneeModel, SIGNAL(dataChanged()), this, SLOT(calcAutoMakeup()), Qt::DirectConnection);
connect(&m_compressorControls.m_autoMakeupModel, SIGNAL(dataChanged()), this, SLOT(calcAutoMakeup()), Qt::DirectConnection);
connect(Engine::mixer(), SIGNAL(sampleRateChanged()), this, SLOT(changeSampleRate()));
connect(Engine::audioEngine(), SIGNAL(sampleRateChanged()), this, SLOT(changeSampleRate()));
changeSampleRate();
}
@@ -614,7 +614,7 @@ inline void CompressorEffect::calcTiltFilter(sample_t inputSample, sample_t &out
void CompressorEffect::changeSampleRate()
{
m_sampleRate = Engine::mixer()->processingSampleRate();
m_sampleRate = Engine::audioEngine()->processingSampleRate();
m_coeffPrecalc = COMP_LOG / (m_sampleRate * 0.001f);

View File

@@ -51,7 +51,7 @@ Plugin::Descriptor PLUGIN_EXPORT crossovereq_plugin_descriptor =
CrossoverEQEffect::CrossoverEQEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ) :
Effect( &crossovereq_plugin_descriptor, parent, key ),
m_controls( this ),
m_sampleRate( Engine::mixer()->processingSampleRate() ),
m_sampleRate( Engine::audioEngine()->processingSampleRate() ),
m_lp1( m_sampleRate ),
m_lp2( m_sampleRate ),
m_lp3( m_sampleRate ),
@@ -60,9 +60,9 @@ CrossoverEQEffect::CrossoverEQEffect( Model* parent, const Descriptor::SubPlugin
m_hp4( m_sampleRate ),
m_needsUpdate( true )
{
m_tmp1 = MM_ALLOC( sampleFrame, Engine::mixer()->framesPerPeriod() );
m_tmp2 = MM_ALLOC( sampleFrame, Engine::mixer()->framesPerPeriod() );
m_work = MM_ALLOC( sampleFrame, Engine::mixer()->framesPerPeriod() );
m_tmp1 = MM_ALLOC( sampleFrame, Engine::audioEngine()->framesPerPeriod() );
m_tmp2 = MM_ALLOC( sampleFrame, Engine::audioEngine()->framesPerPeriod() );
m_work = MM_ALLOC( sampleFrame, Engine::audioEngine()->framesPerPeriod() );
}
CrossoverEQEffect::~CrossoverEQEffect()
@@ -74,7 +74,7 @@ CrossoverEQEffect::~CrossoverEQEffect()
void CrossoverEQEffect::sampleRateChanged()
{
m_sampleRate = Engine::mixer()->processingSampleRate();
m_sampleRate = Engine::audioEngine()->processingSampleRate();
m_lp1.setSampleRate( m_sampleRate );
m_lp2.setSampleRate( m_sampleRate );
m_lp3.setSampleRate( m_sampleRate );

View File

@@ -42,7 +42,7 @@ CrossoverEQControls::CrossoverEQControls( CrossoverEQEffect * eff ) :
m_mute3( true, this, "Mute Band 3" ),
m_mute4( true, this, "Mute Band 4" )
{
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) );
connect( &m_xover12, SIGNAL( dataChanged() ), this, SLOT( xover12Changed() ) );
connect( &m_xover23, SIGNAL( dataChanged() ), this, SLOT( xover23Changed() ) );
connect( &m_xover34, SIGNAL( dataChanged() ), this, SLOT( xover34Changed() ) );

View File

@@ -38,7 +38,7 @@ DelayControls::DelayControls( DelayEffect* effect ):
m_lfoAmountModel(0.0, 0.0, 0.5, 0.0001, 2000.0, this, tr ( "LFO amount" ) ),
m_outGainModel( 0.0, -60.0, 20.0, 0.01, this, tr( "Output gain" ) )
{
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeSampleRate() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( changeSampleRate() ) );
m_outPeakL = 0.0;
m_outPeakR = 0.0;
}

View File

@@ -52,8 +52,8 @@ DelayEffect::DelayEffect( Model* parent, const Plugin::Descriptor::SubPluginFeat
m_delayControls( this )
{
m_delay = 0;
m_delay = new StereoDelay( 20, Engine::mixer()->processingSampleRate() );
m_lfo = new Lfo( Engine::mixer()->processingSampleRate() );
m_delay = new StereoDelay( 20, Engine::audioEngine()->processingSampleRate() );
m_lfo = new Lfo( Engine::audioEngine()->processingSampleRate() );
m_outGain = 1.0;
}
@@ -82,7 +82,7 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames )
return( false );
}
double outSum = 0.0;
const float sr = Engine::mixer()->processingSampleRate();
const float sr = Engine::audioEngine()->processingSampleRate();
const float d = dryLevel();
const float w = wetLevel();
sample_t dryS[2];
@@ -117,7 +117,7 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames )
m_delay->setFeedback( *feedbackPtr );
m_lfo->setFrequency( *lfoTimePtr );
sampleLength = *lengthPtr * Engine::mixer()->processingSampleRate();
sampleLength = *lengthPtr * Engine::audioEngine()->processingSampleRate();
m_currentLength = sampleLength;
m_delay->setLength( m_currentLength + ( *amplitudePtr * ( float )m_lfo->tick() ) );
m_delay->tick( buf[f] );
@@ -146,8 +146,8 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames )
void DelayEffect::changeSampleRate()
{
m_lfo->setSampleRate( Engine::mixer()->processingSampleRate() );
m_delay->setSampleRate( Engine::mixer()->processingSampleRate() );
m_lfo->setSampleRate( Engine::audioEngine()->processingSampleRate() );
m_delay->setSampleRate( Engine::audioEngine()->processingSampleRate() );
}

View File

@@ -53,8 +53,8 @@ DualFilterEffect::DualFilterEffect( Model* parent, const Descriptor::SubPluginFe
Effect( &dualfilter_plugin_descriptor, parent, key ),
m_dfControls( this )
{
m_filter1 = new BasicFilters<2>( Engine::mixer()->processingSampleRate() );
m_filter2 = new BasicFilters<2>( Engine::mixer()->processingSampleRate() );
m_filter1 = new BasicFilters<2>( Engine::audioEngine()->processingSampleRate() );
m_filter2 = new BasicFilters<2>( Engine::audioEngine()->processingSampleRate() );
// ensure filters get updated
m_filter1changed = true;

View File

@@ -97,7 +97,7 @@ DualFilterControls::DualFilterControls( DualFilterEffect* effect ) :
m_filter2Model.addItem( tr( "Fast Formant" ), std::make_unique<PixmapLoader>( "filter_hp" ) );
m_filter2Model.addItem( tr( "Tripole" ), std::make_unique<PixmapLoader>( "filter_lp" ) );
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateFilters() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( updateFilters() ) );
}
@@ -108,8 +108,8 @@ void DualFilterControls::updateFilters()
delete m_effect->m_filter1;
delete m_effect->m_filter2;
m_effect->m_filter1 = new BasicFilters<2>( Engine::mixer()->processingSampleRate() );
m_effect->m_filter2 = new BasicFilters<2>( Engine::mixer()->processingSampleRate() );
m_effect->m_filter1 = new BasicFilters<2>( Engine::audioEngine()->processingSampleRate() );
m_effect->m_filter2 = new BasicFilters<2>( Engine::audioEngine()->processingSampleRate() );
// flag filters as needing recalculation

View File

@@ -190,7 +190,7 @@ bool EqHandle::mousePressed() const
float EqHandle::getPeakCurve( float x )
{
double freqZ = xPixelToFreq( EqHandle::x(), m_width );
const int SR = Engine::mixer()->processingSampleRate();
const int SR = Engine::audioEngine()->processingSampleRate();
double w0 = 2 * LD_PI * freqZ / SR ;
double c = cosf( w0 );
double s = sinf( w0 );
@@ -228,7 +228,7 @@ float EqHandle::getPeakCurve( float x )
float EqHandle::getHighShelfCurve( float x )
{
double freqZ = xPixelToFreq( EqHandle::x(), m_width );
const int SR = Engine::mixer()->processingSampleRate();
const int SR = Engine::audioEngine()->processingSampleRate();
double w0 = 2 * LD_PI * freqZ / SR;
double c = cosf( w0 );
double s = sinf( w0 );
@@ -264,7 +264,7 @@ float EqHandle::getHighShelfCurve( float x )
float EqHandle::getLowShelfCurve( float x )
{
double freqZ = xPixelToFreq( EqHandle::x(), m_width );
const int SR = Engine::mixer()->processingSampleRate();
const int SR = Engine::audioEngine()->processingSampleRate();
double w0 = 2 * LD_PI * freqZ / SR ;
double c = cosf( w0 );
double s = sinf( w0 );
@@ -301,7 +301,7 @@ float EqHandle::getLowShelfCurve( float x )
float EqHandle::getLowCutCurve( float x )
{
double freqZ = xPixelToFreq( EqHandle::x(), m_width );
const int SR = Engine::mixer()->processingSampleRate();
const int SR = Engine::audioEngine()->processingSampleRate();
double w0 = 2 * LD_PI * freqZ / SR ;
double c = cosf( w0 );
double s = sinf( w0 );
@@ -345,7 +345,7 @@ float EqHandle::getLowCutCurve( float x )
float EqHandle::getHighCutCurve( float x )
{
double freqZ = xPixelToFreq( EqHandle::x(), m_width );
const int SR = Engine::mixer()->processingSampleRate();
const int SR = Engine::audioEngine()->processingSampleRate();
double w0 = 2 * LD_PI * freqZ / SR ;
double c = cosf( w0 );
double s = sinf( w0 );
@@ -520,7 +520,7 @@ void EqHandle::setlp48()
double EqHandle::calculateGain(const double freq, const double a1, const double a2, const double b0, const double b1, const double b2 )
{
const int SR = Engine::mixer()->processingSampleRate();
const int SR = Engine::audioEngine()->processingSampleRate();
const double w = 2 * LD_PI * freq / SR ;
const double PHI = pow( sin( w / 2 ), 2 ) * 4;

View File

@@ -71,7 +71,7 @@ EqEffect::~EqEffect()
bool EqEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames )
{
const int sampleRate = Engine::mixer()->processingSampleRate();
const int sampleRate = Engine::audioEngine()->processingSampleRate();
//wet/dry controls
const float dry = dryLevel();

View File

@@ -22,11 +22,11 @@
#include "EqSpectrumView.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "EqCurve.h"
#include "GuiApplication.h"
#include "MainWindow.h"
#include "Mixer.h"
EqAnalyser::EqAnalyser() :
m_framesFilledUp ( 0 ),
@@ -93,7 +93,7 @@ void EqAnalyser::analyze( sampleFrame *buf, const fpp_t frames )
return;
}
m_sampleRate = Engine::mixer()->processingSampleRate();
m_sampleRate = Engine::audioEngine()->processingSampleRate();
const int LOWEST_FREQ = 0;
const int HIGHEST_FREQ = m_sampleRate / 2;

View File

@@ -43,7 +43,7 @@ FlangerControls::FlangerControls( FlangerEffect *effect ) :
m_invertFeedbackModel ( false, this, tr( "Invert" ) )
{
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changedSampleRate() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( changedSampleRate() ) );
connect( Engine::getSong(), SIGNAL( playbackStateChanged() ), this, SLOT( changedPlaybackState() ) );
}

View File

@@ -51,9 +51,9 @@ FlangerEffect::FlangerEffect( Model *parent, const Plugin::Descriptor::SubPlugin
Effect( &flanger_plugin_descriptor, parent, key ),
m_flangerControls( this )
{
m_lfo = new QuadratureLfo( Engine::mixer()->processingSampleRate() );
m_lDelay = new MonoDelay( 1, Engine::mixer()->processingSampleRate() );
m_rDelay = new MonoDelay( 1, Engine::mixer()->processingSampleRate() );
m_lfo = new QuadratureLfo( Engine::audioEngine()->processingSampleRate() );
m_lDelay = new MonoDelay( 1, Engine::audioEngine()->processingSampleRate() );
m_rDelay = new MonoDelay( 1, Engine::audioEngine()->processingSampleRate() );
m_noise = new Noise;
}
@@ -92,9 +92,9 @@ bool FlangerEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames )
double outSum = 0.0;
const float d = dryLevel();
const float w = wetLevel();
const float length = m_flangerControls.m_delayTimeModel.value() * Engine::mixer()->processingSampleRate();
const float length = m_flangerControls.m_delayTimeModel.value() * Engine::audioEngine()->processingSampleRate();
const float noise = m_flangerControls.m_whiteNoiseAmountModel.value();
float amplitude = m_flangerControls.m_lfoAmountModel.value() * Engine::mixer()->processingSampleRate();
float amplitude = m_flangerControls.m_lfoAmountModel.value() * Engine::audioEngine()->processingSampleRate();
bool invertFeedback = m_flangerControls.m_invertFeedbackModel.value();
m_lfo->setFrequency( 1.0/m_flangerControls.m_lfoFrequencyModel.value() );
m_lfo->setOffset( m_flangerControls.m_lfoPhaseModel.value() / 180 * D_PI );
@@ -135,9 +135,9 @@ bool FlangerEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames )
void FlangerEffect::changeSampleRate()
{
m_lfo->setSampleRate( Engine::mixer()->processingSampleRate() );
m_lDelay->setSampleRate( Engine::mixer()->processingSampleRate() );
m_rDelay->setSampleRate( Engine::mixer()->processingSampleRate() );
m_lfo->setSampleRate( Engine::audioEngine()->processingSampleRate() );
m_lDelay->setSampleRate( Engine::audioEngine()->processingSampleRate() );
m_rDelay->setSampleRate( Engine::audioEngine()->processingSampleRate() );
}

View File

@@ -33,7 +33,7 @@
#include "base64.h"
#include "InstrumentTrack.h"
#include "Knob.h"
#include "Mixer.h"
#include "AudioEngine.h"
#include "NotePlayHandle.h"
#include "PixmapButton.h"
#include "ToolTip.h"
@@ -224,7 +224,7 @@ QString FreeBoyInstrument::nodeName() const
/*f_cnt_t FreeBoyInstrument::desiredReleaseFrames() const
{
const float samplerate = Engine::mixer()->processingSampleRate();
const float samplerate = Engine::audioEngine()->processingSampleRate();
int maxrel = 0;
for( int i = 0 ; i < 3 ; ++i )
{
@@ -246,7 +246,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n,
sampleFrame * _working_buffer )
{
const f_cnt_t tfp = _n->totalFramesPlayed();
const int samplerate = Engine::mixer()->processingSampleRate();
const int samplerate = Engine::audioEngine()->processingSampleRate();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
const f_cnt_t offset = _n->noteOffset();

View File

@@ -36,6 +36,7 @@
#include <QLabel>
#include <QDomDocument>
#include "AudioEngine.h"
#include "ConfigManager.h"
#include "endian_handling.h"
#include "Engine.h"
@@ -43,7 +44,6 @@
#include "InstrumentTrack.h"
#include "InstrumentPlayHandle.h"
#include "Knob.h"
#include "Mixer.h"
#include "NotePlayHandle.h"
#include "PathUtil.h"
#include "SampleBuffer.h"
@@ -90,13 +90,13 @@ GigInstrument::GigInstrument( InstrumentTrack * _instrument_track ) :
m_currentKeyDimension( 0 )
{
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
Engine::mixer()->addPlayHandle( iph );
Engine::audioEngine()->addPlayHandle( iph );
updateSampleRate();
connect( &m_bankNum, SIGNAL( dataChanged() ), this, SLOT( updatePatch() ) );
connect( &m_patchNum, SIGNAL( dataChanged() ), this, SLOT( updatePatch() ) );
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) );
}
@@ -104,7 +104,7 @@ GigInstrument::GigInstrument( InstrumentTrack * _instrument_track ) :
GigInstrument::~GigInstrument()
{
Engine::mixer()->removePlayHandlesOfTypes( instrumentTrack(),
Engine::audioEngine()->removePlayHandlesOfTypes( instrumentTrack(),
PlayHandle::TypeNotePlayHandle
| PlayHandle::TypeInstrumentPlayHandle );
freeInstance();
@@ -321,8 +321,8 @@ void GigInstrument::playNote( NotePlayHandle * _n, sampleFrame * )
// the preferences)
void GigInstrument::play( sampleFrame * _working_buffer )
{
const fpp_t frames = Engine::mixer()->framesPerPeriod();
const int rate = Engine::mixer()->processingSampleRate();
const fpp_t frames = Engine::audioEngine()->framesPerPeriod();
const int rate = Engine::audioEngine()->processingSampleRate();
// Initialize to zeros
std::memset( &_working_buffer[0][0], 0, DEFAULT_CHANNELS * frames * sizeof( float ) );
@@ -758,7 +758,7 @@ void GigInstrument::addSamples( GigNote & gignote, bool wantReleaseSample )
if( gignote.midiNote >= keyLow && gignote.midiNote <= keyHigh )
{
float attenuation = pDimRegion->GetVelocityAttenuation( gignote.velocity );
float length = (float) pSample->SamplesTotal / Engine::mixer()->processingSampleRate();
float length = (float) pSample->SamplesTotal / Engine::audioEngine()->processingSampleRate();
// TODO: sample panning? crossfade different layers?

View File

@@ -30,11 +30,11 @@
#include "LadspaEffect.h"
#include "DataFile.h"
#include "AudioDevice.h"
#include "AudioEngine.h"
#include "ConfigManager.h"
#include "Ladspa2LMMS.h"
#include "LadspaControl.h"
#include "LadspaSubPluginFeatures.h"
#include "Mixer.h"
#include "EffectChain.h"
#include "AutomationPattern.h"
#include "ControllerConnection.h"
@@ -87,7 +87,7 @@ LadspaEffect::LadspaEffect( Model * _parent,
pluginInstantiation();
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ),
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ),
this, SLOT( changeSampleRate() ) );
}
@@ -142,13 +142,13 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
sampleFrame * o_buf = NULL;
QVarLengthArray<sample_t> sBuf(_frames * DEFAULT_CHANNELS);
if( m_maxSampleRate < Engine::mixer()->processingSampleRate() )
if( m_maxSampleRate < Engine::audioEngine()->processingSampleRate() )
{
o_buf = _buf;
_buf = reinterpret_cast<sampleFrame*>(sBuf.data());
sampleDown( o_buf, _buf, m_maxSampleRate );
frames = _frames * m_maxSampleRate /
Engine::mixer()->processingSampleRate();
Engine::audioEngine()->processingSampleRate();
}
// Copy the LMMS audio buffer to the LADSPA input buffer and initialize
@@ -289,7 +289,7 @@ void LadspaEffect::pluginInstantiation()
Ladspa2LMMS * manager = Engine::getLADSPAManager();
// Calculate how many processing units are needed.
const ch_cnt_t lmms_chnls = Engine::mixer()->audioDev()->channels();
const ch_cnt_t lmms_chnls = Engine::audioEngine()->audioDev()->channels();
int effect_channels = manager->getDescription( m_key )->inputChannels;
setProcessorCount( lmms_chnls / effect_channels );
@@ -324,7 +324,7 @@ void LadspaEffect::pluginInstantiation()
manager->isPortInput( m_key, port ) )
{
p->rate = CHANNEL_IN;
p->buffer = MM_ALLOC( LADSPA_Data, Engine::mixer()->framesPerPeriod() );
p->buffer = MM_ALLOC( LADSPA_Data, Engine::audioEngine()->framesPerPeriod() );
inbuf[ inputch ] = p->buffer;
inputch++;
}
@@ -339,19 +339,19 @@ void LadspaEffect::pluginInstantiation()
}
else
{
p->buffer = MM_ALLOC( LADSPA_Data, Engine::mixer()->framesPerPeriod() );
p->buffer = MM_ALLOC( LADSPA_Data, Engine::audioEngine()->framesPerPeriod() );
m_inPlaceBroken = true;
}
}
else if( manager->isPortInput( m_key, port ) )
{
p->rate = AUDIO_RATE_INPUT;
p->buffer = MM_ALLOC( LADSPA_Data, Engine::mixer()->framesPerPeriod() );
p->buffer = MM_ALLOC( LADSPA_Data, Engine::audioEngine()->framesPerPeriod() );
}
else
{
p->rate = AUDIO_RATE_OUTPUT;
p->buffer = MM_ALLOC( LADSPA_Data, Engine::mixer()->framesPerPeriod() );
p->buffer = MM_ALLOC( LADSPA_Data, Engine::audioEngine()->framesPerPeriod() );
}
}
else
@@ -586,7 +586,7 @@ sample_rate_t LadspaEffect::maxSamplerate( const QString & _name )
{
return( __buggy_plugins[_name] );
}
return( Engine::mixer()->processingSampleRate() );
return( Engine::audioEngine()->processingSampleRate() );
}

View File

@@ -30,10 +30,10 @@
#include "LadspaSubPluginFeatures.h"
#include "AudioDevice.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "Ladspa2LMMS.h"
#include "LadspaBase.h"
#include "Mixer.h"
LadspaSubPluginFeatures::LadspaSubPluginFeatures( Plugin::PluginTypes _type ) :
@@ -154,8 +154,7 @@ void LadspaSubPluginFeatures::listSubPluginKeys(
for( l_sortable_plugin_t::const_iterator it = plugins.begin();
it != plugins.end(); ++it )
{
if( lm->getDescription( ( *it ).second )->inputChannels <=
Engine::mixer()->audioDev()->channels() )
if( lm->getDescription( ( *it ).second )->inputChannels <= Engine::audioEngine()->audioDev()->channels() )
{
_kl.push_back( ladspaKeyToSubPluginKey( _desc, ( *it ).first, ( *it ).second ) );
}

View File

@@ -60,7 +60,7 @@ Plugin::Descriptor PLUGIN_EXPORT lv2effect_plugin_descriptor =
Lv2Effect::Lv2Effect(Model* parent, const Descriptor::SubPluginFeatures::Key *key) :
Effect(&lv2effect_plugin_descriptor, parent, key),
m_controls(this, key->attributes["uri"]),
m_tmpOutputSmps(Engine::mixer()->framesPerPeriod())
m_tmpOutputSmps(Engine::audioEngine()->framesPerPeriod())
{
}

View File

@@ -40,7 +40,7 @@ Lv2FxControls::Lv2FxControls(class Lv2Effect *effect, const QString& uri) :
{
if (isValid())
{
connect(Engine::mixer(), &Mixer::sampleRateChanged,
connect(Engine::audioEngine(), &AudioEngine::sampleRateChanged,
this, [this](){Lv2ControlBase::reloadPlugin();});
}
}

View File

@@ -27,11 +27,11 @@
#include <QDebug>
#include <QDragEnterEvent>
#include "AudioEngine.h"
#include "Engine.h"
#include "InstrumentPlayHandle.h"
#include "InstrumentTrack.h"
#include "Lv2SubPluginFeatures.h"
#include "Mixer.h"
#include "StringPairDrag.h"
#include "Clipboard.h"
@@ -80,13 +80,13 @@ Lv2Instrument::Lv2Instrument(InstrumentTrack *instrumentTrackArg,
#endif
connect(instrumentTrack()->pitchRangeModel(), SIGNAL(dataChanged()),
this, SLOT(updatePitchRange()), Qt::DirectConnection);
connect(Engine::mixer(), &Mixer::sampleRateChanged,
connect(Engine::audioEngine(), &AudioEngine::sampleRateChanged,
this, [this](){Lv2ControlBase::reloadPlugin();});
// now we need a play-handle which cares for calling play()
InstrumentPlayHandle *iph =
new InstrumentPlayHandle(this, instrumentTrackArg);
Engine::mixer()->addPlayHandle(iph);
Engine::audioEngine()->addPlayHandle(iph);
}
}
@@ -95,9 +95,8 @@ Lv2Instrument::Lv2Instrument(InstrumentTrack *instrumentTrackArg,
Lv2Instrument::~Lv2Instrument()
{
Engine::mixer()->removePlayHandlesOfTypes(instrumentTrack(),
PlayHandle::TypeNotePlayHandle |
PlayHandle::TypeInstrumentPlayHandle);
Engine::audioEngine()->removePlayHandlesOfTypes(instrumentTrack(),
PlayHandle::TypeNotePlayHandle | PlayHandle::TypeInstrumentPlayHandle);
}
@@ -160,7 +159,7 @@ void Lv2Instrument::play(sampleFrame *buf)
{
copyModelsFromLmms();
fpp_t fpp = Engine::mixer()->framesPerPeriod();
fpp_t fpp = Engine::audioEngine()->framesPerPeriod();
run(fpp);

View File

@@ -51,10 +51,10 @@ MultitapEchoEffect::MultitapEchoEffect( Model* parent, const Descriptor::SubPlug
m_stages( 1 ),
m_controls( this ),
m_buffer( 16100.0f ),
m_sampleRate( Engine::mixer()->processingSampleRate() ),
m_sampleRate( Engine::audioEngine()->processingSampleRate() ),
m_sampleRatio( 1.0f / m_sampleRate )
{
m_work = MM_ALLOC( sampleFrame, Engine::mixer()->framesPerPeriod() );
m_work = MM_ALLOC( sampleFrame, Engine::audioEngine()->framesPerPeriod() );
m_buffer.reset();
m_stages = static_cast<int>( m_controls.m_stages.value() );
updateFilters( 0, 19 );

View File

@@ -48,7 +48,7 @@ MultitapEchoControls::MultitapEchoControls( MultitapEchoEffect * eff ) :
connect( &m_lpGraph, SIGNAL( samplesChanged( int, int ) ), this, SLOT( lpSamplesChanged( int, int ) ) );
connect( &m_steps, SIGNAL( dataChanged() ), this, SLOT( lengthChanged() ) );
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) );
setDefaultAmpShape();
setDefaultLpShape();
@@ -174,7 +174,7 @@ void MultitapEchoControls::lengthChanged()
void MultitapEchoControls::sampleRateChanged()
{
m_effect->m_sampleRate = Engine::mixer()->processingSampleRate();
m_effect->m_sampleRate = Engine::audioEngine()->processingSampleRate();
m_effect->m_sampleRatio = 1.0f / m_effect->m_sampleRate;
m_effect->updateFilters( 0, 19 );
}

View File

@@ -35,10 +35,10 @@
#include "OpulenZ.h"
#include "Instrument.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "InstrumentPlayHandle.h"
#include "InstrumentTrack.h"
#include "Mixer.h"
#include <QDomDocument>
#include <QFile>
@@ -139,7 +139,7 @@ OpulenzInstrument::OpulenzInstrument( InstrumentTrack * _instrument_track ) :
// Create an emulator - samplerate, 16 bit, mono
emulatorMutex.lock();
theEmulator = new CTemuopl(Engine::mixer()->processingSampleRate(), true, false);
theEmulator = new CTemuopl(Engine::audioEngine()->processingSampleRate(), true, false);
theEmulator->init();
// Enable waveform selection
theEmulator->write(0x01,0x20);
@@ -158,7 +158,7 @@ OpulenzInstrument::OpulenzInstrument( InstrumentTrack * _instrument_track ) :
updatePatch();
// Can the buffer size change suddenly? I bet that would break lots of stuff
frameCount = Engine::mixer()->framesPerPeriod();
frameCount = Engine::audioEngine()->framesPerPeriod();
renderbuffer = new short[frameCount];
// Some kind of sane defaults
@@ -168,7 +168,7 @@ OpulenzInstrument::OpulenzInstrument( InstrumentTrack * _instrument_track ) :
tuneEqual(69, 440);
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ),
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ),
this, SLOT( reloadEmulator() ) );
// Connect knobs
// This one's for testing...
@@ -213,14 +213,14 @@ OpulenzInstrument::OpulenzInstrument( InstrumentTrack * _instrument_track ) :
MOD_CON( vib_depth_mdl );
MOD_CON( trem_depth_mdl );
// Connect the plugin to the mixer...
// Connect the plugin to the audio engine...
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
Engine::mixer()->addPlayHandle( iph );
Engine::audioEngine()->addPlayHandle( iph );
}
OpulenzInstrument::~OpulenzInstrument() {
delete theEmulator;
Engine::mixer()->removePlayHandlesOfTypes( instrumentTrack(),
Engine::audioEngine()->removePlayHandlesOfTypes( instrumentTrack(),
PlayHandle::TypeNotePlayHandle
| PlayHandle::TypeInstrumentPlayHandle );
delete [] renderbuffer;
@@ -230,7 +230,7 @@ OpulenzInstrument::~OpulenzInstrument() {
void OpulenzInstrument::reloadEmulator() {
delete theEmulator;
emulatorMutex.lock();
theEmulator = new CTemuopl(Engine::mixer()->processingSampleRate(), true, false);
theEmulator = new CTemuopl(Engine::audioEngine()->processingSampleRate(), true, false);
theEmulator->init();
theEmulator->write(0x01,0x20);
emulatorMutex.unlock();

View File

@@ -51,7 +51,7 @@ ReverbSCEffect::ReverbSCEffect( Model* parent, const Descriptor::SubPluginFeatur
m_reverbSCControls( this )
{
sp_create(&sp);
sp->sr = Engine::mixer()->processingSampleRate();
sp->sr = Engine::audioEngine()->processingSampleRate();
sp_revsc_create(&revsc);
sp_revsc_init(sp, revsc);
@@ -59,8 +59,8 @@ ReverbSCEffect::ReverbSCEffect( Model* parent, const Descriptor::SubPluginFeatur
sp_dcblock_create(&dcblk[0]);
sp_dcblock_create(&dcblk[1]);
sp_dcblock_init(sp, dcblk[0], Engine::mixer()->currentQualitySettings().sampleRateMultiplier() );
sp_dcblock_init(sp, dcblk[1], Engine::mixer()->currentQualitySettings().sampleRateMultiplier() );
sp_dcblock_init(sp, dcblk[0], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() );
sp_dcblock_init(sp, dcblk[1], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() );
}
ReverbSCEffect::~ReverbSCEffect()
@@ -130,7 +130,7 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames )
void ReverbSCEffect::changeSampleRate()
{
// Change sr variable in Soundpipe. does not need to be destroyed
sp->sr = Engine::mixer()->processingSampleRate();
sp->sr = Engine::audioEngine()->processingSampleRate();
mutex.lock();
sp_revsc_destroy(&revsc);
@@ -143,8 +143,8 @@ void ReverbSCEffect::changeSampleRate()
sp_dcblock_create(&dcblk[0]);
sp_dcblock_create(&dcblk[1]);
sp_dcblock_init(sp, dcblk[0], Engine::mixer()->currentQualitySettings().sampleRateMultiplier() );
sp_dcblock_init(sp, dcblk[1], Engine::mixer()->currentQualitySettings().sampleRateMultiplier() );
sp_dcblock_init(sp, dcblk[0], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() );
sp_dcblock_init(sp, dcblk[1], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() );
mutex.unlock();
}

View File

@@ -38,7 +38,7 @@ ReverbSCControls::ReverbSCControls( ReverbSCEffect* effect ) :
m_colorModel( 10000.0f, 100.0f, 15000.0f, 0.1f, this, tr( "Color" ) ),
m_outputGainModel( 0.0f, -60.0f, 15, 0.1f, this, tr( "Output gain" ) )
{
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeSampleRate() ));
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( changeSampleRate() ));
}
void ReverbSCControls::changeControl()

View File

@@ -33,10 +33,10 @@
#include "sid.h"
#include "SidInstrument.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "InstrumentTrack.h"
#include "Knob.h"
#include "Mixer.h"
#include "NotePlayHandle.h"
#include "PixmapButton.h"
#include "ToolTip.h"
@@ -233,7 +233,7 @@ QString SidInstrument::nodeName() const
f_cnt_t SidInstrument::desiredReleaseFrames() const
{
const float samplerate = Engine::mixer()->processingSampleRate();
const float samplerate = Engine::audioEngine()->processingSampleRate();
int maxrel = 0;
for( int i = 0 ; i < 3 ; ++i )
{
@@ -308,7 +308,7 @@ void SidInstrument::playNote( NotePlayHandle * _n,
const f_cnt_t tfp = _n->totalFramesPlayed();
const int clockrate = C64_PAL_CYCLES_PER_SEC;
const int samplerate = Engine::mixer()->processingSampleRate();
const int samplerate = Engine::audioEngine()->processingSampleRate();
if ( tfp == 0 )
{

View File

@@ -45,7 +45,7 @@ SaProcessor::SaProcessor(const SaControls *controls) :
m_terminate(false),
m_inBlockSize(FFT_BLOCK_SIZES[0]),
m_fftBlockSize(FFT_BLOCK_SIZES[0]),
m_sampleRate(Engine::mixer()->processingSampleRate()),
m_sampleRate(Engine::audioEngine()->processingSampleRate()),
m_framesFilledUp(0),
m_spectrumActive(false),
m_waterfallActive(false),
@@ -158,7 +158,7 @@ void SaProcessor::analyze(LocklessRingBuffer<sampleFrame> &ring_buffer)
#endif
// update sample rate
m_sampleRate = Engine::mixer()->processingSampleRate();
m_sampleRate = Engine::audioEngine()->processingSampleRate();
// apply FFT window
for (unsigned int i = 0; i < m_inBlockSize; i++)

View File

@@ -26,6 +26,7 @@
#include <QDomElement>
#include "AudioEngine.h"
#include "Engine.h"
#include "Graph.h"
#include "GuiApplication.h"
@@ -33,7 +34,6 @@
#include "Knob.h"
#include "LedCheckbox.h"
#include "MainWindow.h"
#include "Mixer.h"
#include "NotePlayHandle.h"
#include "Oscillator.h"
#include "PixmapButton.h"
@@ -204,14 +204,14 @@ void Xpressive::playNote(NotePlayHandle* nph, sampleFrame* working_buffer) {
if (nph->totalFramesPlayed() == 0 || nph->m_pluginData == NULL) {
ExprFront *exprO1 = new ExprFront(m_outputExpression[0].constData(),Engine::mixer()->processingSampleRate());//give the "last" function a whole second
ExprFront *exprO2 = new ExprFront(m_outputExpression[1].constData(),Engine::mixer()->processingSampleRate());
ExprFront *exprO1 = new ExprFront(m_outputExpression[0].constData(),Engine::audioEngine()->processingSampleRate());//give the "last" function a whole second
ExprFront *exprO2 = new ExprFront(m_outputExpression[1].constData(),Engine::audioEngine()->processingSampleRate());
auto init_expression_step1 = [this, nph](ExprFront* e) { //lambda function to init exprO1 and exprO2
//add the constants and the variables to the expression.
e->add_constant("key", nph->key());//the key that was pressed.
e->add_constant("bnote", nph->instrumentTrack()->baseNote()); // the base note
e->add_constant("srate", Engine::mixer()->processingSampleRate());// sample rate of the mixer
e->add_constant("srate", Engine::audioEngine()->processingSampleRate());// sample rate of the audio engine
e->add_constant("v", nph->getVolume() / 255.0); //volume of the note.
e->add_constant("tempo", Engine::getSong()->getTempo());//tempo of the song.
e->add_variable("A1", m_A1);//A1,A2,A3: general purpose input controls.
@@ -225,7 +225,7 @@ void Xpressive::playNote(NotePlayHandle* nph, sampleFrame* working_buffer) {
m_W2.setInterpolate(m_interpolateW2.value());
m_W3.setInterpolate(m_interpolateW3.value());
nph->m_pluginData = new ExprSynth(&m_W1, &m_W2, &m_W3, exprO1, exprO2, nph,
Engine::mixer()->processingSampleRate(), &m_panning1, &m_panning2, m_relTransition.value());
Engine::audioEngine()->processingSampleRate(), &m_panning1, &m_panning2, m_relTransition.value());
}

View File

@@ -32,13 +32,13 @@
#include <samplerate.h>
#include "AudioEngine.h"
#include "ConfigManager.h"
#include "DataFile.h"
#include "Engine.h"
#include "gui_templates.h"
#include "InstrumentTrack.h"
#include "interpolation.h"
#include "Mixer.h"
#include "NotePlayHandle.h"
#include "PathUtil.h"
#include "Song.h"
@@ -305,7 +305,7 @@ int audioFileProcessor::getBeatLen( NotePlayHandle * _n ) const
{
const auto baseFreq = instrumentTrack()->baseFreq();
const float freq_factor = baseFreq / _n->frequency() *
Engine::mixer()->processingSampleRate() / Engine::mixer()->baseSampleRate();
Engine::audioEngine()->processingSampleRate() / Engine::audioEngine()->baseSampleRate();
return static_cast<int>( floorf( ( m_sampleBuffer.endFrame() - m_sampleBuffer.startFrame() ) * freq_factor ) );
}

View File

@@ -26,13 +26,13 @@
#include <QDomElement>
#include "bit_invader.h"
#include "AudioEngine.h"
#include "base64.h"
#include "Engine.h"
#include "Graph.h"
#include "InstrumentTrack.h"
#include "Knob.h"
#include "LedCheckbox.h"
#include "Mixer.h"
#include "NotePlayHandle.h"
#include "Oscillator.h"
#include "PixmapButton.h"
@@ -295,7 +295,7 @@ void bitInvader::playNote( NotePlayHandle * _n,
const_cast<float*>( m_graph.samples() ),
_n,
m_interpolation.value(), factor,
Engine::mixer()->processingSampleRate() );
Engine::audioEngine()->processingSampleRate() );
}
const fpp_t frames = _n->framesLeftForCurrentPeriod();

View File

@@ -24,6 +24,7 @@
#include "carla.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "Song.h"
#include "GuiApplication.h"
@@ -31,7 +32,6 @@
#include "InstrumentTrack.h"
#include "MidiEventToByteSeq.h"
#include "MainWindow.h"
#include "Mixer.h"
#include "Song.h"
#include "gui_templates.h"
@@ -189,7 +189,7 @@ CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const D
// we need a play-handle which cares for calling play()
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, instrumentTrack );
Engine::mixer()->addPlayHandle( iph );
Engine::audioEngine()->addPlayHandle( iph );
#if CARLA_VERSION_HEX >= CARLA_MIN_PARAM_VERSION
// text filter completion
@@ -209,12 +209,12 @@ CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const D
}
#endif
connect(Engine::mixer(), SIGNAL(sampleRateChanged()), this, SLOT(sampleRateChanged()));
connect(Engine::audioEngine(), SIGNAL(sampleRateChanged()), this, SLOT(sampleRateChanged()));
}
CarlaInstrument::~CarlaInstrument()
{
Engine::mixer()->removePlayHandlesOfTypes(instrumentTrack(), PlayHandle::TypeNotePlayHandle | PlayHandle::TypeInstrumentPlayHandle);
Engine::audioEngine()->removePlayHandlesOfTypes(instrumentTrack(), PlayHandle::TypeNotePlayHandle | PlayHandle::TypeInstrumentPlayHandle);
if (fHost.resourceDir != NULL)
{
@@ -248,12 +248,12 @@ CarlaInstrument::~CarlaInstrument()
uint32_t CarlaInstrument::handleGetBufferSize() const
{
return Engine::mixer()->framesPerPeriod();
return Engine::audioEngine()->framesPerPeriod();
}
double CarlaInstrument::handleGetSampleRate() const
{
return Engine::mixer()->processingSampleRate();
return Engine::audioEngine()->processingSampleRate();
}
bool CarlaInstrument::handleIsOffline() const
@@ -496,7 +496,7 @@ void CarlaInstrument::loadSettings(const QDomElement& elem)
void CarlaInstrument::play(sampleFrame* workingBuffer)
{
const uint bufsize = Engine::mixer()->framesPerPeriod();
const uint bufsize = Engine::audioEngine()->framesPerPeriod();
std::memset(workingBuffer, 0, sizeof(sample_t)*bufsize*DEFAULT_CHANNELS);

View File

@@ -59,8 +59,8 @@ dynProcEffect::dynProcEffect( Model * _parent,
m_dpControls( this )
{
m_currentPeak[0] = m_currentPeak[1] = DYN_NOISE_FLOOR;
m_rms[0] = new RmsHelper( 64 * Engine::mixer()->processingSampleRate() / 44100 );
m_rms[1] = new RmsHelper( 64 * Engine::mixer()->processingSampleRate() / 44100 );
m_rms[0] = new RmsHelper( 64 * Engine::audioEngine()->processingSampleRate() / 44100 );
m_rms[1] = new RmsHelper( 64 * Engine::audioEngine()->processingSampleRate() / 44100 );
calcAttack();
calcRelease();
}
@@ -77,12 +77,12 @@ dynProcEffect::~dynProcEffect()
inline void dynProcEffect::calcAttack()
{
m_attCoeff = exp10( ( DNF_LOG / ( m_dpControls.m_attackModel.value() * 0.001 ) ) / Engine::mixer()->processingSampleRate() );
m_attCoeff = exp10( ( DNF_LOG / ( m_dpControls.m_attackModel.value() * 0.001 ) ) / Engine::audioEngine()->processingSampleRate() );
}
inline void dynProcEffect::calcRelease()
{
m_relCoeff = exp10( ( -DNF_LOG / ( m_dpControls.m_releaseModel.value() * 0.001 ) ) / Engine::mixer()->processingSampleRate() );
m_relCoeff = exp10( ( -DNF_LOG / ( m_dpControls.m_releaseModel.value() * 0.001 ) ) / Engine::audioEngine()->processingSampleRate() );
}
@@ -118,8 +118,8 @@ bool dynProcEffect::processAudioBuffer( sampleFrame * _buf,
if( m_needsUpdate )
{
m_rms[0]->setSize( 64 * Engine::mixer()->processingSampleRate() / 44100 );
m_rms[1]->setSize( 64 * Engine::mixer()->processingSampleRate() / 44100 );
m_rms[0]->setSize( 64 * Engine::audioEngine()->processingSampleRate() / 44100 );
m_rms[1]->setSize( 64 * Engine::audioEngine()->processingSampleRate() / 44100 );
calcAttack();
calcRelease();
m_needsUpdate = false;

View File

@@ -48,7 +48,7 @@ dynProcControls::dynProcControls( dynProcEffect * _eff ) :
{
connect( &m_wavegraphModel, SIGNAL( samplesChanged( int, int ) ),
this, SLOT( samplesChanged( int, int ) ) );
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) );
setDefaultShape();

View File

@@ -28,10 +28,10 @@
#include <QPainter>
#include "kicker.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "InstrumentTrack.h"
#include "Knob.h"
#include "Mixer.h"
#include "NotePlayHandle.h"
#include "KickerOsc.h"
@@ -166,8 +166,7 @@ void kickerInstrument::playNote( NotePlayHandle * _n,
{
const fpp_t frames = _n->framesLeftForCurrentPeriod();
const f_cnt_t offset = _n->noteOffset();
const float decfr = m_decayModel.value() *
Engine::mixer()->processingSampleRate() / 1000.0f;
const float decfr = m_decayModel.value() * Engine::audioEngine()->processingSampleRate() / 1000.0f;
const f_cnt_t tfp = _n->totalFramesPlayed();
if ( tfp == 0 )
@@ -191,7 +190,7 @@ void kickerInstrument::playNote( NotePlayHandle * _n,
}
SweepOsc * so = static_cast<SweepOsc *>( _n->m_pluginData );
so->update( _working_buffer + offset, frames, Engine::mixer()->processingSampleRate() );
so->update( _working_buffer + offset, frames, Engine::audioEngine()->processingSampleRate() );
if( _n->isReleased() )
{

View File

@@ -31,9 +31,9 @@
#include <QVBoxLayout>
#include "AudioDevice.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "Ladspa2LMMS.h"
#include "Mixer.h"
@@ -74,7 +74,7 @@ ladspaDescription::ladspaDescription( QWidget * _parent,
{
if( _type != VALID ||
manager->getDescription( ( *it ).second )->inputChannels
<= Engine::mixer()->audioDev()->channels() )
<= Engine::audioEngine()->audioDev()->channels() )
{
pluginNames.push_back( ( *it ).first );
m_pluginKeys.push_back( ( *it ).second );

View File

@@ -28,10 +28,10 @@
#include <QLayout>
#include <QTableWidget>
#include "AudioEngine.h"
#include "embed.h"
#include "Engine.h"
#include "Ladspa2LMMS.h"
#include "Mixer.h"
ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
@@ -87,11 +87,11 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
{
if( min != NOHINT )
{
min *= Engine::mixer()->processingSampleRate();
min *= Engine::audioEngine()->processingSampleRate();
}
if( max != NOHINT )
{
max *= Engine::mixer()->processingSampleRate();
max *= Engine::audioEngine()->processingSampleRate();
}
}

View File

@@ -27,8 +27,8 @@ BUG:
without also using LB302, so I do not know if the problem is actually
in the Bass Synth. I have gotten the backtraces a few times:
...
mixer::renderNextBuffer()
mixer::nextAudioBuffer()
audioEngine::renderNextBuffer()
audioEngine::nextAudioBuffer()
QOBject::activate_signal()
??()

View File

@@ -73,7 +73,7 @@
//
//#define engine::mixer()->processingSampleRate() 44100.0f
//#define engine::audioEngine()->processingSampleRate() 44100.0f
const float sampleRateCutoff = 44100.0f;
extern "C"
@@ -112,8 +112,8 @@ void lb302Filter::recalc()
{
vcf_e1 = exp(6.109 + 1.5876*(fs->envmod) + 2.1553*(fs->cutoff) - 1.2*(1.0-(fs->reso)));
vcf_e0 = exp(5.613 - 0.8*(fs->envmod) + 2.1553*(fs->cutoff) - 0.7696*(1.0-(fs->reso)));
vcf_e0*=M_PI/Engine::mixer()->processingSampleRate();
vcf_e1*=M_PI/Engine::mixer()->processingSampleRate();
vcf_e0*=M_PI/Engine::audioEngine()->processingSampleRate();
vcf_e1*=M_PI/Engine::audioEngine()->processingSampleRate();
vcf_e1 -= vcf_e0;
vcf_rescoeff = exp(-1.20 + 3.455*(fs->reso));
@@ -229,7 +229,7 @@ void lb302Filter3Pole::envRecalc()
w = vcf_e0 + vcf_c0;
k = (fs->cutoff > 0.975)?0.975:fs->cutoff;
// sampleRateCutoff should not be changed to anything dynamic that is outside the
// scope of lb302 (like e.g. the mixers sample rate) as this changes the filters cutoff
// scope of lb302 (like e.g. the audio engine's sample rate) as this changes the filter's cutoff
// behavior without any modification to its controls.
kfco = 50.f + (k)*((2300.f-1600.f*(fs->envmod))+(w) *
(700.f+1500.f*(k)+(1500.f+(k)*(sampleRateCutoff/2.f-6000.f)) *
@@ -239,7 +239,7 @@ void lb302Filter3Pole::envRecalc()
#ifdef LB_24_IGNORE_ENVELOPE
// kfcn = fs->cutoff;
kfcn = 2.0 * kfco / Engine::mixer()->processingSampleRate();
kfcn = 2.0 * kfco / Engine::audioEngine()->processingSampleRate();
#else
kfcn = w;
#endif
@@ -294,7 +294,7 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) :
vca_mode(never_played)
{
connect( Engine::mixer(), SIGNAL( sampleRateChanged( ) ),
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged( ) ),
this, SLOT ( filterChanged( ) ) );
connect( &vcf_cut_knob, SIGNAL( dataChanged( ) ),
@@ -351,7 +351,7 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) :
filterChanged();
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrumentTrack );
Engine::mixer()->addPlayHandle( iph );
Engine::audioEngine()->addPlayHandle( iph );
}
@@ -410,7 +410,7 @@ void lb302Synth::filterChanged()
float d = 0.2 + (2.3*vcf_dec_knob.value());
d *= Engine::mixer()->processingSampleRate(); // d *= smpl rate
d *= Engine::audioEngine()->processingSampleRate(); // d *= smpl rate
fs.envdecay = pow(0.1, 1.0/d * ENVINC); // decay is 0.1 to the 1/d * ENVINC
// vcf_envdecay is now adjusted for both
// sampling rate and ENVINC
@@ -444,7 +444,7 @@ void lb302Synth::recalcFilter()
// THIS IS OLD 3pole/24dB code, I may reintegrate it. Don't need it
// right now. Should be toggled by LB_24_RES_TRICK at the moment.
/*kfcn = 2.0 * (((vcf_cutoff*3000))) / engine::mixer()->processingSampleRate();
/*kfcn = 2.0 * (((vcf_cutoff*3000))) / engine::audioEngine()->processingSampleRate();
kp = ((-2.7528*kfcn + 3.0429)*kfcn + 1.718)*kfcn - 0.9984;
kp1 = kp+1.0;
kp1h = 0.5*kp1;
@@ -455,12 +455,12 @@ void lb302Synth::recalcFilter()
}
inline float GET_INC(float freq) {
return freq/Engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
return freq/Engine::audioEngine()->processingSampleRate(); // TODO: Use actual sampling rate.
}
int lb302Synth::process(sampleFrame *outbuf, const int size)
{
const float sampleRatio = 44100.f / Engine::mixer()->processingSampleRate();
const float sampleRatio = 44100.f / Engine::audioEngine()->processingSampleRate();
float w;
float samp;
@@ -635,7 +635,7 @@ int lb302Synth::process(sampleFrame *outbuf, const int size)
// Handle Envelope
if(vca_mode==attack) {
vca_a+=(vca_a0-vca_a)*vca_attack;
if(sample_cnt>=0.5*Engine::mixer()->processingSampleRate())
if(sample_cnt>=0.5*Engine::audioEngine()->processingSampleRate())
vca_mode = idle;
}
else if(vca_mode == decay) {
@@ -787,7 +787,7 @@ void lb302Synth::play( sampleFrame * _working_buffer )
};
m_notesMutex.unlock();
const fpp_t frames = Engine::mixer()->framesPerPeriod();
const fpp_t frames = Engine::audioEngine()->framesPerPeriod();
process( _working_buffer, frames );
instrumentTrack()->processAudioBuffer( _working_buffer, frames, NULL );

View File

@@ -1006,9 +1006,9 @@ MonstroInstrument::MonstroInstrument( InstrumentTrack * _instrument_track ) :
// updateSampleRate
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSamplerate() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSamplerate() ) );
m_fpp = Engine::mixer()->framesPerPeriod();
m_fpp = Engine::audioEngine()->framesPerPeriod();
updateSamplerate();
updateVolume1();
@@ -1419,7 +1419,7 @@ void MonstroInstrument::updateLFOAtts()
void MonstroInstrument::updateSamplerate()
{
m_samplerate = Engine::mixer()->processingSampleRate();
m_samplerate = Engine::audioEngine()->processingSampleRate();
m_integrator = 0.5f - ( 0.5f - INTEGRATOR ) * 44100.0f / m_samplerate;
m_fmCorrection = 44100.f / m_samplerate * FM_AMOUNT;

View File

@@ -25,13 +25,13 @@
#include <QDomElement>
#include "Nes.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "InstrumentTrack.h"
#include "ToolTip.h"
#include "Song.h"
#include "lmms_math.h"
#include "interpolation.h"
#include "Mixer.h"
#include "Oscillator.h"
#include "embed.h"
@@ -560,7 +560,7 @@ void NesInstrument::playNote( NotePlayHandle * n, sampleFrame * workingBuffer )
if ( n->totalFramesPlayed() == 0 || n->m_pluginData == NULL )
{
NesObject * nes = new NesObject( this, Engine::mixer()->processingSampleRate(), n );
NesObject * nes = new NesObject( this, Engine::audioEngine()->processingSampleRate(), n );
n->m_pluginData = nes;
}

View File

@@ -31,9 +31,9 @@
#include "Engine.h"
#include "AudioEngine.h"
#include "InstrumentTrack.h"
#include "Knob.h"
#include "Mixer.h"
#include "NotePlayHandle.h"
#include "Oscillator.h"
#include "PixmapButton.h"
@@ -143,7 +143,7 @@ organicInstrument::organicInstrument( InstrumentTrack * _instrument_track ) :
}
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ),
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateAllDetuning() ) );
}
@@ -622,10 +622,10 @@ void OscillatorObject::updateDetuning()
{
m_detuningLeft = powf( 2.0f, organicInstrument::s_harmonics[ static_cast<int>( m_harmModel.value() ) ]
+ (float)m_detuneModel.value() * CENT ) /
Engine::mixer()->processingSampleRate();
Engine::audioEngine()->processingSampleRate();
m_detuningRight = powf( 2.0f, organicInstrument::s_harmonics[ static_cast<int>( m_harmModel.value() ) ]
- (float)m_detuneModel.value() * CENT ) /
Engine::mixer()->processingSampleRate();
Engine::audioEngine()->processingSampleRate();
}

View File

@@ -30,6 +30,7 @@
#include <QLabel>
#include <QDomDocument>
#include "AudioEngine.h"
#include "ConfigManager.h"
#include "FileDialog.h"
#include "ConfigManager.h"
@@ -37,7 +38,6 @@
#include "InstrumentTrack.h"
#include "InstrumentPlayHandle.h"
#include "Knob.h"
#include "Mixer.h"
#include "NotePlayHandle.h"
#include "PathUtil.h"
#include "SampleBuffer.h"
@@ -124,7 +124,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
#endif
m_settings = new_fluid_settings();
//fluid_settings_setint( m_settings, (char *) "audio.period-size", engine::mixer()->framesPerPeriod() );
//fluid_settings_setint( m_settings, (char *) "audio.period-size", engine::audioEngine()->framesPerPeriod() );
// This is just our starting instance of synth. It is recreated
// everytime we load a new soundfont.
@@ -165,7 +165,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
connect( &m_bankNum, SIGNAL( dataChanged() ), this, SLOT( updatePatch() ) );
connect( &m_patchNum, SIGNAL( dataChanged() ), this, SLOT( updatePatch() ) );
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) );
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) );
// Gain
connect( &m_gain, SIGNAL( dataChanged() ), this, SLOT( updateGain() ) );
@@ -185,14 +185,14 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
connect( &m_chorusDepth, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) );
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
Engine::mixer()->addPlayHandle( iph );
Engine::audioEngine()->addPlayHandle( iph );
}
sf2Instrument::~sf2Instrument()
{
Engine::mixer()->removePlayHandlesOfTypes( instrumentTrack(),
Engine::audioEngine()->removePlayHandlesOfTypes( instrumentTrack(),
PlayHandle::TypeNotePlayHandle
| PlayHandle::TypeInstrumentPlayHandle );
freeFont();
@@ -549,7 +549,7 @@ void sf2Instrument::updateSampleRate()
double tempRate;
// Set & get, returns the true sample rate
fluid_settings_setnum( m_settings, (char *) "synth.sample-rate", Engine::mixer()->processingSampleRate() );
fluid_settings_setnum( m_settings, (char *) "synth.sample-rate", Engine::audioEngine()->processingSampleRate() );
fluid_settings_getnum( m_settings, (char *) "synth.sample-rate", &tempRate );
m_internalSampleRate = static_cast<int>( tempRate );
@@ -578,8 +578,8 @@ void sf2Instrument::updateSampleRate()
}
m_synthMutex.lock();
if( Engine::mixer()->currentQualitySettings().interpolation >=
Mixer::qualitySettings::Interpolation_SincFastest )
if( Engine::audioEngine()->currentQualitySettings().interpolation >=
AudioEngine::qualitySettings::Interpolation_SincFastest )
{
fluid_synth_set_interp_method( m_synth, -1, FLUID_INTERP_7THORDER );
}
@@ -588,7 +588,7 @@ void sf2Instrument::updateSampleRate()
fluid_synth_set_interp_method( m_synth, -1, FLUID_INTERP_DEFAULT );
}
m_synthMutex.unlock();
if( m_internalSampleRate < Engine::mixer()->processingSampleRate() )
if( m_internalSampleRate < Engine::audioEngine()->processingSampleRate() )
{
m_synthMutex.lock();
if( m_srcState != NULL )
@@ -596,7 +596,7 @@ void sf2Instrument::updateSampleRate()
src_delete( m_srcState );
}
int error;
m_srcState = src_new( Engine::mixer()->currentQualitySettings().libsrcInterpolation(), DEFAULT_CHANNELS, &error );
m_srcState = src_new( Engine::audioEngine()->currentQualitySettings().libsrcInterpolation(), DEFAULT_CHANNELS, &error );
if( m_srcState == NULL || error )
{
qCritical( "error while creating libsamplerate data structure in Sf2Instrument::updateSampleRate()" );
@@ -728,7 +728,7 @@ void sf2Instrument::noteOff( SF2PluginData * n )
void sf2Instrument::play( sampleFrame * _working_buffer )
{
const fpp_t frames = Engine::mixer()->framesPerPeriod();
const fpp_t frames = Engine::audioEngine()->framesPerPeriod();
// set midi pitch for this period
const int currentMidiPitch = instrumentTrack()->midiPitch();
@@ -817,10 +817,10 @@ void sf2Instrument::play( sampleFrame * _working_buffer )
void sf2Instrument::renderFrames( f_cnt_t frames, sampleFrame * buf )
{
m_synthMutex.lock();
if( m_internalSampleRate < Engine::mixer()->processingSampleRate() &&
if( m_internalSampleRate < Engine::audioEngine()->processingSampleRate() &&
m_srcState != NULL )
{
const fpp_t f = frames * m_internalSampleRate / Engine::mixer()->processingSampleRate();
const fpp_t f = frames * m_internalSampleRate / Engine::audioEngine()->processingSampleRate();
#ifdef __GNUC__
sampleFrame tmp[f];
#else

View File

@@ -40,6 +40,7 @@ float frnd(float range)
#include <QDomElement>
#include "sfxr.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "InstrumentTrack.h"
#include "Knob.h"
@@ -49,7 +50,6 @@ float frnd(float range)
#include "ToolTip.h"
#include "Song.h"
#include "MidiEvent.h"
#include "Mixer.h"
#include "embed.h"
@@ -455,7 +455,7 @@ QString sfxrInstrument::nodeName() const
void sfxrInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer )
{
float currentSampleRate = Engine::mixer()->processingSampleRate();
float currentSampleRate = Engine::audioEngine()->processingSampleRate();
fpp_t frameNum = _n->framesLeftForCurrentPeriod();
const f_cnt_t offset = _n->noteOffset();

View File

@@ -33,12 +33,12 @@
#include "ModalBar.h"
#include "TubeBell.h"
#include "AudioEngine.h"
#include "ConfigManager.h"
#include "Engine.h"
#include "gui_templates.h"
#include "GuiApplication.h"
#include "InstrumentTrack.h"
#include "Mixer.h"
#include "embed.h"
#include "plugin_export.h"
@@ -309,7 +309,7 @@ void malletsInstrument::playNote( NotePlayHandle * _n,
m_vibratoFreqModel.value(),
p,
(uint8_t) m_spreadModel.value(),
Engine::mixer()->processingSampleRate() );
Engine::audioEngine()->processingSampleRate() );
}
else if( p == 9 )
{
@@ -322,7 +322,7 @@ void malletsInstrument::playNote( NotePlayHandle * _n,
m_lfoSpeedModel.value(),
m_adsrModel.value(),
(uint8_t) m_spreadModel.value(),
Engine::mixer()->processingSampleRate() );
Engine::audioEngine()->processingSampleRate() );
}
else
{
@@ -335,7 +335,7 @@ void malletsInstrument::playNote( NotePlayHandle * _n,
m_strikeModel.value() * 128.0,
m_velocityModel.value(),
(uint8_t) m_spreadModel.value(),
Engine::mixer()->processingSampleRate() );
Engine::audioEngine()->processingSampleRate() );
}
m.unlock();
static_cast<malletsSynth *>(_n->m_pluginData)->setPresetIndex(p);

View File

@@ -28,12 +28,12 @@
#include <QPainter>
#include "TripleOscillator.h"
#include "AudioEngine.h"
#include "AutomatableButton.h"
#include "debug.h"
#include "Engine.h"
#include "InstrumentTrack.h"
#include "Knob.h"
#include "Mixer.h"
#include "NotePlayHandle.h"
#include "PixmapButton.h"
#include "SampleBuffer.h"
@@ -181,7 +181,7 @@ void OscillatorObject::updateDetuningLeft()
{
m_detuningLeft = powf( 2.0f, ( (float)m_coarseModel.value() * 100.0f
+ (float)m_fineLeftModel.value() ) / 1200.0f )
/ Engine::mixer()->processingSampleRate();
/ Engine::audioEngine()->processingSampleRate();
}
@@ -191,7 +191,7 @@ void OscillatorObject::updateDetuningRight()
{
m_detuningRight = powf( 2.0f, ( (float)m_coarseModel.value() * 100.0f
+ (float)m_fineRightModel.value() ) / 1200.0f )
/ Engine::mixer()->processingSampleRate();
/ Engine::audioEngine()->processingSampleRate();
}
@@ -228,7 +228,7 @@ TripleOscillator::TripleOscillator( InstrumentTrack * _instrument_track ) :
}
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ),
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateAllDetuning() ) );
}

View File

@@ -40,6 +40,7 @@
#include <string>
#include "AudioEngine.h"
#include "BufferManager.h"
#include "ConfigManager.h"
#include "Engine.h"
@@ -50,7 +51,6 @@
#include "InstrumentTrack.h"
#include "LocaleHelper.h"
#include "MainWindow.h"
#include "Mixer.h"
#include "PathUtil.h"
#include "PixmapButton.h"
#include "SampleBuffer.h"
@@ -156,7 +156,7 @@ vestigeInstrument::vestigeInstrument( InstrumentTrack * _instrument_track ) :
{
// now we need a play-handle which cares for calling play()
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
Engine::mixer()->addPlayHandle( iph );
Engine::audioEngine()->addPlayHandle( iph );
connect( ConfigManager::inst(), SIGNAL( valueChanged(QString,QString,QString) ),
this, SLOT( handleConfigChange(QString, QString, QString) ),
@@ -178,7 +178,7 @@ vestigeInstrument::~vestigeInstrument()
knobFModel = NULL;
}
Engine::mixer()->removePlayHandlesOfTypes( instrumentTrack(),
Engine::audioEngine()->removePlayHandlesOfTypes( instrumentTrack(),
PlayHandle::TypeNotePlayHandle
| PlayHandle::TypeInstrumentPlayHandle );
closePlugin();
@@ -393,7 +393,7 @@ void vestigeInstrument::play( sampleFrame * _buf )
{
if (!m_pluginMutex.tryLock(Engine::getSong()->isExporting() ? -1 : 0)) {return;}
const fpp_t frames = Engine::mixer()->framesPerPeriod();
const fpp_t frames = Engine::audioEngine()->framesPerPeriod();
if( m_plugin == NULL )
{
@@ -702,7 +702,7 @@ void VestigeInstrumentView::openPlugin()
{
return;
}
Engine::mixer()->requestChangeInModel();
Engine::audioEngine()->requestChangeInModel();
if (m_vi->p_subWindow != NULL) {
delete m_vi->p_subWindow;
@@ -710,7 +710,7 @@ void VestigeInstrumentView::openPlugin()
}
m_vi->loadFile( ofd.selectedFiles()[0] );
Engine::mixer()->doneChangeInModel();
Engine::audioEngine()->doneChangeInModel();
if( m_vi->m_plugin && m_vi->m_plugin->pluginWidget() )
{
m_vi->m_plugin->pluginWidget()->setWindowIcon(

View File

@@ -26,9 +26,9 @@
#include <QMap>
#include "vibed.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "InstrumentTrack.h"
#include "Mixer.h"
#include "NotePlayHandle.h"
#include "ToolTip.h"
#include "base64.h"
@@ -276,7 +276,7 @@ void vibed::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer )
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
{
_n->m_pluginData = new stringContainer( _n->frequency(),
Engine::mixer()->processingSampleRate(),
Engine::audioEngine()->processingSampleRate(),
__sampleLength );
for( int i = 0; i < 9; ++i )

View File

@@ -25,7 +25,7 @@
#include "vibrating_string.h"
#include "interpolation.h"
#include "Mixer.h"
#include "AudioEngine.h"
#include "Engine.h"
@@ -41,7 +41,7 @@ vibratingString::vibratingString( float _pitch,
float _detune,
bool _state ) :
m_oversample( 2 * _oversample / (int)( _sample_rate /
Engine::mixer()->baseSampleRate() ) ),
Engine::audioEngine()->baseSampleRate() ) ),
m_randomize( _randomize ),
m_stringLoss( 1.0f - _string_loss ),
m_state( 0.1f )

View File

@@ -50,11 +50,11 @@
# include <QLayout>
#endif
#include "AudioEngine.h"
#include "ConfigManager.h"
#include "GuiApplication.h"
#include "LocaleHelper.h"
#include "MainWindow.h"
#include "Mixer.h"
#include "PathUtil.h"
#include "Song.h"
#include "FileDialog.h"
@@ -154,7 +154,7 @@ VstPlugin::VstPlugin( const QString & _plugin ) :
connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ),
this, SLOT( setTempo( bpm_t ) ), Qt::DirectConnection );
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ),
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateSampleRate() ) );
// update once per second
@@ -308,7 +308,7 @@ void VstPlugin::updateSampleRate()
{
lock();
sendMessage( message( IdSampleRateInformation ).
addInt( Engine::mixer()->processingSampleRate() ) );
addInt( Engine::audioEngine()->processingSampleRate() ) );
waitForMessage( IdInformationUpdated, true );
unlock();
}

View File

@@ -26,12 +26,12 @@
#include "Watsyn.h"
#include "base64.h"
#include "AudioEngine.h"
#include "Engine.h"
#include "InstrumentTrack.h"
#include "ToolTip.h"
#include "Song.h"
#include "lmms_math.h"
#include "Mixer.h"
#include "interpolation.h"
#include "embed.h"
@@ -338,8 +338,8 @@ void WatsynInstrument::playNote( NotePlayHandle * _n,
&B1_wave[0],
&B2_wave[0],
m_amod.value(), m_bmod.value(),
Engine::mixer()->processingSampleRate(), _n,
Engine::mixer()->framesPerPeriod(), this );
Engine::audioEngine()->processingSampleRate(), _n,
Engine::audioEngine()->framesPerPeriod(), this );
_n->m_pluginData = w;
}
@@ -365,7 +365,7 @@ void WatsynInstrument::playNote( NotePlayHandle * _n,
// if sample-exact is enabled, use sample-exact calculations...
// disabled pending proper implementation of sample-exactness
/* if( engine::mixer()->currentQualitySettings().sampleExactControllers )
/* if( engine::audioEngine()->currentQualitySettings().sampleExactControllers )
{
for( fpp_t f=0; f < frames; f++ )
{

View File

@@ -45,7 +45,7 @@
#include "StringPairDrag.h"
#include "RemoteZynAddSubFx.h"
#include "LocalZynAddSubFx.h"
#include "Mixer.h"
#include "AudioEngine.h"
#include "ControllerConnection.h"
#include "Clipboard.h"
@@ -140,9 +140,9 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument(
// now we need a play-handle which cares for calling play()
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrumentTrack );
Engine::mixer()->addPlayHandle( iph );
Engine::audioEngine()->addPlayHandle( iph );
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ),
connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ),
this, SLOT( reloadPlugin() ) );
connect( instrumentTrack()->pitchRangeModel(), SIGNAL( dataChanged() ),
@@ -154,7 +154,7 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument(
ZynAddSubFxInstrument::~ZynAddSubFxInstrument()
{
Engine::mixer()->removePlayHandlesOfTypes( instrumentTrack(),
Engine::audioEngine()->removePlayHandlesOfTypes( instrumentTrack(),
PlayHandle::TypeNotePlayHandle
| PlayHandle::TypeInstrumentPlayHandle );
@@ -345,7 +345,7 @@ void ZynAddSubFxInstrument::play( sampleFrame * _buf )
m_plugin->processAudio( _buf );
}
m_pluginMutex.unlock();
instrumentTrack()->processAudioBuffer( _buf, Engine::mixer()->framesPerPeriod(), NULL );
instrumentTrack()->processAudioBuffer( _buf, Engine::audioEngine()->framesPerPeriod(), NULL );
}
@@ -457,11 +457,11 @@ void ZynAddSubFxInstrument::initPlugin()
QDir( ConfigManager::inst()->factoryPresetsDir() +
"/ZynAddSubFX" ).absolutePath() ) ) );
m_remotePlugin->updateSampleRate( Engine::mixer()->processingSampleRate() );
m_remotePlugin->updateSampleRate( Engine::audioEngine()->processingSampleRate() );
// temporary workaround until the VST synchronization feature gets stripped out of the RemotePluginClient class
// causing not to send buffer size information requests
m_remotePlugin->sendMessage( RemotePlugin::message( IdBufferSizeInformation ).addInt( Engine::mixer()->framesPerPeriod() ) );
m_remotePlugin->sendMessage( RemotePlugin::message( IdBufferSizeInformation ).addInt( Engine::audioEngine()->framesPerPeriod() ) );
m_remotePlugin->showUI();
m_remotePlugin->unlock();
@@ -469,8 +469,8 @@ void ZynAddSubFxInstrument::initPlugin()
else
{
m_plugin = new LocalZynAddSubFx;
m_plugin->setSampleRate( Engine::mixer()->processingSampleRate() );
m_plugin->setBufferSize( Engine::mixer()->framesPerPeriod() );
m_plugin->setSampleRate( Engine::audioEngine()->processingSampleRate() );
m_plugin->setBufferSize( Engine::audioEngine()->framesPerPeriod() );
}
m_pluginMutex.unlock();