Mixer: renamed class and file name
The mixer class is now named "Mixer" and accessible via engine::mixer().
This commit is contained in:
@@ -44,7 +44,7 @@ class QLineEdit;
|
||||
class AudioAlsa : public AudioDevice, public QThread
|
||||
{
|
||||
public:
|
||||
AudioAlsa( bool & _success_ful, mixer * _mixer );
|
||||
AudioAlsa( bool & _success_ful, Mixer* mixer );
|
||||
virtual ~AudioAlsa();
|
||||
|
||||
inline static QString name()
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QThread>
|
||||
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "tab_widget.h"
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class AudioPort;
|
||||
class AudioDevice
|
||||
{
|
||||
public:
|
||||
AudioDevice( const ch_cnt_t _channels, mixer * _mixer );
|
||||
AudioDevice( const ch_cnt_t _channels, Mixer* mixer );
|
||||
virtual ~AudioDevice();
|
||||
|
||||
inline void lock()
|
||||
@@ -152,7 +152,7 @@ protected:
|
||||
m_sampleRate = _new_sr;
|
||||
}
|
||||
|
||||
mixer * getMixer()
|
||||
Mixer* mixer()
|
||||
{
|
||||
return m_mixer;
|
||||
}
|
||||
@@ -167,7 +167,7 @@ protected:
|
||||
private:
|
||||
sample_rate_t m_sampleRate;
|
||||
ch_cnt_t m_channels;
|
||||
mixer * m_mixer;
|
||||
Mixer* m_mixer;
|
||||
bool m_inProcess;
|
||||
|
||||
QMutex m_devMutex;
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
class AudioDummy : public AudioDevice, public QThread
|
||||
{
|
||||
public:
|
||||
AudioDummy( bool & _success_ful, mixer * _mixer ) :
|
||||
AudioDevice( DEFAULT_CHANNELS, _mixer )
|
||||
AudioDummy( bool & _success_ful, Mixer* mixer ) :
|
||||
AudioDevice( DEFAULT_CHANNELS, mixer )
|
||||
{
|
||||
_success_ful = true;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
{
|
||||
timer.reset();
|
||||
const surroundSampleFrame * b =
|
||||
getMixer()->nextBuffer();
|
||||
mixer()->nextBuffer();
|
||||
if( !b )
|
||||
{
|
||||
break;
|
||||
@@ -104,9 +104,9 @@ private:
|
||||
delete[] b;
|
||||
|
||||
const Sint32 microseconds = static_cast<Sint32>(
|
||||
getMixer()->framesPerPeriod() *
|
||||
mixer()->framesPerPeriod() *
|
||||
1000000.0f /
|
||||
getMixer()->processingSampleRate() -
|
||||
mixer()->processingSampleRate() -
|
||||
timer.elapsed() );
|
||||
if( microseconds > 0 )
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate,
|
||||
const int _depth,
|
||||
mixer * _mixer );
|
||||
Mixer* mixer );
|
||||
virtual ~AudioFileDevice();
|
||||
|
||||
QString outputFile() const
|
||||
@@ -108,7 +108,7 @@ typedef AudioFileDevice * ( * AudioFileDeviceInstantiaton )
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate,
|
||||
const int _depth,
|
||||
mixer * _mixer );
|
||||
Mixer* mixer );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate,
|
||||
const int _depth,
|
||||
mixer * _mixer );
|
||||
Mixer* mixer );
|
||||
virtual ~AudioFileOgg();
|
||||
|
||||
static AudioFileDevice * getInst( const sample_rate_t _sample_rate,
|
||||
@@ -59,12 +59,12 @@ public:
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate,
|
||||
const int _depth,
|
||||
mixer * _mixer )
|
||||
Mixer* mixer )
|
||||
{
|
||||
return new AudioFileOgg( _sample_rate, _channels, _success_ful,
|
||||
_file, _use_vbr, _nom_bitrate,
|
||||
_min_bitrate, _max_bitrate,
|
||||
_depth, _mixer );
|
||||
_depth, mixer );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate,
|
||||
const int _depth,
|
||||
mixer * _mixer );
|
||||
Mixer* mixer );
|
||||
virtual ~AudioFileWave();
|
||||
|
||||
static AudioFileDevice * getInst( const sample_rate_t _sample_rate,
|
||||
@@ -56,13 +56,13 @@ public:
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate,
|
||||
const int _depth,
|
||||
mixer * _mixer )
|
||||
Mixer* mixer )
|
||||
{
|
||||
return new AudioFileWave( _sample_rate, _channels,
|
||||
_success_ful, _file, _use_vbr,
|
||||
_nom_bitrate, _min_bitrate,
|
||||
_max_bitrate, _depth,
|
||||
_mixer );
|
||||
mixer );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class AudioJack : public QObject, public AudioDevice
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AudioJack( bool & _success_ful, mixer * _mixer );
|
||||
AudioJack( bool & _success_ful, Mixer* mixer );
|
||||
virtual ~AudioJack();
|
||||
|
||||
inline static QString name()
|
||||
|
||||
@@ -39,7 +39,7 @@ class QLineEdit;
|
||||
class AudioOss : public AudioDevice, public QThread
|
||||
{
|
||||
public:
|
||||
AudioOss( bool & _success_ful, mixer * _mixer );
|
||||
AudioOss( bool & _success_ful, Mixer* mixer );
|
||||
virtual ~AudioOss();
|
||||
|
||||
inline static QString name()
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QMutexLocker>
|
||||
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
class EffectChain;
|
||||
|
||||
@@ -134,7 +134,7 @@ private:
|
||||
EffectChain * m_effects;
|
||||
|
||||
|
||||
friend class mixer;
|
||||
friend class Mixer;
|
||||
friend class MixerWorkerThread;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -63,7 +63,7 @@ class lcdSpinBox;
|
||||
class AudioPortAudio : public AudioDevice
|
||||
{
|
||||
public:
|
||||
AudioPortAudio( bool & _success_ful, mixer * _mixer );
|
||||
AudioPortAudio( bool & _success_ful, Mixer* mixer );
|
||||
virtual ~AudioPortAudio();
|
||||
|
||||
inline static QString name()
|
||||
|
||||
@@ -41,7 +41,7 @@ class QLineEdit;
|
||||
class AudioPulseAudio : public AudioDevice, public QThread
|
||||
{
|
||||
public:
|
||||
AudioPulseAudio( bool & _success_ful, mixer * _mixer );
|
||||
AudioPulseAudio( bool & _success_ful, Mixer* mixer );
|
||||
virtual ~AudioPulseAudio();
|
||||
|
||||
inline static QString name()
|
||||
|
||||
@@ -38,7 +38,7 @@ class AudioSampleRecorder : public AudioDevice
|
||||
{
|
||||
public:
|
||||
AudioSampleRecorder( const ch_cnt_t _channels, bool & _success_ful,
|
||||
mixer * _mixer );
|
||||
Mixer* mixer );
|
||||
virtual ~AudioSampleRecorder();
|
||||
|
||||
f_cnt_t framesRecorded() const;
|
||||
|
||||
@@ -40,7 +40,7 @@ class QLineEdit;
|
||||
class AudioSdl : public AudioDevice
|
||||
{
|
||||
public:
|
||||
AudioSdl( bool & _success_ful, mixer * _mixer );
|
||||
AudioSdl( bool & _success_ful, Mixer* mixer );
|
||||
virtual ~AudioSdl();
|
||||
|
||||
inline static QString name()
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#define _CONTROLLER_H
|
||||
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "Model.h"
|
||||
#include "JournallingObject.h"
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
inline bool isSampleExact() const
|
||||
{
|
||||
return m_sampleExact ||
|
||||
engine::getMixer()->currentQualitySettings().
|
||||
engine::mixer()->currentQualitySettings().
|
||||
sampleExactControllers;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "Plugin.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "AutomatableModel.h"
|
||||
#include "TempoSyncKnobModel.h"
|
||||
|
||||
@@ -102,10 +102,10 @@ public:
|
||||
inline f_cnt_t timeout() const
|
||||
{
|
||||
const float samples =
|
||||
engine::getMixer()->processingSampleRate() *
|
||||
engine::mixer()->processingSampleRate() *
|
||||
m_autoQuitModel.value() / 1000.0f;
|
||||
return 1 + ( static_cast<Uint32>( samples ) /
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
}
|
||||
|
||||
inline float wetLevel() const
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
{
|
||||
const float level = m_gateModel.value();
|
||||
return level*level * m_processors *
|
||||
engine::getMixer()->framesPerPeriod();
|
||||
engine::mixer()->framesPerPeriod();
|
||||
}
|
||||
|
||||
inline f_cnt_t bufferCount() const
|
||||
@@ -174,9 +174,9 @@ protected:
|
||||
sample_rate_t _dst_sr )
|
||||
{
|
||||
resample( 0, _src_buf,
|
||||
engine::getMixer()->processingSampleRate(),
|
||||
engine::mixer()->processingSampleRate(),
|
||||
_dst_buf, _dst_sr,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
}
|
||||
|
||||
inline void sampleBack( const sampleFrame * _src_buf,
|
||||
@@ -184,9 +184,9 @@ protected:
|
||||
sample_rate_t _src_sr )
|
||||
{
|
||||
resample( 1, _src_buf, _src_sr, _dst_buf,
|
||||
engine::getMixer()->processingSampleRate(),
|
||||
engine::getMixer()->framesPerPeriod() * _src_sr /
|
||||
engine::getMixer()->processingSampleRate() );
|
||||
engine::mixer()->processingSampleRate(),
|
||||
engine::mixer()->framesPerPeriod() * _src_sr /
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
void reinitSRC();
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "Model.h"
|
||||
#include "SerializingObject.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "AutomatableModel.h"
|
||||
|
||||
class Effect;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#define _FX_MIXER_H
|
||||
|
||||
#include "Model.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "EffectChain.h"
|
||||
#include "JournallingObject.h"
|
||||
|
||||
@@ -91,7 +91,7 @@ private:
|
||||
FxChannel * m_fxChannels[NumFxChannels+1]; // +1 = master
|
||||
|
||||
|
||||
friend class mixerWorkerThread;
|
||||
friend class MixerWorkerThread;
|
||||
friend class FxMixerView;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "Plugin.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
|
||||
// forward-declarations
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifndef _INSTRUMENT_SOUND_SHAPING_H
|
||||
#define _INSTRUMENT_SOUND_SHAPING_H
|
||||
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "ComboBoxModel.h"
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* mixer.h - audio-device-independent mixer for LMMS
|
||||
* Mixer.h - audio-device-independent mixer for LMMS
|
||||
*
|
||||
* Copyright (c) 2004-2009 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
|
||||
*
|
||||
@@ -75,7 +75,7 @@ const Octaves BaseOctave = DefaultOctave;
|
||||
class MixerWorkerThread;
|
||||
|
||||
|
||||
class EXPORT mixer : public QObject
|
||||
class EXPORT Mixer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -377,13 +377,13 @@ private:
|
||||
class fifoWriter : public QThread
|
||||
{
|
||||
public:
|
||||
fifoWriter( mixer * _mixer, fifo * _fifo );
|
||||
fifoWriter( Mixer * _mixer, fifo * _fifo );
|
||||
|
||||
void finish();
|
||||
|
||||
|
||||
private:
|
||||
mixer * m_mixer;
|
||||
Mixer * m_mixer;
|
||||
fifo * m_fifo;
|
||||
volatile bool m_writing;
|
||||
|
||||
@@ -392,8 +392,8 @@ private:
|
||||
} ;
|
||||
|
||||
|
||||
mixer();
|
||||
virtual ~mixer();
|
||||
Mixer();
|
||||
virtual ~Mixer();
|
||||
|
||||
void startProcessing( bool _needs_fifo = true );
|
||||
void stopProcessing();
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
} ;
|
||||
|
||||
|
||||
ProjectRenderer( const mixer::qualitySettings & _qs,
|
||||
ProjectRenderer( const Mixer::qualitySettings & _qs,
|
||||
const OutputSettings & _os,
|
||||
ExportFileFormats _file_format,
|
||||
const QString & _out_file );
|
||||
@@ -95,8 +95,8 @@ private:
|
||||
virtual void run();
|
||||
|
||||
AudioFileDevice * m_fileDev;
|
||||
mixer::qualitySettings m_qualitySettings;
|
||||
mixer::qualitySettings m_oldQualitySettings;
|
||||
Mixer::qualitySettings m_qualitySettings;
|
||||
Mixer::qualitySettings m_oldQualitySettings;
|
||||
|
||||
volatile int m_progress;
|
||||
volatile bool m_abort;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "templates.h"
|
||||
#include "lmms_constants.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* engine.h - engine-system of LMMS
|
||||
*
|
||||
* Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -40,7 +40,7 @@ class FxMixer;
|
||||
class FxMixerView;
|
||||
class ProjectJournal;
|
||||
class MainWindow;
|
||||
class mixer;
|
||||
class Mixer;
|
||||
class pianoRoll;
|
||||
class projectNotes;
|
||||
class song;
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
}
|
||||
|
||||
// core
|
||||
static mixer * getMixer()
|
||||
static Mixer *mixer()
|
||||
{
|
||||
return s_mixer;
|
||||
}
|
||||
@@ -177,7 +177,7 @@ private:
|
||||
static float s_framesPerTick;
|
||||
|
||||
// core
|
||||
static mixer * s_mixer;
|
||||
static Mixer *s_mixer;
|
||||
static FxMixer * s_fxMixer;
|
||||
static song * s_song;
|
||||
static bbTrackContainer * s_bbTrackContainer;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#define _NOTE_PLAY_HANDLE_H
|
||||
|
||||
#include "lmmsconfig.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "note.h"
|
||||
#include "engine.h"
|
||||
#include "track.h"
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
inline fpp_t framesLeftForCurrentPeriod() const
|
||||
{
|
||||
return (fpp_t) qMin<f_cnt_t>( framesLeft(),
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,6 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#ifndef _SAMPLE_PLAY_HANDLE_H
|
||||
#define _SAMPLE_PLAY_HANDLE_H
|
||||
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "sample_buffer.h"
|
||||
#include "AutomatableModel.h"
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <QtCore/QPair>
|
||||
#include <qobject.h>
|
||||
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "sample_buffer.h"
|
||||
|
||||
class bbTrack;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "AutomatableModel.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
|
||||
class QPixmap;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QPixmap>
|
||||
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
|
||||
class visualizationWidget : public QWidget
|
||||
|
||||
@@ -195,8 +195,8 @@ QString audioFileProcessor::nodeName( void ) const
|
||||
Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
|
||||
{
|
||||
const float freq_factor = BaseFreq / _n->frequency() *
|
||||
engine::getMixer()->processingSampleRate() /
|
||||
engine::getMixer()->baseSampleRate();
|
||||
engine::mixer()->processingSampleRate() /
|
||||
engine::mixer()->baseSampleRate();
|
||||
|
||||
return( static_cast<Uint32>( floorf( ( m_sampleBuffer.endFrame() -
|
||||
m_sampleBuffer.startFrame() ) *
|
||||
|
||||
@@ -46,7 +46,7 @@ bassBoosterControls::bassBoosterControls( bassBoosterEffect * _eff ) :
|
||||
connect( &m_ratioModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( changeRatio() ) );
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
|
||||
this, SLOT( changeFrequency() ) );
|
||||
changeFrequency();
|
||||
changeGain();
|
||||
@@ -58,7 +58,7 @@ bassBoosterControls::bassBoosterControls( bassBoosterEffect * _eff ) :
|
||||
|
||||
void bassBoosterControls::changeFrequency()
|
||||
{
|
||||
const sample_t fac = engine::getMixer()->processingSampleRate() /
|
||||
const sample_t fac = engine::mixer()->processingSampleRate() /
|
||||
44100.0f;
|
||||
m_effect->m_bbFX.leftFX().setFrequency( m_freqModel.value() * fac );
|
||||
m_effect->m_bbFX.rightFX().setFrequency( m_freqModel.value() * fac );
|
||||
|
||||
@@ -278,7 +278,7 @@ void bitInvader::playNote( notePlayHandle * _n,
|
||||
m_graph.length(),
|
||||
_n,
|
||||
m_interpolation.value(), factor,
|
||||
engine::getMixer()->processingSampleRate() );
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
|
||||
const fpp_t frames = _n->framesLeftForCurrentPeriod();
|
||||
|
||||
@@ -117,7 +117,7 @@ void kickerInstrument::playNote( notePlayHandle * _n,
|
||||
sampleFrame * _working_buffer )
|
||||
{
|
||||
const float decfr = m_decayModel.value() *
|
||||
engine::getMixer()->processingSampleRate() / 1000.0f;
|
||||
engine::mixer()->processingSampleRate() / 1000.0f;
|
||||
const f_cnt_t tfp = _n->totalFramesPlayed();
|
||||
|
||||
if ( tfp == 0 )
|
||||
@@ -136,9 +136,9 @@ void kickerInstrument::playNote( notePlayHandle * _n,
|
||||
/* const fpp_t frames = _n->released() ?
|
||||
tMax( tMin<f_cnt_t>( desiredReleaseFrames() -
|
||||
_n->releaseFramesDone(),
|
||||
engine::getMixer()->framesPerAudioBuffer() ), 0 )
|
||||
engine::mixer()->framesPerAudioBuffer() ), 0 )
|
||||
:
|
||||
engine::getMixer()->framesPerAudioBuffer();*/
|
||||
engine::mixer()->framesPerAudioBuffer();*/
|
||||
const fpp_t frames = _n->framesLeftForCurrentPeriod();
|
||||
const float f1 = m_startFreqModel.value() + tfp * fdiff / decfr;
|
||||
const float f2 = m_startFreqModel.value() + (frames+tfp-1)*fdiff/decfr;
|
||||
@@ -146,7 +146,7 @@ void kickerInstrument::playNote( notePlayHandle * _n,
|
||||
|
||||
SweepOsc * so = static_cast<SweepOsc *>( _n->m_pluginData );
|
||||
so->update( _working_buffer, frames, f1, f2,
|
||||
engine::getMixer()->processingSampleRate() );
|
||||
engine::mixer()->processingSampleRate() );
|
||||
|
||||
if( _n->released() )
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "AudioDevice.h"
|
||||
#include "engine.h"
|
||||
#include "ladspa_2_lmms.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ ladspaDescription::ladspaDescription( QWidget * _parent,
|
||||
{
|
||||
if( _type != VALID ||
|
||||
manager->getDescription( ( *it ).second )->inputChannels
|
||||
<= engine::getMixer()->audioDev()->channels() )
|
||||
<= engine::mixer()->audioDev()->channels() )
|
||||
{
|
||||
pluginNames.push_back( ( *it ).first );
|
||||
m_pluginKeys.push_back( ( *it ).second );
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "ladspa_2_lmms.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
|
||||
ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
|
||||
@@ -95,11 +95,11 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
|
||||
{
|
||||
if( min != NOHINT )
|
||||
{
|
||||
min *= engine::getMixer()->processingSampleRate();
|
||||
min *= engine::mixer()->processingSampleRate();
|
||||
}
|
||||
if( max != NOHINT )
|
||||
{
|
||||
max *= engine::getMixer()->processingSampleRate();
|
||||
max *= engine::mixer()->processingSampleRate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "ladspa_2_lmms.h"
|
||||
#include "LadspaControl.h"
|
||||
#include "LadspaSubPluginFeatures.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "EffectChain.h"
|
||||
#include "AutomationPattern.h"
|
||||
#include "ControllerConnection.h"
|
||||
@@ -87,7 +87,7 @@ LadspaEffect::LadspaEffect( Model * _parent,
|
||||
|
||||
pluginInstantiation();
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
|
||||
this, SLOT( changeSampleRate() ) );
|
||||
}
|
||||
|
||||
@@ -144,13 +144,13 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
int frames = _frames;
|
||||
sampleFrame * o_buf = NULL;
|
||||
|
||||
if( m_maxSampleRate < engine::getMixer()->processingSampleRate() )
|
||||
if( m_maxSampleRate < engine::mixer()->processingSampleRate() )
|
||||
{
|
||||
o_buf = _buf;
|
||||
_buf = new sampleFrame[_frames];
|
||||
sampleDown( o_buf, _buf, m_maxSampleRate );
|
||||
frames = _frames * m_maxSampleRate /
|
||||
engine::getMixer()->processingSampleRate();
|
||||
engine::mixer()->processingSampleRate();
|
||||
}
|
||||
|
||||
// Copy the LMMS audio buffer to the LADSPA input buffer and initialize
|
||||
@@ -289,7 +289,7 @@ void LadspaEffect::pluginInstantiation()
|
||||
ladspa2LMMS * manager = engine::getLADSPAManager();
|
||||
|
||||
// Calculate how many processing units are needed.
|
||||
const ch_cnt_t lmms_chnls = engine::getMixer()->audioDev()->channels();
|
||||
const ch_cnt_t lmms_chnls = engine::mixer()->audioDev()->channels();
|
||||
int effect_channels = manager->getDescription( m_key )->inputChannels;
|
||||
setProcessorCount( lmms_chnls / effect_channels );
|
||||
|
||||
@@ -316,7 +316,7 @@ void LadspaEffect::pluginInstantiation()
|
||||
// during cleanup. It was easier to troubleshoot with the
|
||||
// memory management all taking place in one file.
|
||||
p->buffer =
|
||||
new LADSPA_Data[engine::getMixer()->framesPerPeriod()];
|
||||
new LADSPA_Data[engine::mixer()->framesPerPeriod()];
|
||||
|
||||
if( p->name.toUpper().contains( "IN" ) &&
|
||||
manager->isPortInput( m_key, port ) )
|
||||
@@ -557,7 +557,7 @@ sample_rate_t LadspaEffect::maxSamplerate( const QString & _name )
|
||||
{
|
||||
return( __buggy_plugins[_name] );
|
||||
}
|
||||
return( engine::getMixer()->processingSampleRate() );
|
||||
return( engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "engine.h"
|
||||
#include "ladspa_2_lmms.h"
|
||||
#include "LadspaBase.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
|
||||
LadspaSubPluginFeatures::LadspaSubPluginFeatures( Plugin::PluginTypes _type ) :
|
||||
@@ -142,7 +142,7 @@ void LadspaSubPluginFeatures::listSubPluginKeys(
|
||||
it != plugins.end(); ++it )
|
||||
{
|
||||
if( lm->getDescription( ( *it ).second )->inputChannels <=
|
||||
engine::getMixer()->audioDev()->channels() )
|
||||
engine::mixer()->audioDev()->channels() )
|
||||
{
|
||||
_kl.push_back( ladspaKeyToSubPluginKey( _desc, ( *it ).first, ( *it ).second ) );
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
//
|
||||
|
||||
|
||||
//#define engine::getMixer()->processingSampleRate() 44100.0f
|
||||
//#define engine::mixer()->processingSampleRate() 44100.0f
|
||||
|
||||
|
||||
extern "C"
|
||||
@@ -109,8 +109,8 @@ void lb302Filter::recalc()
|
||||
{
|
||||
vcf_e1 = exp(6.109 + 1.5876*(fs->envmod) + 2.1553*(fs->cutoff) - 1.2*(1.0-(fs->reso)));
|
||||
vcf_e0 = exp(5.613 - 0.8*(fs->envmod) + 2.1553*(fs->cutoff) - 0.7696*(1.0-(fs->reso)));
|
||||
vcf_e0*=M_PI/engine::getMixer()->processingSampleRate();
|
||||
vcf_e1*=M_PI/engine::getMixer()->processingSampleRate();
|
||||
vcf_e0*=M_PI/engine::mixer()->processingSampleRate();
|
||||
vcf_e1*=M_PI/engine::mixer()->processingSampleRate();
|
||||
vcf_e1 -= vcf_e0;
|
||||
|
||||
vcf_rescoeff = exp(-1.20 + 3.455*(fs->reso));
|
||||
@@ -226,14 +226,14 @@ void lb302Filter3Pole::envRecalc()
|
||||
w = vcf_e0 + vcf_c0;
|
||||
k = (fs->cutoff > 0.975)?0.975:fs->cutoff;
|
||||
kfco = 50.f + (k)*((2300.f-1600.f*(fs->envmod))+(w) *
|
||||
(700.f+1500.f*(k)+(1500.f+(k)*(engine::getMixer()->processingSampleRate()/2.f-6000.f)) *
|
||||
(700.f+1500.f*(k)+(1500.f+(k)*(engine::mixer()->processingSampleRate()/2.f-6000.f)) *
|
||||
(fs->envmod)) );
|
||||
//+iacc*(.3+.7*kfco*kenvmod)*kaccent*kaccurve*2000
|
||||
|
||||
|
||||
#ifdef LB_24_IGNORE_ENVELOPE
|
||||
// kfcn = fs->cutoff;
|
||||
kfcn = 2.0 * kfco / engine::getMixer()->processingSampleRate();
|
||||
kfcn = 2.0 * kfco / engine::mixer()->processingSampleRate();
|
||||
#else
|
||||
kfcn = w;
|
||||
#endif
|
||||
@@ -284,7 +284,7 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) :
|
||||
|
||||
{
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged( ) ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged( ) ),
|
||||
this, SLOT ( filterChanged( ) ) );
|
||||
|
||||
connect( &vcf_cut_knob, SIGNAL( dataChanged( ) ),
|
||||
@@ -354,7 +354,7 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) :
|
||||
delete_freq = -1;
|
||||
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
|
||||
engine::getMixer()->addPlayHandle( iph );
|
||||
engine::mixer()->addPlayHandle( iph );
|
||||
|
||||
filterChanged();
|
||||
}
|
||||
@@ -412,7 +412,7 @@ void lb302Synth::filterChanged()
|
||||
|
||||
float d = 0.2 + (2.3*vcf_dec_knob.value());
|
||||
|
||||
d *= engine::getMixer()->processingSampleRate(); // d *= smpl rate
|
||||
d *= engine::mixer()->processingSampleRate(); // d *= smpl rate
|
||||
fs.envdecay = pow(0.1, 1.0/d * ENVINC); // decay is 0.1 to the 1/d * ENVINC
|
||||
// vcf_envdecay is now adjusted for both
|
||||
// sampling rate and ENVINC
|
||||
@@ -448,7 +448,7 @@ void lb302Synth::recalcFilter()
|
||||
// THIS IS OLD 3pole/24dB code, I may reintegrate it. Don't need it
|
||||
// right now. Should be toggled by LB_24_RES_TRICK at the moment.
|
||||
|
||||
/*kfcn = 2.0 * (((vcf_cutoff*3000))) / engine::getMixer()->processingSampleRate();
|
||||
/*kfcn = 2.0 * (((vcf_cutoff*3000))) / engine::mixer()->processingSampleRate();
|
||||
kp = ((-2.7528*kfcn + 3.0429)*kfcn + 1.718)*kfcn - 0.9984;
|
||||
kp1 = kp+1.0;
|
||||
kp1h = 0.5*kp1;
|
||||
@@ -463,7 +463,7 @@ inline int MIN(int a, int b) {
|
||||
}
|
||||
|
||||
inline float GET_INC(float freq) {
|
||||
return freq/engine::getMixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
return freq/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
}
|
||||
|
||||
int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
|
||||
@@ -483,7 +483,7 @@ int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
|
||||
lb302Note note;
|
||||
note.vco_inc = GET_INC( true_freq );
|
||||
//printf("GET_INC %f %f %d\n", note.vco_inc, new_freq, vca_mode );
|
||||
///**vco_detune*//engine::getMixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
///**vco_detune*//engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
//printf("VCO_INC = %f\n", note.vco_inc);
|
||||
note.dead = deadToggle.value();
|
||||
initNote(¬e);
|
||||
@@ -634,7 +634,7 @@ int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
|
||||
// Handle Envelope
|
||||
if(vca_mode==0) {
|
||||
vca_a+=(vca_a0-vca_a)*vca_attack;
|
||||
if(sample_cnt>=0.5*engine::getMixer()->processingSampleRate())
|
||||
if(sample_cnt>=0.5*engine::mixer()->processingSampleRate())
|
||||
vca_mode = 2;
|
||||
}
|
||||
else if(vca_mode == 1) {
|
||||
@@ -712,7 +712,7 @@ void lb302Synth::initNote( lb302Note *n)
|
||||
|
||||
void lb302Synth::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
{
|
||||
//fpp_t framesPerPeriod = engine::getMixer()->framesPerPeriod();
|
||||
//fpp_t framesPerPeriod = engine::mixer()->framesPerPeriod();
|
||||
|
||||
if( _n->isArpeggioBaseNote() )
|
||||
{
|
||||
@@ -736,7 +736,7 @@ void lb302Synth::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
if(deadToggle.value() == 0 && decay_note) {
|
||||
|
||||
/* lb302Note note;
|
||||
note.vco_inc = _n->frequency()*vco_detune/engine::getMixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
note.vco_inc = _n->frequency()*vco_detune/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
note.dead = deadToggle.value();
|
||||
initNote(¬e);
|
||||
vca_mode=0;
|
||||
@@ -772,7 +772,7 @@ void lb302Synth::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
void lb302Synth::play( sampleFrame * _working_buffer )
|
||||
{
|
||||
//printf(".");
|
||||
const fpp_t frames = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t frames = engine::mixer()->framesPerPeriod();
|
||||
|
||||
process( _working_buffer, frames);
|
||||
instrumentTrack()->processAudioBuffer( _working_buffer, frames,
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "InstrumentView.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "knob.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
class lb302SynthView;
|
||||
class notePlayHandle;
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
//
|
||||
|
||||
|
||||
//#define engine::getMixer()->processingSampleRate() 44100.0f
|
||||
//#define engine::mixer()->processingSampleRate() 44100.0f
|
||||
|
||||
|
||||
extern "C"
|
||||
@@ -108,8 +108,8 @@ void lb303Filter::recalc()
|
||||
{
|
||||
vcf_e1 = exp(6.109 + 1.5876*(fs->envmod) + 2.1553*(fs->cutoff) - 1.2*(1.0-(fs->reso)));
|
||||
vcf_e0 = exp(5.613 - 0.8*(fs->envmod) + 2.1553*(fs->cutoff) - 0.7696*(1.0-(fs->reso)));
|
||||
vcf_e0*=M_PI/engine::getMixer()->processingSampleRate();
|
||||
vcf_e1*=M_PI/engine::getMixer()->processingSampleRate();
|
||||
vcf_e0*=M_PI/engine::mixer()->processingSampleRate();
|
||||
vcf_e1*=M_PI/engine::mixer()->processingSampleRate();
|
||||
vcf_e1 -= vcf_e0;
|
||||
|
||||
vcf_rescoeff = exp(-1.20 + 3.455*(fs->reso));
|
||||
@@ -225,14 +225,14 @@ void lb303Filter3Pole::envRecalc()
|
||||
w = vcf_e0 + vcf_c0;
|
||||
k = (fs->cutoff > 0.975)?0.975:fs->cutoff;
|
||||
kfco = 50.f + (k)*((2300.f-1600.f*(fs->envmod))+(w) *
|
||||
(700.f+1500.f*(k)+(1500.f+(k)*(engine::getMixer()->processingSampleRate()/2.f-6000.f)) *
|
||||
(700.f+1500.f*(k)+(1500.f+(k)*(engine::mixer()->processingSampleRate()/2.f-6000.f)) *
|
||||
(fs->envmod)) );
|
||||
//+iacc*(.3+.7*kfco*kenvmod)*kaccent*kaccurve*2000
|
||||
|
||||
|
||||
#ifdef LB_24_IGNORE_ENVELOPE
|
||||
// kfcn = fs->cutoff;
|
||||
kfcn = 2.0 * kfco / engine::getMixer()->processingSampleRate();
|
||||
kfcn = 2.0 * kfco / engine::mixer()->processingSampleRate();
|
||||
#else
|
||||
kfcn = w;
|
||||
#endif
|
||||
@@ -283,7 +283,7 @@ lb303Synth::lb303Synth( InstrumentTrack * _InstrumentTrack ) :
|
||||
|
||||
{
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged( ) ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged( ) ),
|
||||
this, SLOT ( filterChanged( ) ) );
|
||||
|
||||
connect( &vcf_cut_knob, SIGNAL( dataChanged( ) ),
|
||||
@@ -353,7 +353,7 @@ lb303Synth::lb303Synth( InstrumentTrack * _InstrumentTrack ) :
|
||||
delete_freq = -1;
|
||||
|
||||
instrumentPlayHandle * iph = new instrumentPlayHandle( this );
|
||||
engine::getMixer()->addPlayHandle( iph );
|
||||
engine::mixer()->addPlayHandle( iph );
|
||||
|
||||
filterChanged();
|
||||
}
|
||||
@@ -412,7 +412,7 @@ void lb303Synth::filterChanged()
|
||||
|
||||
float d = 0.2 + (2.3*vcf_dec_knob.value());
|
||||
|
||||
d *= engine::getMixer()->processingSampleRate(); // d *= smpl rate
|
||||
d *= engine::mixer()->processingSampleRate(); // d *= smpl rate
|
||||
fs.envdecay = pow(0.1, 1.0/d * ENVINC); // decay is 0.1 to the 1/d * ENVINC
|
||||
// vcf_envdecay is now adjusted for both
|
||||
// sampling rate and ENVINC
|
||||
@@ -452,7 +452,7 @@ inline int MIN(int a, int b) {
|
||||
}
|
||||
|
||||
inline float GET_INC(float freq) {
|
||||
return freq/engine::getMixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
return freq/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
}
|
||||
|
||||
int lb303Synth::process(sampleFrame *outbuf, const Uint32 size)
|
||||
@@ -590,7 +590,7 @@ int lb303Synth::process(sampleFrame *outbuf, const Uint32 size)
|
||||
// Handle Envelope
|
||||
if(vca_mode==0) {
|
||||
vca_a+=(vca_a0-vca_a)*vca_attack;
|
||||
if(sample_cnt>=0.5*engine::getMixer()->processingSampleRate())
|
||||
if(sample_cnt>=0.5*engine::mixer()->processingSampleRate())
|
||||
vca_mode = 2;
|
||||
}
|
||||
else if(vca_mode == 1) {
|
||||
@@ -710,7 +710,7 @@ void lb303Synth::playNote( notePlayHandle * _n,
|
||||
void lb303Synth::play( sampleFrame * _working_buffer )
|
||||
{
|
||||
//printf(".");
|
||||
const fpp_t frames = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t frames = engine::mixer()->framesPerPeriod();
|
||||
|
||||
process( _working_buffer, frames);
|
||||
instrumentTrack()->processAudioBuffer( _working_buffer, frames,
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "InstrumentView.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "knob.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
class lb303SynthView;
|
||||
class notePlayHandle;
|
||||
|
||||
@@ -141,13 +141,13 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
|
||||
|
||||
// Connect the plugin to the mixer...
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
|
||||
engine::getMixer()->addPlayHandle( iph );
|
||||
engine::mixer()->addPlayHandle( iph );
|
||||
|
||||
// Create an emulator - samplerate, 16 bit, mono
|
||||
// CTemuopl is the better one, CKemuopl kinda sucks (some sounds silent, pitch goes flat after a while)
|
||||
emulatorMutex.lock();
|
||||
// theEmulator = new CKemuopl(engine::getMixer()->processingSampleRate(), true, false);
|
||||
theEmulator = new CTemuopl(engine::getMixer()->processingSampleRate(), true, false);
|
||||
// theEmulator = new CKemuopl(engine::mixer()->processingSampleRate(), true, false);
|
||||
theEmulator = new CTemuopl(engine::mixer()->processingSampleRate(), true, false);
|
||||
theEmulator->init();
|
||||
// Enable waveform selection
|
||||
theEmulator->write(0x01,0x20);
|
||||
@@ -158,7 +158,7 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
|
||||
updatePatch();
|
||||
|
||||
// Can the buffer size change suddenly? I bet that would break lots of stuff
|
||||
frameCount = engine::getMixer()->framesPerPeriod();
|
||||
frameCount = engine::mixer()->framesPerPeriod();
|
||||
renderbuffer = new short[frameCount];
|
||||
|
||||
// Some kind of sane default
|
||||
@@ -167,7 +167,7 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
|
||||
for(int i=1; i<9; ++i) {
|
||||
voiceNote[i] = OPL2_VOICE_FREE;
|
||||
}
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
|
||||
this, SLOT( reloadEmulator() ) );
|
||||
// Connect knobs
|
||||
// This one's for testing...
|
||||
@@ -216,7 +216,7 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) :
|
||||
// Samplerate changes when choosing oversampling, so this is more or less mandatory
|
||||
void opl2instrument::reloadEmulator() {
|
||||
emulatorMutex.lock();
|
||||
theEmulator = new CTemuopl(engine::getMixer()->processingSampleRate(), true, false);
|
||||
theEmulator = new CTemuopl(engine::mixer()->processingSampleRate(), true, false);
|
||||
theEmulator->init();
|
||||
theEmulator->write(0x01,0x20);
|
||||
emulatorMutex.unlock();
|
||||
|
||||
@@ -116,7 +116,7 @@ organicInstrument::organicInstrument( InstrumentTrack * _instrument_track ) :
|
||||
}
|
||||
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
|
||||
this, SLOT( updateAllDetuning() ) );
|
||||
|
||||
}
|
||||
@@ -551,10 +551,10 @@ void OscillatorObject::updateDetuning()
|
||||
{
|
||||
m_detuningLeft = powf( 2.0f, m_harmonic
|
||||
+ (float)m_detuneModel.value() / 100.0f ) /
|
||||
engine::getMixer()->processingSampleRate();
|
||||
engine::mixer()->processingSampleRate();
|
||||
m_detuningRight = powf( 2.0f, m_harmonic
|
||||
- (float)m_detuneModel.value() / 100.0f ) /
|
||||
engine::getMixer()->processingSampleRate();
|
||||
engine::mixer()->processingSampleRate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ QString papuInstrument::nodeName() const
|
||||
|
||||
/*f_cnt_t papuInstrument::desiredReleaseFrames() const
|
||||
{
|
||||
const float samplerate = engine::getMixer()->processingSampleRate();
|
||||
const float samplerate = engine::mixer()->processingSampleRate();
|
||||
int maxrel = 0;
|
||||
for( int i = 0 ; i < 3 ; ++i )
|
||||
{
|
||||
@@ -235,7 +235,7 @@ void papuInstrument::playNote( notePlayHandle * _n,
|
||||
sampleFrame * _working_buffer )
|
||||
{
|
||||
const f_cnt_t tfp = _n->totalFramesPlayed();
|
||||
const int samplerate = engine::getMixer()->processingSampleRate();
|
||||
const int samplerate = engine::mixer()->processingSampleRate();
|
||||
const fpp_t frames = _n->framesLeftForCurrentPeriod();
|
||||
|
||||
int data = 0;
|
||||
|
||||
@@ -119,14 +119,14 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
|
||||
m_settings = new_fluid_settings();
|
||||
|
||||
fluid_settings_setint( m_settings, (char *) "audio.period-size",
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
|
||||
// This is just our starting instance of synth. It is recreated
|
||||
// everytime we load a new soundfont.
|
||||
m_synth = new_fluid_synth( m_settings );
|
||||
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
|
||||
engine::getMixer()->addPlayHandle( iph );
|
||||
engine::mixer()->addPlayHandle( iph );
|
||||
|
||||
loadFile( configManager::inst()->defaultSoundfont() );
|
||||
|
||||
@@ -144,7 +144,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
|
||||
connect( &m_patchNum, SIGNAL( dataChanged() ),
|
||||
this, SLOT( updatePatch() ) );
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
|
||||
this, SLOT( updateSampleRate() ) );
|
||||
|
||||
// Gain
|
||||
@@ -189,7 +189,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
|
||||
|
||||
sf2Instrument::~sf2Instrument()
|
||||
{
|
||||
engine::getMixer()->removePlayHandles( instrumentTrack() );
|
||||
engine::mixer()->removePlayHandles( instrumentTrack() );
|
||||
freeFont();
|
||||
delete_fluid_synth( m_synth );
|
||||
delete_fluid_settings( m_settings );
|
||||
@@ -501,7 +501,7 @@ void sf2Instrument::updateSampleRate()
|
||||
|
||||
// Set & get, returns the true sample rate
|
||||
fluid_settings_setnum( m_settings, (char *) "synth.sample-rate",
|
||||
engine::getMixer()->processingSampleRate() );
|
||||
engine::mixer()->processingSampleRate() );
|
||||
fluid_settings_getnum( m_settings, (char *) "synth.sample-rate",
|
||||
&tempRate );
|
||||
m_internalSampleRate = static_cast<int>( tempRate );
|
||||
@@ -532,8 +532,8 @@ void sf2Instrument::updateSampleRate()
|
||||
}
|
||||
|
||||
m_synthMutex.lock();
|
||||
if( engine::getMixer()->currentQualitySettings().interpolation >=
|
||||
mixer::qualitySettings::Interpolation_SincFastest )
|
||||
if( engine::mixer()->currentQualitySettings().interpolation >=
|
||||
Mixer::qualitySettings::Interpolation_SincFastest )
|
||||
{
|
||||
fluid_synth_set_interp_method( m_synth, -1,
|
||||
FLUID_INTERP_7THORDER );
|
||||
@@ -544,7 +544,7 @@ void sf2Instrument::updateSampleRate()
|
||||
FLUID_INTERP_DEFAULT );
|
||||
}
|
||||
m_synthMutex.unlock();
|
||||
if( m_internalSampleRate < engine::getMixer()->processingSampleRate() )
|
||||
if( m_internalSampleRate < engine::mixer()->processingSampleRate() )
|
||||
{
|
||||
m_synthMutex.lock();
|
||||
if( m_srcState != NULL )
|
||||
@@ -552,7 +552,7 @@ void sf2Instrument::updateSampleRate()
|
||||
src_delete( m_srcState );
|
||||
}
|
||||
int error;
|
||||
m_srcState = src_new( engine::getMixer()->
|
||||
m_srcState = src_new( engine::mixer()->
|
||||
currentQualitySettings().libsrcInterpolation(),
|
||||
DEFAULT_CHANNELS, &error );
|
||||
if( m_srcState == NULL || error )
|
||||
@@ -677,7 +677,7 @@ void sf2Instrument::playNote( notePlayHandle * _n, sampleFrame * )
|
||||
// frame-length of 1 while rendering?
|
||||
void sf2Instrument::play( sampleFrame * _working_buffer )
|
||||
{
|
||||
const fpp_t frames = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t frames = engine::mixer()->framesPerPeriod();
|
||||
|
||||
m_synthMutex.lock();
|
||||
if( m_lastMidiPitch != instrumentTrack()->midiPitch() )
|
||||
@@ -686,11 +686,11 @@ void sf2Instrument::play( sampleFrame * _working_buffer )
|
||||
fluid_synth_pitch_bend( m_synth, m_channel, m_lastMidiPitch );
|
||||
}
|
||||
|
||||
if( m_internalSampleRate < engine::getMixer()->processingSampleRate() &&
|
||||
if( m_internalSampleRate < engine::mixer()->processingSampleRate() &&
|
||||
m_srcState != NULL )
|
||||
{
|
||||
const fpp_t f = frames * m_internalSampleRate /
|
||||
engine::getMixer()->processingSampleRate();
|
||||
engine::mixer()->processingSampleRate();
|
||||
#ifdef __GNUC__
|
||||
sampleFrame tmp[f];
|
||||
#else
|
||||
|
||||
@@ -230,7 +230,7 @@ QString sidInstrument::nodeName() const
|
||||
|
||||
f_cnt_t sidInstrument::desiredReleaseFrames() const
|
||||
{
|
||||
const float samplerate = engine::getMixer()->processingSampleRate();
|
||||
const float samplerate = engine::mixer()->processingSampleRate();
|
||||
int maxrel = 0;
|
||||
for( int i = 0 ; i < 3 ; ++i )
|
||||
{
|
||||
@@ -305,7 +305,7 @@ void sidInstrument::playNote( notePlayHandle * _n,
|
||||
const f_cnt_t tfp = _n->totalFramesPlayed();
|
||||
|
||||
const int clockrate = C64_PAL_CYCLES_PER_SEC;
|
||||
const int samplerate = engine::getMixer()->processingSampleRate();
|
||||
const int samplerate = engine::mixer()->processingSampleRate();
|
||||
|
||||
if ( tfp == 0 )
|
||||
{
|
||||
|
||||
@@ -132,7 +132,7 @@ bool spectrumAnalyzer::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
// hanming( m_buffer, FFT_BUFFER_SIZE, HAMMING );
|
||||
|
||||
const sample_rate_t sr = engine::getMixer()->processingSampleRate();
|
||||
const sample_rate_t sr = engine::mixer()->processingSampleRate();
|
||||
const int LOWEST_FREQ = 0;
|
||||
const int HIGHEST_FREQ = sr / 2;
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
|
||||
m_vibratoFreqModel.value(),
|
||||
p,
|
||||
(Uint8) m_spreadModel.value(),
|
||||
engine::getMixer()->processingSampleRate() );
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
else if( p == 9 )
|
||||
{
|
||||
@@ -246,7 +246,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
|
||||
m_lfoSpeedModel.value(),
|
||||
m_adsrModel.value(),
|
||||
(Uint8) m_spreadModel.value(),
|
||||
engine::getMixer()->processingSampleRate() );
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -259,7 +259,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
|
||||
m_strikeModel.value() * 128.0,
|
||||
m_velocityModel.value(),
|
||||
(Uint8) m_spreadModel.value(),
|
||||
engine::getMixer()->processingSampleRate() );
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
m.unlock();
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ void OscillatorObject::updateDetuningLeft()
|
||||
{
|
||||
m_detuningLeft = powf( 2.0f, ( (float)m_coarseModel.value() * 100.0f
|
||||
+ (float)m_fineLeftModel.value() ) / 1200.0f )
|
||||
/ engine::getMixer()->processingSampleRate();
|
||||
/ engine::mixer()->processingSampleRate();
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ void OscillatorObject::updateDetuningRight()
|
||||
{
|
||||
m_detuningRight = powf( 2.0f, ( (float)m_coarseModel.value() * 100.0f
|
||||
+ (float)m_fineRightModel.value() ) / 1200.0f )
|
||||
/ engine::getMixer()->processingSampleRate();
|
||||
/ engine::mixer()->processingSampleRate();
|
||||
}
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ TripleOscillator::TripleOscillator( InstrumentTrack * _instrument_track ) :
|
||||
|
||||
}
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
|
||||
this, SLOT( updateAllDetuning() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ vestigeInstrument::vestigeInstrument( InstrumentTrack * _instrument_track ) :
|
||||
{
|
||||
// now we need a play-handle which cares for calling play()
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
|
||||
engine::getMixer()->addPlayHandle( iph );
|
||||
engine::mixer()->addPlayHandle( iph );
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ vestigeInstrument::~vestigeInstrument()
|
||||
knobFModel = NULL;
|
||||
}
|
||||
|
||||
engine::getMixer()->removePlayHandles( instrumentTrack() );
|
||||
engine::mixer()->removePlayHandles( instrumentTrack() );
|
||||
closePlugin();
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ void vestigeInstrument::play( sampleFrame * _buf )
|
||||
|
||||
m_plugin->process( NULL, _buf );
|
||||
|
||||
const fpp_t frames = engine::getMixer()->framesPerPeriod();
|
||||
const fpp_t frames = engine::mixer()->framesPerPeriod();
|
||||
|
||||
instrumentTrack()->processAudioBuffer( _buf, frames, NULL );
|
||||
|
||||
@@ -652,7 +652,7 @@ void VestigeInstrumentView::openPlugin()
|
||||
{
|
||||
return;
|
||||
}
|
||||
engine::getMixer()->lock();
|
||||
engine::mixer()->lock();
|
||||
|
||||
if (m_vi->p_subWindow != NULL) {
|
||||
delete m_vi->p_subWindow;
|
||||
@@ -660,7 +660,7 @@ void VestigeInstrumentView::openPlugin()
|
||||
}
|
||||
|
||||
m_vi->loadFile( ofd.selectedFiles()[0] );
|
||||
engine::getMixer()->unlock();
|
||||
engine::mixer()->unlock();
|
||||
if( m_vi->m_plugin && m_vi->m_plugin->pluginWidget() )
|
||||
{
|
||||
m_vi->m_plugin->pluginWidget()->setWindowIcon(
|
||||
|
||||
@@ -277,7 +277,7 @@ void vibed::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
|
||||
{
|
||||
_n->m_pluginData = new stringContainer( _n->frequency(),
|
||||
engine::getMixer()->processingSampleRate(),
|
||||
engine::mixer()->processingSampleRate(),
|
||||
__sampleLength );
|
||||
|
||||
for( Uint8 i = 0; i < 9; ++i )
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "vibrating_string.h"
|
||||
#include "templates.h"
|
||||
#include "interpolation.h"
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ vibratingString::vibratingString( float _pitch,
|
||||
float _detune,
|
||||
bool _state ) :
|
||||
m_oversample( 2 * _oversample / (int)( _sample_rate /
|
||||
engine::getMixer()->baseSampleRate() ) ),
|
||||
engine::mixer()->baseSampleRate() ) ),
|
||||
m_randomize( _randomize ),
|
||||
m_stringLoss( 1.0f - _string_loss ),
|
||||
m_state( 0.1f )
|
||||
|
||||
@@ -110,7 +110,7 @@ VstPlugin::VstPlugin( const QString & _plugin ) :
|
||||
|
||||
connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ),
|
||||
this, SLOT( setTempo( bpm_t ) ) );
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
|
||||
this, SLOT( updateSampleRate() ) );
|
||||
|
||||
// update once per second
|
||||
@@ -372,7 +372,7 @@ void VstPlugin::updateSampleRate()
|
||||
{
|
||||
lock();
|
||||
sendMessage( message( IdSampleRateInformation ).
|
||||
addInt( engine::getMixer()->processingSampleRate() ) );
|
||||
addInt( engine::mixer()->processingSampleRate() ) );
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "mixer.h"
|
||||
#include "Mixer.h"
|
||||
#include "JournallingObject.h"
|
||||
#include "communication.h"
|
||||
|
||||
|
||||
@@ -129,9 +129,9 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument(
|
||||
|
||||
// now we need a play-handle which cares for calling play()
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
|
||||
engine::getMixer()->addPlayHandle( iph );
|
||||
engine::mixer()->addPlayHandle( iph );
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
|
||||
this, SLOT( reloadPlugin() ) );
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument(
|
||||
|
||||
ZynAddSubFxInstrument::~ZynAddSubFxInstrument()
|
||||
{
|
||||
engine::getMixer()->removePlayHandles( instrumentTrack() );
|
||||
engine::mixer()->removePlayHandles( instrumentTrack() );
|
||||
|
||||
m_pluginMutex.lock();
|
||||
delete m_remotePlugin;
|
||||
@@ -334,7 +334,7 @@ void ZynAddSubFxInstrument::play( sampleFrame * _buf )
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
instrumentTrack()->processAudioBuffer( _buf,
|
||||
engine::getMixer()->framesPerPeriod(), NULL );
|
||||
engine::mixer()->framesPerPeriod(), NULL );
|
||||
}
|
||||
|
||||
|
||||
@@ -440,8 +440,8 @@ void ZynAddSubFxInstrument::initPlugin()
|
||||
else
|
||||
{
|
||||
m_plugin = new LocalZynAddSubFx;
|
||||
m_plugin->setSampleRate( engine::getMixer()->processingSampleRate() );
|
||||
m_plugin->setBufferSize( engine::getMixer()->framesPerPeriod() );
|
||||
m_plugin->setSampleRate( engine::mixer()->processingSampleRate() );
|
||||
m_plugin->setBufferSize( engine::mixer()->framesPerPeriod() );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
@@ -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 ),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user