From 0ff1f91c1b0b05393b12572ebc2c03d4c4a2a48a Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 8 Jan 2014 22:35:14 +0100 Subject: [PATCH] Mixer: renamed class and file name The mixer class is now named "Mixer" and accessible via engine::mixer(). --- include/AudioAlsa.h | 2 +- include/AudioDevice.h | 8 +- include/AudioDummy.h | 10 +-- include/AudioFileDevice.h | 4 +- include/AudioFileOgg.h | 6 +- include/AudioFileWave.h | 6 +- include/AudioJack.h | 2 +- include/AudioOss.h | 2 +- include/AudioPort.h | 4 +- include/AudioPortAudio.h | 2 +- include/AudioPulseAudio.h | 2 +- include/AudioSampleRecorder.h | 2 +- include/AudioSdl.h | 2 +- include/Controller.h | 4 +- include/Effect.h | 18 ++-- include/EffectChain.h | 2 +- include/FxMixer.h | 4 +- include/Instrument.h | 2 +- include/InstrumentSoundShaping.h | 2 +- include/{mixer.h => Mixer.h} | 14 +-- include/ProjectRenderer.h | 6 +- include/basic_filters.h | 2 +- include/engine.h | 8 +- include/note_play_handle.h | 4 +- include/pch.h | 2 +- include/sample_play_handle.h | 2 +- include/sample_record_handle.h | 2 +- include/surround_area.h | 2 +- include/visualization_widget.h | 2 +- .../audio_file_processor.cpp | 4 +- plugins/bass_booster/bassbooster_controls.cpp | 4 +- plugins/bit_invader/bit_invader.cpp | 2 +- plugins/kicker/kicker.cpp | 8 +- plugins/ladspa_browser/ladspa_description.cpp | 4 +- plugins/ladspa_browser/ladspa_port_dialog.cpp | 6 +- plugins/ladspa_effect/LadspaEffect.cpp | 14 +-- .../ladspa_effect/LadspaSubPluginFeatures.cpp | 4 +- plugins/lb302/lb302.cpp | 30 +++---- plugins/lb302/lb302.h | 2 +- plugins/lb303/lb303.cpp | 22 ++--- plugins/lb303/lb303.h | 2 +- plugins/opl2/opl2instrument.cpp | 12 +-- plugins/organic/organic.cpp | 6 +- plugins/papu/papu_instrument.cpp | 4 +- plugins/sf2_player/sf2_player.cpp | 24 +++--- plugins/sid/sid_instrument.cpp | 4 +- .../spectrum_analyzer/spectrum_analyzer.cpp | 2 +- plugins/stk/mallets/mallets.cpp | 6 +- .../triple_oscillator/TripleOscillator.cpp | 6 +- plugins/vestige/vestige.cpp | 10 +-- plugins/vibed/vibed.cpp | 2 +- plugins/vibed/vibrating_string.cpp | 4 +- plugins/vst_base/VstPlugin.cpp | 4 +- plugins/vst_base/VstPlugin.h | 2 +- plugins/zynaddsubfx/ZynAddSubFx.cpp | 12 +-- src/core/Controller.cpp | 6 +- src/core/ControllerConnection.cpp | 2 +- src/core/Effect.cpp | 4 +- src/core/EffectChain.cpp | 8 +- src/core/EnvelopeAndLfoParameters.cpp | 18 ++-- src/core/FxMixer.cpp | 34 ++++---- src/core/Instrument.cpp | 2 +- src/core/InstrumentFunctions.cpp | 8 +- src/core/InstrumentSoundShaping.cpp | 6 +- src/core/LfoController.cpp | 6 +- src/core/{mixer.cpp => Mixer.cpp} | 86 +++++++++---------- src/core/Oscillator.cpp | 8 +- src/core/PeakController.cpp | 2 +- src/core/Plugin.cpp | 2 +- src/core/ProjectRenderer.cpp | 14 +-- src/core/RemotePlugin.cpp | 16 ++-- src/core/audio/AudioAlsa.cpp | 16 ++-- src/core/audio/AudioDevice.cpp | 28 +++--- src/core/audio/AudioFileDevice.cpp | 2 +- src/core/audio/AudioFileOgg.cpp | 2 +- src/core/audio/AudioFileWave.cpp | 4 +- src/core/audio/AudioJack.cpp | 12 +-- src/core/audio/AudioOss.cpp | 16 ++-- src/core/audio/AudioPort.cpp | 28 +++--- src/core/audio/AudioPortAudio.cpp | 22 ++--- src/core/audio/AudioPulseAudio.cpp | 10 +-- src/core/audio/AudioSampleRecorder.cpp | 2 +- src/core/audio/AudioSdl.cpp | 12 +-- src/core/engine.cpp | 6 +- src/core/main.cpp | 18 ++-- src/core/midi/MidiController.cpp | 4 +- src/core/note_play_handle.cpp | 18 ++-- src/core/sample_buffer.cpp | 28 +++--- src/core/sample_play_handle.cpp | 8 +- src/core/sample_record_handle.cpp | 6 +- src/core/song.cpp | 46 +++++----- src/core/track.cpp | 8 +- src/gui/ControllerConnectionDialog.cpp | 4 +- src/gui/MainWindow.cpp | 4 +- src/gui/export_project_dialog.cpp | 8 +- src/gui/file_browser.cpp | 20 ++--- src/gui/setup_dialog.cpp | 12 +-- src/gui/song_editor.cpp | 10 +-- src/gui/track_container_view.cpp | 8 +- src/gui/widgets/EnvelopeAndLfoView.cpp | 4 +- src/gui/widgets/InstrumentMidiIOView.cpp | 4 +- src/gui/widgets/cpuload_widget.cpp | 4 +- src/gui/widgets/visualization_widget.cpp | 28 +++--- src/tracks/InstrumentTrack.cpp | 36 ++++---- src/tracks/bb_track.cpp | 4 +- src/tracks/pattern.cpp | 22 ++--- src/tracks/sample_track.cpp | 4 +- 107 files changed, 509 insertions(+), 509 deletions(-) rename include/{mixer.h => Mixer.h} (97%) rename src/core/{mixer.cpp => Mixer.cpp} (92%) diff --git a/include/AudioAlsa.h b/include/AudioAlsa.h index c2be94ac8..5e60b54a8 100644 --- a/include/AudioAlsa.h +++ b/include/AudioAlsa.h @@ -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() diff --git a/include/AudioDevice.h b/include/AudioDevice.h index 420e289d4..e1d354013 100644 --- a/include/AudioDevice.h +++ b/include/AudioDevice.h @@ -29,7 +29,7 @@ #include #include -#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; diff --git a/include/AudioDummy.h b/include/AudioDummy.h index 1cbe14915..70d95e36b 100644 --- a/include/AudioDummy.h +++ b/include/AudioDummy.h @@ -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( - getMixer()->framesPerPeriod() * + mixer()->framesPerPeriod() * 1000000.0f / - getMixer()->processingSampleRate() - + mixer()->processingSampleRate() - timer.elapsed() ); if( microseconds > 0 ) { diff --git a/include/AudioFileDevice.h b/include/AudioFileDevice.h index cbc30b28f..1049aff26 100644 --- a/include/AudioFileDevice.h +++ b/include/AudioFileDevice.h @@ -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 diff --git a/include/AudioFileOgg.h b/include/AudioFileOgg.h index 8ea9b9d51..888853693 100644 --- a/include/AudioFileOgg.h +++ b/include/AudioFileOgg.h @@ -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 ); } diff --git a/include/AudioFileWave.h b/include/AudioFileWave.h index 6446e35f6..ee68affbc 100644 --- a/include/AudioFileWave.h +++ b/include/AudioFileWave.h @@ -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 ); } diff --git a/include/AudioJack.h b/include/AudioJack.h index 5cc12acf3..523ffe2c4 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -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() diff --git a/include/AudioOss.h b/include/AudioOss.h index 293694fe4..4d1d32bb0 100644 --- a/include/AudioOss.h +++ b/include/AudioOss.h @@ -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() diff --git a/include/AudioPort.h b/include/AudioPort.h index 82e61fb1e..47129aede 100644 --- a/include/AudioPort.h +++ b/include/AudioPort.h @@ -29,7 +29,7 @@ #include #include -#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; } ; diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 85d2880cd..eec48be94 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -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() diff --git a/include/AudioPulseAudio.h b/include/AudioPulseAudio.h index 33a11da1f..f7eb8c6c2 100644 --- a/include/AudioPulseAudio.h +++ b/include/AudioPulseAudio.h @@ -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() diff --git a/include/AudioSampleRecorder.h b/include/AudioSampleRecorder.h index e1e732f80..09d012792 100644 --- a/include/AudioSampleRecorder.h +++ b/include/AudioSampleRecorder.h @@ -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; diff --git a/include/AudioSdl.h b/include/AudioSdl.h index a2ae6afde..d5b073e1e 100644 --- a/include/AudioSdl.h +++ b/include/AudioSdl.h @@ -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() diff --git a/include/Controller.h b/include/Controller.h index 5ca110a53..ea86fdaf1 100644 --- a/include/Controller.h +++ b/include/Controller.h @@ -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; } diff --git a/include/Effect.h b/include/Effect.h index 4fff6b178..34d2283bf 100644 --- a/include/Effect.h +++ b/include/Effect.h @@ -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( 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(); diff --git a/include/EffectChain.h b/include/EffectChain.h index bf949f2bd..b09863896 100644 --- a/include/EffectChain.h +++ b/include/EffectChain.h @@ -28,7 +28,7 @@ #include "Model.h" #include "SerializingObject.h" -#include "mixer.h" +#include "Mixer.h" #include "AutomatableModel.h" class Effect; diff --git a/include/FxMixer.h b/include/FxMixer.h index 2a6bd84e0..10b6b2cc6 100644 --- a/include/FxMixer.h +++ b/include/FxMixer.h @@ -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; } ; diff --git a/include/Instrument.h b/include/Instrument.h index 97b23b0cf..6e0e69012 100644 --- a/include/Instrument.h +++ b/include/Instrument.h @@ -29,7 +29,7 @@ #include #include "Plugin.h" -#include "mixer.h" +#include "Mixer.h" // forward-declarations diff --git a/include/InstrumentSoundShaping.h b/include/InstrumentSoundShaping.h index 398df0688..eae4b9b69 100644 --- a/include/InstrumentSoundShaping.h +++ b/include/InstrumentSoundShaping.h @@ -25,7 +25,7 @@ #ifndef _INSTRUMENT_SOUND_SHAPING_H #define _INSTRUMENT_SOUND_SHAPING_H -#include "mixer.h" +#include "Mixer.h" #include "ComboBoxModel.h" diff --git a/include/mixer.h b/include/Mixer.h similarity index 97% rename from include/mixer.h rename to include/Mixer.h index e84122049..e3c1781e9 100644 --- a/include/mixer.h +++ b/include/Mixer.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 + * Copyright (c) 2004-2014 Tobias Doerffel * * 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(); diff --git a/include/ProjectRenderer.h b/include/ProjectRenderer.h index 28e03bafe..afee328e0 100644 --- a/include/ProjectRenderer.h +++ b/include/ProjectRenderer.h @@ -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; diff --git a/include/basic_filters.h b/include/basic_filters.h index ee986b0e2..2462978ee 100644 --- a/include/basic_filters.h +++ b/include/basic_filters.h @@ -36,7 +36,7 @@ #include #include "lmms_basics.h" -#include "mixer.h" +#include "Mixer.h" #include "templates.h" #include "lmms_constants.h" diff --git a/include/engine.h b/include/engine.h index 5c0d64199..0d52d040d 100644 --- a/include/engine.h +++ b/include/engine.h @@ -1,7 +1,7 @@ /* * engine.h - engine-system of LMMS * - * Copyright (c) 2006-2010 Tobias Doerffel + * Copyright (c) 2006-2014 Tobias Doerffel * * 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; diff --git a/include/note_play_handle.h b/include/note_play_handle.h index a80eda9b5..84ec7c20f 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -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( framesLeft(), - engine::getMixer()->framesPerPeriod() ); + engine::mixer()->framesPerPeriod() ); } diff --git a/include/pch.h b/include/pch.h index 67aa73033..aa334c07d 100644 --- a/include/pch.h +++ b/include/pch.h @@ -31,6 +31,6 @@ #include -#include "mixer.h" +#include "Mixer.h" #endif diff --git a/include/sample_play_handle.h b/include/sample_play_handle.h index 2c1161737..2b590e892 100644 --- a/include/sample_play_handle.h +++ b/include/sample_play_handle.h @@ -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" diff --git a/include/sample_record_handle.h b/include/sample_record_handle.h index f07cfd350..5afeb08f8 100644 --- a/include/sample_record_handle.h +++ b/include/sample_record_handle.h @@ -30,7 +30,7 @@ #include #include -#include "mixer.h" +#include "Mixer.h" #include "sample_buffer.h" class bbTrack; diff --git a/include/surround_area.h b/include/surround_area.h index 16b5822e1..a26ecfc0c 100644 --- a/include/surround_area.h +++ b/include/surround_area.h @@ -31,7 +31,7 @@ #include #include "AutomatableModel.h" -#include "mixer.h" +#include "Mixer.h" class QPixmap; diff --git a/include/visualization_widget.h b/include/visualization_widget.h index 863a0ecca..8b8c3fd16 100644 --- a/include/visualization_widget.h +++ b/include/visualization_widget.h @@ -29,7 +29,7 @@ #include #include -#include "mixer.h" +#include "Mixer.h" class visualizationWidget : public QWidget diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 04fca5c37..76f619dd3 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -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( floorf( ( m_sampleBuffer.endFrame() - m_sampleBuffer.startFrame() ) * diff --git a/plugins/bass_booster/bassbooster_controls.cpp b/plugins/bass_booster/bassbooster_controls.cpp index b6fbee498..441bb5fdc 100644 --- a/plugins/bass_booster/bassbooster_controls.cpp +++ b/plugins/bass_booster/bassbooster_controls.cpp @@ -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 ); diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index e679c6e73..cef694f02 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -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(); diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index c800b24cf..14f90cd12 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -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( 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( _n->m_pluginData ); so->update( _working_buffer, frames, f1, f2, - engine::getMixer()->processingSampleRate() ); + engine::mixer()->processingSampleRate() ); if( _n->released() ) { diff --git a/plugins/ladspa_browser/ladspa_description.cpp b/plugins/ladspa_browser/ladspa_description.cpp index 209d0b89a..19070adca 100644 --- a/plugins/ladspa_browser/ladspa_description.cpp +++ b/plugins/ladspa_browser/ladspa_description.cpp @@ -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 ); diff --git a/plugins/ladspa_browser/ladspa_port_dialog.cpp b/plugins/ladspa_browser/ladspa_port_dialog.cpp index 3f324dbf4..71e3f1f80 100644 --- a/plugins/ladspa_browser/ladspa_port_dialog.cpp +++ b/plugins/ladspa_browser/ladspa_port_dialog.cpp @@ -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(); } } diff --git a/plugins/ladspa_effect/LadspaEffect.cpp b/plugins/ladspa_effect/LadspaEffect.cpp index dcfe4118f..e219d51d7 100644 --- a/plugins/ladspa_effect/LadspaEffect.cpp +++ b/plugins/ladspa_effect/LadspaEffect.cpp @@ -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() ); } diff --git a/plugins/ladspa_effect/LadspaSubPluginFeatures.cpp b/plugins/ladspa_effect/LadspaSubPluginFeatures.cpp index bb6cba447..23f191d31 100644 --- a/plugins/ladspa_effect/LadspaSubPluginFeatures.cpp +++ b/plugins/ladspa_effect/LadspaSubPluginFeatures.cpp @@ -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 ) ); } diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index 87655f27d..4040a00e6 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -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, diff --git a/plugins/lb302/lb302.h b/plugins/lb302/lb302.h index 6094c4c53..140e3917f 100644 --- a/plugins/lb302/lb302.h +++ b/plugins/lb302/lb302.h @@ -37,7 +37,7 @@ #include "InstrumentView.h" #include "led_checkbox.h" #include "knob.h" -#include "mixer.h" +#include "Mixer.h" class lb302SynthView; class notePlayHandle; diff --git a/plugins/lb303/lb303.cpp b/plugins/lb303/lb303.cpp index 3c277c42f..fa4c91a37 100644 --- a/plugins/lb303/lb303.cpp +++ b/plugins/lb303/lb303.cpp @@ -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, diff --git a/plugins/lb303/lb303.h b/plugins/lb303/lb303.h index 0c5beec67..87b6f256c 100644 --- a/plugins/lb303/lb303.h +++ b/plugins/lb303/lb303.h @@ -37,7 +37,7 @@ #include "InstrumentView.h" #include "led_checkbox.h" #include "knob.h" -#include "mixer.h" +#include "Mixer.h" class lb303SynthView; class notePlayHandle; diff --git a/plugins/opl2/opl2instrument.cpp b/plugins/opl2/opl2instrument.cpp index fb46ab34d..0117d1650 100644 --- a/plugins/opl2/opl2instrument.cpp +++ b/plugins/opl2/opl2instrument.cpp @@ -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(); diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index e3e3d7c1b..6fd9455bb 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -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(); } diff --git a/plugins/papu/papu_instrument.cpp b/plugins/papu/papu_instrument.cpp index d49807d2a..2cd42cbd2 100644 --- a/plugins/papu/papu_instrument.cpp +++ b/plugins/papu/papu_instrument.cpp @@ -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; diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index ff590b622..e25883785 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -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( 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 diff --git a/plugins/sid/sid_instrument.cpp b/plugins/sid/sid_instrument.cpp index d88b40d16..7e317a876 100644 --- a/plugins/sid/sid_instrument.cpp +++ b/plugins/sid/sid_instrument.cpp @@ -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 ) { diff --git a/plugins/spectrum_analyzer/spectrum_analyzer.cpp b/plugins/spectrum_analyzer/spectrum_analyzer.cpp index 16d27fe94..c707d76bb 100644 --- a/plugins/spectrum_analyzer/spectrum_analyzer.cpp +++ b/plugins/spectrum_analyzer/spectrum_analyzer.cpp @@ -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; diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index b03267b2e..338736ab3 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -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(); } diff --git a/plugins/triple_oscillator/TripleOscillator.cpp b/plugins/triple_oscillator/TripleOscillator.cpp index 0f5bacb39..e928aa539 100644 --- a/plugins/triple_oscillator/TripleOscillator.cpp +++ b/plugins/triple_oscillator/TripleOscillator.cpp @@ -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() ) ); } diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 023e9ce5d..2a073253a 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -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( diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 8f4c0dd41..2ace7a171 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -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 ) diff --git a/plugins/vibed/vibrating_string.cpp b/plugins/vibed/vibrating_string.cpp index cdffd2caf..fc91a9036 100644 --- a/plugins/vibed/vibrating_string.cpp +++ b/plugins/vibed/vibrating_string.cpp @@ -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 ) diff --git a/plugins/vst_base/VstPlugin.cpp b/plugins/vst_base/VstPlugin.cpp index d040c61a8..8e331829b 100644 --- a/plugins/vst_base/VstPlugin.cpp +++ b/plugins/vst_base/VstPlugin.cpp @@ -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(); } diff --git a/plugins/vst_base/VstPlugin.h b/plugins/vst_base/VstPlugin.h index 992e59ff0..16b31e25a 100644 --- a/plugins/vst_base/VstPlugin.h +++ b/plugins/vst_base/VstPlugin.h @@ -31,7 +31,7 @@ #include #include -#include "mixer.h" +#include "Mixer.h" #include "JournallingObject.h" #include "communication.h" diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index 3db7a59e6..18775b5dd 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -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(); } diff --git a/src/core/Controller.cpp b/src/core/Controller.cpp index f65d9bee5..82fc5f578 100644 --- a/src/core/Controller.cpp +++ b/src/core/Controller.cpp @@ -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(); } diff --git a/src/core/ControllerConnection.cpp b/src/core/ControllerConnection.cpp index f0cf3327e..1840c2ddc 100644 --- a/src/core/ControllerConnection.cpp +++ b/src/core/ControllerConnection.cpp @@ -31,7 +31,7 @@ #include "song.h" #include "engine.h" -#include "mixer.h" +#include "Mixer.h" #include "ControllerConnection.h" diff --git a/src/core/Effect.cpp b/src/core/Effect.cpp index f848aacea..b0212533f 100644 --- a/src/core/Effect.cpp +++ b/src/core/Effect.cpp @@ -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; diff --git a/src/core/EffectChain.cpp b/src/core/EffectChain.cpp index fa8d50f89..207492d9f 100644 --- a/src/core/EffectChain.cpp +++ b/src/core/EffectChain.cpp @@ -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(); } diff --git a/src/core/EnvelopeAndLfoParameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp index 82914330a..97c926398 100644 --- a/src/core/EnvelopeAndLfoParameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -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( 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( frames_per_lfo_oscillation * expKnobVal( m_lfoPredelayModel.value() ) ); m_lfoAttackFrames = static_cast( frames_per_lfo_oscillation * @@ -504,7 +504,7 @@ void EnvelopeAndLfoParameters::updateSampleVars() emit dataChanged(); - engine::getMixer()->unlock(); + engine::mixer()->unlock(); } diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index cedf2ff8f..864364cf5 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -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(); } diff --git a/src/core/Instrument.cpp b/src/core/Instrument.cpp index 1f1ed5204..ad45bb846 100644 --- a/src/core/Instrument.cpp +++ b/src/core/Instrument.cpp @@ -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 ) { diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 71751e188..4f9261a4e 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -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; } diff --git a/src/core/InstrumentSoundShaping.cpp b/src/core/InstrumentSoundShaping.cpp index edd456a18..535a0d99d 100644 --- a/src/core/InstrumentSoundShaping.cpp +++ b/src/core/InstrumentSoundShaping.cpp @@ -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() ); diff --git a/src/core/LfoController.cpp b/src/core/LfoController.cpp index 94d6cc687..a189d500e 100644 --- a/src/core/LfoController.cpp +++ b/src/core/LfoController.cpp @@ -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() ) { diff --git a/src/core/mixer.cpp b/src/core/Mixer.cpp similarity index 92% rename from src/core/mixer.cpp rename to src/core/Mixer.cpp index 535d2c4ff..b8d05c71b 100644 --- a/src/core/mixer.cpp +++ b/src/core/Mixer.cpp @@ -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 + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -24,7 +24,7 @@ #include -#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::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" diff --git a/src/core/Oscillator.cpp b/src/core/Oscillator.cpp index ed00ef643..7b5c8a60c 100644 --- a/src/core/Oscillator.cpp +++ b/src/core/Oscillator.cpp @@ -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 ) { diff --git a/src/core/PeakController.cpp b/src/core/PeakController.cpp index 6efcbb08d..7d5407df0 100644 --- a/src/core/PeakController.cpp +++ b/src/core/PeakController.cpp @@ -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" diff --git a/src/core/Plugin.cpp b/src/core/Plugin.cpp index d3f1c3d1c..8a81e2c99 100644 --- a/src/core/Plugin.cpp +++ b/src/core/Plugin.cpp @@ -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" diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index 89f3f46d3..4017b4669 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -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 ) diff --git a/src/core/RemotePlugin.cpp b/src/core/RemotePlugin.cpp index bb755bf40..24e047d99 100644 --- a/src/core/RemotePlugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -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( 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: diff --git a/src/core/audio/AudioAlsa.cpp b/src/core/audio/AudioAlsa.cpp index 7e2567b0a..4267e2f02 100644 --- a/src/core/audio/AudioAlsa.cpp +++ b/src/core/audio/AudioAlsa.cpp @@ -38,7 +38,7 @@ -AudioAlsa::AudioAlsa( bool & _success_ful, mixer * _mixer ) : +AudioAlsa::AudioAlsa( bool & _success_ful, Mixer* _mixer ) : AudioDevice( tLimit( 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, diff --git a/src/core/audio/AudioDevice.cpp b/src/core/audio/AudioDevice.cpp index 8d6c9185f..52ee44d5c 100644 --- a/src/core/audio/AudioDevice.cpp +++ b/src/core/audio/AudioDevice.cpp @@ -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( - 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( - mixer::clip( _ab[frame][chnl] * + Mixer::clip( _ab[frame][chnl] * _master_gain ) * OUTPUT_SAMPLE_MULTIPLIER ); } diff --git a/src/core/audio/AudioFileDevice.cpp b/src/core/audio/AudioFileDevice.cpp index 945f90ea6..dd0324308 100644 --- a/src/core/audio/AudioFileDevice.cpp +++ b/src/core/audio/AudioFileDevice.cpp @@ -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 ), diff --git a/src/core/audio/AudioFileOgg.cpp b/src/core/audio/AudioFileOgg.cpp index e0e4e9b03..fc25c1355 100644 --- a/src/core/audio/AudioFileOgg.cpp +++ b/src/core/audio/AudioFileOgg.cpp @@ -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 ) diff --git a/src/core/audio/AudioFileWave.cpp b/src/core/audio/AudioFileWave.cpp index cedd4de84..074a1de1e 100644 --- a/src/core/audio/AudioFileWave.cpp +++ b/src/core/audio/AudioFileWave.cpp @@ -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; diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp index c5e0eb332..24ffdf300 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -44,7 +44,7 @@ -AudioJack::AudioJack( bool & _success_ful, mixer * _mixer ) : +AudioJack::AudioJack( bool & _success_ful, Mixer* _mixer ) : AudioDevice( tLimit( 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( _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]; diff --git a/src/core/audio/AudioOss.cpp b/src/core/audio/AudioOss.cpp index c314de939..8e7886ac2 100644 --- a/src/core/audio/AudioOss.cpp +++ b/src/core/audio/AudioOss.cpp @@ -71,7 +71,7 @@ -AudioOss::AudioOss( bool & _success_ful, mixer * _mixer ) : +AudioOss::AudioOss( bool & _success_ful, Mixer* _mixer ) : AudioDevice( tLimit( 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( 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 ) { diff --git a/src/core/audio/AudioPort.cpp b/src/core/audio/AudioPort.cpp index 2bc27050d..5071cc369 100644 --- a/src/core/audio/AudioPort.cpp +++ b/src/core/audio/AudioPort.cpp @@ -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; } diff --git a/src/core/audio/AudioPortAudio.cpp b/src/core/audio/AudioPortAudio.cpp index 9460cd40e..5882ee17e 100644 --- a/src/core/audio/AudioPortAudio.cpp +++ b/src/core/audio/AudioPortAudio.cpp @@ -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( 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 ); } } diff --git a/src/core/audio/AudioPulseAudio.cpp b/src/core/audio/AudioPulseAudio.cpp index 9e184b729..668e5cc87 100644 --- a/src/core/audio/AudioPulseAudio.cpp +++ b/src/core/audio/AudioPulseAudio.cpp @@ -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( 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 ) diff --git a/src/core/audio/AudioSampleRecorder.cpp b/src/core/audio/AudioSampleRecorder.cpp index 4601182a5..311edd848 100644 --- a/src/core/audio/AudioSampleRecorder.cpp +++ b/src/core/audio/AudioSampleRecorder.cpp @@ -32,7 +32,7 @@ AudioSampleRecorder::AudioSampleRecorder( const ch_cnt_t _channels, bool & _success_ful, - mixer * _mixer ) : + Mixer * _mixer ) : AudioDevice( _channels, _mixer ), m_buffers() { diff --git a/src/core/audio/AudioSdl.cpp b/src/core/audio/AudioSdl.cpp index b47db4b09..e9a592fa1 100644 --- a/src/core/audio/AudioSdl.cpp +++ b/src/core/audio/AudioSdl.cpp @@ -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 ); } diff --git a/src/core/engine.cpp b/src/core/engine.cpp index 5dad25e9f..a62781a98 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -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; diff --git a/src/core/main.cpp b/src/core/main.cpp index 55490628d..df7943389 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -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" diff --git a/src/core/midi/MidiController.cpp b/src/core/midi/MidiController.cpp index 455eed589..7e12cad98 100644 --- a/src/core/midi/MidiController.cpp +++ b/src/core/midi/MidiController.cpp @@ -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() ), diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index 90bf54d01..a8f0604fd 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -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(); diff --git a/src/core/sample_buffer.cpp b/src/core/sample_buffer.cpp index dfcd9f967..45483eae7 100644 --- a/src/core/sample_buffer.cpp +++ b/src/core/sample_buffer.cpp @@ -24,7 +24,7 @@ #include "sample_buffer.h" -#include "mixer.h" +#include "Mixer.h" #include @@ -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( ( @@ -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 ) diff --git a/src/core/sample_play_handle.cpp b/src/core/sample_play_handle.cpp index ab594e926..d9e67624f 100644 --- a/src/core/sample_play_handle.cpp +++ b/src/core/sample_play_handle.cpp @@ -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() ) ); } diff --git a/src/core/sample_record_handle.cpp b/src/core/sample_record_handle.cpp index 667ac7c55..d539442f8 100644 --- a/src/core/sample_record_handle.cpp +++ b/src/core/sample_record_handle.cpp @@ -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; } diff --git a/src/core/song.cpp b/src/core/song.cpp index 105bd7c7f..5a7509082 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -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 / diff --git a/src/core/track.cpp b/src/core/track.cpp index 82694aaf5..31ea31f67 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -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(); } } diff --git a/src/gui/ControllerConnectionDialog.cpp b/src/gui/ControllerConnectionDialog.cpp index 53ffc89e9..9a415045a 100644 --- a/src/gui/ControllerConnectionDialog.cpp +++ b/src/gui/ControllerConnectionDialog.cpp @@ -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 * ) ), diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 0cb8f09cf..30fa8d925 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -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 ); diff --git a/src/gui/export_project_dialog.cpp b/src/gui/export_project_dialog.cpp index 2a385093c..3b9dd2de4 100644 --- a/src/gui/export_project_dialog.cpp +++ b/src/gui/export_project_dialog.cpp @@ -238,10 +238,10 @@ void exportProjectDialog::multiRender() ProjectRenderer* exportProjectDialog::prepRender() { - mixer::qualitySettings qs = - mixer::qualitySettings( - static_cast(interpolationCB->currentIndex()), - static_cast(oversamplingCB->currentIndex()), + Mixer::qualitySettings qs = + Mixer::qualitySettings( + static_cast(interpolationCB->currentIndex()), + static_cast(oversamplingCB->currentIndex()), sampleExactControllersCB->isChecked(), aliasFreeOscillatorsCB->isChecked() ); diff --git a/src/gui/file_browser.cpp b/src/gui/file_browser.cpp index 30436bc89..cdfcb319a 100644 --- a/src/gui/file_browser.cpp +++ b/src/gui/file_browser.cpp @@ -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( m_previewPlayHandle ); if( s && s->totalFrames() - s->framesDone() <= - static_cast( engine::getMixer()-> + static_cast( 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( 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( track::create( track::InstrumentTrack, _tc ) ); handleFile( m_contextMenuItem, it ); - engine::getMixer()->unlock(); + engine::mixer()->unlock(); } } diff --git a/src/gui/setup_dialog.cpp b/src/gui/setup_dialog.cpp index 7780f2bae..670651eb3 100644 --- a/src/gui/setup_dialog.cpp +++ b/src/gui/setup_dialog.cpp @@ -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 ) ); } diff --git a/src/gui/song_editor.cpp b/src/gui/song_editor.cpp index c016af33f..65e9c889e 100644 --- a/src/gui/song_editor.cpp +++ b/src/gui/song_editor.cpp @@ -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 ); } diff --git a/src/gui/track_container_view.cpp b/src/gui/track_container_view.cpp index d9da9e471..94c35dc5b 100644 --- a/src/gui/track_container_view.cpp +++ b/src/gui/track_container_view.cpp @@ -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( @@ -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(); } diff --git a/src/gui/widgets/EnvelopeAndLfoView.cpp b/src/gui/widgets/EnvelopeAndLfoView.cpp index a0ac1fcb6..ae796f0d8 100644 --- a/src/gui/widgets/EnvelopeAndLfoView.cpp +++ b/src/gui/widgets/EnvelopeAndLfoView.cpp @@ -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() ); p.setPen( QPen( QColor( static_cast( 96 * lfo_gray_amount ), diff --git a/src/gui/widgets/InstrumentMidiIOView.cpp b/src/gui/widgets/InstrumentMidiIOView.cpp index bfa08e95c..f67cb0e7a 100644 --- a/src/gui/widgets/InstrumentMidiIOView.cpp +++ b/src/gui/widgets/InstrumentMidiIOView.cpp @@ -33,7 +33,7 @@ #include "gui_templates.h" #include "lcd_spinbox.h" #include "MidiClient.h" -#include "mixer.h" +#include "Mixer.h" #include "tooltip.h" @@ -101,7 +101,7 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget * _parent ) : connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_fixedOutputNoteSpinBox, SLOT( setEnabled( bool ) ) ); - if( !engine::getMixer()->midiClient()->isRaw() ) + if( !engine::mixer()->midiClient()->isRaw() ) { m_rpBtn = new QToolButton( m_midiInputGroupBox ); m_rpBtn->setText( tr( "MIDI devices to receive MIDI events from" ) ); diff --git a/src/gui/widgets/cpuload_widget.cpp b/src/gui/widgets/cpuload_widget.cpp index 5856bfd6f..4b2db4626 100644 --- a/src/gui/widgets/cpuload_widget.cpp +++ b/src/gui/widgets/cpuload_widget.cpp @@ -29,7 +29,7 @@ #include "cpuload_widget.h" #include "embed.h" #include "engine.h" -#include "mixer.h" +#include "Mixer.h" cpuloadWidget::cpuloadWidget( QWidget * _parent ) : @@ -90,7 +90,7 @@ void cpuloadWidget::paintEvent( QPaintEvent * ) void cpuloadWidget::updateCpuLoad() { // smooth load-values a bit - Uint8 new_load = ( m_currentLoad + engine::getMixer()->cpuLoad() ) / 2; + Uint8 new_load = ( m_currentLoad + engine::mixer()->cpuLoad() ) / 2; if( new_load != m_currentLoad ) { m_currentLoad = new_load; diff --git a/src/gui/widgets/visualization_widget.cpp b/src/gui/widgets/visualization_widget.cpp index 8ad8e9110..d1437932b 100644 --- a/src/gui/widgets/visualization_widget.cpp +++ b/src/gui/widgets/visualization_widget.cpp @@ -40,16 +40,16 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p, visualizationTypes _vtype ) : QWidget( _p ), s_background( _bg ), - m_points( new QPointF[engine::getMixer()->framesPerPeriod()] ), + m_points( new QPointF[engine::mixer()->framesPerPeriod()] ), m_active( false ) { setFixedSize( s_background.width(), s_background.height() ); setAttribute( Qt::WA_OpaquePaintEvent, true ); - const fpp_t frames = engine::getMixer()->framesPerPeriod(); + const fpp_t frames = engine::mixer()->framesPerPeriod(); m_buffer = new sampleFrame[frames]; - engine::getMixer()->clearAudioBuffer( m_buffer, frames ); + engine::mixer()->clearAudioBuffer( m_buffer, frames ); toolTip::add( this, tr( "click to enable/disable visualization of " @@ -71,12 +71,12 @@ void visualizationWidget::updateAudioBuffer() { if( !engine::getSong()->isExporting() ) { - engine::getMixer()->lock(); - const surroundSampleFrame * c = engine::getMixer()-> + engine::mixer()->lock(); + const surroundSampleFrame * c = engine::mixer()-> currentReadBuffer(); - const fpp_t fpp = engine::getMixer()->framesPerPeriod(); + const fpp_t fpp = engine::mixer()->framesPerPeriod(); memcpy( m_buffer, c, sizeof( surroundSampleFrame ) * fpp ); - engine::getMixer()->unlock(); + engine::mixer()->unlock(); } } @@ -91,7 +91,7 @@ void visualizationWidget::setActive( bool _active ) connect( engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); - connect( engine::getMixer(), + connect( engine::mixer(), SIGNAL( nextAudioBuffer() ), this, SLOT( updateAudioBuffer() ) ); } @@ -100,7 +100,7 @@ void visualizationWidget::setActive( bool _active ) disconnect( engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); - disconnect( engine::getMixer(), + disconnect( engine::mixer(), SIGNAL( nextAudioBuffer() ), this, SLOT( updateAudioBuffer() ) ); // we have to update (remove last waves), @@ -120,7 +120,7 @@ void visualizationWidget::paintEvent( QPaintEvent * ) if( m_active && !engine::getSong()->isExporting() ) { - float master_output = engine::getMixer()->masterGain(); + float master_output = engine::mixer()->masterGain(); int w = width()-4; const float half_h = -( height() - 6 ) / 3.0 * master_output - 1; int x_base = 2; @@ -130,10 +130,10 @@ void visualizationWidget::paintEvent( QPaintEvent * ) const fpp_t frames = - engine::getMixer()->framesPerPeriod(); + engine::mixer()->framesPerPeriod(); const float max_level = qMax( - mixer::peakValueLeft( m_buffer, frames ), - mixer::peakValueRight( m_buffer, frames ) ); + Mixer::peakValueLeft( m_buffer, frames ), + Mixer::peakValueRight( m_buffer, frames ) ); // and set color according to that... if( max_level * master_output < 0.9 ) @@ -161,7 +161,7 @@ void visualizationWidget::paintEvent( QPaintEvent * ) { m_points[frame] = QPointF( x_base + (float) frame * xd, - y_base + ( mixer::clip( + y_base + ( Mixer::clip( m_buffer[frame][ch] ) * half_h ) ); } diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index ce7a444a4..3387f585c 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -95,7 +95,7 @@ InstrumentTrack::InstrumentTrack( trackContainer * _tc ) : track( track::InstrumentTrack, _tc ), MidiEventProcessor(), m_audioPort( tr( "unnamed_track" ) ), - m_midiPort( tr( "unnamed_track" ), engine::getMixer()->midiClient(), + m_midiPort( tr( "unnamed_track" ), engine::mixer()->midiClient(), this, this ), m_notes(), m_sustainPedalPressed( false ), @@ -187,7 +187,7 @@ void InstrumentTrack::processAudioBuffer( sampleFrame * _buf, panning += _n->getPanning(); panning = tLimit( panning, PanningLeft, PanningRight ); } - engine::getMixer()->bufferToPort( _buf, ( _n != NULL ) ? + engine::mixer()->bufferToPort( _buf, ( _n != NULL ) ? qMin(_n->framesLeftForCurrentPeriod(), _frames ) : _frames, ( _n != NULL ) ? _n->offset() : 0, @@ -220,7 +220,7 @@ midiEvent InstrumentTrack::applyMasterKey( const midiEvent & _me ) void InstrumentTrack::processInEvent( const midiEvent & _me, const midiTime & _time ) { - engine::getMixer()->lock(); + engine::mixer()->lock(); // in the special case this event comes from a MIDI port, the instrument // is MIDI based (VST plugin, Sf2Player etc.) and the user did not set @@ -230,7 +230,7 @@ void InstrumentTrack::processInEvent( const midiEvent & _me, midiPort()->realOutputChannel() < 0 */ ) { m_instrument->handleMidiEvent( _me, _time ); - engine::getMixer()->unlock(); + engine::mixer()->unlock(); return; } @@ -262,7 +262,7 @@ void InstrumentTrack::processInEvent( const midiEvent & _me, engine::framesPerTick() ), typeInfo::max() / 2, n ); - if( engine::getMixer()->addPlayHandle( + if( engine::mixer()->addPlayHandle( nph ) ) { m_notes[_me.key()] = nph; @@ -370,7 +370,7 @@ void InstrumentTrack::processInEvent( const midiEvent & _me, } break; } - engine::getMixer()->unlock(); + engine::mixer()->unlock(); } @@ -449,7 +449,7 @@ void InstrumentTrack::processOutEvent( const midiEvent & _me, void InstrumentTrack::silenceAllNotes() { - engine::getMixer()->lock(); + engine::mixer()->lock(); for( int i = 0; i < NumKeys; ++i ) { m_notes[i] = NULL; @@ -458,8 +458,8 @@ void InstrumentTrack::silenceAllNotes() // invalidate all NotePlayHandles linked to this track m_processHandles.clear(); - engine::getMixer()->removePlayHandles( this ); - engine::getMixer()->unlock(); + engine::mixer()->removePlayHandles( this ); + engine::mixer()->unlock(); } @@ -562,13 +562,13 @@ void InstrumentTrack::setName( const QString & _new_name ) void InstrumentTrack::updateBaseNote() { - engine::getMixer()->lock(); + engine::mixer()->lock(); for( NotePlayHandleList::Iterator it = m_processHandles.begin(); it != m_processHandles.end(); ++it ) { ( *it )->updateFrequency(); } - engine::getMixer()->unlock(); + engine::mixer()->unlock(); } @@ -662,7 +662,7 @@ bool InstrumentTrack::play( const midiTime & _start, handle->setBBTrack( bb_track ); handle->setOffset( _offset ); // send it to the mixer - engine::getMixer()->addPlayHandle( handle ); + engine::mixer()->addPlayHandle( handle ); played_a_note = true; continue; } @@ -720,7 +720,7 @@ bool InstrumentTrack::play( const midiTime & _start, #if LMMS_SINGERBOT_SUPPORT note_play_handle->setPatternIndex( note_idx ); #endif - engine::getMixer()->addPlayHandle( + engine::mixer()->addPlayHandle( note_play_handle ); played_a_note = true; #if LMMS_SINGERBOT_SUPPORT @@ -783,7 +783,7 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) { silenceAllNotes(); - engine::getMixer()->lock(); + engine::mixer()->lock(); m_volumeModel.loadSettings( _this, "vol" ); @@ -878,7 +878,7 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) } node = node.nextSibling(); } - engine::getMixer()->unlock(); + engine::mixer()->unlock(); } @@ -888,10 +888,10 @@ Instrument * InstrumentTrack::loadInstrument( const QString & _plugin_name ) { silenceAllNotes(); - engine::getMixer()->lock(); + engine::mixer()->lock(); delete m_instrument; m_instrument = Instrument::instantiate( _plugin_name, this ); - engine::getMixer()->unlock(); + engine::mixer()->unlock(); emit instrumentChanged(); @@ -963,7 +963,7 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, m_midiMenu = new QMenu( tr( "MIDI" ), this ); // sequenced MIDI? - if( !engine::getMixer()->midiClient()->isRaw() ) + if( !engine::mixer()->midiClient()->isRaw() ) { _it->m_midiPort.m_readablePortsMenu = new MidiPortMenu( MidiPort::Input ); diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index f4ba75dbc..89caac6a9 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -34,7 +34,7 @@ #include "engine.h" #include "gui_templates.h" #include "MainWindow.h" -#include "mixer.h" +#include "Mixer.h" #include "rename_dialog.h" #include "song.h" #include "song_editor.h" @@ -317,7 +317,7 @@ bbTrack::bbTrack( trackContainer * _tc ) : bbTrack::~bbTrack() { - engine::getMixer()->removePlayHandles( this ); + engine::mixer()->removePlayHandles( this ); const int bb = s_infoMap[this]; engine::getBBTrackContainer()->removeBB( bb ); diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 67f07fbd3..3a7f0ebca 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -188,7 +188,7 @@ note * pattern::addNote( const note & _new_note, const bool _quant_pos ) new_note->quantizePos( engine::getPianoRoll()->quantization() ); } - engine::getMixer()->lock(); + engine::mixer()->lock(); if( m_notes.size() == 0 || m_notes.back()->pos() <= new_note->pos() ) { m_notes.push_back( new_note ); @@ -211,7 +211,7 @@ note * pattern::addNote( const note & _new_note, const bool _quant_pos ) m_notes.insert( it, new_note ); } - engine::getMixer()->unlock(); + engine::mixer()->unlock(); checkType(); changeLength( length() ); @@ -228,7 +228,7 @@ note * pattern::addNote( const note & _new_note, const bool _quant_pos ) void pattern::removeNote( const note * _note_to_del ) { - engine::getMixer()->lock(); + engine::mixer()->lock(); NoteVector::Iterator it = m_notes.begin(); while( it != m_notes.end() ) { @@ -240,7 +240,7 @@ void pattern::removeNote( const note * _note_to_del ) } ++it; } - engine::getMixer()->unlock(); + engine::mixer()->unlock(); checkType(); changeLength( length() ); @@ -276,14 +276,14 @@ void pattern::rearrangeAllNotes() void pattern::clearNotes() { - engine::getMixer()->lock(); + engine::mixer()->lock(); for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end(); ++it ) { delete *it; } m_notes.clear(); - engine::getMixer()->unlock(); + engine::mixer()->unlock(); checkType(); emit dataChanged(); @@ -739,12 +739,12 @@ void patternFreezeThread::run() // create and install audio-sample-recorder bool b; // we cannot create local copy, because at a later stage - // mixer::restoreAudioDevice(...) deletes old audio-dev and thus + // Mixer::restoreAudioDevice(...) deletes old audio-dev and thus // AudioSampleRecorder would be destroyed two times... AudioSampleRecorder * freeze_recorder = new AudioSampleRecorder( DEFAULT_CHANNELS, b, - engine::getMixer() ); - engine::getMixer()->setAudioDevice( freeze_recorder ); + engine::mixer() ); + engine::mixer()->setAudioDevice( freeze_recorder ); // prepare stuff for playing correct things later engine::getSong()->playPattern( m_pattern, false ); @@ -769,7 +769,7 @@ void patternFreezeThread::run() // render tails int count = 0; - while( engine::getMixer()->hasNotePlayHandles() && + while( engine::mixer()->hasNotePlayHandles() && m_pattern->m_freezeAborted == false && ++count < 2000 ) { @@ -791,7 +791,7 @@ void patternFreezeThread::run() } // restore original audio-device - engine::getMixer()->restoreAudioDevice(); + engine::mixer()->restoreAudioDevice(); m_statusDlg->setProgress( -1 ); // we're finished diff --git a/src/tracks/sample_track.cpp b/src/tracks/sample_track.cpp index 0ced90e1e..bd3576247 100644 --- a/src/tracks/sample_track.cpp +++ b/src/tracks/sample_track.cpp @@ -399,7 +399,7 @@ sampleTrack::sampleTrack( trackContainer * _tc ) : sampleTrack::~sampleTrack() { - engine::getMixer()->removePlayHandles( this ); + engine::mixer()->removePlayHandles( this ); } @@ -442,7 +442,7 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames, // handle->setBBTrack( _tco_num ); handle->setOffset( _offset ); // send it to the mixer - engine::getMixer()->addPlayHandle( handle ); + engine::mixer()->addPlayHandle( handle ); played_a_note = true; } }