Mixer: renamed class and file name
The mixer class is now named "Mixer" and accessible via engine::mixer().
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "song.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "Controller.h"
|
||||
#include "ControllerConnection.h"
|
||||
#include "ControllerDialog.h"
|
||||
@@ -109,7 +109,7 @@ unsigned int Controller::runningFrames()
|
||||
// Get position in seconds
|
||||
float Controller::runningTime()
|
||||
{
|
||||
return s_frames / engine::getMixer()->processingSampleRate();
|
||||
return s_frames / engine::mixer()->processingSampleRate();
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ void Controller::triggerFrameCounter()
|
||||
emit s_controllers.at(i)->valueChanged();
|
||||
}
|
||||
|
||||
s_frames += engine::getMixer()->framesPerPeriod();
|
||||
s_frames += engine::mixer()->framesPerPeriod();
|
||||
//emit s_signaler.triggerValueChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "song.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "ControllerConnection.h"
|
||||
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ void Effect::reinitSRC()
|
||||
}
|
||||
int error;
|
||||
if( ( m_srcState[i] = src_new(
|
||||
engine::getMixer()->currentQualitySettings().
|
||||
engine::mixer()->currentQualitySettings().
|
||||
libsrcInterpolation(),
|
||||
DEFAULT_CHANNELS, &error ) ) == NULL )
|
||||
{
|
||||
@@ -190,7 +190,7 @@ void Effect::resample( int _i, const sampleFrame * _src_buf,
|
||||
return;
|
||||
}
|
||||
m_srcData[_i].input_frames = _frames;
|
||||
m_srcData[_i].output_frames = engine::getMixer()->framesPerPeriod();
|
||||
m_srcData[_i].output_frames = engine::mixer()->framesPerPeriod();
|
||||
m_srcData[_i].data_in = (float *) _src_buf[0];
|
||||
m_srcData[_i].data_out = _dst_buf[0];
|
||||
m_srcData[_i].src_ratio = (double) _dst_sr / _src_sr;
|
||||
|
||||
@@ -116,9 +116,9 @@ void EffectChain::loadSettings( const QDomElement & _this )
|
||||
|
||||
void EffectChain::appendEffect( Effect * _effect )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
m_effects.append( _effect );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
|
||||
emit dataChanged();
|
||||
}
|
||||
@@ -128,9 +128,9 @@ void EffectChain::appendEffect( Effect * _effect )
|
||||
|
||||
void EffectChain::removeEffect( Effect * _effect )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
m_effects.erase( qFind( m_effects.begin(), m_effects.end(), _effect ) );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "EnvelopeAndLfoParameters.h"
|
||||
#include "debug.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "mmp.h"
|
||||
#include "Oscillator.h"
|
||||
|
||||
@@ -48,7 +48,7 @@ void EnvelopeAndLfoParameters::LfoInstances::trigger()
|
||||
it != m_lfos.end(); ++it )
|
||||
{
|
||||
( *it )->m_lfoFrame +=
|
||||
engine::getMixer()->framesPerPeriod();
|
||||
engine::mixer()->framesPerPeriod();
|
||||
( *it )->m_bad_lfoShapeData = true;
|
||||
}
|
||||
}
|
||||
@@ -151,12 +151,12 @@ EnvelopeAndLfoParameters::EnvelopeAndLfoParameters(
|
||||
connect( &m_x100Model, SIGNAL( dataChanged() ),
|
||||
this, SLOT( updateSampleVars() ) );
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
|
||||
this, SLOT( updateSampleVars() ) );
|
||||
|
||||
|
||||
m_lfoShapeData =
|
||||
new sample_t[engine::getMixer()->framesPerPeriod()];
|
||||
new sample_t[engine::mixer()->framesPerPeriod()];
|
||||
|
||||
updateSampleVars();
|
||||
}
|
||||
@@ -229,7 +229,7 @@ inline sample_t EnvelopeAndLfoParameters::lfoShapeSample( fpp_t _frame_offset )
|
||||
|
||||
void EnvelopeAndLfoParameters::updateLfoShapeData()
|
||||
{
|
||||
const fpp_t frames = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t frames = engine::mixer()->framesPerPeriod();
|
||||
for( fpp_t offset = 0; offset < frames; ++offset )
|
||||
{
|
||||
m_lfoShapeData[offset] = lfoShapeSample( offset );
|
||||
@@ -380,10 +380,10 @@ void EnvelopeAndLfoParameters::loadSettings( const QDomElement & _this )
|
||||
|
||||
void EnvelopeAndLfoParameters::updateSampleVars()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
|
||||
const float frames_per_env_seg = SECS_PER_ENV_SEGMENT *
|
||||
engine::getMixer()->processingSampleRate();
|
||||
engine::mixer()->processingSampleRate();
|
||||
// TODO: Remove the expKnobVals, time should be linear
|
||||
const f_cnt_t predelay_frames = static_cast<f_cnt_t>(
|
||||
frames_per_env_seg *
|
||||
@@ -472,7 +472,7 @@ void EnvelopeAndLfoParameters::updateSampleVars()
|
||||
|
||||
|
||||
const float frames_per_lfo_oscillation = SECS_PER_LFO_OSCILLATION *
|
||||
engine::getMixer()->processingSampleRate();
|
||||
engine::mixer()->processingSampleRate();
|
||||
m_lfoPredelayFrames = static_cast<f_cnt_t>( frames_per_lfo_oscillation *
|
||||
expKnobVal( m_lfoPredelayModel.value() ) );
|
||||
m_lfoAttackFrames = static_cast<f_cnt_t>( frames_per_lfo_oscillation *
|
||||
@@ -504,7 +504,7 @@ void EnvelopeAndLfoParameters::updateSampleVars()
|
||||
|
||||
emit dataChanged();
|
||||
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,14 +38,14 @@ FxChannel::FxChannel( Model * _parent ) :
|
||||
m_stillRunning( false ),
|
||||
m_peakLeft( 0.0f ),
|
||||
m_peakRight( 0.0f ),
|
||||
m_buffer( new sampleFrame[engine::getMixer()->framesPerPeriod()] ),
|
||||
m_buffer( new sampleFrame[engine::mixer()->framesPerPeriod()] ),
|
||||
m_muteModel( false, _parent ),
|
||||
m_volumeModel( 1.0, 0.0, 2.0, 0.01, _parent ),
|
||||
m_name(),
|
||||
m_lock()
|
||||
{
|
||||
engine::getMixer()->clearAudioBuffer( m_buffer,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::mixer()->clearAudioBuffer( m_buffer,
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ void FxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch )
|
||||
{
|
||||
m_fxChannels[_ch]->m_lock.lock();
|
||||
sampleFrame * buf = m_fxChannels[_ch]->m_buffer;
|
||||
for( f_cnt_t f = 0; f < engine::getMixer()->framesPerPeriod();
|
||||
for( f_cnt_t f = 0; f < engine::mixer()->framesPerPeriod();
|
||||
++f )
|
||||
{
|
||||
buf[f][0] += _buf[f][0];
|
||||
@@ -118,14 +118,14 @@ void FxMixer::processChannel( fx_ch_t _ch, sampleFrame * _buf )
|
||||
{
|
||||
_buf = m_fxChannels[_ch]->m_buffer;
|
||||
}
|
||||
const fpp_t f = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t f = engine::mixer()->framesPerPeriod();
|
||||
if( !engine::getSong()->isFreezingPattern() )
|
||||
{
|
||||
m_fxChannels[_ch]->m_fxChain.startRunning();
|
||||
m_fxChannels[_ch]->m_stillRunning = m_fxChannels[_ch]->m_fxChain.processAudioBuffer( _buf, f );
|
||||
m_fxChannels[_ch]->m_peakLeft = engine::getMixer()->peakValueLeft( _buf, f ) *
|
||||
m_fxChannels[_ch]->m_peakLeft = engine::mixer()->peakValueLeft( _buf, f ) *
|
||||
m_fxChannels[_ch]->m_volumeModel.value();
|
||||
m_fxChannels[_ch]->m_peakRight = engine::getMixer()->peakValueRight( _buf, f ) *
|
||||
m_fxChannels[_ch]->m_peakRight = engine::mixer()->peakValueRight( _buf, f ) *
|
||||
m_fxChannels[_ch]->m_volumeModel.value();
|
||||
}
|
||||
m_fxChannels[_ch]->m_used = true;
|
||||
@@ -142,8 +142,8 @@ void FxMixer::processChannel( fx_ch_t _ch, sampleFrame * _buf )
|
||||
|
||||
void FxMixer::prepareMasterMix()
|
||||
{
|
||||
engine::getMixer()->clearAudioBuffer( m_fxChannels[0]->m_buffer,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::mixer()->clearAudioBuffer( m_fxChannels[0]->m_buffer,
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ void FxMixer::prepareMasterMix()
|
||||
|
||||
void FxMixer::masterMix( sampleFrame * _buf )
|
||||
{
|
||||
const int fpp = engine::getMixer()->framesPerPeriod();
|
||||
const int fpp = engine::mixer()->framesPerPeriod();
|
||||
memcpy( _buf, m_fxChannels[0]->m_buffer, sizeof( sampleFrame ) * fpp );
|
||||
|
||||
for( int i = 1; i < NumFxChannels+1; ++i )
|
||||
@@ -165,8 +165,8 @@ void FxMixer::masterMix( sampleFrame * _buf )
|
||||
_buf[f][0] += ch_buf[f][0] * v;
|
||||
_buf[f][1] += ch_buf[f][1] * v;
|
||||
}
|
||||
engine::getMixer()->clearAudioBuffer( ch_buf,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::mixer()->clearAudioBuffer( ch_buf,
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
m_fxChannels[i]->m_used = false;
|
||||
}
|
||||
}
|
||||
@@ -175,20 +175,20 @@ void FxMixer::masterMix( sampleFrame * _buf )
|
||||
|
||||
if( m_fxChannels[0]->m_muteModel.value() )
|
||||
{
|
||||
engine::getMixer()->clearAudioBuffer( _buf,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::mixer()->clearAudioBuffer( _buf,
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
return;
|
||||
}
|
||||
|
||||
const float v = m_fxChannels[0]->m_volumeModel.value();
|
||||
for( f_cnt_t f = 0; f < engine::getMixer()->framesPerPeriod(); ++f )
|
||||
for( f_cnt_t f = 0; f < engine::mixer()->framesPerPeriod(); ++f )
|
||||
{
|
||||
_buf[f][0] *= v;
|
||||
_buf[f][1] *= v;
|
||||
}
|
||||
|
||||
m_fxChannels[0]->m_peakLeft *= engine::getMixer()->masterGain();
|
||||
m_fxChannels[0]->m_peakRight *= engine::getMixer()->masterGain();
|
||||
m_fxChannels[0]->m_peakLeft *= engine::mixer()->masterGain();
|
||||
m_fxChannels[0]->m_peakRight *= engine::mixer()->masterGain();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ bool Instrument::isMuted() const
|
||||
void Instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n )
|
||||
{
|
||||
const fpp_t frames = _n->framesLeftForCurrentPeriod();
|
||||
const fpp_t fpp = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t fpp = engine::mixer()->framesPerPeriod();
|
||||
const f_cnt_t fl = _n->framesLeft();
|
||||
if( fl <= desiredReleaseFrames()+fpp )
|
||||
{
|
||||
|
||||
@@ -380,7 +380,7 @@ void Arpeggiator::processNote( notePlayHandle * _n )
|
||||
|
||||
// number of frames that every note should be played
|
||||
const f_cnt_t arp_frames = (f_cnt_t)( m_arpTimeModel.value() / 1000.0f *
|
||||
engine::getMixer()->processingSampleRate() );
|
||||
engine::mixer()->processingSampleRate() );
|
||||
const f_cnt_t gated_frames = (f_cnt_t)( m_arpGateModel.value() *
|
||||
arp_frames / 100.0f );
|
||||
|
||||
@@ -393,13 +393,13 @@ void Arpeggiator::processNote( notePlayHandle * _n )
|
||||
// used for loop
|
||||
f_cnt_t frames_processed = 0;
|
||||
|
||||
while( frames_processed < engine::getMixer()->framesPerPeriod() )
|
||||
while( frames_processed < engine::mixer()->framesPerPeriod() )
|
||||
{
|
||||
const f_cnt_t remaining_frames_for_cur_arp = arp_frames -
|
||||
( cur_frame % arp_frames );
|
||||
// does current arp-note fill whole audio-buffer?
|
||||
if( remaining_frames_for_cur_arp >
|
||||
engine::getMixer()->framesPerPeriod() )
|
||||
engine::mixer()->framesPerPeriod() )
|
||||
{
|
||||
// then we don't have to do something!
|
||||
break;
|
||||
@@ -465,7 +465,7 @@ void Arpeggiator::processNote( notePlayHandle * _n )
|
||||
// range-checking
|
||||
if( sub_note_key >= NumKeys ||
|
||||
sub_note_key < 0 ||
|
||||
engine::getMixer()->criticalXRuns() )
|
||||
engine::mixer()->criticalXRuns() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ float InstrumentSoundShaping::volumeLevel( notePlayHandle * _n,
|
||||
|
||||
if( _n->released() == false )
|
||||
{
|
||||
release_begin += engine::getMixer()->framesPerPeriod();
|
||||
release_begin += engine::mixer()->framesPerPeriod();
|
||||
}
|
||||
|
||||
float volume_level;
|
||||
@@ -137,7 +137,7 @@ void InstrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
|
||||
if( _n->released() == false )
|
||||
{
|
||||
release_begin += engine::getMixer()->framesPerPeriod();
|
||||
release_begin += engine::mixer()->framesPerPeriod();
|
||||
}
|
||||
|
||||
// because of optimizations, there's special code for several cases:
|
||||
@@ -156,7 +156,7 @@ void InstrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
if( _n->m_filter == NULL )
|
||||
{
|
||||
_n->m_filter = new basicFilters<>(
|
||||
engine::getMixer()->processingSampleRate() );
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
_n->m_filter->setFilterType( m_filterModel.value() );
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "song.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "LfoController.h"
|
||||
#include "ControllerDialog.h"
|
||||
|
||||
@@ -89,7 +89,7 @@ float LfoController::value( int _offset )
|
||||
// The new duration in frames
|
||||
// (Samples/Second) / (periods/second) = (Samples/cycle)
|
||||
float newDurationF =
|
||||
engine::getMixer()->processingSampleRate() *
|
||||
engine::mixer()->processingSampleRate() *
|
||||
m_speedModel.value();
|
||||
|
||||
switch(m_multiplierModel.value() )
|
||||
@@ -146,7 +146,7 @@ float LfoController::value( int _offset )
|
||||
|
||||
// frames / (20seconds of frames)
|
||||
float sampleFrame = float( frame+m_phaseOffset ) /
|
||||
(engine::getMixer()->processingSampleRate() * m_speedModel.value() );
|
||||
(engine::mixer()->processingSampleRate() * m_speedModel.value() );
|
||||
|
||||
switch(m_multiplierModel.value() )
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* mixer.cpp - audio-device-independent mixer for LMMS
|
||||
* Mixer.cpp - audio-device-independent mixer for LMMS
|
||||
*
|
||||
* Copyright (c) 2004-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "FxMixer.h"
|
||||
#include "MixHelpers.h"
|
||||
#include "play_handle.h"
|
||||
@@ -143,14 +143,14 @@ public:
|
||||
|
||||
static JobQueue s_jobQueue;
|
||||
|
||||
MixerWorkerThread( int _worker_num, mixer * _mixer ) :
|
||||
QThread( _mixer ),
|
||||
MixerWorkerThread( int _worker_num, Mixer* mixer ) :
|
||||
QThread( mixer ),
|
||||
m_workingBuf( (sampleFrame *) aligned_malloc(
|
||||
_mixer->framesPerPeriod() *
|
||||
mixer->framesPerPeriod() *
|
||||
sizeof( sampleFrame ) ) ),
|
||||
m_workerNum( _worker_num ),
|
||||
m_quit( false ),
|
||||
m_mixer( _mixer ),
|
||||
m_mixer( mixer ),
|
||||
m_queueReadyWaitCond( &m_mixer->m_queueReadyWaitCond )
|
||||
{
|
||||
}
|
||||
@@ -194,7 +194,7 @@ private:
|
||||
sampleFrame * m_workingBuf;
|
||||
int m_workerNum;
|
||||
volatile bool m_quit;
|
||||
mixer * m_mixer;
|
||||
Mixer* m_mixer;
|
||||
QWaitCondition * m_queueReadyWaitCond;
|
||||
|
||||
} ;
|
||||
@@ -296,7 +296,7 @@ void MixerWorkerThread::processJobQueue()
|
||||
|
||||
|
||||
|
||||
mixer::mixer() :
|
||||
Mixer::Mixer() :
|
||||
m_framesPerPeriod( DEFAULT_BUFFER_SIZE ),
|
||||
m_workingBuf( NULL ),
|
||||
m_inputBufferRead( 0 ),
|
||||
@@ -388,7 +388,7 @@ mixer::mixer() :
|
||||
|
||||
|
||||
|
||||
mixer::~mixer()
|
||||
Mixer::~Mixer()
|
||||
{
|
||||
// distribute an empty job-queue so that worker-threads
|
||||
// get out of their processing-loop
|
||||
@@ -428,7 +428,7 @@ mixer::~mixer()
|
||||
|
||||
|
||||
|
||||
void mixer::initDevices()
|
||||
void Mixer::initDevices()
|
||||
{
|
||||
m_audioDev = tryAudioDevices();
|
||||
m_midiClient = tryMidiClients();
|
||||
@@ -437,7 +437,7 @@ void mixer::initDevices()
|
||||
|
||||
|
||||
|
||||
void mixer::startProcessing( bool _needs_fifo )
|
||||
void Mixer::startProcessing( bool _needs_fifo )
|
||||
{
|
||||
if( _needs_fifo )
|
||||
{
|
||||
@@ -455,7 +455,7 @@ void mixer::startProcessing( bool _needs_fifo )
|
||||
|
||||
|
||||
|
||||
void mixer::stopProcessing()
|
||||
void Mixer::stopProcessing()
|
||||
{
|
||||
if( m_fifoWriter != NULL )
|
||||
{
|
||||
@@ -475,7 +475,7 @@ void mixer::stopProcessing()
|
||||
|
||||
|
||||
|
||||
sample_rate_t mixer::baseSampleRate() const
|
||||
sample_rate_t Mixer::baseSampleRate() const
|
||||
{
|
||||
sample_rate_t sr =
|
||||
configManager::inst()->value( "mixer", "samplerate" ).toInt();
|
||||
@@ -489,7 +489,7 @@ sample_rate_t mixer::baseSampleRate() const
|
||||
|
||||
|
||||
|
||||
sample_rate_t mixer::outputSampleRate() const
|
||||
sample_rate_t Mixer::outputSampleRate() const
|
||||
{
|
||||
return m_audioDev != NULL ? m_audioDev->sampleRate() :
|
||||
baseSampleRate();
|
||||
@@ -498,7 +498,7 @@ sample_rate_t mixer::outputSampleRate() const
|
||||
|
||||
|
||||
|
||||
sample_rate_t mixer::inputSampleRate() const
|
||||
sample_rate_t Mixer::inputSampleRate() const
|
||||
{
|
||||
return m_audioDev != NULL ? m_audioDev->sampleRate() :
|
||||
baseSampleRate();
|
||||
@@ -507,7 +507,7 @@ sample_rate_t mixer::inputSampleRate() const
|
||||
|
||||
|
||||
|
||||
sample_rate_t mixer::processingSampleRate() const
|
||||
sample_rate_t Mixer::processingSampleRate() const
|
||||
{
|
||||
return outputSampleRate() * m_qualitySettings.sampleRateMultiplier();
|
||||
}
|
||||
@@ -515,7 +515,7 @@ sample_rate_t mixer::processingSampleRate() const
|
||||
|
||||
|
||||
|
||||
bool mixer::criticalXRuns() const
|
||||
bool Mixer::criticalXRuns() const
|
||||
{
|
||||
return m_cpuLoad >= 99 && engine::getSong()->realTimeTask() == true;
|
||||
}
|
||||
@@ -523,7 +523,7 @@ bool mixer::criticalXRuns() const
|
||||
|
||||
|
||||
|
||||
void mixer::pushInputFrames( sampleFrame * _ab, const f_cnt_t _frames )
|
||||
void Mixer::pushInputFrames( sampleFrame * _ab, const f_cnt_t _frames )
|
||||
{
|
||||
lockInputFrames();
|
||||
|
||||
@@ -553,7 +553,7 @@ void mixer::pushInputFrames( sampleFrame * _ab, const f_cnt_t _frames )
|
||||
|
||||
|
||||
|
||||
const surroundSampleFrame * mixer::renderNextBuffer()
|
||||
const surroundSampleFrame * Mixer::renderNextBuffer()
|
||||
{
|
||||
MicroTimer timer;
|
||||
static song::playPos last_metro_pos = -1;
|
||||
@@ -685,7 +685,7 @@ const surroundSampleFrame * mixer::renderNextBuffer()
|
||||
|
||||
// removes all play-handles. this is necessary, when the song is stopped ->
|
||||
// all remaining notes etc. would be played until their end
|
||||
void mixer::clear()
|
||||
void Mixer::clear()
|
||||
{
|
||||
// TODO: m_midiClient->noteOffAll();
|
||||
lock();
|
||||
@@ -705,7 +705,7 @@ void mixer::clear()
|
||||
|
||||
|
||||
|
||||
void mixer::bufferToPort( const sampleFrame * _buf,
|
||||
void Mixer::bufferToPort( const sampleFrame * _buf,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _offset,
|
||||
stereoVolumeVector _vv,
|
||||
@@ -748,7 +748,7 @@ void mixer::bufferToPort( const sampleFrame * _buf,
|
||||
|
||||
|
||||
|
||||
void mixer::clearAudioBuffer( sampleFrame * _ab, const f_cnt_t _frames,
|
||||
void Mixer::clearAudioBuffer( sampleFrame * _ab, const f_cnt_t _frames,
|
||||
const f_cnt_t _offset )
|
||||
{
|
||||
memset( _ab+_offset, 0, sizeof( *_ab ) * _frames );
|
||||
@@ -757,7 +757,7 @@ void mixer::clearAudioBuffer( sampleFrame * _ab, const f_cnt_t _frames,
|
||||
|
||||
|
||||
#ifndef LMMS_DISABLE_SURROUND
|
||||
void mixer::clearAudioBuffer( surroundSampleFrame * _ab, const f_cnt_t _frames,
|
||||
void Mixer::clearAudioBuffer( surroundSampleFrame * _ab, const f_cnt_t _frames,
|
||||
const f_cnt_t _offset )
|
||||
{
|
||||
memset( _ab+_offset, 0, sizeof( *_ab ) * _frames );
|
||||
@@ -767,7 +767,7 @@ void mixer::clearAudioBuffer( surroundSampleFrame * _ab, const f_cnt_t _frames,
|
||||
|
||||
|
||||
|
||||
float mixer::peakValueLeft( sampleFrame * _ab, const f_cnt_t _frames )
|
||||
float Mixer::peakValueLeft( sampleFrame * _ab, const f_cnt_t _frames )
|
||||
{
|
||||
float p = 0.0f;
|
||||
for( f_cnt_t f = 0; f < _frames; ++f )
|
||||
@@ -787,7 +787,7 @@ float mixer::peakValueLeft( sampleFrame * _ab, const f_cnt_t _frames )
|
||||
|
||||
|
||||
|
||||
float mixer::peakValueRight( sampleFrame * _ab, const f_cnt_t _frames )
|
||||
float Mixer::peakValueRight( sampleFrame * _ab, const f_cnt_t _frames )
|
||||
{
|
||||
float p = 0.0f;
|
||||
for( f_cnt_t f = 0; f < _frames; ++f )
|
||||
@@ -807,7 +807,7 @@ float mixer::peakValueRight( sampleFrame * _ab, const f_cnt_t _frames )
|
||||
|
||||
|
||||
|
||||
void mixer::changeQuality( const struct qualitySettings & _qs )
|
||||
void Mixer::changeQuality( const struct qualitySettings & _qs )
|
||||
{
|
||||
// don't delete the audio-device
|
||||
stopProcessing();
|
||||
@@ -824,7 +824,7 @@ void mixer::changeQuality( const struct qualitySettings & _qs )
|
||||
|
||||
|
||||
|
||||
void mixer::setAudioDevice( AudioDevice * _dev )
|
||||
void Mixer::setAudioDevice( AudioDevice * _dev )
|
||||
{
|
||||
stopProcessing();
|
||||
|
||||
@@ -832,7 +832,7 @@ void mixer::setAudioDevice( AudioDevice * _dev )
|
||||
|
||||
if( _dev == NULL )
|
||||
{
|
||||
printf( "param _dev == NULL in mixer::setAudioDevice(...). "
|
||||
printf( "param _dev == NULL in Mixer::setAudioDevice(...). "
|
||||
"Trying any working audio-device\n" );
|
||||
m_audioDev = tryAudioDevices();
|
||||
}
|
||||
@@ -849,7 +849,7 @@ void mixer::setAudioDevice( AudioDevice * _dev )
|
||||
|
||||
|
||||
|
||||
void mixer::setAudioDevice( AudioDevice * _dev,
|
||||
void Mixer::setAudioDevice( AudioDevice * _dev,
|
||||
const struct qualitySettings & _qs,
|
||||
bool _needs_fifo )
|
||||
{
|
||||
@@ -861,7 +861,7 @@ void mixer::setAudioDevice( AudioDevice * _dev,
|
||||
|
||||
if( _dev == NULL )
|
||||
{
|
||||
printf( "param _dev == NULL in mixer::setAudioDevice(...). "
|
||||
printf( "param _dev == NULL in Mixer::setAudioDevice(...). "
|
||||
"Trying any working audio-device\n" );
|
||||
m_audioDev = tryAudioDevices();
|
||||
}
|
||||
@@ -879,7 +879,7 @@ void mixer::setAudioDevice( AudioDevice * _dev,
|
||||
|
||||
|
||||
|
||||
void mixer::restoreAudioDevice()
|
||||
void Mixer::restoreAudioDevice()
|
||||
{
|
||||
if( m_oldAudioDev != NULL )
|
||||
{
|
||||
@@ -897,7 +897,7 @@ void mixer::restoreAudioDevice()
|
||||
|
||||
|
||||
|
||||
void mixer::removeAudioPort( AudioPort * _port )
|
||||
void Mixer::removeAudioPort( AudioPort * _port )
|
||||
{
|
||||
QVector<AudioPort *>::Iterator it = qFind( m_audioPorts.begin(),
|
||||
m_audioPorts.end(),
|
||||
@@ -913,7 +913,7 @@ void mixer::removeAudioPort( AudioPort * _port )
|
||||
|
||||
|
||||
|
||||
void mixer::removePlayHandle( playHandle * _ph )
|
||||
void Mixer::removePlayHandle( playHandle * _ph )
|
||||
{
|
||||
lock();
|
||||
// check thread affinity as we must not delete play-handles
|
||||
@@ -940,7 +940,7 @@ void mixer::removePlayHandle( playHandle * _ph )
|
||||
|
||||
|
||||
|
||||
void mixer::removePlayHandles( track * _track )
|
||||
void Mixer::removePlayHandles( track * _track )
|
||||
{
|
||||
lock();
|
||||
PlayHandleList::Iterator it = m_playHandles.begin();
|
||||
@@ -962,7 +962,7 @@ void mixer::removePlayHandles( track * _track )
|
||||
|
||||
|
||||
|
||||
bool mixer::hasNotePlayHandles()
|
||||
bool Mixer::hasNotePlayHandles()
|
||||
{
|
||||
lock();
|
||||
|
||||
@@ -983,7 +983,7 @@ bool mixer::hasNotePlayHandles()
|
||||
|
||||
|
||||
|
||||
AudioDevice * mixer::tryAudioDevices()
|
||||
AudioDevice * Mixer::tryAudioDevices()
|
||||
{
|
||||
bool success_ful = false;
|
||||
AudioDevice * dev = NULL;
|
||||
@@ -1097,7 +1097,7 @@ AudioDevice * mixer::tryAudioDevices()
|
||||
|
||||
|
||||
|
||||
MidiClient * mixer::tryMidiClients()
|
||||
MidiClient * Mixer::tryMidiClients()
|
||||
{
|
||||
QString client_name = configManager::inst()->value( "mixer",
|
||||
"mididev" );
|
||||
@@ -1168,8 +1168,8 @@ MidiClient * mixer::tryMidiClients()
|
||||
|
||||
|
||||
|
||||
mixer::fifoWriter::fifoWriter( mixer * _mixer, fifo * _fifo ) :
|
||||
m_mixer( _mixer ),
|
||||
Mixer::fifoWriter::fifoWriter( Mixer* mixer, fifo * _fifo ) :
|
||||
m_mixer( mixer ),
|
||||
m_fifo( _fifo ),
|
||||
m_writing( true )
|
||||
{
|
||||
@@ -1178,7 +1178,7 @@ mixer::fifoWriter::fifoWriter( mixer * _mixer, fifo * _fifo ) :
|
||||
|
||||
|
||||
|
||||
void mixer::fifoWriter::finish()
|
||||
void Mixer::fifoWriter::finish()
|
||||
{
|
||||
m_writing = false;
|
||||
}
|
||||
@@ -1186,7 +1186,7 @@ void mixer::fifoWriter::finish()
|
||||
|
||||
|
||||
|
||||
void mixer::fifoWriter::run()
|
||||
void Mixer::fifoWriter::run()
|
||||
{
|
||||
#if 0
|
||||
#ifdef LMMS_BUILD_LINUX
|
||||
@@ -1214,5 +1214,5 @@ void mixer::fifoWriter::run()
|
||||
|
||||
|
||||
|
||||
#include "moc_mixer.cxx"
|
||||
#include "moc_Mixer.cxx"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "Oscillator.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "AutomatableModel.h"
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ Oscillator::Oscillator( const IntModel * _wave_shape_model,
|
||||
void Oscillator::update( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
if( m_freq >= engine::getMixer()->processingSampleRate() / 2 )
|
||||
if( m_freq >= engine::mixer()->processingSampleRate() / 2 )
|
||||
{
|
||||
mixer::clearAudioBuffer( _ab, _frames );
|
||||
Mixer::clearAudioBuffer( _ab, _frames );
|
||||
return;
|
||||
}
|
||||
if( m_subOsc != NULL )
|
||||
@@ -456,7 +456,7 @@ void Oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
|
||||
recalcPhase();
|
||||
const float osc_coeff = m_freq * m_detuning;
|
||||
const float sampleRateCorrection = 44100.0f /
|
||||
engine::getMixer()->processingSampleRate();
|
||||
engine::mixer()->processingSampleRate();
|
||||
|
||||
for( fpp_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "song.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "PeakController.h"
|
||||
#include "ControllerDialog.h"
|
||||
#include "plugins/peak_controller_effect/peak_controller_effect.h"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "Plugin.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "config_mgr.h"
|
||||
#include "DummyPlugin.h"
|
||||
#include "AutomatableModel.h"
|
||||
|
||||
@@ -62,14 +62,14 @@ FileEncodeDevice __fileEncodeDevices[] =
|
||||
|
||||
|
||||
|
||||
ProjectRenderer::ProjectRenderer( const mixer::qualitySettings & _qs,
|
||||
ProjectRenderer::ProjectRenderer( const Mixer::qualitySettings & _qs,
|
||||
const OutputSettings & _os,
|
||||
ExportFileFormats _file_format,
|
||||
const QString & _out_file ) :
|
||||
QThread( engine::getMixer() ),
|
||||
QThread( engine::mixer() ),
|
||||
m_fileDev( NULL ),
|
||||
m_qualitySettings( _qs ),
|
||||
m_oldQualitySettings( engine::getMixer()->currentQualitySettings() ),
|
||||
m_oldQualitySettings( engine::mixer()->currentQualitySettings() ),
|
||||
m_progress( 0 ),
|
||||
m_abort( false )
|
||||
{
|
||||
@@ -84,7 +84,7 @@ ProjectRenderer::ProjectRenderer( const mixer::qualitySettings & _qs,
|
||||
_out_file, _os.vbr,
|
||||
_os.bitrate, _os.bitrate - 64, _os.bitrate + 64,
|
||||
_os.depth == Depth_32Bit ? 32 : 16,
|
||||
engine::getMixer() );
|
||||
engine::mixer() );
|
||||
if( success_ful == false )
|
||||
{
|
||||
delete m_fileDev;
|
||||
@@ -132,7 +132,7 @@ void ProjectRenderer::startProcessing()
|
||||
// have to do mixer stuff with GUI-thread-affinity in order to
|
||||
// make slots connected to sampleRateChanged()-signals being
|
||||
// called immediately
|
||||
engine::getMixer()->setAudioDevice( m_fileDev,
|
||||
engine::mixer()->setAudioDevice( m_fileDev,
|
||||
m_qualitySettings, false );
|
||||
|
||||
start(
|
||||
@@ -183,8 +183,8 @@ void ProjectRenderer::run()
|
||||
|
||||
const QString f = m_fileDev->outputFile();
|
||||
|
||||
engine::getMixer()->restoreAudioDevice(); // also deletes audio-dev
|
||||
engine::getMixer()->changeQuality( m_oldQualitySettings );
|
||||
engine::mixer()->restoreAudioDevice(); // also deletes audio-dev
|
||||
engine::mixer()->changeQuality( m_oldQualitySettings );
|
||||
|
||||
// if the user aborted export-process, the file has to be deleted
|
||||
if( m_abort )
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include "RemotePlugin.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "engine.h"
|
||||
#include "config_mgr.h"
|
||||
|
||||
@@ -162,13 +162,13 @@ bool RemotePlugin::init( const QString &pluginExecutable,
|
||||
bool RemotePlugin::process( const sampleFrame * _in_buf,
|
||||
sampleFrame * _out_buf )
|
||||
{
|
||||
const fpp_t frames = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t frames = engine::mixer()->framesPerPeriod();
|
||||
|
||||
if( m_failed || !isRunning() )
|
||||
{
|
||||
if( _out_buf != NULL )
|
||||
{
|
||||
engine::getMixer()->clearAudioBuffer( _out_buf,
|
||||
engine::mixer()->clearAudioBuffer( _out_buf,
|
||||
frames );
|
||||
}
|
||||
return false;
|
||||
@@ -188,7 +188,7 @@ bool RemotePlugin::process( const sampleFrame * _in_buf,
|
||||
}
|
||||
if( _out_buf != NULL )
|
||||
{
|
||||
engine::getMixer()->clearAudioBuffer( _out_buf,
|
||||
engine::mixer()->clearAudioBuffer( _out_buf,
|
||||
frames );
|
||||
}
|
||||
return false;
|
||||
@@ -263,7 +263,7 @@ bool RemotePlugin::process( const sampleFrame * _in_buf,
|
||||
sampleFrame * o = (sampleFrame *) ( m_shm +
|
||||
m_inputCount*frames );
|
||||
// clear buffer, if plugin didn't fill up both channels
|
||||
engine::getMixer()->clearAudioBuffer( _out_buf, frames );
|
||||
engine::mixer()->clearAudioBuffer( _out_buf, frames );
|
||||
|
||||
for( ch_cnt_t ch = 0; ch <
|
||||
qMin<int>( DEFAULT_CHANNELS, outputs ); ++ch )
|
||||
@@ -301,7 +301,7 @@ void RemotePlugin::processMidiEvent( const midiEvent & _e,
|
||||
void RemotePlugin::resizeSharedProcessingMemory()
|
||||
{
|
||||
const size_t s = ( m_inputCount+m_outputCount ) *
|
||||
engine::getMixer()->framesPerPeriod() *
|
||||
engine::mixer()->framesPerPeriod() *
|
||||
sizeof( float );
|
||||
if( m_shm != NULL )
|
||||
{
|
||||
@@ -354,12 +354,12 @@ bool RemotePlugin::processMessage( const message & _m )
|
||||
|
||||
case IdSampleRateInformation:
|
||||
reply = true;
|
||||
reply_message.addInt( engine::getMixer()->processingSampleRate() );
|
||||
reply_message.addInt( engine::mixer()->processingSampleRate() );
|
||||
break;
|
||||
|
||||
case IdBufferSizeInformation:
|
||||
reply = true;
|
||||
reply_message.addInt( engine::getMixer()->framesPerPeriod() );
|
||||
reply_message.addInt( engine::mixer()->framesPerPeriod() );
|
||||
break;
|
||||
|
||||
case IdChangeInputCount:
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
|
||||
|
||||
AudioAlsa::AudioAlsa( bool & _success_ful, mixer * _mixer ) :
|
||||
AudioAlsa::AudioAlsa( bool & _success_ful, Mixer* _mixer ) :
|
||||
AudioDevice( tLimit<ch_cnt_t>(
|
||||
configManager::inst()->value( "audioalsa", "channels" ).toInt(),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ),
|
||||
@@ -199,7 +199,7 @@ void AudioAlsa::applyQualitySettings()
|
||||
{
|
||||
if( hqAudio() )
|
||||
{
|
||||
setSampleRate( engine::getMixer()->processingSampleRate() );
|
||||
setSampleRate( engine::mixer()->processingSampleRate() );
|
||||
|
||||
if( m_handle != NULL )
|
||||
{
|
||||
@@ -241,13 +241,13 @@ void AudioAlsa::applyQualitySettings()
|
||||
void AudioAlsa::run()
|
||||
{
|
||||
surroundSampleFrame * temp =
|
||||
new surroundSampleFrame[getMixer()->framesPerPeriod()];
|
||||
new surroundSampleFrame[mixer()->framesPerPeriod()];
|
||||
int_sample_t * outbuf =
|
||||
new int_sample_t[getMixer()->framesPerPeriod() *
|
||||
new int_sample_t[mixer()->framesPerPeriod() *
|
||||
channels()];
|
||||
int_sample_t * pcmbuf = new int_sample_t[m_periodSize * channels()];
|
||||
|
||||
int outbuf_size = getMixer()->framesPerPeriod() * channels();
|
||||
int outbuf_size = mixer()->framesPerPeriod() * channels();
|
||||
int outbuf_pos = 0;
|
||||
int pcmbuf_size = m_periodSize * channels();
|
||||
|
||||
@@ -272,7 +272,7 @@ void AudioAlsa::run()
|
||||
outbuf_size = frames * channels();
|
||||
|
||||
convertToS16( temp, frames,
|
||||
getMixer()->masterGain(),
|
||||
mixer()->masterGain(),
|
||||
outbuf,
|
||||
m_convertEndian );
|
||||
}
|
||||
@@ -373,7 +373,7 @@ int AudioAlsa::setHWParams( const ch_cnt_t _channels, snd_pcm_access_t _access )
|
||||
sampleRate(), 0 ) ) < 0 )
|
||||
{
|
||||
if( ( err = snd_pcm_hw_params_set_rate( m_handle, m_hwParams,
|
||||
getMixer()->baseSampleRate(), 0 ) ) < 0 )
|
||||
mixer()->baseSampleRate(), 0 ) ) < 0 )
|
||||
{
|
||||
printf( "Could not set sample rate: %s\n",
|
||||
snd_strerror( err ) );
|
||||
@@ -381,7 +381,7 @@ int AudioAlsa::setHWParams( const ch_cnt_t _channels, snd_pcm_access_t _access )
|
||||
}
|
||||
}
|
||||
|
||||
m_periodSize = getMixer()->framesPerPeriod();
|
||||
m_periodSize = mixer()->framesPerPeriod();
|
||||
m_bufferSize = m_periodSize * 8;
|
||||
dir = 0;
|
||||
err = snd_pcm_hw_params_set_period_size_near( m_handle, m_hwParams,
|
||||
|
||||
@@ -30,16 +30,16 @@
|
||||
|
||||
|
||||
|
||||
AudioDevice::AudioDevice( const ch_cnt_t _channels, mixer * _mixer ) :
|
||||
AudioDevice::AudioDevice( const ch_cnt_t _channels, Mixer* _mixer ) :
|
||||
m_supportsCapture( false ),
|
||||
m_sampleRate( _mixer->processingSampleRate() ),
|
||||
m_channels( _channels ),
|
||||
m_mixer( _mixer ),
|
||||
m_buffer( new surroundSampleFrame[getMixer()->framesPerPeriod()] )
|
||||
m_buffer( new surroundSampleFrame[mixer()->framesPerPeriod()] )
|
||||
{
|
||||
int error;
|
||||
if( ( m_srcState = src_new(
|
||||
getMixer()->currentQualitySettings().libsrcInterpolation(),
|
||||
mixer()->currentQualitySettings().libsrcInterpolation(),
|
||||
SURROUND_CHANNELS, &error ) ) == NULL )
|
||||
{
|
||||
printf( "Error: src_new() failed in audio_device.cpp!\n" );
|
||||
@@ -66,7 +66,7 @@ void AudioDevice::processNextBuffer()
|
||||
const fpp_t frames = getNextBuffer( m_buffer );
|
||||
if( frames )
|
||||
{
|
||||
writeBuffer( m_buffer, frames, getMixer()->masterGain() );
|
||||
writeBuffer( m_buffer, frames, mixer()->masterGain() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -79,8 +79,8 @@ void AudioDevice::processNextBuffer()
|
||||
|
||||
fpp_t AudioDevice::getNextBuffer( surroundSampleFrame * _ab )
|
||||
{
|
||||
fpp_t frames = getMixer()->framesPerPeriod();
|
||||
const surroundSampleFrame * b = getMixer()->nextBuffer();
|
||||
fpp_t frames = mixer()->framesPerPeriod();
|
||||
const surroundSampleFrame * b = mixer()->nextBuffer();
|
||||
if( !b )
|
||||
{
|
||||
return 0;
|
||||
@@ -90,12 +90,12 @@ fpp_t AudioDevice::getNextBuffer( surroundSampleFrame * _ab )
|
||||
lock();
|
||||
|
||||
// resample if necessary
|
||||
if( getMixer()->processingSampleRate() != m_sampleRate )
|
||||
if( mixer()->processingSampleRate() != m_sampleRate )
|
||||
{
|
||||
resample( b, frames, _ab, getMixer()->processingSampleRate(),
|
||||
resample( b, frames, _ab, mixer()->processingSampleRate(),
|
||||
m_sampleRate );
|
||||
frames = frames * m_sampleRate /
|
||||
getMixer()->processingSampleRate();
|
||||
mixer()->processingSampleRate();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -105,7 +105,7 @@ fpp_t AudioDevice::getNextBuffer( surroundSampleFrame * _ab )
|
||||
// release lock
|
||||
unlock();
|
||||
|
||||
if( getMixer()->hasFifoWriter() )
|
||||
if( mixer()->hasFifoWriter() )
|
||||
{
|
||||
delete[] b;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ fpp_t AudioDevice::getNextBuffer( surroundSampleFrame * _ab )
|
||||
|
||||
void AudioDevice::stopProcessing()
|
||||
{
|
||||
if( getMixer()->hasFifoWriter() )
|
||||
if( mixer()->hasFifoWriter() )
|
||||
{
|
||||
while( m_inProcess )
|
||||
{
|
||||
@@ -136,7 +136,7 @@ void AudioDevice::applyQualitySettings()
|
||||
|
||||
int error;
|
||||
if( ( m_srcState = src_new(
|
||||
getMixer()->currentQualitySettings().libsrcInterpolation(),
|
||||
mixer()->currentQualitySettings().libsrcInterpolation(),
|
||||
SURROUND_CHANNELS, &error ) ) == NULL )
|
||||
{
|
||||
printf( "Error: src_new() failed in audio_device.cpp!\n" );
|
||||
@@ -207,7 +207,7 @@ Uint32 AudioDevice::convertToS16( const surroundSampleFrame * _ab,
|
||||
for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl )
|
||||
{
|
||||
temp = static_cast<int_sample_t>(
|
||||
mixer::clip( _ab[frame][chnl] *
|
||||
Mixer::clip( _ab[frame][chnl] *
|
||||
_master_gain ) *
|
||||
OUTPUT_SAMPLE_MULTIPLIER );
|
||||
|
||||
@@ -225,7 +225,7 @@ Uint32 AudioDevice::convertToS16( const surroundSampleFrame * _ab,
|
||||
{
|
||||
( _output_buffer + frame * channels() )[chnl] =
|
||||
static_cast<int_sample_t>(
|
||||
mixer::clip( _ab[frame][chnl] *
|
||||
Mixer::clip( _ab[frame][chnl] *
|
||||
_master_gain ) *
|
||||
OUTPUT_SAMPLE_MULTIPLIER );
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ AudioFileDevice::AudioFileDevice( const sample_rate_t _sample_rate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate,
|
||||
const int _depth,
|
||||
mixer * _mixer ) :
|
||||
Mixer* _mixer ) :
|
||||
AudioDevice( _channels, _mixer ),
|
||||
m_outputFile( _file ),
|
||||
m_useVbr( _use_vbr ),
|
||||
|
||||
@@ -44,7 +44,7 @@ AudioFileOgg::AudioFileOgg( const sample_rate_t _sample_rate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate,
|
||||
const int _depth,
|
||||
mixer * _mixer ) :
|
||||
Mixer* _mixer ) :
|
||||
AudioFileDevice( _sample_rate, _channels, _file, _use_vbr,
|
||||
_nom_bitrate, _min_bitrate, _max_bitrate,
|
||||
_depth, _mixer )
|
||||
|
||||
@@ -35,7 +35,7 @@ AudioFileWave::AudioFileWave( const sample_rate_t _sample_rate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate,
|
||||
const int _depth,
|
||||
mixer * _mixer ) :
|
||||
Mixer* _mixer ) :
|
||||
AudioFileDevice( _sample_rate, _channels, _file, _use_vbr,
|
||||
_nom_bitrate, _min_bitrate, _max_bitrate,
|
||||
_depth, _mixer ),
|
||||
@@ -59,7 +59,7 @@ bool AudioFileWave::startEncoding()
|
||||
{
|
||||
m_si.samplerate = sampleRate();
|
||||
m_si.channels = channels();
|
||||
m_si.frames = getMixer()->framesPerPeriod();
|
||||
m_si.frames = mixer()->framesPerPeriod();
|
||||
m_si.sections = 1;
|
||||
m_si.seekable = 0;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
|
||||
|
||||
AudioJack::AudioJack( bool & _success_ful, mixer * _mixer ) :
|
||||
AudioJack::AudioJack( bool & _success_ful, Mixer* _mixer ) :
|
||||
AudioDevice( tLimit<int>( configManager::inst()->value(
|
||||
"audiojack", "channels" ).toInt(),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ),
|
||||
@@ -53,7 +53,7 @@ AudioJack::AudioJack( bool & _success_ful, mixer * _mixer ) :
|
||||
m_active( false ),
|
||||
m_stopSemaphore( 1 ),
|
||||
m_tempOutBufs( new jack_default_audio_sample_t *[channels()] ),
|
||||
m_outBuf( new surroundSampleFrame[getMixer()->framesPerPeriod()] ),
|
||||
m_outBuf( new surroundSampleFrame[mixer()->framesPerPeriod()] ),
|
||||
m_framesDoneInCurBuf( 0 ),
|
||||
m_framesToDoInCurBuf( 0 )
|
||||
{
|
||||
@@ -214,7 +214,7 @@ void AudioJack::startProcessing()
|
||||
|
||||
|
||||
// try to sync JACK's and LMMS's buffer-size
|
||||
// jack_set_buffer_size( m_client, getMixer()->framesPerPeriod() );
|
||||
// jack_set_buffer_size( m_client, mixer()->framesPerPeriod() );
|
||||
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ void AudioJack::applyQualitySettings()
|
||||
{
|
||||
if( hqAudio() )
|
||||
{
|
||||
setSampleRate( engine::getMixer()->processingSampleRate() );
|
||||
setSampleRate( engine::mixer()->processingSampleRate() );
|
||||
|
||||
if( jack_get_sample_rate( m_client ) != sampleRate() )
|
||||
{
|
||||
@@ -345,7 +345,7 @@ int AudioJack::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
|
||||
#ifdef AUDIO_PORT_SUPPORT
|
||||
const Uint32 frames = qMin<Uint32>( _nframes,
|
||||
getMixer()->framesPerPeriod() );
|
||||
mixer()->framesPerPeriod() );
|
||||
for( jackPortMap::iterator it = m_portMap.begin();
|
||||
it != m_portMap.end(); ++it )
|
||||
{
|
||||
@@ -374,7 +374,7 @@ int AudioJack::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
_nframes,
|
||||
m_framesToDoInCurBuf -
|
||||
m_framesDoneInCurBuf );
|
||||
const float gain = getMixer()->masterGain();
|
||||
const float gain = mixer()->masterGain();
|
||||
for( int c = 0; c < channels(); ++c )
|
||||
{
|
||||
jack_default_audio_sample_t * o = m_tempOutBufs[c];
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
|
||||
|
||||
AudioOss::AudioOss( bool & _success_ful, mixer * _mixer ) :
|
||||
AudioOss::AudioOss( bool & _success_ful, Mixer* _mixer ) :
|
||||
AudioDevice( tLimit<ch_cnt_t>(
|
||||
configManager::inst()->value( "audiooss", "channels" ).toInt(),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ),
|
||||
@@ -103,7 +103,7 @@ AudioOss::AudioOss( bool & _success_ful, mixer * _mixer ) :
|
||||
|
||||
int frag_spec;
|
||||
for( frag_spec = 0; static_cast<int>( 0x01 << frag_spec ) <
|
||||
getMixer()->framesPerPeriod() * channels() *
|
||||
mixer()->framesPerPeriod() * channels() *
|
||||
BYTES_PER_INT_SAMPLE;
|
||||
++frag_spec )
|
||||
{
|
||||
@@ -175,7 +175,7 @@ AudioOss::AudioOss( bool & _success_ful, mixer * _mixer ) :
|
||||
}
|
||||
if( value != sampleRate() )
|
||||
{
|
||||
value = getMixer()->baseSampleRate();
|
||||
value = mixer()->baseSampleRate();
|
||||
if ( ioctl( m_audioFD, SNDCTL_DSP_SPEED, &value ) < 0 )
|
||||
{
|
||||
perror( "SNDCTL_DSP_SPEED" );
|
||||
@@ -268,7 +268,7 @@ void AudioOss::applyQualitySettings()
|
||||
{
|
||||
if( hqAudio() )
|
||||
{
|
||||
setSampleRate( engine::getMixer()->processingSampleRate() );
|
||||
setSampleRate( engine::mixer()->processingSampleRate() );
|
||||
|
||||
unsigned int value = sampleRate();
|
||||
if ( ioctl( m_audioFD, SNDCTL_DSP_SPEED, &value ) < 0 )
|
||||
@@ -279,7 +279,7 @@ void AudioOss::applyQualitySettings()
|
||||
}
|
||||
if( value != sampleRate() )
|
||||
{
|
||||
value = getMixer()->baseSampleRate();
|
||||
value = mixer()->baseSampleRate();
|
||||
if ( ioctl( m_audioFD, SNDCTL_DSP_SPEED, &value ) < 0 )
|
||||
{
|
||||
perror( "SNDCTL_DSP_SPEED" );
|
||||
@@ -299,9 +299,9 @@ void AudioOss::applyQualitySettings()
|
||||
void AudioOss::run()
|
||||
{
|
||||
surroundSampleFrame * temp =
|
||||
new surroundSampleFrame[getMixer()->framesPerPeriod()];
|
||||
new surroundSampleFrame[mixer()->framesPerPeriod()];
|
||||
int_sample_t * outbuf =
|
||||
new int_sample_t[getMixer()->framesPerPeriod() *
|
||||
new int_sample_t[mixer()->framesPerPeriod() *
|
||||
channels()];
|
||||
|
||||
while( true )
|
||||
@@ -313,7 +313,7 @@ void AudioOss::run()
|
||||
}
|
||||
|
||||
int bytes = convertToS16( temp, frames,
|
||||
getMixer()->masterGain(), outbuf,
|
||||
mixer()->masterGain(), outbuf,
|
||||
m_convertEndian );
|
||||
if( write( m_audioFD, outbuf, bytes ) != bytes )
|
||||
{
|
||||
|
||||
@@ -30,19 +30,19 @@
|
||||
|
||||
AudioPort::AudioPort( const QString & _name, bool _has_effect_chain ) :
|
||||
m_bufferUsage( NoUsage ),
|
||||
m_firstBuffer( new sampleFrame[engine::getMixer()->framesPerPeriod()] ),
|
||||
m_firstBuffer( new sampleFrame[engine::mixer()->framesPerPeriod()] ),
|
||||
m_secondBuffer( new sampleFrame[
|
||||
engine::getMixer()->framesPerPeriod()] ),
|
||||
engine::mixer()->framesPerPeriod()] ),
|
||||
m_extOutputEnabled( false ),
|
||||
m_nextFxChannel( 0 ),
|
||||
m_name( "unnamed port" ),
|
||||
m_effects( _has_effect_chain ? new EffectChain( NULL ) : NULL )
|
||||
{
|
||||
engine::getMixer()->clearAudioBuffer( m_firstBuffer,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::getMixer()->clearAudioBuffer( m_secondBuffer,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::getMixer()->addAudioPort( this );
|
||||
engine::mixer()->clearAudioBuffer( m_firstBuffer,
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
engine::mixer()->clearAudioBuffer( m_secondBuffer,
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
engine::mixer()->addAudioPort( this );
|
||||
setExtOutputEnabled( true );
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ AudioPort::AudioPort( const QString & _name, bool _has_effect_chain ) :
|
||||
AudioPort::~AudioPort()
|
||||
{
|
||||
setExtOutputEnabled( false );
|
||||
engine::getMixer()->removeAudioPort( this );
|
||||
engine::mixer()->removeAudioPort( this );
|
||||
delete[] m_firstBuffer;
|
||||
delete[] m_secondBuffer;
|
||||
delete m_effects;
|
||||
@@ -64,8 +64,8 @@ AudioPort::~AudioPort()
|
||||
void AudioPort::nextPeriod()
|
||||
{
|
||||
m_firstBufferLock.lock();
|
||||
engine::getMixer()->clearAudioBuffer( m_firstBuffer,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::mixer()->clearAudioBuffer( m_firstBuffer,
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
qSwap( m_firstBuffer, m_secondBuffer );
|
||||
|
||||
// this is how we decrease state of buffer-usage ;-)
|
||||
@@ -86,11 +86,11 @@ void AudioPort::setExtOutputEnabled( bool _enabled )
|
||||
m_extOutputEnabled = _enabled;
|
||||
if( m_extOutputEnabled )
|
||||
{
|
||||
engine::getMixer()->audioDev()->registerPort( this );
|
||||
engine::mixer()->audioDev()->registerPort( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
engine::getMixer()->audioDev()->unregisterPort( this );
|
||||
engine::mixer()->audioDev()->unregisterPort( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ void AudioPort::setExtOutputEnabled( bool _enabled )
|
||||
void AudioPort::setName( const QString & _name )
|
||||
{
|
||||
m_name = _name;
|
||||
engine::getMixer()->audioDev()->renamePort( this );
|
||||
engine::mixer()->audioDev()->renamePort( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ bool AudioPort::processEffects()
|
||||
{
|
||||
lockFirstBuffer();
|
||||
bool more = m_effects->processAudioBuffer( m_firstBuffer,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
unlockFirstBuffer();
|
||||
return more;
|
||||
}
|
||||
|
||||
@@ -50,20 +50,20 @@ void AudioPortAudioSetupUtil::updateChannels()
|
||||
#include "lcd_spinbox.h"
|
||||
|
||||
|
||||
AudioPortAudio::AudioPortAudio( bool & _success_ful, mixer * _mixer ) :
|
||||
AudioPortAudio::AudioPortAudio( bool & _success_ful, Mixer * _mixer ) :
|
||||
AudioDevice( tLimit<ch_cnt_t>(
|
||||
configManager::inst()->value( "audioportaudio", "channels" ).toInt(),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ),
|
||||
_mixer ),
|
||||
m_paStream( NULL ),
|
||||
m_wasPAInitError( false ),
|
||||
m_outBuf( new surroundSampleFrame[getMixer()->framesPerPeriod()] ),
|
||||
m_outBuf( new surroundSampleFrame[mixer()->framesPerPeriod()] ),
|
||||
m_outBufPos( 0 ),
|
||||
m_stopSemaphore( 1 )
|
||||
{
|
||||
_success_ful = false;
|
||||
|
||||
m_outBufSize = getMixer()->framesPerPeriod();
|
||||
m_outBufSize = mixer()->framesPerPeriod();
|
||||
|
||||
PaError err = Pa_Initialize();
|
||||
|
||||
@@ -110,12 +110,12 @@ AudioPortAudio::AudioPortAudio( bool & _success_ful, mixer * _mixer ) :
|
||||
return;
|
||||
}
|
||||
|
||||
double inLatency = 0;//(double)getMixer()->framesPerPeriod() / (double)sampleRate();
|
||||
double outLatency = 0;//(double)getMixer()->framesPerPeriod() / (double)sampleRate();
|
||||
double inLatency = 0;//(double)mixer()->framesPerPeriod() / (double)sampleRate();
|
||||
double outLatency = 0;//(double)mixer()->framesPerPeriod() / (double)sampleRate();
|
||||
|
||||
//inLatency = Pa_GetDeviceInfo( inDevIdx )->defaultLowInputLatency;
|
||||
//outLatency = Pa_GetDeviceInfo( outDevIdx )->defaultLowOutputLatency;
|
||||
const int samples = getMixer()->framesPerPeriod();
|
||||
const int samples = mixer()->framesPerPeriod();
|
||||
|
||||
// Configure output parameters.
|
||||
m_outputParameters.device = outDevIdx;
|
||||
@@ -232,8 +232,8 @@ void AudioPortAudio::applyQualitySettings()
|
||||
if( hqAudio() )
|
||||
{
|
||||
|
||||
setSampleRate( engine::getMixer()->processingSampleRate() );
|
||||
int samples = getMixer()->framesPerPeriod();
|
||||
setSampleRate( engine::mixer()->processingSampleRate() );
|
||||
int samples = mixer()->framesPerPeriod();
|
||||
|
||||
PaError err = Pa_OpenStream(
|
||||
&m_paStream,
|
||||
@@ -264,7 +264,7 @@ int AudioPortAudio::process_callback(
|
||||
{
|
||||
if( supportsCapture() )
|
||||
{
|
||||
getMixer()->pushInputFrames( (sampleFrame*)_inputBuffer,
|
||||
mixer()->pushInputFrames( (sampleFrame*)_inputBuffer,
|
||||
_framesPerBuffer );
|
||||
}
|
||||
|
||||
@@ -294,14 +294,14 @@ int AudioPortAudio::process_callback(
|
||||
const int min_len = qMin( (int)_framesPerBuffer,
|
||||
m_outBufSize - m_outBufPos );
|
||||
|
||||
float master_gain = getMixer()->masterGain();
|
||||
float master_gain = mixer()->masterGain();
|
||||
|
||||
for( fpp_t frame = 0; frame < min_len; ++frame )
|
||||
{
|
||||
for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl )
|
||||
{
|
||||
( _outputBuffer + frame * channels() )[chnl] =
|
||||
mixer::clip( m_outBuf[frame][chnl] *
|
||||
Mixer::clip( m_outBuf[frame][chnl] *
|
||||
master_gain );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ static void stream_write_callback(pa_stream *s, size_t length, void *userdata)
|
||||
|
||||
|
||||
|
||||
AudioPulseAudio::AudioPulseAudio( bool & _success_ful, mixer * _mixer ) :
|
||||
AudioPulseAudio::AudioPulseAudio( bool & _success_ful, Mixer* _mixer ) :
|
||||
AudioDevice( tLimit<ch_cnt_t>(
|
||||
configManager::inst()->value( "audiopa", "channels" ).toInt(),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ),
|
||||
@@ -118,7 +118,7 @@ void AudioPulseAudio::applyQualitySettings()
|
||||
{
|
||||
if( hqAudio() )
|
||||
{
|
||||
// setSampleRate( engine::getMixer()->processingSampleRate() );
|
||||
// setSampleRate( engine::mixer()->processingSampleRate() );
|
||||
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ static void context_state_callback(pa_context *c, void *userdata)
|
||||
buffer_attr.minreq = (uint32_t)(-1);
|
||||
buffer_attr.fragsize = (uint32_t)(-1);
|
||||
|
||||
double latency = (double)( engine::getMixer()->framesPerPeriod() ) /
|
||||
double latency = (double)( engine::mixer()->framesPerPeriod() ) /
|
||||
(double)_this->sampleRate();
|
||||
|
||||
// ask PulseAudio for the desired latency (which might not be approved)
|
||||
@@ -247,7 +247,7 @@ void AudioPulseAudio::run()
|
||||
|
||||
void AudioPulseAudio::streamWriteCallback( pa_stream *s, size_t length )
|
||||
{
|
||||
const fpp_t fpp = getMixer()->framesPerPeriod();
|
||||
const fpp_t fpp = mixer()->framesPerPeriod();
|
||||
surroundSampleFrame * temp = new surroundSampleFrame[fpp];
|
||||
Sint16 * pcmbuf = (Sint16*)pa_xmalloc( fpp * channels() * sizeof(Sint16) );
|
||||
|
||||
@@ -261,7 +261,7 @@ void AudioPulseAudio::streamWriteCallback( pa_stream *s, size_t length )
|
||||
break;
|
||||
}
|
||||
int bytes = convertToS16( temp, frames,
|
||||
getMixer()->masterGain(),
|
||||
mixer()->masterGain(),
|
||||
pcmbuf,
|
||||
m_convertEndian );
|
||||
if( bytes > 0 )
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
AudioSampleRecorder::AudioSampleRecorder( const ch_cnt_t _channels,
|
||||
bool & _success_ful,
|
||||
mixer * _mixer ) :
|
||||
Mixer * _mixer ) :
|
||||
AudioDevice( _channels, _mixer ),
|
||||
m_buffers()
|
||||
{
|
||||
|
||||
@@ -38,16 +38,16 @@
|
||||
|
||||
|
||||
|
||||
AudioSdl::AudioSdl( bool & _success_ful, mixer * _mixer ) :
|
||||
AudioSdl::AudioSdl( bool & _success_ful, Mixer* _mixer ) :
|
||||
AudioDevice( DEFAULT_CHANNELS, _mixer ),
|
||||
m_outBuf( new surroundSampleFrame[getMixer()->framesPerPeriod()] ),
|
||||
m_outBuf( new surroundSampleFrame[mixer()->framesPerPeriod()] ),
|
||||
m_convertedBufPos( 0 ),
|
||||
m_convertEndian( false ),
|
||||
m_stopSemaphore( 1 )
|
||||
{
|
||||
_success_ful = false;
|
||||
|
||||
m_convertedBufSize = getMixer()->framesPerPeriod() * channels()
|
||||
m_convertedBufSize = mixer()->framesPerPeriod() * channels()
|
||||
* sizeof( int_sample_t );
|
||||
m_convertedBuf = new Uint8[m_convertedBufSize];
|
||||
|
||||
@@ -63,7 +63,7 @@ AudioSdl::AudioSdl( bool & _success_ful, mixer * _mixer ) :
|
||||
// of system, so we don't have
|
||||
// to convert the buffers
|
||||
m_audioHandle.channels = channels();
|
||||
m_audioHandle.samples = qMax( 1024, getMixer()->framesPerPeriod()*2 );
|
||||
m_audioHandle.samples = qMax( 1024, mixer()->framesPerPeriod()*2 );
|
||||
|
||||
m_audioHandle.callback = sdlAudioCallback;
|
||||
m_audioHandle.userdata = this;
|
||||
@@ -131,7 +131,7 @@ void AudioSdl::applyQualitySettings()
|
||||
{
|
||||
SDL_CloseAudio();
|
||||
|
||||
setSampleRate( engine::getMixer()->processingSampleRate() );
|
||||
setSampleRate( engine::mixer()->processingSampleRate() );
|
||||
|
||||
m_audioHandle.freq = sampleRate();
|
||||
|
||||
@@ -185,7 +185,7 @@ void AudioSdl::sdlAudioCallback( Uint8 * _buf, int _len )
|
||||
* sizeof( int_sample_t );
|
||||
|
||||
convertToS16( m_outBuf, frames,
|
||||
getMixer()->masterGain(),
|
||||
mixer()->masterGain(),
|
||||
(int_sample_t *)m_convertedBuf,
|
||||
m_convertEndian );
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "InstrumentTrack.h"
|
||||
#include "ladspa_2_lmms.h"
|
||||
#include "MainWindow.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "pattern.h"
|
||||
#include "piano_roll.h"
|
||||
#include "preset_preview_play_handle.h"
|
||||
@@ -50,7 +50,7 @@
|
||||
bool engine::s_hasGUI = true;
|
||||
bool engine::s_suppressMessages = false;
|
||||
float engine::s_framesPerTick;
|
||||
mixer * engine::s_mixer = NULL;
|
||||
Mixer* engine::s_mixer = NULL;
|
||||
FxMixer * engine::s_fxMixer = NULL;
|
||||
FxMixerView * engine::s_fxMixerView = NULL;
|
||||
MainWindow * engine::s_mainWindow = NULL;
|
||||
@@ -77,7 +77,7 @@ void engine::init( const bool _has_gui )
|
||||
initPluginFileHandling();
|
||||
|
||||
s_projectJournal = new ProjectJournal;
|
||||
s_mixer = new mixer;
|
||||
s_mixer = new Mixer;
|
||||
s_song = new song;
|
||||
s_fxMixer = new FxMixer;
|
||||
s_bbTrackContainer = new bbTrackContainer;
|
||||
|
||||
@@ -120,7 +120,7 @@ int main( int argc, char * * argv )
|
||||
new QApplication( argc, argv ) ;
|
||||
|
||||
|
||||
mixer::qualitySettings qs( mixer::qualitySettings::Mode_HighQuality );
|
||||
Mixer::qualitySettings qs( Mixer::qualitySettings::Mode_HighQuality );
|
||||
ProjectRenderer::OutputSettings os( 44100, false, 160,
|
||||
ProjectRenderer::Depth_16Bit );
|
||||
ProjectRenderer::ExportFileFormats eff = ProjectRenderer::WaveFile;
|
||||
@@ -278,19 +278,19 @@ int main( int argc, char * * argv )
|
||||
const QString ip = QString( argv[i + 1] );
|
||||
if( ip == "linear" )
|
||||
{
|
||||
qs.interpolation = mixer::qualitySettings::Interpolation_Linear;
|
||||
qs.interpolation = Mixer::qualitySettings::Interpolation_Linear;
|
||||
}
|
||||
else if( ip == "sincfastest" )
|
||||
{
|
||||
qs.interpolation = mixer::qualitySettings::Interpolation_SincFastest;
|
||||
qs.interpolation = Mixer::qualitySettings::Interpolation_SincFastest;
|
||||
}
|
||||
else if( ip == "sincmedium" )
|
||||
{
|
||||
qs.interpolation = mixer::qualitySettings::Interpolation_SincMedium;
|
||||
qs.interpolation = Mixer::qualitySettings::Interpolation_SincMedium;
|
||||
}
|
||||
else if( ip == "sincbest" )
|
||||
{
|
||||
qs.interpolation = mixer::qualitySettings::Interpolation_SincBest;
|
||||
qs.interpolation = Mixer::qualitySettings::Interpolation_SincBest;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -308,16 +308,16 @@ int main( int argc, char * * argv )
|
||||
switch( o )
|
||||
{
|
||||
case 1:
|
||||
qs.oversampling = mixer::qualitySettings::Oversampling_None;
|
||||
qs.oversampling = Mixer::qualitySettings::Oversampling_None;
|
||||
break;
|
||||
case 2:
|
||||
qs.oversampling = mixer::qualitySettings::Oversampling_2x;
|
||||
qs.oversampling = Mixer::qualitySettings::Oversampling_2x;
|
||||
break;
|
||||
case 4:
|
||||
qs.oversampling = mixer::qualitySettings::Oversampling_4x;
|
||||
qs.oversampling = Mixer::qualitySettings::Oversampling_4x;
|
||||
break;
|
||||
case 8:
|
||||
qs.oversampling = mixer::qualitySettings::Oversampling_8x;
|
||||
qs.oversampling = Mixer::qualitySettings::Oversampling_8x;
|
||||
break;
|
||||
default:
|
||||
printf( "\nInvalid oversampling %s.\n\n"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "song.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "MidiClient.h"
|
||||
#include "MidiController.h"
|
||||
|
||||
@@ -38,7 +38,7 @@ MidiController::MidiController( Model * _parent ) :
|
||||
Controller( Controller::MidiController, _parent, tr( "MIDI Controller" ) ),
|
||||
MidiEventProcessor(),
|
||||
m_midiPort( tr( "unnamed_midi_controller" ),
|
||||
engine::getMixer()->midiClient(), this, this, MidiPort::Input ),
|
||||
engine::mixer()->midiClient(), this, this, MidiPort::Input ),
|
||||
m_lastValue( 0.0f )
|
||||
{
|
||||
connect( &m_midiPort, SIGNAL( modeChanged() ),
|
||||
|
||||
@@ -191,7 +191,7 @@ void notePlayHandle::play( sampleFrame * _working_buffer )
|
||||
|
||||
if( m_released == false &&
|
||||
instrumentTrack()->isSustainPedalPressed() == false &&
|
||||
m_totalFramesPlayed + engine::getMixer()->framesPerPeriod()
|
||||
m_totalFramesPlayed + engine::mixer()->framesPerPeriod()
|
||||
>= m_frames )
|
||||
{
|
||||
noteOff( m_frames - m_totalFramesPlayed );
|
||||
@@ -208,7 +208,7 @@ void notePlayHandle::play( sampleFrame * _working_buffer )
|
||||
|
||||
if( m_released )
|
||||
{
|
||||
f_cnt_t todo = engine::getMixer()->framesPerPeriod();
|
||||
f_cnt_t todo = engine::mixer()->framesPerPeriod();
|
||||
// if this note is base-note for arpeggio, always set
|
||||
// m_releaseFramesToDo to bigger value than m_releaseFramesDone
|
||||
// because we do not allow notePlayHandle::done() to be true
|
||||
@@ -217,7 +217,7 @@ void notePlayHandle::play( sampleFrame * _working_buffer )
|
||||
if( isArpeggioBaseNote() )
|
||||
{
|
||||
m_releaseFramesToDo = m_releaseFramesDone + 2 *
|
||||
engine::getMixer()->framesPerPeriod();
|
||||
engine::mixer()->framesPerPeriod();
|
||||
}
|
||||
// look whether we have frames left to be done before release
|
||||
if( m_framesBeforeRelease )
|
||||
@@ -225,7 +225,7 @@ void notePlayHandle::play( sampleFrame * _working_buffer )
|
||||
// yes, then look whether these samples can be played
|
||||
// within one audio-buffer
|
||||
if( m_framesBeforeRelease <=
|
||||
engine::getMixer()->framesPerPeriod() )
|
||||
engine::mixer()->framesPerPeriod() )
|
||||
{
|
||||
// yes, then we did less releaseFramesDone
|
||||
todo -= m_framesBeforeRelease;
|
||||
@@ -238,7 +238,7 @@ void notePlayHandle::play( sampleFrame * _working_buffer )
|
||||
// release-phase yet)
|
||||
todo = 0;
|
||||
m_framesBeforeRelease -=
|
||||
engine::getMixer()->framesPerPeriod();
|
||||
engine::mixer()->framesPerPeriod();
|
||||
}
|
||||
}
|
||||
// look whether we're in release-phase
|
||||
@@ -286,7 +286,7 @@ void notePlayHandle::play( sampleFrame * _working_buffer )
|
||||
}
|
||||
|
||||
// update internal data
|
||||
m_totalFramesPlayed += engine::getMixer()->framesPerPeriod();
|
||||
m_totalFramesPlayed += engine::mixer()->framesPerPeriod();
|
||||
}
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ f_cnt_t notePlayHandle::framesLeft() const
|
||||
{
|
||||
if( instrumentTrack()->isSustainPedalPressed() )
|
||||
{
|
||||
return 4*engine::getMixer()->framesPerPeriod();
|
||||
return 4*engine::mixer()->framesPerPeriod();
|
||||
}
|
||||
else if( m_released && actualReleaseFramesToDo() == 0 )
|
||||
{
|
||||
@@ -412,7 +412,7 @@ void notePlayHandle::mute()
|
||||
int notePlayHandle::index() const
|
||||
{
|
||||
const PlayHandleList & playHandles =
|
||||
engine::getMixer()->playHandles();
|
||||
engine::mixer()->playHandles();
|
||||
int idx = 0;
|
||||
for( PlayHandleList::ConstIterator it = playHandles.begin();
|
||||
it != playHandles.end(); ++it )
|
||||
@@ -440,7 +440,7 @@ int notePlayHandle::index() const
|
||||
ConstNotePlayHandleList notePlayHandle::nphsOfInstrumentTrack(
|
||||
const InstrumentTrack * _it, bool _all_ph )
|
||||
{
|
||||
const PlayHandleList & playHandles = engine::getMixer()->playHandles();
|
||||
const PlayHandleList & playHandles = engine::mixer()->playHandles();
|
||||
ConstNotePlayHandleList cnphv;
|
||||
|
||||
for( PlayHandleList::ConstIterator it = playHandles.begin();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
|
||||
#include "sample_buffer.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
|
||||
#include <QtCore/QBuffer>
|
||||
@@ -76,7 +76,7 @@ sampleBuffer::sampleBuffer( const QString & _audio_file,
|
||||
m_amplification( 1.0f ),
|
||||
m_reversed( false ),
|
||||
m_frequency( BaseFreq ),
|
||||
m_sampleRate( engine::getMixer()->baseSampleRate() )
|
||||
m_sampleRate( engine::mixer()->baseSampleRate() )
|
||||
{
|
||||
if( _is_base64_data == true )
|
||||
{
|
||||
@@ -101,7 +101,7 @@ sampleBuffer::sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ) :
|
||||
m_amplification( 1.0f ),
|
||||
m_reversed( false ),
|
||||
m_frequency( BaseFreq ),
|
||||
m_sampleRate( engine::getMixer()->baseSampleRate() )
|
||||
m_sampleRate( engine::mixer()->baseSampleRate() )
|
||||
{
|
||||
if( _frames > 0 )
|
||||
{
|
||||
@@ -128,7 +128,7 @@ sampleBuffer::sampleBuffer( const f_cnt_t _frames ) :
|
||||
m_amplification( 1.0f ),
|
||||
m_reversed( false ),
|
||||
m_frequency( BaseFreq ),
|
||||
m_sampleRate( engine::getMixer()->baseSampleRate() )
|
||||
m_sampleRate( engine::mixer()->baseSampleRate() )
|
||||
{
|
||||
if( _frames > 0 )
|
||||
{
|
||||
@@ -158,7 +158,7 @@ void sampleBuffer::update( bool _keep_settings )
|
||||
const bool lock = ( m_data != NULL );
|
||||
if( lock )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
delete[] m_data;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ void sampleBuffer::update( bool _keep_settings )
|
||||
#endif
|
||||
int_sample_t * buf = NULL;
|
||||
ch_cnt_t channels = DEFAULT_CHANNELS;
|
||||
sample_rate_t samplerate = engine::getMixer()->baseSampleRate();
|
||||
sample_rate_t samplerate = engine::mixer()->baseSampleRate();
|
||||
m_frames = 0;
|
||||
|
||||
const QFileInfo fileInfo( file );
|
||||
@@ -289,7 +289,7 @@ void sampleBuffer::update( bool _keep_settings )
|
||||
|
||||
if( lock )
|
||||
{
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
emit sampleUpdated();
|
||||
@@ -302,10 +302,10 @@ void sampleBuffer::normalizeSampleRate( const sample_rate_t _src_sr,
|
||||
bool _keep_settings )
|
||||
{
|
||||
// do samplerate-conversion to our default-samplerate
|
||||
if( _src_sr != engine::getMixer()->baseSampleRate() )
|
||||
if( _src_sr != engine::mixer()->baseSampleRate() )
|
||||
{
|
||||
sampleBuffer * resampled = resample( this, _src_sr,
|
||||
engine::getMixer()->baseSampleRate() );
|
||||
engine::mixer()->baseSampleRate() );
|
||||
delete[] m_data;
|
||||
m_frames = resampled->frames();
|
||||
m_data = new sampleFrame[m_frames];
|
||||
@@ -524,7 +524,7 @@ bool sampleBuffer::play( sampleFrame * _ab, handleState * _state,
|
||||
{
|
||||
QMutexLocker ml( &m_varLock );
|
||||
|
||||
engine::getMixer()->clearAudioBuffer( _ab, _frames );
|
||||
engine::mixer()->clearAudioBuffer( _ab, _frames );
|
||||
|
||||
if( m_endFrame == 0 || _frames == 0 )
|
||||
{
|
||||
@@ -532,7 +532,7 @@ bool sampleBuffer::play( sampleFrame * _ab, handleState * _state,
|
||||
}
|
||||
|
||||
const double freq_factor = (double) _freq / (double) m_frequency *
|
||||
m_sampleRate / engine::getMixer()->processingSampleRate();
|
||||
m_sampleRate / engine::mixer()->processingSampleRate();
|
||||
|
||||
// calculate how many frames we have in requested pitch
|
||||
const f_cnt_t total_frames_for_current_pitch = static_cast<f_cnt_t>( (
|
||||
@@ -855,7 +855,7 @@ QString & sampleBuffer::toBase64( QString & _dst ) const
|
||||
/* FLAC__stream_encoder_set_do_exhaustive_model_search( flac_enc, true );
|
||||
FLAC__stream_encoder_set_do_mid_side_stereo( flac_enc, true );*/
|
||||
FLAC__stream_encoder_set_sample_rate( flac_enc,
|
||||
engine::getMixer()->sampleRate() );
|
||||
engine::mixer()->sampleRate() );
|
||||
QBuffer ba_writer;
|
||||
ba_writer.open( QBuffer::WriteOnly );
|
||||
|
||||
@@ -879,7 +879,7 @@ QString & sampleBuffer::toBase64( QString & _dst ) const
|
||||
for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
|
||||
{
|
||||
buf[f*DEFAULT_CHANNELS+ch] = (FLAC__int32)(
|
||||
mixer::clip( m_data[f+frame_cnt][ch] ) *
|
||||
Mixer::clip( m_data[f+frame_cnt][ch] ) *
|
||||
OUTPUT_SAMPLE_MULTIPLIER );
|
||||
}
|
||||
}
|
||||
@@ -1206,7 +1206,7 @@ sampleBuffer::handleState::handleState( bool _varying_pitch ) :
|
||||
{
|
||||
int error;
|
||||
if( ( m_resamplingData = src_new(/*
|
||||
( engine::getMixer()->highQuality() == true ) ?
|
||||
( engine::mixer()->highQuality() == true ) ?
|
||||
SRC_SINC_FASTEST :*/
|
||||
SRC_LINEAR,
|
||||
DEFAULT_CHANNELS, &error ) ) == NULL )
|
||||
|
||||
@@ -121,7 +121,7 @@ void samplePlayHandle::play( sampleFrame * _working_buffer )
|
||||
return;
|
||||
}
|
||||
|
||||
const fpp_t frames = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t frames = engine::mixer()->framesPerPeriod();
|
||||
if( !( m_track && m_track->isMuted() )
|
||||
&& !( m_bbTrack && m_bbTrack->isMuted() ) )
|
||||
{
|
||||
@@ -130,7 +130,7 @@ void samplePlayHandle::play( sampleFrame * _working_buffer )
|
||||
m_volumeModel->value() / DefaultVolume } };
|
||||
m_sampleBuffer->play( _working_buffer, &m_state, frames,
|
||||
BaseFreq );
|
||||
engine::getMixer()->bufferToPort( _working_buffer, frames,
|
||||
engine::mixer()->bufferToPort( _working_buffer, frames,
|
||||
offset(), v, m_audioPort );
|
||||
}
|
||||
|
||||
@@ -159,8 +159,8 @@ bool samplePlayHandle::isFromTrack( const track * _track ) const
|
||||
f_cnt_t samplePlayHandle::totalFrames() const
|
||||
{
|
||||
return( ( m_sampleBuffer->endFrame() - m_sampleBuffer->startFrame() ) *
|
||||
( engine::getMixer()->processingSampleRate() /
|
||||
engine::getMixer()->baseSampleRate() ) );
|
||||
( engine::mixer()->processingSampleRate() /
|
||||
engine::mixer()->baseSampleRate() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ sampleRecordHandle::~sampleRecordHandle()
|
||||
|
||||
void sampleRecordHandle::play( sampleFrame * /*_working_buffer*/ )
|
||||
{
|
||||
const sampleFrame * recbuf = engine::getMixer()->inputBuffer();
|
||||
const f_cnt_t frames = engine::getMixer()->inputBufferFrames();
|
||||
const sampleFrame * recbuf = engine::mixer()->inputBuffer();
|
||||
const f_cnt_t frames = engine::mixer()->inputBufferFrames();
|
||||
writeBuffer( recbuf, frames );
|
||||
m_framesRecorded += frames;
|
||||
|
||||
@@ -129,7 +129,7 @@ void sampleRecordHandle::createSampleBuffer( sampleBuffer * * _sample_buf )
|
||||
}
|
||||
// create according sample-buffer out of big buffer
|
||||
*_sample_buf = new sampleBuffer( data, frames );
|
||||
( *_sample_buf )->setSampleRate( engine::getMixer()->inputSampleRate() );
|
||||
( *_sample_buf )->setSampleRate( engine::mixer()->inputSampleRate() );
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,13 +119,13 @@ song::song() :
|
||||
this, SLOT( setTimeSignature() ) );
|
||||
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ), this,
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this,
|
||||
SLOT( updateFramesPerTick() ) );
|
||||
|
||||
// handle VST plugins sync
|
||||
if( configManager::inst()->value( "ui", "syncvstplugins" ).toInt() )
|
||||
{
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ), this,
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this,
|
||||
SLOT( updateSampleRateSHM() ) );
|
||||
#ifdef USE_QT_SHMEM
|
||||
if ( !m_shmQtID.create( sizeof( sncVST ) ) )
|
||||
@@ -163,9 +163,9 @@ song::song() :
|
||||
m_SncVSTplug->isPlayin = m_playing | m_exporting;
|
||||
m_SncVSTplug->hasSHM = true;
|
||||
m_SncVSTplug->m_sampleRate =
|
||||
engine::getMixer()->processingSampleRate();
|
||||
engine::mixer()->processingSampleRate();
|
||||
m_SncVSTplug->m_bufferSize =
|
||||
engine::getMixer()->framesPerPeriod();
|
||||
engine::mixer()->framesPerPeriod();
|
||||
m_SncVSTplug->timeSigNumer = 4;
|
||||
m_SncVSTplug->timeSigDenom = 4;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ song::~song()
|
||||
|
||||
void song::masterVolumeChanged()
|
||||
{
|
||||
engine::getMixer()->setMasterGain( m_masterVolumeModel.value() /
|
||||
engine::mixer()->setMasterGain( m_masterVolumeModel.value() /
|
||||
100.0f );
|
||||
}
|
||||
|
||||
@@ -226,8 +226,8 @@ void song::masterVolumeChanged()
|
||||
void song::setTempo()
|
||||
{
|
||||
const bpm_t tempo = (bpm_t) m_tempoModel.value();
|
||||
engine::getMixer()->lock();
|
||||
PlayHandleList & playHandles = engine::getMixer()->playHandles();
|
||||
engine::mixer()->lock();
|
||||
PlayHandleList & playHandles = engine::mixer()->playHandles();
|
||||
for( PlayHandleList::Iterator it = playHandles.begin();
|
||||
it != playHandles.end(); ++it )
|
||||
{
|
||||
@@ -237,7 +237,7 @@ void song::setTempo()
|
||||
nph->resize( tempo );
|
||||
}
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
|
||||
engine::updateFramesPerTick();
|
||||
|
||||
@@ -315,7 +315,7 @@ void song::savePos()
|
||||
m_playPos[m_playMode].setCurrentFrame( 0 );
|
||||
|
||||
// remove all note-play-handles that are active
|
||||
engine::getMixer()->clear();
|
||||
engine::mixer()->clear();
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -468,9 +468,9 @@ void song::processNextBuffer()
|
||||
const float frames_per_tick = engine::framesPerTick();
|
||||
|
||||
while( total_frames_played
|
||||
< engine::getMixer()->framesPerPeriod() )
|
||||
< engine::mixer()->framesPerPeriod() )
|
||||
{
|
||||
f_cnt_t played_frames = ( m_SncVSTplug->m_bufferSize = engine::getMixer()
|
||||
f_cnt_t played_frames = ( m_SncVSTplug->m_bufferSize = engine::mixer()
|
||||
->framesPerPeriod() ) - total_frames_played;
|
||||
|
||||
#ifdef VST_SNC_LATENCY
|
||||
@@ -830,7 +830,7 @@ void song::stop()
|
||||
m_playPos[m_playMode].setCurrentFrame( 0 );
|
||||
|
||||
// remove all note-play-handles that are active
|
||||
engine::getMixer()->clear();
|
||||
engine::mixer()->clear();
|
||||
|
||||
m_playMode = Mode_None;
|
||||
|
||||
@@ -894,11 +894,11 @@ void song::removeBar()
|
||||
|
||||
void song::addBBTrack()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
track * t = track::create( track::BBTrack, this );
|
||||
engine::getBBTrackContainer()->setCurrentBB(
|
||||
bbTrack::numOfBBTrack( t ) );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -906,9 +906,9 @@ void song::addBBTrack()
|
||||
|
||||
void song::addSampleTrack()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
(void) track::create( track::SampleTrack, this );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -916,9 +916,9 @@ void song::addSampleTrack()
|
||||
|
||||
void song::addAutomationTrack()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
(void) track::create( track::AutomationTrack, this );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -955,7 +955,7 @@ void song::clearProject()
|
||||
}
|
||||
|
||||
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
if( engine::getBBEditor() )
|
||||
{
|
||||
engine::getBBEditor()->clearAllTracks();
|
||||
@@ -990,7 +990,7 @@ void song::clearProject()
|
||||
AutomationPattern::globalAutomationPattern( &m_masterPitchModel )->
|
||||
clear();
|
||||
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
|
||||
if( engine::getProjectNotes() )
|
||||
{
|
||||
@@ -1118,7 +1118,7 @@ void song::loadProject( const QString & _file_name )
|
||||
return;
|
||||
}
|
||||
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
|
||||
// get the header information from the DOM
|
||||
m_tempoModel.loadSettings( mmp.head(), "bpm" );
|
||||
@@ -1208,7 +1208,7 @@ void song::loadProject( const QString & _file_name )
|
||||
AutomationPattern::resolveAllIDs();
|
||||
|
||||
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
|
||||
configManager::inst()->addRecentlyOpenedProject( _file_name );
|
||||
|
||||
@@ -1443,7 +1443,7 @@ void song::updateFramesPerTick()
|
||||
|
||||
void song::updateSampleRateSHM()
|
||||
{
|
||||
m_SncVSTplug->m_sampleRate = engine::getMixer()->processingSampleRate();
|
||||
m_SncVSTplug->m_sampleRate = engine::mixer()->processingSampleRate();
|
||||
|
||||
#ifdef VST_SNC_LATENCY
|
||||
m_SncVSTplug->m_latency = m_SncVSTplug->m_bufferSize * m_SncVSTplug->m_bpm /
|
||||
|
||||
@@ -1484,9 +1484,9 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe )
|
||||
*/
|
||||
void trackOperationsWidget::cloneTrack()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
m_trackView->getTrack()->clone();
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -2310,9 +2310,9 @@ void trackView::dropEvent( QDropEvent * _de )
|
||||
// value contains our XML-data so simply create a
|
||||
// multimediaProject which does the rest for us...
|
||||
multimediaProject mmp( value.toUtf8() );
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
m_track->restoreState( mmp.content().firstChild().toElement() );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
_de->accept();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
m_detectedMidiChannel = _me.m_channel + 1;
|
||||
m_detectedMidiController = ( _me.m_data.m_bytes[0] & 0x7F ) + 1;
|
||||
m_detectedMidiPort =
|
||||
engine::getMixer()->midiClient()->sourcePortName( _me );
|
||||
engine::mixer()->midiClient()->sourcePortName( _me );
|
||||
|
||||
emit valueChanged();
|
||||
}
|
||||
@@ -168,7 +168,7 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent,
|
||||
|
||||
// when using with non-raw-clients we can provide buttons showing
|
||||
// our port-menus when being clicked
|
||||
if( !engine::getMixer()->midiClient()->isRaw() )
|
||||
if( !engine::mixer()->midiClient()->isRaw() )
|
||||
{
|
||||
m_readablePorts = new MidiPortMenu( MidiPort::Input );
|
||||
connect( m_readablePorts, SIGNAL( triggered( QAction * ) ),
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "plugin_browser.h"
|
||||
#include "SideBar.h"
|
||||
#include "config_mgr.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "PluginView.h"
|
||||
#include "project_notes.h"
|
||||
#include "setup_dialog.h"
|
||||
@@ -500,7 +500,7 @@ void MainWindow::finalize( void )
|
||||
sd.exec();
|
||||
}
|
||||
// look whether mixer could use a audio-interface beside AudioDummy
|
||||
else if( engine::getMixer()->audioDevName() == AudioDummy::name() )
|
||||
else if( engine::mixer()->audioDevName() == AudioDummy::name() )
|
||||
{
|
||||
// no, so we offer setup-dialog with audio-settings...
|
||||
setupDialog sd( setupDialog::AudioSettings );
|
||||
|
||||
@@ -238,10 +238,10 @@ void exportProjectDialog::multiRender()
|
||||
|
||||
ProjectRenderer* exportProjectDialog::prepRender()
|
||||
{
|
||||
mixer::qualitySettings qs =
|
||||
mixer::qualitySettings(
|
||||
static_cast<mixer::qualitySettings::Interpolation>(interpolationCB->currentIndex()),
|
||||
static_cast<mixer::qualitySettings::Oversampling>(oversamplingCB->currentIndex()),
|
||||
Mixer::qualitySettings qs =
|
||||
Mixer::qualitySettings(
|
||||
static_cast<Mixer::qualitySettings::Interpolation>(interpolationCB->currentIndex()),
|
||||
static_cast<Mixer::qualitySettings::Oversampling>(oversamplingCB->currentIndex()),
|
||||
sampleExactControllersCB->isChecked(),
|
||||
aliasFreeOscillatorsCB->isChecked() );
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me )
|
||||
m_pphMutex.lock();
|
||||
if( m_previewPlayHandle != NULL )
|
||||
{
|
||||
engine::getMixer()->removePlayHandle(
|
||||
engine::mixer()->removePlayHandle(
|
||||
m_previewPlayHandle );
|
||||
m_previewPlayHandle = NULL;
|
||||
}
|
||||
@@ -446,7 +446,7 @@ void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
if( m_previewPlayHandle != NULL )
|
||||
{
|
||||
if( !engine::getMixer()->addPlayHandle(
|
||||
if( !engine::mixer()->addPlayHandle(
|
||||
m_previewPlayHandle ) )
|
||||
{
|
||||
m_previewPlayHandle = NULL;
|
||||
@@ -523,7 +523,7 @@ void fileBrowserTreeWidget::mouseReleaseEvent( QMouseEvent * _me )
|
||||
samplePlayHandle * s = dynamic_cast<samplePlayHandle *>(
|
||||
m_previewPlayHandle );
|
||||
if( s && s->totalFrames() - s->framesDone() <=
|
||||
static_cast<f_cnt_t>( engine::getMixer()->
|
||||
static_cast<f_cnt_t>( engine::mixer()->
|
||||
processingSampleRate() * 3 ) )
|
||||
{
|
||||
s->setDoneMayReturnTrue( true );
|
||||
@@ -532,7 +532,7 @@ void fileBrowserTreeWidget::mouseReleaseEvent( QMouseEvent * _me )
|
||||
return;
|
||||
}
|
||||
}
|
||||
engine::getMixer()->removePlayHandle( m_previewPlayHandle );
|
||||
engine::mixer()->removePlayHandle( m_previewPlayHandle );
|
||||
m_previewPlayHandle = NULL;
|
||||
}
|
||||
m_pphMutex.unlock();
|
||||
@@ -544,7 +544,7 @@ void fileBrowserTreeWidget::mouseReleaseEvent( QMouseEvent * _me )
|
||||
|
||||
void fileBrowserTreeWidget::handleFile( fileItem * f, InstrumentTrack * _it )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
switch( f->handling() )
|
||||
{
|
||||
case fileItem::LoadAsProject:
|
||||
@@ -592,7 +592,7 @@ void fileBrowserTreeWidget::handleFile( fileItem * f, InstrumentTrack * _it )
|
||||
break;
|
||||
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -614,12 +614,12 @@ void fileBrowserTreeWidget::activateListItem( QTreeWidgetItem * _item,
|
||||
}
|
||||
else if( f->handling() != fileItem::NotSupported )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
track::create( track::InstrumentTrack,
|
||||
engine::getBBTrackContainer() ) );
|
||||
handleFile( f, it );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -631,11 +631,11 @@ void fileBrowserTreeWidget::openInNewInstrumentTrack( trackContainer * _tc )
|
||||
if( m_contextMenuItem->handling() == fileItem::LoadAsPreset ||
|
||||
m_contextMenuItem->handling() == fileItem::LoadByPlugin )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
track::create( track::InstrumentTrack, _tc ) );
|
||||
handleFile( m_contextMenuItem, it );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "tab_button.h"
|
||||
#include "tab_widget.h"
|
||||
#include "gui_templates.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "config_mgr.h"
|
||||
#include "embed.h"
|
||||
@@ -606,8 +606,8 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) :
|
||||
m_audioInterfaces->addItem( it.key() );
|
||||
}
|
||||
m_audioInterfaces->setCurrentIndex( m_audioInterfaces->findText(
|
||||
tr( engine::getMixer()->audioDevName().toAscii() ) ) );
|
||||
m_audioIfaceSetupWidgets[engine::getMixer()->audioDevName()]->show();
|
||||
tr( engine::mixer()->audioDevName().toAscii() ) ) );
|
||||
m_audioIfaceSetupWidgets[engine::mixer()->audioDevName()]->show();
|
||||
|
||||
connect( m_audioInterfaces, SIGNAL( activated( const QString & ) ),
|
||||
this, SLOT( audioInterfaceChanged( const QString & ) ) );
|
||||
@@ -687,8 +687,8 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) :
|
||||
}
|
||||
|
||||
m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText(
|
||||
tr( engine::getMixer()->midiClientName().toAscii() ) ) );
|
||||
m_midiIfaceSetupWidgets[engine::getMixer()->midiClientName()]->show();
|
||||
tr( engine::mixer()->midiClientName().toAscii() ) ) );
|
||||
m_midiIfaceSetupWidgets[engine::mixer()->midiClientName()]->show();
|
||||
|
||||
connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ),
|
||||
this, SLOT( midiInterfaceChanged( const QString & ) ) );
|
||||
@@ -870,7 +870,7 @@ void setupDialog::setBufferSize( int _value )
|
||||
m_bufSizeLbl->setText( tr( "Frames: %1\nLatency: %2 ms" ).arg(
|
||||
m_bufferSize ).arg(
|
||||
1000.0f * m_bufferSize /
|
||||
engine::getMixer()->processingSampleRate(),
|
||||
engine::mixer()->processingSampleRate(),
|
||||
0, 'f', 1 ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
m_recordButton->setDisabled( true );
|
||||
|
||||
// disable record buttons if capturing is not supported
|
||||
if( !engine::getMixer()->audioDev()->supportsCapture() )
|
||||
if( !engine::mixer()->audioDev()->supportsCapture() )
|
||||
{
|
||||
m_recordButton->setDisabled( true );
|
||||
m_recordAccompanyButton->setDisabled( true );
|
||||
@@ -408,9 +408,9 @@ songEditor::~songEditor()
|
||||
|
||||
void songEditor::setHighQuality( bool _hq )
|
||||
{
|
||||
engine::getMixer()->changeQuality( mixer::qualitySettings(
|
||||
_hq ? mixer::qualitySettings::Mode_HighQuality :
|
||||
mixer::qualitySettings::Mode_Draft ) );
|
||||
engine::mixer()->changeQuality( Mixer::qualitySettings(
|
||||
_hq ? Mixer::qualitySettings::Mode_HighQuality :
|
||||
Mixer::qualitySettings::Mode_Draft ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -593,7 +593,7 @@ void songEditor::masterVolumeChanged( int _new_val )
|
||||
QPoint( m_masterVolumeSlider->width() + 2, -2 ) );
|
||||
m_mvsStatus->setVisibilityTimeOut( 1000 );
|
||||
}
|
||||
engine::getMixer()->setMasterGain( _new_val / 100.0f );
|
||||
engine::mixer()->setMasterGain( _new_val / 100.0f );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -242,9 +242,9 @@ void trackContainerView::deleteTrackView( trackView * _tv )
|
||||
removeTrackView( _tv );
|
||||
delete _tv;
|
||||
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
delete t;
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -381,7 +381,7 @@ void trackContainerView::dropEvent( QDropEvent * _de )
|
||||
{
|
||||
QString type = stringPairDrag::decodeKey( _de );
|
||||
QString value = stringPairDrag::decodeValue( _de );
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
if( type == "instrument" )
|
||||
{
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
@@ -425,7 +425,7 @@ void trackContainerView::dropEvent( QDropEvent * _de )
|
||||
track::create( mmp.content().firstChild().toElement(), m_tc );
|
||||
_de->accept();
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "gui_templates.h"
|
||||
#include "knob.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "mmp.h"
|
||||
#include "Oscillator.h"
|
||||
#include "pixmap_button.h"
|
||||
@@ -481,7 +481,7 @@ void EnvelopeAndLfoView::paintEvent( QPaintEvent * )
|
||||
int graph_y_base = LFO_GRAPH_Y + 3 + LFO_GRAPH_H / 2;
|
||||
|
||||
const float frames_for_graph = SECS_PER_LFO_OSCILLATION *
|
||||
engine::getMixer()->baseSampleRate() / 10;
|
||||
engine::mixer()->baseSampleRate() / 10;
|
||||
|
||||
const float lfo_gray_amount = 1.0f - fabsf( m_lfoAmountKnob->value<float>() );
|
||||
p.setPen( QPen( QColor( static_cast<int>( 96 * lfo_gray_amount ),
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "gui_templates.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "MidiClient.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget * _parent ) :
|
||||
connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ),
|
||||
m_fixedOutputNoteSpinBox, SLOT( setEnabled( bool ) ) );
|
||||
|
||||
if( !engine::getMixer()->midiClient()->isRaw() )
|
||||
if( !engine::mixer()->midiClient()->isRaw() )
|
||||
{
|
||||
m_rpBtn = new QToolButton( m_midiInputGroupBox );
|
||||
m_rpBtn->setText( tr( "MIDI devices to receive MIDI events from" ) );
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "cpuload_widget.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
|
||||
cpuloadWidget::cpuloadWidget( QWidget * _parent ) :
|
||||
@@ -90,7 +90,7 @@ void cpuloadWidget::paintEvent( QPaintEvent * )
|
||||
void cpuloadWidget::updateCpuLoad()
|
||||
{
|
||||
// smooth load-values a bit
|
||||
Uint8 new_load = ( m_currentLoad + engine::getMixer()->cpuLoad() ) / 2;
|
||||
Uint8 new_load = ( m_currentLoad + engine::mixer()->cpuLoad() ) / 2;
|
||||
if( new_load != m_currentLoad )
|
||||
{
|
||||
m_currentLoad = new_load;
|
||||
|
||||
@@ -40,16 +40,16 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p,
|
||||
visualizationTypes _vtype ) :
|
||||
QWidget( _p ),
|
||||
s_background( _bg ),
|
||||
m_points( new QPointF[engine::getMixer()->framesPerPeriod()] ),
|
||||
m_points( new QPointF[engine::mixer()->framesPerPeriod()] ),
|
||||
m_active( false )
|
||||
{
|
||||
setFixedSize( s_background.width(), s_background.height() );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
|
||||
const fpp_t frames = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t frames = engine::mixer()->framesPerPeriod();
|
||||
m_buffer = new sampleFrame[frames];
|
||||
|
||||
engine::getMixer()->clearAudioBuffer( m_buffer, frames );
|
||||
engine::mixer()->clearAudioBuffer( m_buffer, frames );
|
||||
|
||||
|
||||
toolTip::add( this, tr( "click to enable/disable visualization of "
|
||||
@@ -71,12 +71,12 @@ void visualizationWidget::updateAudioBuffer()
|
||||
{
|
||||
if( !engine::getSong()->isExporting() )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
const surroundSampleFrame * c = engine::getMixer()->
|
||||
engine::mixer()->lock();
|
||||
const surroundSampleFrame * c = engine::mixer()->
|
||||
currentReadBuffer();
|
||||
const fpp_t fpp = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t fpp = engine::mixer()->framesPerPeriod();
|
||||
memcpy( m_buffer, c, sizeof( surroundSampleFrame ) * fpp );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ void visualizationWidget::setActive( bool _active )
|
||||
connect( engine::mainWindow(),
|
||||
SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( update() ) );
|
||||
connect( engine::getMixer(),
|
||||
connect( engine::mixer(),
|
||||
SIGNAL( nextAudioBuffer() ),
|
||||
this, SLOT( updateAudioBuffer() ) );
|
||||
}
|
||||
@@ -100,7 +100,7 @@ void visualizationWidget::setActive( bool _active )
|
||||
disconnect( engine::mainWindow(),
|
||||
SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( update() ) );
|
||||
disconnect( engine::getMixer(),
|
||||
disconnect( engine::mixer(),
|
||||
SIGNAL( nextAudioBuffer() ),
|
||||
this, SLOT( updateAudioBuffer() ) );
|
||||
// we have to update (remove last waves),
|
||||
@@ -120,7 +120,7 @@ void visualizationWidget::paintEvent( QPaintEvent * )
|
||||
|
||||
if( m_active && !engine::getSong()->isExporting() )
|
||||
{
|
||||
float master_output = engine::getMixer()->masterGain();
|
||||
float master_output = engine::mixer()->masterGain();
|
||||
int w = width()-4;
|
||||
const float half_h = -( height() - 6 ) / 3.0 * master_output - 1;
|
||||
int x_base = 2;
|
||||
@@ -130,10 +130,10 @@ void visualizationWidget::paintEvent( QPaintEvent * )
|
||||
|
||||
|
||||
const fpp_t frames =
|
||||
engine::getMixer()->framesPerPeriod();
|
||||
engine::mixer()->framesPerPeriod();
|
||||
const float max_level = qMax<float>(
|
||||
mixer::peakValueLeft( m_buffer, frames ),
|
||||
mixer::peakValueRight( m_buffer, frames ) );
|
||||
Mixer::peakValueLeft( m_buffer, frames ),
|
||||
Mixer::peakValueRight( m_buffer, frames ) );
|
||||
|
||||
// and set color according to that...
|
||||
if( max_level * master_output < 0.9 )
|
||||
@@ -161,7 +161,7 @@ void visualizationWidget::paintEvent( QPaintEvent * )
|
||||
{
|
||||
m_points[frame] = QPointF(
|
||||
x_base + (float) frame * xd,
|
||||
y_base + ( mixer::clip(
|
||||
y_base + ( Mixer::clip(
|
||||
m_buffer[frame][ch] ) *
|
||||
half_h ) );
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ InstrumentTrack::InstrumentTrack( trackContainer * _tc ) :
|
||||
track( track::InstrumentTrack, _tc ),
|
||||
MidiEventProcessor(),
|
||||
m_audioPort( tr( "unnamed_track" ) ),
|
||||
m_midiPort( tr( "unnamed_track" ), engine::getMixer()->midiClient(),
|
||||
m_midiPort( tr( "unnamed_track" ), engine::mixer()->midiClient(),
|
||||
this, this ),
|
||||
m_notes(),
|
||||
m_sustainPedalPressed( false ),
|
||||
@@ -187,7 +187,7 @@ void InstrumentTrack::processAudioBuffer( sampleFrame * _buf,
|
||||
panning += _n->getPanning();
|
||||
panning = tLimit<int>( panning, PanningLeft, PanningRight );
|
||||
}
|
||||
engine::getMixer()->bufferToPort( _buf, ( _n != NULL ) ?
|
||||
engine::mixer()->bufferToPort( _buf, ( _n != NULL ) ?
|
||||
qMin<f_cnt_t>(_n->framesLeftForCurrentPeriod(), _frames ) :
|
||||
_frames,
|
||||
( _n != NULL ) ? _n->offset() : 0,
|
||||
@@ -220,7 +220,7 @@ midiEvent InstrumentTrack::applyMasterKey( const midiEvent & _me )
|
||||
void InstrumentTrack::processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
|
||||
// in the special case this event comes from a MIDI port, the instrument
|
||||
// is MIDI based (VST plugin, Sf2Player etc.) and the user did not set
|
||||
@@ -230,7 +230,7 @@ void InstrumentTrack::processInEvent( const midiEvent & _me,
|
||||
midiPort()->realOutputChannel() < 0 */ )
|
||||
{
|
||||
m_instrument->handleMidiEvent( _me, _time );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ void InstrumentTrack::processInEvent( const midiEvent & _me,
|
||||
engine::framesPerTick() ),
|
||||
typeInfo<f_cnt_t>::max() / 2,
|
||||
n );
|
||||
if( engine::getMixer()->addPlayHandle(
|
||||
if( engine::mixer()->addPlayHandle(
|
||||
nph ) )
|
||||
{
|
||||
m_notes[_me.key()] = nph;
|
||||
@@ -370,7 +370,7 @@ void InstrumentTrack::processInEvent( const midiEvent & _me,
|
||||
}
|
||||
break;
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -449,7 +449,7 @@ void InstrumentTrack::processOutEvent( const midiEvent & _me,
|
||||
|
||||
void InstrumentTrack::silenceAllNotes()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
for( int i = 0; i < NumKeys; ++i )
|
||||
{
|
||||
m_notes[i] = NULL;
|
||||
@@ -458,8 +458,8 @@ void InstrumentTrack::silenceAllNotes()
|
||||
|
||||
// invalidate all NotePlayHandles linked to this track
|
||||
m_processHandles.clear();
|
||||
engine::getMixer()->removePlayHandles( this );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->removePlayHandles( this );
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -562,13 +562,13 @@ void InstrumentTrack::setName( const QString & _new_name )
|
||||
|
||||
void InstrumentTrack::updateBaseNote()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
for( NotePlayHandleList::Iterator it = m_processHandles.begin();
|
||||
it != m_processHandles.end(); ++it )
|
||||
{
|
||||
( *it )->updateFrequency();
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -662,7 +662,7 @@ bool InstrumentTrack::play( const midiTime & _start,
|
||||
handle->setBBTrack( bb_track );
|
||||
handle->setOffset( _offset );
|
||||
// send it to the mixer
|
||||
engine::getMixer()->addPlayHandle( handle );
|
||||
engine::mixer()->addPlayHandle( handle );
|
||||
played_a_note = true;
|
||||
continue;
|
||||
}
|
||||
@@ -720,7 +720,7 @@ bool InstrumentTrack::play( const midiTime & _start,
|
||||
#if LMMS_SINGERBOT_SUPPORT
|
||||
note_play_handle->setPatternIndex( note_idx );
|
||||
#endif
|
||||
engine::getMixer()->addPlayHandle(
|
||||
engine::mixer()->addPlayHandle(
|
||||
note_play_handle );
|
||||
played_a_note = true;
|
||||
#if LMMS_SINGERBOT_SUPPORT
|
||||
@@ -783,7 +783,7 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & _this )
|
||||
{
|
||||
silenceAllNotes();
|
||||
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
|
||||
m_volumeModel.loadSettings( _this, "vol" );
|
||||
|
||||
@@ -878,7 +878,7 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & _this )
|
||||
}
|
||||
node = node.nextSibling();
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -888,10 +888,10 @@ Instrument * InstrumentTrack::loadInstrument( const QString & _plugin_name )
|
||||
{
|
||||
silenceAllNotes();
|
||||
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
delete m_instrument;
|
||||
m_instrument = Instrument::instantiate( _plugin_name, this );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
|
||||
emit instrumentChanged();
|
||||
|
||||
@@ -963,7 +963,7 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it,
|
||||
m_midiMenu = new QMenu( tr( "MIDI" ), this );
|
||||
|
||||
// sequenced MIDI?
|
||||
if( !engine::getMixer()->midiClient()->isRaw() )
|
||||
if( !engine::mixer()->midiClient()->isRaw() )
|
||||
{
|
||||
_it->m_midiPort.m_readablePortsMenu = new MidiPortMenu(
|
||||
MidiPort::Input );
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "MainWindow.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "rename_dialog.h"
|
||||
#include "song.h"
|
||||
#include "song_editor.h"
|
||||
@@ -317,7 +317,7 @@ bbTrack::bbTrack( trackContainer * _tc ) :
|
||||
|
||||
bbTrack::~bbTrack()
|
||||
{
|
||||
engine::getMixer()->removePlayHandles( this );
|
||||
engine::mixer()->removePlayHandles( this );
|
||||
|
||||
const int bb = s_infoMap[this];
|
||||
engine::getBBTrackContainer()->removeBB( bb );
|
||||
|
||||
@@ -188,7 +188,7 @@ note * pattern::addNote( const note & _new_note, const bool _quant_pos )
|
||||
new_note->quantizePos( engine::getPianoRoll()->quantization() );
|
||||
}
|
||||
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
if( m_notes.size() == 0 || m_notes.back()->pos() <= new_note->pos() )
|
||||
{
|
||||
m_notes.push_back( new_note );
|
||||
@@ -211,7 +211,7 @@ note * pattern::addNote( const note & _new_note, const bool _quant_pos )
|
||||
|
||||
m_notes.insert( it, new_note );
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
|
||||
checkType();
|
||||
changeLength( length() );
|
||||
@@ -228,7 +228,7 @@ note * pattern::addNote( const note & _new_note, const bool _quant_pos )
|
||||
|
||||
void pattern::removeNote( const note * _note_to_del )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
NoteVector::Iterator it = m_notes.begin();
|
||||
while( it != m_notes.end() )
|
||||
{
|
||||
@@ -240,7 +240,7 @@ void pattern::removeNote( const note * _note_to_del )
|
||||
}
|
||||
++it;
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
|
||||
checkType();
|
||||
changeLength( length() );
|
||||
@@ -276,14 +276,14 @@ void pattern::rearrangeAllNotes()
|
||||
|
||||
void pattern::clearNotes()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end();
|
||||
++it )
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
m_notes.clear();
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
|
||||
checkType();
|
||||
emit dataChanged();
|
||||
@@ -739,12 +739,12 @@ void patternFreezeThread::run()
|
||||
// create and install audio-sample-recorder
|
||||
bool b;
|
||||
// we cannot create local copy, because at a later stage
|
||||
// mixer::restoreAudioDevice(...) deletes old audio-dev and thus
|
||||
// Mixer::restoreAudioDevice(...) deletes old audio-dev and thus
|
||||
// AudioSampleRecorder would be destroyed two times...
|
||||
AudioSampleRecorder * freeze_recorder = new AudioSampleRecorder(
|
||||
DEFAULT_CHANNELS, b,
|
||||
engine::getMixer() );
|
||||
engine::getMixer()->setAudioDevice( freeze_recorder );
|
||||
engine::mixer() );
|
||||
engine::mixer()->setAudioDevice( freeze_recorder );
|
||||
|
||||
// prepare stuff for playing correct things later
|
||||
engine::getSong()->playPattern( m_pattern, false );
|
||||
@@ -769,7 +769,7 @@ void patternFreezeThread::run()
|
||||
|
||||
// render tails
|
||||
int count = 0;
|
||||
while( engine::getMixer()->hasNotePlayHandles() &&
|
||||
while( engine::mixer()->hasNotePlayHandles() &&
|
||||
m_pattern->m_freezeAborted == false &&
|
||||
++count < 2000 )
|
||||
{
|
||||
@@ -791,7 +791,7 @@ void patternFreezeThread::run()
|
||||
}
|
||||
|
||||
// restore original audio-device
|
||||
engine::getMixer()->restoreAudioDevice();
|
||||
engine::mixer()->restoreAudioDevice();
|
||||
|
||||
m_statusDlg->setProgress( -1 ); // we're finished
|
||||
|
||||
|
||||
@@ -399,7 +399,7 @@ sampleTrack::sampleTrack( trackContainer * _tc ) :
|
||||
|
||||
sampleTrack::~sampleTrack()
|
||||
{
|
||||
engine::getMixer()->removePlayHandles( this );
|
||||
engine::mixer()->removePlayHandles( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -442,7 +442,7 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames,
|
||||
// handle->setBBTrack( _tco_num );
|
||||
handle->setOffset( _offset );
|
||||
// send it to the mixer
|
||||
engine::getMixer()->addPlayHandle( handle );
|
||||
engine::mixer()->addPlayHandle( handle );
|
||||
played_a_note = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user