Mixer: renamed class and file name

The mixer class is now named "Mixer" and accessible via engine::mixer().
This commit is contained in:
Tobias Doerffel
2014-01-08 22:35:14 +01:00
parent 40290117ff
commit 0ff1f91c1b
107 changed files with 509 additions and 509 deletions

View File

@@ -195,8 +195,8 @@ QString audioFileProcessor::nodeName( void ) const
Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
{
const float freq_factor = BaseFreq / _n->frequency() *
engine::getMixer()->processingSampleRate() /
engine::getMixer()->baseSampleRate();
engine::mixer()->processingSampleRate() /
engine::mixer()->baseSampleRate();
return( static_cast<Uint32>( floorf( ( m_sampleBuffer.endFrame() -
m_sampleBuffer.startFrame() ) *

View File

@@ -46,7 +46,7 @@ bassBoosterControls::bassBoosterControls( bassBoosterEffect * _eff ) :
connect( &m_ratioModel, SIGNAL( dataChanged() ),
this, SLOT( changeRatio() ) );
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( changeFrequency() ) );
changeFrequency();
changeGain();
@@ -58,7 +58,7 @@ bassBoosterControls::bassBoosterControls( bassBoosterEffect * _eff ) :
void bassBoosterControls::changeFrequency()
{
const sample_t fac = engine::getMixer()->processingSampleRate() /
const sample_t fac = engine::mixer()->processingSampleRate() /
44100.0f;
m_effect->m_bbFX.leftFX().setFrequency( m_freqModel.value() * fac );
m_effect->m_bbFX.rightFX().setFrequency( m_freqModel.value() * fac );

View File

@@ -278,7 +278,7 @@ void bitInvader::playNote( notePlayHandle * _n,
m_graph.length(),
_n,
m_interpolation.value(), factor,
engine::getMixer()->processingSampleRate() );
engine::mixer()->processingSampleRate() );
}
const fpp_t frames = _n->framesLeftForCurrentPeriod();

View File

@@ -117,7 +117,7 @@ void kickerInstrument::playNote( notePlayHandle * _n,
sampleFrame * _working_buffer )
{
const float decfr = m_decayModel.value() *
engine::getMixer()->processingSampleRate() / 1000.0f;
engine::mixer()->processingSampleRate() / 1000.0f;
const f_cnt_t tfp = _n->totalFramesPlayed();
if ( tfp == 0 )
@@ -136,9 +136,9 @@ void kickerInstrument::playNote( notePlayHandle * _n,
/* const fpp_t frames = _n->released() ?
tMax( tMin<f_cnt_t>( desiredReleaseFrames() -
_n->releaseFramesDone(),
engine::getMixer()->framesPerAudioBuffer() ), 0 )
engine::mixer()->framesPerAudioBuffer() ), 0 )
:
engine::getMixer()->framesPerAudioBuffer();*/
engine::mixer()->framesPerAudioBuffer();*/
const fpp_t frames = _n->framesLeftForCurrentPeriod();
const float f1 = m_startFreqModel.value() + tfp * fdiff / decfr;
const float f2 = m_startFreqModel.value() + (frames+tfp-1)*fdiff/decfr;
@@ -146,7 +146,7 @@ void kickerInstrument::playNote( notePlayHandle * _n,
SweepOsc * so = static_cast<SweepOsc *>( _n->m_pluginData );
so->update( _working_buffer, frames, f1, f2,
engine::getMixer()->processingSampleRate() );
engine::mixer()->processingSampleRate() );
if( _n->released() )
{

View File

@@ -33,7 +33,7 @@
#include "AudioDevice.h"
#include "engine.h"
#include "ladspa_2_lmms.h"
#include "mixer.h"
#include "Mixer.h"
@@ -74,7 +74,7 @@ ladspaDescription::ladspaDescription( QWidget * _parent,
{
if( _type != VALID ||
manager->getDescription( ( *it ).second )->inputChannels
<= engine::getMixer()->audioDev()->channels() )
<= engine::mixer()->audioDev()->channels() )
{
pluginNames.push_back( ( *it ).first );
m_pluginKeys.push_back( ( *it ).second );

View File

@@ -31,7 +31,7 @@
#include "embed.h"
#include "engine.h"
#include "ladspa_2_lmms.h"
#include "mixer.h"
#include "Mixer.h"
ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
@@ -95,11 +95,11 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
{
if( min != NOHINT )
{
min *= engine::getMixer()->processingSampleRate();
min *= engine::mixer()->processingSampleRate();
}
if( max != NOHINT )
{
max *= engine::getMixer()->processingSampleRate();
max *= engine::mixer()->processingSampleRate();
}
}

View File

@@ -33,7 +33,7 @@
#include "ladspa_2_lmms.h"
#include "LadspaControl.h"
#include "LadspaSubPluginFeatures.h"
#include "mixer.h"
#include "Mixer.h"
#include "EffectChain.h"
#include "AutomationPattern.h"
#include "ControllerConnection.h"
@@ -87,7 +87,7 @@ LadspaEffect::LadspaEffect( Model * _parent,
pluginInstantiation();
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( changeSampleRate() ) );
}
@@ -144,13 +144,13 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
int frames = _frames;
sampleFrame * o_buf = NULL;
if( m_maxSampleRate < engine::getMixer()->processingSampleRate() )
if( m_maxSampleRate < engine::mixer()->processingSampleRate() )
{
o_buf = _buf;
_buf = new sampleFrame[_frames];
sampleDown( o_buf, _buf, m_maxSampleRate );
frames = _frames * m_maxSampleRate /
engine::getMixer()->processingSampleRate();
engine::mixer()->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::getMixer()->audioDev()->channels();
const ch_cnt_t lmms_chnls = engine::mixer()->audioDev()->channels();
int effect_channels = manager->getDescription( m_key )->inputChannels;
setProcessorCount( lmms_chnls / effect_channels );
@@ -316,7 +316,7 @@ void LadspaEffect::pluginInstantiation()
// during cleanup. It was easier to troubleshoot with the
// memory management all taking place in one file.
p->buffer =
new LADSPA_Data[engine::getMixer()->framesPerPeriod()];
new LADSPA_Data[engine::mixer()->framesPerPeriod()];
if( p->name.toUpper().contains( "IN" ) &&
manager->isPortInput( m_key, port ) )
@@ -557,7 +557,7 @@ sample_rate_t LadspaEffect::maxSamplerate( const QString & _name )
{
return( __buggy_plugins[_name] );
}
return( engine::getMixer()->processingSampleRate() );
return( engine::mixer()->processingSampleRate() );
}

View File

@@ -33,7 +33,7 @@
#include "engine.h"
#include "ladspa_2_lmms.h"
#include "LadspaBase.h"
#include "mixer.h"
#include "Mixer.h"
LadspaSubPluginFeatures::LadspaSubPluginFeatures( Plugin::PluginTypes _type ) :
@@ -142,7 +142,7 @@ void LadspaSubPluginFeatures::listSubPluginKeys(
it != plugins.end(); ++it )
{
if( lm->getDescription( ( *it ).second )->inputChannels <=
engine::getMixer()->audioDev()->channels() )
engine::mixer()->audioDev()->channels() )
{
_kl.push_back( ladspaKeyToSubPluginKey( _desc, ( *it ).first, ( *it ).second ) );
}

View File

@@ -70,7 +70,7 @@
//
//#define engine::getMixer()->processingSampleRate() 44100.0f
//#define engine::mixer()->processingSampleRate() 44100.0f
extern "C"
@@ -109,8 +109,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::getMixer()->processingSampleRate();
vcf_e1*=M_PI/engine::getMixer()->processingSampleRate();
vcf_e0*=M_PI/engine::mixer()->processingSampleRate();
vcf_e1*=M_PI/engine::mixer()->processingSampleRate();
vcf_e1 -= vcf_e0;
vcf_rescoeff = exp(-1.20 + 3.455*(fs->reso));
@@ -226,14 +226,14 @@ void lb302Filter3Pole::envRecalc()
w = vcf_e0 + vcf_c0;
k = (fs->cutoff > 0.975)?0.975:fs->cutoff;
kfco = 50.f + (k)*((2300.f-1600.f*(fs->envmod))+(w) *
(700.f+1500.f*(k)+(1500.f+(k)*(engine::getMixer()->processingSampleRate()/2.f-6000.f)) *
(700.f+1500.f*(k)+(1500.f+(k)*(engine::mixer()->processingSampleRate()/2.f-6000.f)) *
(fs->envmod)) );
//+iacc*(.3+.7*kfco*kenvmod)*kaccent*kaccurve*2000
#ifdef LB_24_IGNORE_ENVELOPE
// kfcn = fs->cutoff;
kfcn = 2.0 * kfco / engine::getMixer()->processingSampleRate();
kfcn = 2.0 * kfco / engine::mixer()->processingSampleRate();
#else
kfcn = w;
#endif
@@ -284,7 +284,7 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) :
{
connect( engine::getMixer(), SIGNAL( sampleRateChanged( ) ),
connect( engine::mixer(), SIGNAL( sampleRateChanged( ) ),
this, SLOT ( filterChanged( ) ) );
connect( &vcf_cut_knob, SIGNAL( dataChanged( ) ),
@@ -354,7 +354,7 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) :
delete_freq = -1;
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
engine::getMixer()->addPlayHandle( iph );
engine::mixer()->addPlayHandle( iph );
filterChanged();
}
@@ -412,7 +412,7 @@ void lb302Synth::filterChanged()
float d = 0.2 + (2.3*vcf_dec_knob.value());
d *= engine::getMixer()->processingSampleRate(); // d *= smpl rate
d *= engine::mixer()->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
@@ -448,7 +448,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::getMixer()->processingSampleRate();
/*kfcn = 2.0 * (((vcf_cutoff*3000))) / engine::mixer()->processingSampleRate();
kp = ((-2.7528*kfcn + 3.0429)*kfcn + 1.718)*kfcn - 0.9984;
kp1 = kp+1.0;
kp1h = 0.5*kp1;
@@ -463,7 +463,7 @@ inline int MIN(int a, int b) {
}
inline float GET_INC(float freq) {
return freq/engine::getMixer()->processingSampleRate(); // TODO: Use actual sampling rate.
return freq/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
}
int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
@@ -483,7 +483,7 @@ int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
lb302Note note;
note.vco_inc = GET_INC( true_freq );
//printf("GET_INC %f %f %d\n", note.vco_inc, new_freq, vca_mode );
///**vco_detune*//engine::getMixer()->processingSampleRate(); // TODO: Use actual sampling rate.
///**vco_detune*//engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
//printf("VCO_INC = %f\n", note.vco_inc);
note.dead = deadToggle.value();
initNote(&note);
@@ -634,7 +634,7 @@ int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
// Handle Envelope
if(vca_mode==0) {
vca_a+=(vca_a0-vca_a)*vca_attack;
if(sample_cnt>=0.5*engine::getMixer()->processingSampleRate())
if(sample_cnt>=0.5*engine::mixer()->processingSampleRate())
vca_mode = 2;
}
else if(vca_mode == 1) {
@@ -712,7 +712,7 @@ void lb302Synth::initNote( lb302Note *n)
void lb302Synth::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
{
//fpp_t framesPerPeriod = engine::getMixer()->framesPerPeriod();
//fpp_t framesPerPeriod = engine::mixer()->framesPerPeriod();
if( _n->isArpeggioBaseNote() )
{
@@ -736,7 +736,7 @@ void lb302Synth::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
if(deadToggle.value() == 0 && decay_note) {
/* lb302Note note;
note.vco_inc = _n->frequency()*vco_detune/engine::getMixer()->processingSampleRate(); // TODO: Use actual sampling rate.
note.vco_inc = _n->frequency()*vco_detune/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
note.dead = deadToggle.value();
initNote(&note);
vca_mode=0;
@@ -772,7 +772,7 @@ void lb302Synth::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
void lb302Synth::play( sampleFrame * _working_buffer )
{
//printf(".");
const fpp_t frames = engine::getMixer()->framesPerPeriod();
const fpp_t frames = engine::mixer()->framesPerPeriod();
process( _working_buffer, frames);
instrumentTrack()->processAudioBuffer( _working_buffer, frames,

View File

@@ -37,7 +37,7 @@
#include "InstrumentView.h"
#include "led_checkbox.h"
#include "knob.h"
#include "mixer.h"
#include "Mixer.h"
class lb302SynthView;
class notePlayHandle;

View File

@@ -70,7 +70,7 @@
//
//#define engine::getMixer()->processingSampleRate() 44100.0f
//#define engine::mixer()->processingSampleRate() 44100.0f
extern "C"
@@ -108,8 +108,8 @@ void lb303Filter::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::getMixer()->processingSampleRate();
vcf_e1*=M_PI/engine::getMixer()->processingSampleRate();
vcf_e0*=M_PI/engine::mixer()->processingSampleRate();
vcf_e1*=M_PI/engine::mixer()->processingSampleRate();
vcf_e1 -= vcf_e0;
vcf_rescoeff = exp(-1.20 + 3.455*(fs->reso));
@@ -225,14 +225,14 @@ void lb303Filter3Pole::envRecalc()
w = vcf_e0 + vcf_c0;
k = (fs->cutoff > 0.975)?0.975:fs->cutoff;
kfco = 50.f + (k)*((2300.f-1600.f*(fs->envmod))+(w) *
(700.f+1500.f*(k)+(1500.f+(k)*(engine::getMixer()->processingSampleRate()/2.f-6000.f)) *
(700.f+1500.f*(k)+(1500.f+(k)*(engine::mixer()->processingSampleRate()/2.f-6000.f)) *
(fs->envmod)) );
//+iacc*(.3+.7*kfco*kenvmod)*kaccent*kaccurve*2000
#ifdef LB_24_IGNORE_ENVELOPE
// kfcn = fs->cutoff;
kfcn = 2.0 * kfco / engine::getMixer()->processingSampleRate();
kfcn = 2.0 * kfco / engine::mixer()->processingSampleRate();
#else
kfcn = w;
#endif
@@ -283,7 +283,7 @@ lb303Synth::lb303Synth( InstrumentTrack * _InstrumentTrack ) :
{
connect( engine::getMixer(), SIGNAL( sampleRateChanged( ) ),
connect( engine::mixer(), SIGNAL( sampleRateChanged( ) ),
this, SLOT ( filterChanged( ) ) );
connect( &vcf_cut_knob, SIGNAL( dataChanged( ) ),
@@ -353,7 +353,7 @@ lb303Synth::lb303Synth( InstrumentTrack * _InstrumentTrack ) :
delete_freq = -1;
instrumentPlayHandle * iph = new instrumentPlayHandle( this );
engine::getMixer()->addPlayHandle( iph );
engine::mixer()->addPlayHandle( iph );
filterChanged();
}
@@ -412,7 +412,7 @@ void lb303Synth::filterChanged()
float d = 0.2 + (2.3*vcf_dec_knob.value());
d *= engine::getMixer()->processingSampleRate(); // d *= smpl rate
d *= engine::mixer()->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
@@ -452,7 +452,7 @@ inline int MIN(int a, int b) {
}
inline float GET_INC(float freq) {
return freq/engine::getMixer()->processingSampleRate(); // TODO: Use actual sampling rate.
return freq/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
}
int lb303Synth::process(sampleFrame *outbuf, const Uint32 size)
@@ -590,7 +590,7 @@ int lb303Synth::process(sampleFrame *outbuf, const Uint32 size)
// Handle Envelope
if(vca_mode==0) {
vca_a+=(vca_a0-vca_a)*vca_attack;
if(sample_cnt>=0.5*engine::getMixer()->processingSampleRate())
if(sample_cnt>=0.5*engine::mixer()->processingSampleRate())
vca_mode = 2;
}
else if(vca_mode == 1) {
@@ -710,7 +710,7 @@ void lb303Synth::playNote( notePlayHandle * _n,
void lb303Synth::play( sampleFrame * _working_buffer )
{
//printf(".");
const fpp_t frames = engine::getMixer()->framesPerPeriod();
const fpp_t frames = engine::mixer()->framesPerPeriod();
process( _working_buffer, frames);
instrumentTrack()->processAudioBuffer( _working_buffer, frames,

View File

@@ -37,7 +37,7 @@
#include "InstrumentView.h"
#include "led_checkbox.h"
#include "knob.h"
#include "mixer.h"
#include "Mixer.h"
class lb303SynthView;
class notePlayHandle;

View File

@@ -141,13 +141,13 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
// Connect the plugin to the mixer...
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
engine::getMixer()->addPlayHandle( iph );
engine::mixer()->addPlayHandle( iph );
// Create an emulator - samplerate, 16 bit, mono
// CTemuopl is the better one, CKemuopl kinda sucks (some sounds silent, pitch goes flat after a while)
emulatorMutex.lock();
// theEmulator = new CKemuopl(engine::getMixer()->processingSampleRate(), true, false);
theEmulator = new CTemuopl(engine::getMixer()->processingSampleRate(), true, false);
// theEmulator = new CKemuopl(engine::mixer()->processingSampleRate(), true, false);
theEmulator = new CTemuopl(engine::mixer()->processingSampleRate(), true, false);
theEmulator->init();
// Enable waveform selection
theEmulator->write(0x01,0x20);
@@ -158,7 +158,7 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
updatePatch();
// Can the buffer size change suddenly? I bet that would break lots of stuff
frameCount = engine::getMixer()->framesPerPeriod();
frameCount = engine::mixer()->framesPerPeriod();
renderbuffer = new short[frameCount];
// Some kind of sane default
@@ -167,7 +167,7 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
for(int i=1; i<9; ++i) {
voiceNote[i] = OPL2_VOICE_FREE;
}
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( reloadEmulator() ) );
// Connect knobs
// This one's for testing...
@@ -216,7 +216,7 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
// Samplerate changes when choosing oversampling, so this is more or less mandatory
void opl2instrument::reloadEmulator() {
emulatorMutex.lock();
theEmulator = new CTemuopl(engine::getMixer()->processingSampleRate(), true, false);
theEmulator = new CTemuopl(engine::mixer()->processingSampleRate(), true, false);
theEmulator->init();
theEmulator->write(0x01,0x20);
emulatorMutex.unlock();

View File

@@ -116,7 +116,7 @@ organicInstrument::organicInstrument( InstrumentTrack * _instrument_track ) :
}
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateAllDetuning() ) );
}
@@ -551,10 +551,10 @@ void OscillatorObject::updateDetuning()
{
m_detuningLeft = powf( 2.0f, m_harmonic
+ (float)m_detuneModel.value() / 100.0f ) /
engine::getMixer()->processingSampleRate();
engine::mixer()->processingSampleRate();
m_detuningRight = powf( 2.0f, m_harmonic
- (float)m_detuneModel.value() / 100.0f ) /
engine::getMixer()->processingSampleRate();
engine::mixer()->processingSampleRate();
}

View File

@@ -213,7 +213,7 @@ QString papuInstrument::nodeName() const
/*f_cnt_t papuInstrument::desiredReleaseFrames() const
{
const float samplerate = engine::getMixer()->processingSampleRate();
const float samplerate = engine::mixer()->processingSampleRate();
int maxrel = 0;
for( int i = 0 ; i < 3 ; ++i )
{
@@ -235,7 +235,7 @@ void papuInstrument::playNote( notePlayHandle * _n,
sampleFrame * _working_buffer )
{
const f_cnt_t tfp = _n->totalFramesPlayed();
const int samplerate = engine::getMixer()->processingSampleRate();
const int samplerate = engine::mixer()->processingSampleRate();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
int data = 0;

View File

@@ -119,14 +119,14 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
m_settings = new_fluid_settings();
fluid_settings_setint( m_settings, (char *) "audio.period-size",
engine::getMixer()->framesPerPeriod() );
engine::mixer()->framesPerPeriod() );
// This is just our starting instance of synth. It is recreated
// everytime we load a new soundfont.
m_synth = new_fluid_synth( m_settings );
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
engine::getMixer()->addPlayHandle( iph );
engine::mixer()->addPlayHandle( iph );
loadFile( configManager::inst()->defaultSoundfont() );
@@ -144,7 +144,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
connect( &m_patchNum, SIGNAL( dataChanged() ),
this, SLOT( updatePatch() ) );
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateSampleRate() ) );
// Gain
@@ -189,7 +189,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
sf2Instrument::~sf2Instrument()
{
engine::getMixer()->removePlayHandles( instrumentTrack() );
engine::mixer()->removePlayHandles( instrumentTrack() );
freeFont();
delete_fluid_synth( m_synth );
delete_fluid_settings( m_settings );
@@ -501,7 +501,7 @@ void sf2Instrument::updateSampleRate()
// Set & get, returns the true sample rate
fluid_settings_setnum( m_settings, (char *) "synth.sample-rate",
engine::getMixer()->processingSampleRate() );
engine::mixer()->processingSampleRate() );
fluid_settings_getnum( m_settings, (char *) "synth.sample-rate",
&tempRate );
m_internalSampleRate = static_cast<int>( tempRate );
@@ -532,8 +532,8 @@ void sf2Instrument::updateSampleRate()
}
m_synthMutex.lock();
if( engine::getMixer()->currentQualitySettings().interpolation >=
mixer::qualitySettings::Interpolation_SincFastest )
if( engine::mixer()->currentQualitySettings().interpolation >=
Mixer::qualitySettings::Interpolation_SincFastest )
{
fluid_synth_set_interp_method( m_synth, -1,
FLUID_INTERP_7THORDER );
@@ -544,7 +544,7 @@ void sf2Instrument::updateSampleRate()
FLUID_INTERP_DEFAULT );
}
m_synthMutex.unlock();
if( m_internalSampleRate < engine::getMixer()->processingSampleRate() )
if( m_internalSampleRate < engine::mixer()->processingSampleRate() )
{
m_synthMutex.lock();
if( m_srcState != NULL )
@@ -552,7 +552,7 @@ void sf2Instrument::updateSampleRate()
src_delete( m_srcState );
}
int error;
m_srcState = src_new( engine::getMixer()->
m_srcState = src_new( engine::mixer()->
currentQualitySettings().libsrcInterpolation(),
DEFAULT_CHANNELS, &error );
if( m_srcState == NULL || error )
@@ -677,7 +677,7 @@ void sf2Instrument::playNote( notePlayHandle * _n, sampleFrame * )
// frame-length of 1 while rendering?
void sf2Instrument::play( sampleFrame * _working_buffer )
{
const fpp_t frames = engine::getMixer()->framesPerPeriod();
const fpp_t frames = engine::mixer()->framesPerPeriod();
m_synthMutex.lock();
if( m_lastMidiPitch != instrumentTrack()->midiPitch() )
@@ -686,11 +686,11 @@ void sf2Instrument::play( sampleFrame * _working_buffer )
fluid_synth_pitch_bend( m_synth, m_channel, m_lastMidiPitch );
}
if( m_internalSampleRate < engine::getMixer()->processingSampleRate() &&
if( m_internalSampleRate < engine::mixer()->processingSampleRate() &&
m_srcState != NULL )
{
const fpp_t f = frames * m_internalSampleRate /
engine::getMixer()->processingSampleRate();
engine::mixer()->processingSampleRate();
#ifdef __GNUC__
sampleFrame tmp[f];
#else

View File

@@ -230,7 +230,7 @@ QString sidInstrument::nodeName() const
f_cnt_t sidInstrument::desiredReleaseFrames() const
{
const float samplerate = engine::getMixer()->processingSampleRate();
const float samplerate = engine::mixer()->processingSampleRate();
int maxrel = 0;
for( int i = 0 ; i < 3 ; ++i )
{
@@ -305,7 +305,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::getMixer()->processingSampleRate();
const int samplerate = engine::mixer()->processingSampleRate();
if ( tfp == 0 )
{

View File

@@ -132,7 +132,7 @@ bool spectrumAnalyzer::processAudioBuffer( sampleFrame * _buf,
// hanming( m_buffer, FFT_BUFFER_SIZE, HAMMING );
const sample_rate_t sr = engine::getMixer()->processingSampleRate();
const sample_rate_t sr = engine::mixer()->processingSampleRate();
const int LOWEST_FREQ = 0;
const int HIGHEST_FREQ = sr / 2;

View File

@@ -233,7 +233,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
m_vibratoFreqModel.value(),
p,
(Uint8) m_spreadModel.value(),
engine::getMixer()->processingSampleRate() );
engine::mixer()->processingSampleRate() );
}
else if( p == 9 )
{
@@ -246,7 +246,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
m_lfoSpeedModel.value(),
m_adsrModel.value(),
(Uint8) m_spreadModel.value(),
engine::getMixer()->processingSampleRate() );
engine::mixer()->processingSampleRate() );
}
else
{
@@ -259,7 +259,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
m_strikeModel.value() * 128.0,
m_velocityModel.value(),
(Uint8) m_spreadModel.value(),
engine::getMixer()->processingSampleRate() );
engine::mixer()->processingSampleRate() );
}
m.unlock();
}

View File

@@ -177,7 +177,7 @@ void OscillatorObject::updateDetuningLeft()
{
m_detuningLeft = powf( 2.0f, ( (float)m_coarseModel.value() * 100.0f
+ (float)m_fineLeftModel.value() ) / 1200.0f )
/ engine::getMixer()->processingSampleRate();
/ engine::mixer()->processingSampleRate();
}
@@ -187,7 +187,7 @@ void OscillatorObject::updateDetuningRight()
{
m_detuningRight = powf( 2.0f, ( (float)m_coarseModel.value() * 100.0f
+ (float)m_fineRightModel.value() ) / 1200.0f )
/ engine::getMixer()->processingSampleRate();
/ engine::mixer()->processingSampleRate();
}
@@ -219,7 +219,7 @@ TripleOscillator::TripleOscillator( InstrumentTrack * _instrument_track ) :
}
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateAllDetuning() ) );
}

View File

@@ -83,7 +83,7 @@ vestigeInstrument::vestigeInstrument( InstrumentTrack * _instrument_track ) :
{
// now we need a play-handle which cares for calling play()
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
engine::getMixer()->addPlayHandle( iph );
engine::mixer()->addPlayHandle( iph );
}
@@ -101,7 +101,7 @@ vestigeInstrument::~vestigeInstrument()
knobFModel = NULL;
}
engine::getMixer()->removePlayHandles( instrumentTrack() );
engine::mixer()->removePlayHandles( instrumentTrack() );
closePlugin();
}
@@ -301,7 +301,7 @@ void vestigeInstrument::play( sampleFrame * _buf )
m_plugin->process( NULL, _buf );
const fpp_t frames = engine::getMixer()->framesPerPeriod();
const fpp_t frames = engine::mixer()->framesPerPeriod();
instrumentTrack()->processAudioBuffer( _buf, frames, NULL );
@@ -652,7 +652,7 @@ void VestigeInstrumentView::openPlugin()
{
return;
}
engine::getMixer()->lock();
engine::mixer()->lock();
if (m_vi->p_subWindow != NULL) {
delete m_vi->p_subWindow;
@@ -660,7 +660,7 @@ void VestigeInstrumentView::openPlugin()
}
m_vi->loadFile( ofd.selectedFiles()[0] );
engine::getMixer()->unlock();
engine::mixer()->unlock();
if( m_vi->m_plugin && m_vi->m_plugin->pluginWidget() )
{
m_vi->m_plugin->pluginWidget()->setWindowIcon(

View File

@@ -277,7 +277,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::getMixer()->processingSampleRate(),
engine::mixer()->processingSampleRate(),
__sampleLength );
for( Uint8 i = 0; i < 9; ++i )

View File

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

View File

@@ -110,7 +110,7 @@ VstPlugin::VstPlugin( const QString & _plugin ) :
connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ),
this, SLOT( setTempo( bpm_t ) ) );
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateSampleRate() ) );
// update once per second
@@ -372,7 +372,7 @@ void VstPlugin::updateSampleRate()
{
lock();
sendMessage( message( IdSampleRateInformation ).
addInt( engine::getMixer()->processingSampleRate() ) );
addInt( engine::mixer()->processingSampleRate() ) );
unlock();
}

View File

@@ -31,7 +31,7 @@
#include <QtCore/QTimer>
#include <QtGui/QWidget>
#include "mixer.h"
#include "Mixer.h"
#include "JournallingObject.h"
#include "communication.h"

View File

@@ -129,9 +129,9 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument(
// now we need a play-handle which cares for calling play()
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
engine::getMixer()->addPlayHandle( iph );
engine::mixer()->addPlayHandle( iph );
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( reloadPlugin() ) );
}
@@ -140,7 +140,7 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument(
ZynAddSubFxInstrument::~ZynAddSubFxInstrument()
{
engine::getMixer()->removePlayHandles( instrumentTrack() );
engine::mixer()->removePlayHandles( instrumentTrack() );
m_pluginMutex.lock();
delete m_remotePlugin;
@@ -334,7 +334,7 @@ void ZynAddSubFxInstrument::play( sampleFrame * _buf )
}
m_pluginMutex.unlock();
instrumentTrack()->processAudioBuffer( _buf,
engine::getMixer()->framesPerPeriod(), NULL );
engine::mixer()->framesPerPeriod(), NULL );
}
@@ -440,8 +440,8 @@ void ZynAddSubFxInstrument::initPlugin()
else
{
m_plugin = new LocalZynAddSubFx;
m_plugin->setSampleRate( engine::getMixer()->processingSampleRate() );
m_plugin->setBufferSize( engine::getMixer()->framesPerPeriod() );
m_plugin->setSampleRate( engine::mixer()->processingSampleRate() );
m_plugin->setBufferSize( engine::mixer()->framesPerPeriod() );
}
m_pluginMutex.unlock();
}