From 968909c07c0d1968e01d901f6d404234262ba137 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Wed, 26 Nov 2014 00:49:55 +0100 Subject: [PATCH] Rename engine to Engine --- include/BandLimitedWave.h | 4 +- include/BufferManager.h | 2 +- include/ConfigManager.h | 4 +- include/Controller.h | 2 +- include/Effect.h | 16 +- include/{engine.h => Engine.h} | 4 +- include/FxMixerView.h | 2 +- include/PianoRoll.h | 2 +- include/Song.h | 4 +- plugins/Amplifier/AmplifierControls.cpp | 2 +- plugins/BassBooster/BassBooster.cpp | 2 +- plugins/BassBooster/BassBoosterControls.cpp | 2 +- plugins/DualFilter/DualFilter.cpp | 4 +- plugins/DualFilter/DualFilterControls.cpp | 8 +- plugins/HydrogenImport/HydrogenImport.cpp | 8 +- plugins/LadspaEffect/LadspaEffect.cpp | 26 +-- .../LadspaEffect/LadspaSubPluginFeatures.cpp | 8 +- plugins/MidiImport/MidiImport.cpp | 8 +- plugins/SpectrumAnalyzer/SpectrumAnalyzer.cpp | 2 +- .../SpectrumAnalyzerControlDialog.cpp | 2 +- plugins/VstEffect/VstEffect.cpp | 4 +- plugins/VstEffect/VstEffectControls.cpp | 2 +- .../audio_file_processor.cpp | 6 +- plugins/bit_invader/bit_invader.cpp | 22 +-- plugins/delay/delaycontrols.cpp | 4 +- plugins/delay/delayeffect.cpp | 12 +- .../dynamics_processor/dynamics_processor.cpp | 12 +- .../dynamics_processor_controls.cpp | 14 +- plugins/flp_import/FlpImport.cpp | 38 ++--- plugins/kicker/kicker.cpp | 6 +- plugins/ladspa_browser/ladspa_description.cpp | 8 +- plugins/ladspa_browser/ladspa_port_dialog.cpp | 8 +- plugins/lb302/lb302.cpp | 24 +-- plugins/monstro/Monstro.cpp | 8 +- plugins/nes/Nes.cpp | 4 +- plugins/opl2/opl2instrument.cpp | 14 +- plugins/organic/organic.cpp | 8 +- plugins/papu/papu_instrument.cpp | 4 +- plugins/patman/patman.cpp | 4 +- .../peak_controller_effect.cpp | 6 +- .../peak_controller_effect_controls.cpp | 2 +- plugins/sf2_player/sf2_player.cpp | 24 +-- plugins/sfxr/sfxr.cpp | 4 +- plugins/sid/sid_instrument.cpp | 6 +- plugins/stereo_enhancer/stereo_enhancer.h | 2 +- .../triple_oscillator/TripleOscillator.cpp | 8 +- plugins/vestige/vestige.cpp | 14 +- plugins/vibed/vibed.cpp | 20 +-- plugins/vibed/vibrating_string.cpp | 4 +- plugins/vst_base/VstPlugin.cpp | 12 +- plugins/watsyn/Watsyn.cpp | 86 +++++----- plugins/waveshaper/waveshaper_controls.cpp | 12 +- plugins/zynaddsubfx/ZynAddSubFx.cpp | 18 +- src/core/AutomatableModel.cpp | 2 +- src/core/AutomationPattern.cpp | 52 +++--- src/core/BBTrackContainer.cpp | 20 +-- src/core/Controller.cpp | 12 +- src/core/ControllerConnection.cpp | 12 +- src/core/Effect.cpp | 6 +- src/core/EffectChain.cpp | 12 +- src/core/{engine.cpp => Engine.cpp} | 50 +++--- src/core/EnvelopeAndLfoParameters.cpp | 14 +- src/core/FxMixer.cpp | 40 ++--- src/core/ImportFilter.cpp | 8 +- src/core/Instrument.cpp | 4 +- src/core/InstrumentFunctions.cpp | 14 +- src/core/InstrumentSoundShaping.cpp | 6 +- src/core/JournallingObject.cpp | 14 +- src/core/LfoController.cpp | 14 +- src/core/Mixer.cpp | 20 +-- src/core/MixerWorkerThread.cpp | 2 +- src/core/NotePlayHandle.cpp | 30 ++-- src/core/Oscillator.cpp | 6 +- src/core/PeakController.cpp | 8 +- src/core/Plugin.cpp | 6 +- src/core/PresetPreviewPlayHandle.cpp | 14 +- src/core/ProjectJournal.cpp | 6 +- src/core/ProjectRenderer.cpp | 26 +-- src/core/RemotePlugin.cpp | 16 +- src/core/RingBuffer.cpp | 18 +- src/core/SampleBuffer.cpp | 22 +-- src/core/SamplePlayHandle.cpp | 6 +- src/core/SampleRecordHandle.cpp | 10 +- src/core/Song.cpp | 160 +++++++++--------- src/core/TempoSyncKnobModel.cpp | 10 +- src/core/Track.cpp | 20 +-- src/core/TrackContainer.cpp | 10 +- src/core/VstSyncController.cpp | 10 +- src/core/audio/AudioAlsa.cpp | 4 +- src/core/audio/AudioJack.cpp | 8 +- src/core/audio/AudioOss.cpp | 4 +- src/core/audio/AudioPort.cpp | 20 +-- src/core/audio/AudioPortAudio.cpp | 2 +- src/core/audio/AudioPulseAudio.cpp | 4 +- src/core/audio/AudioSdl.cpp | 4 +- src/core/main.cpp | 32 ++-- src/core/midi/MidiAlsaSeq.cpp | 8 +- src/core/midi/MidiController.cpp | 4 +- src/core/midi/MidiPort.cpp | 2 +- src/core/midi/MidiWinMM.cpp | 2 +- src/core/timeline.cpp | 6 +- src/gui/AutomatableModelView.cpp | 2 +- src/gui/AutomationEditor.cpp | 78 ++++----- src/gui/AutomationPatternView.cpp | 22 +-- src/gui/ControllerConnectionDialog.cpp | 20 +-- src/gui/FileBrowser.cpp | 36 ++-- src/gui/FxMixerView.cpp | 30 ++-- src/gui/LfoControllerDialog.cpp | 2 +- src/gui/MainWindow.cpp | 90 +++++----- src/gui/PeakControllerDialog.cpp | 2 +- src/gui/PianoRoll.cpp | 94 +++++----- src/gui/PianoView.cpp | 2 +- src/gui/SongEditor.cpp | 54 +++--- src/gui/ToolPluginView.cpp | 4 +- src/gui/TrackContainerView.cpp | 8 +- src/gui/about_dialog.cpp | 4 +- src/gui/bb_editor.cpp | 14 +- src/gui/export_project_dialog.cpp | 12 +- src/gui/setup_dialog.cpp | 16 +- src/gui/string_pair_drag.cpp | 6 +- src/gui/widgets/ControllerRackView.cpp | 8 +- src/gui/widgets/ControllerView.cpp | 6 +- src/gui/widgets/EffectView.cpp | 4 +- src/gui/widgets/EnvelopeAndLfoView.cpp | 4 +- src/gui/widgets/FxLine.cpp | 14 +- src/gui/widgets/InstrumentFunctionViews.cpp | 2 +- src/gui/widgets/InstrumentMidiIOView.cpp | 4 +- src/gui/widgets/LcdSpinBox.cpp | 4 +- src/gui/widgets/LcdWidget.cpp | 2 +- src/gui/widgets/SendButtonIndicator.cpp | 6 +- src/gui/widgets/TimeDisplayWidget.cpp | 6 +- src/gui/widgets/automatable_button.cpp | 2 +- src/gui/widgets/automatable_slider.cpp | 2 +- src/gui/widgets/combobox.cpp | 2 +- src/gui/widgets/cpuload_widget.cpp | 4 +- src/gui/widgets/fader.cpp | 2 +- src/gui/widgets/graph.cpp | 2 +- src/gui/widgets/knob.cpp | 8 +- src/gui/widgets/project_notes.cpp | 22 +-- src/gui/widgets/tempo_sync_knob.cpp | 8 +- src/gui/widgets/text_float.cpp | 6 +- src/gui/widgets/track_label_button.cpp | 2 +- src/gui/widgets/visualization_widget.cpp | 28 +-- src/tracks/AutomationTrack.cpp | 6 +- src/tracks/InstrumentTrack.cpp | 42 ++--- src/tracks/Pattern.cpp | 40 ++--- src/tracks/SampleTrack.cpp | 18 +- src/tracks/bb_track.cpp | 54 +++--- 148 files changed, 1058 insertions(+), 1058 deletions(-) rename include/{engine.h => Engine.h} (98%) rename src/core/{engine.cpp => Engine.cpp} (77%) diff --git a/include/BandLimitedWave.h b/include/BandLimitedWave.h index 666f270ff..1c81e0606 100644 --- a/include/BandLimitedWave.h +++ b/include/BandLimitedWave.h @@ -35,7 +35,7 @@ #include "interpolation.h" #include "lmms_basics.h" #include "lmms_math.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #define MAXLEN 11 @@ -104,7 +104,7 @@ public: */ static inline float freqToLen( float f ) { - return freqToLen( f, engine::mixer()->processingSampleRate() ); + return freqToLen( f, Engine::mixer()->processingSampleRate() ); } /*! \brief This method converts frequency to wavelength, but you can use any custom sample rate with it. diff --git a/include/BufferManager.h b/include/BufferManager.h index b437ae05e..c2a0a987c 100644 --- a/include/BufferManager.h +++ b/include/BufferManager.h @@ -28,7 +28,7 @@ #include "MemoryManager.h" #include "lmms_basics.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include #include diff --git a/include/ConfigManager.h b/include/ConfigManager.h index 567dbd1d9..b22792288 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -36,7 +36,7 @@ #include "export.h" #include "MemoryManager.h" -class engine; +class Engine; const QString PROJECTS_PATH = "projects/"; @@ -221,7 +221,7 @@ private: settingsMap m_settings; - friend class engine; + friend class Engine; } ; diff --git a/include/Controller.h b/include/Controller.h index cf130351c..e1d2f9862 100644 --- a/include/Controller.h +++ b/include/Controller.h @@ -27,7 +27,7 @@ #ifndef CONTROLLER_H #define CONTROLLER_H -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include "Model.h" #include "JournallingObject.h" diff --git a/include/Effect.h b/include/Effect.h index ded15c14e..2adfb4f5e 100644 --- a/include/Effect.h +++ b/include/Effect.h @@ -27,7 +27,7 @@ #define EFFECT_H #include "Plugin.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include "AutomatableModel.h" #include "TempoSyncKnobModel.h" @@ -102,8 +102,8 @@ public: inline f_cnt_t timeout() const { - const float samples = engine::mixer()->processingSampleRate() * m_autoQuitModel.value() / 1000.0f; - return 1 + ( static_cast( samples ) / engine::mixer()->framesPerPeriod() ); + const float samples = Engine::mixer()->processingSampleRate() * m_autoQuitModel.value() / 1000.0f; + return 1 + ( static_cast( samples ) / Engine::mixer()->framesPerPeriod() ); } inline float wetLevel() const @@ -176,9 +176,9 @@ protected: sample_rate_t _dst_sr ) { resample( 0, _src_buf, - engine::mixer()->processingSampleRate(), + Engine::mixer()->processingSampleRate(), _dst_buf, _dst_sr, - engine::mixer()->framesPerPeriod() ); + Engine::mixer()->framesPerPeriod() ); } inline void sampleBack( const sampleFrame * _src_buf, @@ -186,9 +186,9 @@ protected: sample_rate_t _src_sr ) { resample( 1, _src_buf, _src_sr, _dst_buf, - engine::mixer()->processingSampleRate(), - engine::mixer()->framesPerPeriod() * _src_sr / - engine::mixer()->processingSampleRate() ); + Engine::mixer()->processingSampleRate(), + Engine::mixer()->framesPerPeriod() * _src_sr / + Engine::mixer()->processingSampleRate() ); } void reinitSRC(); diff --git a/include/engine.h b/include/Engine.h similarity index 98% rename from include/engine.h rename to include/Engine.h index 6ef3dc137..7bbd437f3 100644 --- a/include/engine.h +++ b/include/Engine.h @@ -1,5 +1,5 @@ /* - * engine.h - engine-system of LMMS + * Engine.h - engine-system of LMMS * * Copyright (c) 2006-2014 Tobias Doerffel * @@ -50,7 +50,7 @@ class ladspa2LMMS; class ControllerRackView; -class EXPORT engine +class EXPORT Engine { public: static void init( const bool _has_gui = true ); diff --git a/include/FxMixerView.h b/include/FxMixerView.h index 92f260172..a6735ca7a 100644 --- a/include/FxMixerView.h +++ b/include/FxMixerView.h @@ -33,7 +33,7 @@ #include "FxLine.h" #include "FxMixer.h" #include "ModelView.h" -#include "engine.h" +#include "Engine.h" #include "fader.h" #include "pixmap_button.h" #include "tooltip.h" diff --git a/include/PianoRoll.h b/include/PianoRoll.h index d4ef00776..7bf5edce9 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -366,7 +366,7 @@ private: // did we start a mouseclick with shift pressed bool m_startedWithShift; - friend class engine; + friend class Engine; // qproperty fields QColor m_gridColor; diff --git a/include/Song.h b/include/Song.h index 24afc4377..70c226c46 100644 --- a/include/Song.h +++ b/include/Song.h @@ -317,7 +317,7 @@ private: inline f_cnt_t currentFrame() const { - return m_playPos[m_playMode].getTicks() * engine::framesPerTick() + m_playPos[m_playMode].currentFrame(); + return m_playPos[m_playMode].getTicks() * Engine::framesPerTick() + m_playPos[m_playMode].currentFrame(); } void setPlayPos( tick_t _ticks, PlayModes _play_mode ); @@ -364,7 +364,7 @@ private: VstSyncController m_vstSyncController; - friend class engine; + friend class Engine; friend class SongEditor; friend class mainWindow; friend class ControllerRackView; diff --git a/plugins/Amplifier/AmplifierControls.cpp b/plugins/Amplifier/AmplifierControls.cpp index a18d0c5a8..a127cd3ca 100644 --- a/plugins/Amplifier/AmplifierControls.cpp +++ b/plugins/Amplifier/AmplifierControls.cpp @@ -28,7 +28,7 @@ #include "AmplifierControls.h" #include "Amplifier.h" -#include "engine.h" +#include "Engine.h" #include "Song.h" diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index 60c31ab1a..85aa67f37 100644 --- a/plugins/BassBooster/BassBooster.cpp +++ b/plugins/BassBooster/BassBooster.cpp @@ -105,7 +105,7 @@ bool BassBoosterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames inline void BassBoosterEffect::changeFrequency() { - const sample_t fac = engine::mixer()->processingSampleRate() / 44100.0f; + const sample_t fac = Engine::mixer()->processingSampleRate() / 44100.0f; m_bbFX.leftFX().setFrequency( m_bbControls.m_freqModel.value() * fac ); m_bbFX.rightFX().setFrequency( m_bbControls.m_freqModel.value() * fac ); diff --git a/plugins/BassBooster/BassBoosterControls.cpp b/plugins/BassBooster/BassBoosterControls.cpp index 0fe16a505..d79369ac5 100644 --- a/plugins/BassBooster/BassBoosterControls.cpp +++ b/plugins/BassBooster/BassBoosterControls.cpp @@ -37,7 +37,7 @@ BassBoosterControls::BassBoosterControls( BassBoosterEffect* effect ) : m_gainModel( 1.0f, 0.1f, 5.0f, 0.05f, this, tr( "Gain" ) ), m_ratioModel( 2.0f, 0.1f, 10.0f, 0.1f, this, tr( "Ratio" ) ) { - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeFrequency() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeFrequency() ) ); } diff --git a/plugins/DualFilter/DualFilter.cpp b/plugins/DualFilter/DualFilter.cpp index 22036930c..e0c55eec8 100644 --- a/plugins/DualFilter/DualFilter.cpp +++ b/plugins/DualFilter/DualFilter.cpp @@ -53,8 +53,8 @@ DualFilterEffect::DualFilterEffect( Model* parent, const Descriptor::SubPluginFe Effect( &dualfilter_plugin_descriptor, parent, key ), m_dfControls( this ) { - m_filter1 = new basicFilters<2>( engine::mixer()->processingSampleRate() ); - m_filter2 = new basicFilters<2>( engine::mixer()->processingSampleRate() ); + m_filter1 = new basicFilters<2>( Engine::mixer()->processingSampleRate() ); + m_filter2 = new basicFilters<2>( Engine::mixer()->processingSampleRate() ); // ensure filters get updated m_filter1changed = true; diff --git a/plugins/DualFilter/DualFilterControls.cpp b/plugins/DualFilter/DualFilterControls.cpp index 90a0b4792..10ae56771 100644 --- a/plugins/DualFilter/DualFilterControls.cpp +++ b/plugins/DualFilter/DualFilterControls.cpp @@ -28,7 +28,7 @@ #include "DualFilterControls.h" #include "DualFilter.h" -#include "engine.h" +#include "Engine.h" #include "Song.h" #include "basic_filters.h" #include "embed.h" @@ -97,7 +97,7 @@ DualFilterControls::DualFilterControls( DualFilterEffect* effect ) : m_filter2Model.addItem( tr( "Fast Formant" ), new PixmapLoader( "filter_hp" ) ); m_filter2Model.addItem( tr( "Tripole" ), new PixmapLoader( "filter_lp" ) ); - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateFilters() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateFilters() ) ); } @@ -108,8 +108,8 @@ void DualFilterControls::updateFilters() delete m_effect->m_filter1; delete m_effect->m_filter2; - m_effect->m_filter1 = new basicFilters<2>( engine::mixer()->processingSampleRate() ); - m_effect->m_filter2 = new basicFilters<2>( engine::mixer()->processingSampleRate() ); + m_effect->m_filter1 = new basicFilters<2>( Engine::mixer()->processingSampleRate() ); + m_effect->m_filter2 = new basicFilters<2>( Engine::mixer()->processingSampleRate() ); // flag filters as needing recalculation diff --git a/plugins/HydrogenImport/HydrogenImport.cpp b/plugins/HydrogenImport/HydrogenImport.cpp index edb8bdb17..6be40e091 100644 --- a/plugins/HydrogenImport/HydrogenImport.cpp +++ b/plugins/HydrogenImport/HydrogenImport.cpp @@ -9,7 +9,7 @@ #include "LocalFileMng.h" #include "HydrogenImport.h" #include "Song.h" -#include "engine.h" +#include "Engine.h" #include "Instrument.h" #include "InstrumentTrack.h" #include "note.h" @@ -143,7 +143,7 @@ bool HydrogenImport::readSong() QHash pattern_length; QHash pattern_id; - Song *s = engine::getSong(); + Song *s = Engine::getSong(); int song_num_tracks = s->tracks().size(); if ( QFile( filename ).exists() == false ) { @@ -213,7 +213,7 @@ bool HydrogenImport::readSong() if ( nLayer == 0 ) { - drum_track[sId] = ( InstrumentTrack * ) Track::create( Track::InstrumentTrack,engine::getBBTrackContainer() ); + drum_track[sId] = ( InstrumentTrack * ) Track::create( Track::InstrumentTrack,Engine::getBBTrackContainer() ); drum_track[sId]->volumeModel()->setValue( fVolume * 100 ); drum_track[sId]->panningModel()->setValue( ( fPan_R - fPan_L ) * 100 ); ins = drum_track[sId]->loadInstrument( "audiofileprocessor" ); @@ -237,7 +237,7 @@ bool HydrogenImport::readSong() } QDomNode patterns = songNode.firstChildElement( "patternList" ); int pattern_count = 0; - int nbb = engine::getBBTrackContainer()->numOfBBs(); + int nbb = Engine::getBBTrackContainer()->numOfBBs(); QDomNode patternNode = patterns.firstChildElement( "pattern" ); int pn = 1; while ( !patternNode.isNull() ) diff --git a/plugins/LadspaEffect/LadspaEffect.cpp b/plugins/LadspaEffect/LadspaEffect.cpp index 15b5c284f..83c75ba3d 100644 --- a/plugins/LadspaEffect/LadspaEffect.cpp +++ b/plugins/LadspaEffect/LadspaEffect.cpp @@ -71,10 +71,10 @@ LadspaEffect::LadspaEffect( Model * _parent, m_maxSampleRate( 0 ), m_key( LadspaSubPluginFeatures::subPluginKeyToLadspaKey( _key ) ) { - ladspa2LMMS * manager = engine::getLADSPAManager(); + ladspa2LMMS * manager = Engine::getLADSPAManager(); if( manager->getDescription( m_key ) == NULL ) { - if( !engine::suppressMessages() ) + if( !Engine::suppressMessages() ) { QMessageBox::warning( 0, tr( "Effect" ), tr( "Unknown LADSPA plugin %1 requested." ). @@ -89,7 +89,7 @@ LadspaEffect::LadspaEffect( Model * _parent, pluginInstantiation(); - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeSampleRate() ) ); } @@ -147,13 +147,13 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, sampleFrame * o_buf = NULL; sampleFrame sBuf [_frames]; - if( m_maxSampleRate < engine::mixer()->processingSampleRate() ) + if( m_maxSampleRate < Engine::mixer()->processingSampleRate() ) { o_buf = _buf; _buf = &sBuf[0]; sampleDown( o_buf, _buf, m_maxSampleRate ); frames = _frames * m_maxSampleRate / - engine::mixer()->processingSampleRate(); + Engine::mixer()->processingSampleRate(); } // Copy the LMMS audio buffer to the LADSPA input buffer and initialize @@ -291,10 +291,10 @@ void LadspaEffect::pluginInstantiation() { m_maxSampleRate = maxSamplerate( displayName() ); - ladspa2LMMS * manager = engine::getLADSPAManager(); + ladspa2LMMS * manager = Engine::getLADSPAManager(); // Calculate how many processing units are needed. - const ch_cnt_t lmms_chnls = engine::mixer()->audioDev()->channels(); + const ch_cnt_t lmms_chnls = Engine::mixer()->audioDev()->channels(); int effect_channels = manager->getDescription( m_key )->inputChannels; setProcessorCount( lmms_chnls / effect_channels ); @@ -329,7 +329,7 @@ void LadspaEffect::pluginInstantiation() manager->isPortInput( m_key, port ) ) { p->rate = CHANNEL_IN; - p->buffer = MM_ALLOC( LADSPA_Data, engine::mixer()->framesPerPeriod() ); + p->buffer = MM_ALLOC( LADSPA_Data, Engine::mixer()->framesPerPeriod() ); inbuf[ inputch ] = p->buffer; inputch++; } @@ -344,19 +344,19 @@ void LadspaEffect::pluginInstantiation() } else { - p->buffer = MM_ALLOC( LADSPA_Data, engine::mixer()->framesPerPeriod() ); + p->buffer = MM_ALLOC( LADSPA_Data, Engine::mixer()->framesPerPeriod() ); m_inPlaceBroken = true; } } else if( manager->isPortInput( m_key, port ) ) { p->rate = AUDIO_RATE_INPUT; - p->buffer = MM_ALLOC( LADSPA_Data, engine::mixer()->framesPerPeriod() ); + p->buffer = MM_ALLOC( LADSPA_Data, Engine::mixer()->framesPerPeriod() ); } else { p->rate = AUDIO_RATE_OUTPUT; - p->buffer = MM_ALLOC( LADSPA_Data, engine::mixer()->framesPerPeriod() ); + p->buffer = MM_ALLOC( LADSPA_Data, Engine::mixer()->framesPerPeriod() ); } } else @@ -548,7 +548,7 @@ void LadspaEffect::pluginDestruction() for( ch_cnt_t proc = 0; proc < processorCount(); proc++ ) { - ladspa2LMMS * manager = engine::getLADSPAManager(); + ladspa2LMMS * manager = Engine::getLADSPAManager(); manager->deactivate( m_key, m_handles[proc] ); manager->cleanup( m_key, m_handles[proc] ); for( int port = 0; port < m_portCount; port++ ) @@ -587,7 +587,7 @@ sample_rate_t LadspaEffect::maxSamplerate( const QString & _name ) { return( __buggy_plugins[_name] ); } - return( engine::mixer()->processingSampleRate() ); + return( Engine::mixer()->processingSampleRate() ); } diff --git a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp index 237685bf6..7847b6309 100644 --- a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp +++ b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp @@ -30,7 +30,7 @@ #include "LadspaSubPluginFeatures.h" #include "AudioDevice.h" -#include "engine.h" +#include "Engine.h" #include "ladspa_2_lmms.h" #include "LadspaBase.h" #include "Mixer.h" @@ -48,7 +48,7 @@ void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, const Key * _key ) const { const ladspa_key_t & lkey = subPluginKeyToLadspaKey( _key ); - ladspa2LMMS * lm = engine::getLADSPAManager(); + ladspa2LMMS * lm = Engine::getLADSPAManager(); QLabel * label = new QLabel( _parent ); label->setText( QWidget::tr( "Name: " ) + lm->getName( lkey ) ); @@ -119,7 +119,7 @@ void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, void LadspaSubPluginFeatures::listSubPluginKeys( const Plugin::Descriptor * _desc, KeyList & _kl ) const { - ladspa2LMMS * lm = engine::getLADSPAManager(); + ladspa2LMMS * lm = Engine::getLADSPAManager(); l_sortable_plugin_t plugins; switch( m_type ) @@ -145,7 +145,7 @@ void LadspaSubPluginFeatures::listSubPluginKeys( it != plugins.end(); ++it ) { if( lm->getDescription( ( *it ).second )->inputChannels <= - engine::mixer()->audioDev()->channels() ) + Engine::mixer()->audioDev()->channels() ) { _kl.push_back( ladspaKeyToSubPluginKey( _desc, ( *it ).first, ( *it ).second ) ); } diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index d50770553..7250a126f 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -96,10 +96,10 @@ bool MidiImport::tryImport( TrackContainer* tc ) } #ifdef LMMS_HAVE_FLUIDSYNTH - if( engine::hasGUI() && + if( Engine::hasGUI() && ConfigManager::inst()->defaultSoundfont().isEmpty() ) { - QMessageBox::information( engine::mainWindow(), + QMessageBox::information( Engine::mainWindow(), tr( "Setup incomplete" ), tr( "You do not have set up a default soundfont in " "the settings dialog (Edit->Settings). " @@ -268,7 +268,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) const int preTrackSteps = 2; QProgressDialog pd( TrackContainer::tr( "Importing MIDI-file..." ), - TrackContainer::tr( "Cancel" ), 0, preTrackSteps, engine::mainWindow() ); + TrackContainer::tr( "Cancel" ), 0, preTrackSteps, Engine::mainWindow() ); pd.setWindowTitle( TrackContainer::tr( "Please wait..." ) ); pd.setWindowModality(Qt::WindowModal); pd.setMinimumDuration( 0 ); @@ -285,7 +285,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) smfMidiCC ccs[129]; smfMidiChannel chs[256]; - MeterModel & timeSigMM = engine::getSong()->getTimeSigModel(); + MeterModel & timeSigMM = Engine::getSong()->getTimeSigModel(); AutomationPattern * timeSigNumeratorPat = AutomationPattern::globalAutomationPattern( &timeSigMM.numeratorModel() ); AutomationPattern * timeSigDenominatorPat = diff --git a/plugins/SpectrumAnalyzer/SpectrumAnalyzer.cpp b/plugins/SpectrumAnalyzer/SpectrumAnalyzer.cpp index ce95fba7d..c06d4aa2b 100644 --- a/plugins/SpectrumAnalyzer/SpectrumAnalyzer.cpp +++ b/plugins/SpectrumAnalyzer/SpectrumAnalyzer.cpp @@ -127,7 +127,7 @@ bool SpectrumAnalyzer::processAudioBuffer( sampleFrame* _buf, const fpp_t _frame // hanming( m_buffer, FFT_BUFFER_SIZE, HAMMING ); - const sample_rate_t sr = engine::mixer()->processingSampleRate(); + const sample_rate_t sr = Engine::mixer()->processingSampleRate(); const int LOWEST_FREQ = 0; const int HIGHEST_FREQ = sr / 2; diff --git a/plugins/SpectrumAnalyzer/SpectrumAnalyzerControlDialog.cpp b/plugins/SpectrumAnalyzer/SpectrumAnalyzerControlDialog.cpp index aeaaad42e..fc58d730a 100644 --- a/plugins/SpectrumAnalyzer/SpectrumAnalyzerControlDialog.cpp +++ b/plugins/SpectrumAnalyzer/SpectrumAnalyzerControlDialog.cpp @@ -59,7 +59,7 @@ public: m_background( PLUGIN_NAME::getIconPixmap( "spectrum_background" ).toImage() ) { setFixedSize( 249, 151 ); - connect( engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); + connect( Engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); setAttribute( Qt::WA_OpaquePaintEvent, true ); } diff --git a/plugins/VstEffect/VstEffect.cpp b/plugins/VstEffect/VstEffect.cpp index 8d0462cba..b440c6380 100644 --- a/plugins/VstEffect/VstEffect.cpp +++ b/plugins/VstEffect/VstEffect.cpp @@ -142,8 +142,8 @@ void VstEffect::openPlugin( const QString & _plugin ) return; } - VstPlugin::connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), m_plugin, SLOT( setTempo( bpm_t ) ) ); - m_plugin->setTempo( engine::getSong()->getTempo() ); + VstPlugin::connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), m_plugin, SLOT( setTempo( bpm_t ) ) ); + m_plugin->setTempo( Engine::getSong()->getTempo() ); m_pluginMutex.unlock(); diff --git a/plugins/VstEffect/VstEffectControls.cpp b/plugins/VstEffect/VstEffectControls.cpp index f03a9adfd..0c68706ea 100644 --- a/plugins/VstEffect/VstEffectControls.cpp +++ b/plugins/VstEffect/VstEffectControls.cpp @@ -309,7 +309,7 @@ manageVSTEffectView::manageVSTEffectView( VstEffect * _eff, VstEffectControls * m_vi->m_scrollArea = new QScrollArea( widget ); l = new QGridLayout( widget ); - m_vi->m_subWindow = engine::mainWindow()->workspace()->addSubWindow(new QMdiSubWindow, Qt::SubWindow | + m_vi->m_subWindow = Engine::mainWindow()->workspace()->addSubWindow(new QMdiSubWindow, Qt::SubWindow | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint); m_vi->m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); m_vi->m_subWindow->setFixedSize( 960, 300); diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index b5f4b06ae..2a764222b 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -32,7 +32,7 @@ #include #include "audio_file_processor.h" -#include "engine.h" +#include "Engine.h" #include "Song.h" #include "InstrumentTrack.h" #include "NotePlayHandle.h" @@ -293,7 +293,7 @@ QString audioFileProcessor::nodeName( void ) const int audioFileProcessor::getBeatLen( NotePlayHandle * _n ) const { const float freq_factor = BaseFreq / _n->frequency() * - engine::mixer()->processingSampleRate() / engine::mixer()->baseSampleRate(); + Engine::mixer()->processingSampleRate() / Engine::mixer()->baseSampleRate(); return static_cast( floorf( ( m_sampleBuffer.endFrame() - m_sampleBuffer.startFrame() ) * freq_factor ) ); } @@ -708,7 +708,7 @@ void AudioFileProcessorView::openAudioFile( void ) if( af != "" ) { castModel()->setAudioFile( af ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } } diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index 3978440ee..ec6bf6eed 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -27,7 +27,7 @@ #include "bit_invader.h" #include "base64.h" -#include "engine.h" +#include "Engine.h" #include "graph.h" #include "InstrumentTrack.h" #include "knob.h" @@ -279,7 +279,7 @@ void bitInvader::playNote( NotePlayHandle * _n, m_graph.length(), _n, m_interpolation.value(), factor, - engine::mixer()->processingSampleRate() ); + Engine::mixer()->processingSampleRate() ); } const fpp_t frames = _n->framesLeftForCurrentPeriod(); @@ -472,7 +472,7 @@ void bitInvaderView::modelChanged() void bitInvaderView::sinWaveClicked() { m_graph->model()->setWaveToSine(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -481,7 +481,7 @@ void bitInvaderView::sinWaveClicked() void bitInvaderView::triangleWaveClicked() { m_graph->model()->setWaveToTriangle(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -490,7 +490,7 @@ void bitInvaderView::triangleWaveClicked() void bitInvaderView::sawWaveClicked() { m_graph->model()->setWaveToSaw(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -499,7 +499,7 @@ void bitInvaderView::sawWaveClicked() void bitInvaderView::sqrWaveClicked() { m_graph->model()->setWaveToSquare(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -508,7 +508,7 @@ void bitInvaderView::sqrWaveClicked() void bitInvaderView::noiseWaveClicked() { m_graph->model()->setWaveToNoise(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -518,7 +518,7 @@ void bitInvaderView::usrWaveClicked() { QString fileName = m_graph->model()->setWaveToUser(); toolTip::add( m_usrWaveBtn, fileName ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); /* m_graph->model()->setWaveToNoise(); engine::getSong()->setModified(); @@ -554,7 +554,7 @@ void bitInvaderView::usrWaveClicked() void bitInvaderView::smoothClicked() { m_graph->model()->smooth(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -563,7 +563,7 @@ void bitInvaderView::smoothClicked() void bitInvaderView::interpolationToggled( bool value ) { m_graph->setGraphStyle( value ? graph::LinearStyle : graph::NearestStyle); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -571,7 +571,7 @@ void bitInvaderView::interpolationToggled( bool value ) void bitInvaderView::normalizeToggled( bool value ) { - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } diff --git a/plugins/delay/delaycontrols.cpp b/plugins/delay/delaycontrols.cpp index ecc91e94d..acfdfd36b 100644 --- a/plugins/delay/delaycontrols.cpp +++ b/plugins/delay/delaycontrols.cpp @@ -26,7 +26,7 @@ #include "delaycontrols.h" #include "delayeffect.h" -#include "engine.h" +#include "Engine.h" #include "Song.h" DelayControls::DelayControls( DelayEffect* effect ): @@ -37,7 +37,7 @@ DelayControls::DelayControls( DelayEffect* effect ): m_lfoTimeModel(2.0, 0.01, 20.0, 0.0001, 20000.0, this, tr( "Lfo Frequency" ) ), m_lfoAmountModel(0.0f,0.0f,0.1f,0.0001f, this, tr ( "Lfo Amount" ) ) { - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeSampleRate() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeSampleRate() ) ); } diff --git a/plugins/delay/delayeffect.cpp b/plugins/delay/delayeffect.cpp index 939cae7e2..e1634fcbf 100644 --- a/plugins/delay/delayeffect.cpp +++ b/plugins/delay/delayeffect.cpp @@ -23,7 +23,7 @@ */ #include "delayeffect.h" -#include "engine.h" +#include "Engine.h" #include "embed.cpp" @@ -51,8 +51,8 @@ DelayEffect::DelayEffect( Model* parent, const Plugin::Descriptor::SubPluginFeat m_delayControls( this ) { m_delay = 0; - m_delay = new StereoDelay( 20, engine::mixer()->processingSampleRate() ); - m_lfo = new Lfo( engine::mixer()->processingSampleRate() ); + m_delay = new StereoDelay( 20, Engine::mixer()->processingSampleRate() ); + m_lfo = new Lfo( Engine::mixer()->processingSampleRate() ); } @@ -82,7 +82,7 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) double outSum = 0.0; const float d = dryLevel(); const float w = wetLevel(); - const float length = m_delayControls.m_delayTimeModel.value() * engine::mixer()->processingSampleRate(); + const float length = m_delayControls.m_delayTimeModel.value() * Engine::mixer()->processingSampleRate(); m_lfo->setAmplitude( m_delayControls.m_lfoAmountModel.value() ); m_lfo->setFrequency( 1.0 / m_delayControls.m_lfoTimeModel.value() ); m_delay->setFeedback( m_delayControls.m_feedbackModel.value() ); @@ -104,8 +104,8 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) void DelayEffect::changeSampleRate() { - m_lfo->setSampleRate( engine::mixer()->processingSampleRate() ); - m_delay->setSampleRate( engine::mixer()->processingSampleRate() ); + m_lfo->setSampleRate( Engine::mixer()->processingSampleRate() ); + m_delay->setSampleRate( Engine::mixer()->processingSampleRate() ); } diff --git a/plugins/dynamics_processor/dynamics_processor.cpp b/plugins/dynamics_processor/dynamics_processor.cpp index fa7973dd1..859e661d3 100644 --- a/plugins/dynamics_processor/dynamics_processor.cpp +++ b/plugins/dynamics_processor/dynamics_processor.cpp @@ -58,8 +58,8 @@ dynProcEffect::dynProcEffect( Model * _parent, m_dpControls( this ) { m_currentPeak[0] = m_currentPeak[1] = DYN_NOISE_FLOOR; - m_rms[0] = new RmsHelper( 64 * engine::mixer()->processingSampleRate() / 44100 ); - m_rms[1] = new RmsHelper( 64 * engine::mixer()->processingSampleRate() / 44100 ); + m_rms[0] = new RmsHelper( 64 * Engine::mixer()->processingSampleRate() / 44100 ); + m_rms[1] = new RmsHelper( 64 * Engine::mixer()->processingSampleRate() / 44100 ); calcAttack(); calcRelease(); } @@ -76,12 +76,12 @@ dynProcEffect::~dynProcEffect() inline void dynProcEffect::calcAttack() { - m_attCoeff = exp10( ( DNF_LOG / ( m_dpControls.m_attackModel.value() * 0.001 ) ) / engine::mixer()->processingSampleRate() ); + m_attCoeff = exp10( ( DNF_LOG / ( m_dpControls.m_attackModel.value() * 0.001 ) ) / Engine::mixer()->processingSampleRate() ); } inline void dynProcEffect::calcRelease() { - m_relCoeff = exp10( ( -DNF_LOG / ( m_dpControls.m_releaseModel.value() * 0.001 ) ) / engine::mixer()->processingSampleRate() ); + m_relCoeff = exp10( ( -DNF_LOG / ( m_dpControls.m_releaseModel.value() * 0.001 ) ) / Engine::mixer()->processingSampleRate() ); } @@ -117,8 +117,8 @@ bool dynProcEffect::processAudioBuffer( sampleFrame * _buf, if( m_needsUpdate ) { - m_rms[0]->setSize( 64 * engine::mixer()->processingSampleRate() / 44100 ); - m_rms[1]->setSize( 64 * engine::mixer()->processingSampleRate() / 44100 ); + m_rms[0]->setSize( 64 * Engine::mixer()->processingSampleRate() / 44100 ); + m_rms[1]->setSize( 64 * Engine::mixer()->processingSampleRate() / 44100 ); calcAttack(); calcRelease(); m_needsUpdate = false; diff --git a/plugins/dynamics_processor/dynamics_processor_controls.cpp b/plugins/dynamics_processor/dynamics_processor_controls.cpp index 3a6619853..ecd33eb16 100644 --- a/plugins/dynamics_processor/dynamics_processor_controls.cpp +++ b/plugins/dynamics_processor/dynamics_processor_controls.cpp @@ -30,7 +30,7 @@ #include "dynamics_processor.h" #include "base64.h" #include "graph.h" -#include "engine.h" +#include "Engine.h" #include "Song.h" @@ -48,7 +48,7 @@ dynProcControls::dynProcControls( dynProcEffect * _eff ) : { connect( &m_wavegraphModel, SIGNAL( samplesChanged( int, int ) ), this, SLOT( samplesChanged( int, int ) ) ); - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) ); setDefaultShape(); @@ -63,7 +63,7 @@ void dynProcControls::sampleRateChanged() void dynProcControls::samplesChanged( int _begin, int _end) { - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -126,13 +126,13 @@ void dynProcControls::setDefaultShape() void dynProcControls::resetClicked() { setDefaultShape(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } void dynProcControls::smoothClicked() { m_wavegraphModel.smoothNonCyclic(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } void dynProcControls::addOneClicked() @@ -141,7 +141,7 @@ void dynProcControls::addOneClicked() { m_wavegraphModel.setSampleAt( i, qBound( 0.0f, m_wavegraphModel.samples()[i] * onedB, 1.0f ) ); } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } void dynProcControls::subOneClicked() @@ -150,7 +150,7 @@ void dynProcControls::subOneClicked() { m_wavegraphModel.setSampleAt( i, qBound( 0.0f, m_wavegraphModel.samples()[i] / onedB, 1.0f ) ); } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } diff --git a/plugins/flp_import/FlpImport.cpp b/plugins/flp_import/FlpImport.cpp index 9c5b7c233..64e6b38e9 100644 --- a/plugins/flp_import/FlpImport.cpp +++ b/plugins/flp_import/FlpImport.cpp @@ -39,7 +39,7 @@ #include "ConfigManager.h" #include "debug.h" #include "Effect.h" -#include "engine.h" +#include "Engine.h" #include "FxMixer.h" #include "FxMixerView.h" #include "group_box.h" @@ -767,8 +767,8 @@ bool FlpImport::tryImport( TrackContainer* tc ) int cur_channel = -1; - const bool is_journ = engine::projectJournal()->isJournalling(); - engine::projectJournal()->setJournalling( false ); + const bool is_journ = Engine::projectJournal()->isJournalling(); + Engine::projectJournal()->setJournalling( false ); while( file().atEnd() == false ) @@ -1411,22 +1411,22 @@ else // now create a project from FL_Project data structure - engine::getSong()->clearProject(); + Engine::getSong()->clearProject(); // configure the mixer for( int i=0; icreateChannel(); + Engine::fxMixer()->createChannel(); } - engine::fxMixerView()->refreshDisplay(); + Engine::fxMixerView()->refreshDisplay(); // set global parameters - engine::getSong()->setMasterVolume( p.mainVolume ); - engine::getSong()->setMasterPitch( p.mainPitch ); - engine::getSong()->setTempo( p.tempo ); + Engine::getSong()->setMasterVolume( p.mainVolume ); + Engine::getSong()->setMasterPitch( p.mainPitch ); + Engine::getSong()->setTempo( p.tempo ); // set project notes - engine::getProjectNotes()->setText( p.projectNotes ); + Engine::getProjectNotes()->setText( p.projectNotes ); progressDialog.setMaximum( p.maxPatterns + p.channels.size() + @@ -1437,11 +1437,11 @@ else QList bb_tracks; QList i_tracks; - while( engine::getBBTrackContainer()->numOfBBs() <= p.maxPatterns ) + while( Engine::getBBTrackContainer()->numOfBBs() <= p.maxPatterns ) { const int cur_pat = bb_tracks.size(); bbTrack * bbt = dynamic_cast( - Track::create( Track::BBTrack, engine::getSong() ) ); + Track::create( Track::BBTrack, Engine::getSong() ) ); if( p.patternNames.contains( cur_pat ) ) { bbt->setName( p.patternNames[cur_pat] ); @@ -1457,8 +1457,8 @@ else { InstrumentTrack * t = dynamic_cast( Track::create( Track::InstrumentTrack, - engine::getBBTrackContainer() ) ); - engine::getBBTrackContainer()->updateAfterTrackAdd(); + Engine::getBBTrackContainer() ) ); + Engine::getBBTrackContainer()->updateAfterTrackAdd(); i_tracks.push_back( t ); switch( it->pluginType ) { @@ -1657,7 +1657,7 @@ p->putValue( jt->pos, value, false ); for( int fx_ch = 0; fx_ch <= NumFLFxChannels ; ++fx_ch ) { - FxChannel * ch = engine::fxMixer()->effectChannel( fx_ch ); + FxChannel * ch = Engine::fxMixer()->effectChannel( fx_ch ); if( !ch ) { continue; @@ -1719,7 +1719,7 @@ p->putValue( jt->pos, value, false ); { continue; } - EffectChain * ec = &engine::fxMixer()-> + EffectChain * ec = &Engine::fxMixer()-> effectChannel( it->fxChannel )->m_fxChain; qDebug( "adding %s to %d\n", effName.toUtf8().constData(), it->fxChannel ); @@ -1763,14 +1763,14 @@ p->putValue( jt->pos, value, false ); // set current pattern - if( p.activeEditPattern < engine::getBBTrackContainer()->numOfBBs() ) + if( p.activeEditPattern < Engine::getBBTrackContainer()->numOfBBs() ) { - engine::getBBTrackContainer()->setCurrentBB( + Engine::getBBTrackContainer()->setCurrentBB( p.activeEditPattern ); } // restore journalling settings - engine::projectJournal()->setJournalling( is_journ ); + Engine::projectJournal()->setJournalling( is_journ ); return true; } diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index 30f78be25..7738b6422 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -28,7 +28,7 @@ #include #include "kicker.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "knob.h" #include "NotePlayHandle.h" @@ -166,7 +166,7 @@ void kickerInstrument::playNote( NotePlayHandle * _n, const fpp_t frames = _n->framesLeftForCurrentPeriod(); const f_cnt_t offset = _n->noteOffset(); const float decfr = m_decayModel.value() * - engine::mixer()->processingSampleRate() / 1000.0f; + Engine::mixer()->processingSampleRate() / 1000.0f; const f_cnt_t tfp = _n->totalFramesPlayed(); if ( tfp == 0 ) @@ -190,7 +190,7 @@ void kickerInstrument::playNote( NotePlayHandle * _n, } SweepOsc * so = static_cast( _n->m_pluginData ); - so->update( _working_buffer + offset, frames, engine::mixer()->processingSampleRate() ); + so->update( _working_buffer + offset, frames, Engine::mixer()->processingSampleRate() ); if( _n->isReleased() ) { diff --git a/plugins/ladspa_browser/ladspa_description.cpp b/plugins/ladspa_browser/ladspa_description.cpp index d4e6b35a6..88cb07ac0 100644 --- a/plugins/ladspa_browser/ladspa_description.cpp +++ b/plugins/ladspa_browser/ladspa_description.cpp @@ -31,7 +31,7 @@ #include #include "AudioDevice.h" -#include "engine.h" +#include "Engine.h" #include "ladspa_2_lmms.h" #include "Mixer.h" @@ -41,7 +41,7 @@ ladspaDescription::ladspaDescription( QWidget * _parent, ladspaPluginType _type ) : QWidget( _parent ) { - ladspa2LMMS * manager = engine::getLADSPAManager(); + ladspa2LMMS * manager = Engine::getLADSPAManager(); l_sortable_plugin_t plugins; switch( _type ) @@ -74,7 +74,7 @@ ladspaDescription::ladspaDescription( QWidget * _parent, { if( _type != VALID || manager->getDescription( ( *it ).second )->inputChannels - <= engine::mixer()->audioDev()->channels() ) + <= Engine::mixer()->audioDev()->channels() ) { pluginNames.push_back( ( *it ).first ); m_pluginKeys.push_back( ( *it ).second ); @@ -128,7 +128,7 @@ void ladspaDescription::update( const ladspa_key_t & _key ) QVBoxLayout * layout = new QVBoxLayout( description ); layout->setSizeConstraint( QLayout::SetFixedSize ); - ladspa2LMMS * manager = engine::getLADSPAManager(); + ladspa2LMMS * manager = Engine::getLADSPAManager(); QLabel * name = new QLabel( description ); name->setText( QWidget::tr( "Name: " ) + manager->getName( _key ) ); diff --git a/plugins/ladspa_browser/ladspa_port_dialog.cpp b/plugins/ladspa_browser/ladspa_port_dialog.cpp index fef68280c..49ab388e8 100644 --- a/plugins/ladspa_browser/ladspa_port_dialog.cpp +++ b/plugins/ladspa_browser/ladspa_port_dialog.cpp @@ -29,14 +29,14 @@ #include #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "ladspa_2_lmms.h" #include "Mixer.h" ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key ) { - ladspa2LMMS * manager = engine::getLADSPAManager(); + ladspa2LMMS * manager = Engine::getLADSPAManager(); setWindowIcon( embed::getIconPixmap( "ports" ) ); setWindowTitle( tr( "Ports" ) ); @@ -87,11 +87,11 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key ) { if( min != NOHINT ) { - min *= engine::mixer()->processingSampleRate(); + min *= Engine::mixer()->processingSampleRate(); } if( max != NOHINT ) { - max *= engine::mixer()->processingSampleRate(); + max *= Engine::mixer()->processingSampleRate(); } } diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index 306273b11..e10c5f05d 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -30,7 +30,7 @@ #include "lb302.h" #include "automatable_button.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentPlayHandle.h" #include "InstrumentTrack.h" #include "knob.h" @@ -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::mixer()->processingSampleRate(); - vcf_e1*=M_PI/engine::mixer()->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::mixer()->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::mixer()->processingSampleRate(); + kfcn = 2.0 * kfco / Engine::mixer()->processingSampleRate(); #else kfcn = w; #endif @@ -284,7 +284,7 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) : { - connect( engine::mixer(), SIGNAL( sampleRateChanged( ) ), + connect( Engine::mixer(), SIGNAL( sampleRateChanged( ) ), this, SLOT ( filterChanged( ) ) ); connect( &vcf_cut_knob, SIGNAL( dataChanged( ) ), @@ -354,7 +354,7 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) : filterChanged(); InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrumentTrack ); - engine::mixer()->addPlayHandle( iph ); + Engine::mixer()->addPlayHandle( iph ); } @@ -413,7 +413,7 @@ void lb302Synth::filterChanged() float d = 0.2 + (2.3*vcf_dec_knob.value()); - d *= engine::mixer()->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 @@ -463,12 +463,12 @@ inline int MIN(int a, int b) { } inline float GET_INC(float freq) { - return freq/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate. + return freq/Engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate. } int lb302Synth::process(sampleFrame *outbuf, const int size) { - const float sampleRatio = 44100.f / engine::mixer()->processingSampleRate(); + const float sampleRatio = 44100.f / Engine::mixer()->processingSampleRate(); float w; float samp; @@ -643,7 +643,7 @@ int lb302Synth::process(sampleFrame *outbuf, const int size) // Handle Envelope if(vca_mode==0) { vca_a+=(vca_a0-vca_a)*vca_attack; - if(sample_cnt>=0.5*engine::mixer()->processingSampleRate()) + if(sample_cnt>=0.5*Engine::mixer()->processingSampleRate()) vca_mode = 2; } else if(vca_mode == 1) { @@ -793,7 +793,7 @@ void lb302Synth::play( sampleFrame * _working_buffer ) processNote( m_notes.takeFirst() ); }; - const fpp_t frames = engine::mixer()->framesPerPeriod(); + const fpp_t frames = Engine::mixer()->framesPerPeriod(); process( _working_buffer, frames ); instrumentTrack()->processAudioBuffer( _working_buffer, frames, NULL ); diff --git a/plugins/monstro/Monstro.cpp b/plugins/monstro/Monstro.cpp index e34c36039..70717d9a6 100644 --- a/plugins/monstro/Monstro.cpp +++ b/plugins/monstro/Monstro.cpp @@ -26,7 +26,7 @@ #include #include "Monstro.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "templates.h" #include "gui_templates.h" @@ -1012,9 +1012,9 @@ MonstroInstrument::MonstroInstrument( InstrumentTrack * _instrument_track ) : // updateSampleRate - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSamplerate() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSamplerate() ) ); - m_fpp = engine::mixer()->framesPerPeriod(); + m_fpp = Engine::mixer()->framesPerPeriod(); updateSamplerate(); updateVolume1(); @@ -1425,7 +1425,7 @@ void MonstroInstrument::updateLFOAtts() void MonstroInstrument::updateSamplerate() { - m_samplerate = engine::mixer()->processingSampleRate(); + m_samplerate = Engine::mixer()->processingSampleRate(); m_integrator = 0.5f - ( 0.5f - INTEGRATOR ) * 44100.0f / m_samplerate; m_fmCorrection = 44100.f / m_samplerate * FM_AMOUNT; diff --git a/plugins/nes/Nes.cpp b/plugins/nes/Nes.cpp index b5ee3f5e2..0180551ae 100644 --- a/plugins/nes/Nes.cpp +++ b/plugins/nes/Nes.cpp @@ -26,7 +26,7 @@ #include #include "Nes.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "templates.h" #include "tooltip.h" @@ -560,7 +560,7 @@ void NesInstrument::playNote( NotePlayHandle * n, sampleFrame * workingBuffer ) if ( n->totalFramesPlayed() == 0 || n->m_pluginData == NULL ) { - NesObject * nes = new NesObject( this, engine::mixer()->processingSampleRate(), n ); + NesObject * nes = new NesObject( this, Engine::mixer()->processingSampleRate(), n ); n->m_pluginData = nes; } diff --git a/plugins/opl2/opl2instrument.cpp b/plugins/opl2/opl2instrument.cpp index 4f1e810ef..d5b7cacfc 100644 --- a/plugins/opl2/opl2instrument.cpp +++ b/plugins/opl2/opl2instrument.cpp @@ -45,7 +45,7 @@ #include "mididata.h" #include "debug.h" #include "Instrument.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentPlayHandle.h" #include "InstrumentTrack.h" @@ -139,14 +139,14 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) : { // Connect the plugin to the mixer... InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track ); - engine::mixer()->addPlayHandle( iph ); + Engine::mixer()->addPlayHandle( iph ); // Voices are laid out in a funny way... // adlib_opadd = {0x00, 0x01, 0x02, 0x08, 0x09, 0x0A, 0x10, 0x11, 0x12}; // Create an emulator - samplerate, 16 bit, mono emulatorMutex.lock(); - theEmulator = new CTemuopl(engine::mixer()->processingSampleRate(), true, false); + theEmulator = new CTemuopl(Engine::mixer()->processingSampleRate(), true, false); theEmulator->init(); // Enable waveform selection theEmulator->write(0x01,0x20); @@ -163,7 +163,7 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) : updatePatch(); // Can the buffer size change suddenly? I bet that would break lots of stuff - frameCount = engine::mixer()->framesPerPeriod(); + frameCount = Engine::mixer()->framesPerPeriod(); renderbuffer = new short[frameCount]; // Some kind of sane defaults @@ -173,7 +173,7 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) : tuneEqual(69, 440); - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( reloadEmulator() ) ); // Connect knobs // This one's for testing... @@ -221,7 +221,7 @@ opl2instrument::opl2instrument( InstrumentTrack * _instrument_track ) : opl2instrument::~opl2instrument() { delete theEmulator; - engine::mixer()->removePlayHandles( instrumentTrack() ); + Engine::mixer()->removePlayHandles( instrumentTrack() ); delete [] renderbuffer; } @@ -229,7 +229,7 @@ opl2instrument::~opl2instrument() { void opl2instrument::reloadEmulator() { delete theEmulator; emulatorMutex.lock(); - theEmulator = new CTemuopl(engine::mixer()->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 6cafcad34..5bfb2d863 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -30,7 +30,7 @@ #include -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "knob.h" #include "NotePlayHandle.h" @@ -143,7 +143,7 @@ organicInstrument::organicInstrument( InstrumentTrack * _instrument_track ) : } - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateAllDetuning() ) ); } @@ -628,10 +628,10 @@ void OscillatorObject::updateDetuning() { m_detuningLeft = powf( 2.0f, organicInstrument::s_harmonics[ static_cast( m_harmModel.value() ) ] + (float)m_detuneModel.value() * CENT ) / - engine::mixer()->processingSampleRate(); + Engine::mixer()->processingSampleRate(); m_detuningRight = powf( 2.0f, organicInstrument::s_harmonics[ static_cast( m_harmModel.value() ) ] - (float)m_detuneModel.value() * CENT ) / - engine::mixer()->processingSampleRate(); + Engine::mixer()->processingSampleRate(); } diff --git a/plugins/papu/papu_instrument.cpp b/plugins/papu/papu_instrument.cpp index 6ad4573f7..fc5ff38b7 100644 --- a/plugins/papu/papu_instrument.cpp +++ b/plugins/papu/papu_instrument.cpp @@ -35,7 +35,7 @@ #include "NotePlayHandle.h" #include "pixmap_button.h" #include "tooltip.h" -#include "engine.h" +#include "Engine.h" #include "graph.h" #include "embed.cpp" @@ -237,7 +237,7 @@ void papuInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) { const f_cnt_t tfp = _n->totalFramesPlayed(); - const int samplerate = engine::mixer()->processingSampleRate(); + const int samplerate = Engine::mixer()->processingSampleRate(); const fpp_t frames = _n->framesLeftForCurrentPeriod(); const f_cnt_t offset = _n->noteOffset(); diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 8a97fc577..80dcb5f73 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -30,7 +30,7 @@ #include #include "endian_handling.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "InstrumentTrack.h" #include "NotePlayHandle.h" @@ -551,7 +551,7 @@ void PatmanView::openFile( void ) if( f != "" ) { m_pi->setFile( f ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } } } diff --git a/plugins/peak_controller_effect/peak_controller_effect.cpp b/plugins/peak_controller_effect/peak_controller_effect.cpp index 238006357..105b9daea 100644 --- a/plugins/peak_controller_effect/peak_controller_effect.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect.cpp @@ -66,8 +66,8 @@ PeakControllerEffect::PeakControllerEffect( m_lastSample( 0 ), m_autoController( NULL ) { - m_autoController = new PeakController( engine::getSong(), this ); - engine::getSong()->addController( m_autoController ); + m_autoController = new PeakController( Engine::getSong(), this ); + Engine::getSong()->addController( m_autoController ); PeakController::s_effects.append( this ); } @@ -80,7 +80,7 @@ PeakControllerEffect::~PeakControllerEffect() if( idx >= 0 ) { PeakController::s_effects.remove( idx ); - engine::getSong()->removeController( m_autoController ); + Engine::getSong()->removeController( m_autoController ); } } diff --git a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp index c200903ba..2b040fcc0 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp @@ -72,7 +72,7 @@ void PeakControllerEffectControls::loadSettings( const QDomElement & _this ) * m_effectId is copied, then there would be two instruments * having the same id. */ - if( engine::getSong()->isLoadingProject() == true ) + if( Engine::getSong()->isLoadingProject() == true ) { m_effect->m_effectId = _this.attribute( "effectId" ).toInt(); } diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 9fae191fc..f6eb4c784 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -30,7 +30,7 @@ #include "FileDialog.h" #include "sf2_player.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "InstrumentPlayHandle.h" #include "NotePlayHandle.h" @@ -119,7 +119,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) : m_synth = new_fluid_synth( m_settings ); InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track ); - engine::mixer()->addPlayHandle( iph ); + Engine::mixer()->addPlayHandle( iph ); loadFile( ConfigManager::inst()->defaultSoundfont() ); @@ -133,7 +133,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) : connect( &m_bankNum, SIGNAL( dataChanged() ), this, SLOT( updatePatch() ) ); connect( &m_patchNum, SIGNAL( dataChanged() ), this, SLOT( updatePatch() ) ); - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); // Gain connect( &m_gain, SIGNAL( dataChanged() ), this, SLOT( updateGain() ) ); @@ -158,7 +158,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) : sf2Instrument::~sf2Instrument() { - engine::mixer()->removePlayHandles( instrumentTrack() ); + Engine::mixer()->removePlayHandles( instrumentTrack() ); freeFont(); delete_fluid_synth( m_synth ); delete_fluid_settings( m_settings ); @@ -465,7 +465,7 @@ void sf2Instrument::updateSampleRate() double tempRate; // Set & get, returns the true sample rate - fluid_settings_setnum( m_settings, (char *) "synth.sample-rate", engine::mixer()->processingSampleRate() ); + fluid_settings_setnum( m_settings, (char *) "synth.sample-rate", Engine::mixer()->processingSampleRate() ); fluid_settings_getnum( m_settings, (char *) "synth.sample-rate", &tempRate ); m_internalSampleRate = static_cast( tempRate ); @@ -495,7 +495,7 @@ void sf2Instrument::updateSampleRate() } m_synthMutex.lock(); - if( engine::mixer()->currentQualitySettings().interpolation >= + if( Engine::mixer()->currentQualitySettings().interpolation >= Mixer::qualitySettings::Interpolation_SincFastest ) { fluid_synth_set_interp_method( m_synth, -1, FLUID_INTERP_7THORDER ); @@ -505,7 +505,7 @@ void sf2Instrument::updateSampleRate() fluid_synth_set_interp_method( m_synth, -1, FLUID_INTERP_DEFAULT ); } m_synthMutex.unlock(); - if( m_internalSampleRate < engine::mixer()->processingSampleRate() ) + if( m_internalSampleRate < Engine::mixer()->processingSampleRate() ) { m_synthMutex.lock(); if( m_srcState != NULL ) @@ -513,7 +513,7 @@ void sf2Instrument::updateSampleRate() src_delete( m_srcState ); } int error; - m_srcState = src_new( engine::mixer()->currentQualitySettings().libsrcInterpolation(), DEFAULT_CHANNELS, &error ); + m_srcState = src_new( Engine::mixer()->currentQualitySettings().libsrcInterpolation(), DEFAULT_CHANNELS, &error ); if( m_srcState == NULL || error ) { qCritical( "error while creating libsamplerate data structure in Sf2Instrument::updateSampleRate()" ); @@ -641,7 +641,7 @@ void sf2Instrument::noteOff( SF2PluginData * n ) void sf2Instrument::play( sampleFrame * _working_buffer ) { - const fpp_t frames = engine::mixer()->framesPerPeriod(); + const fpp_t frames = Engine::mixer()->framesPerPeriod(); // set midi pitch for this period const int currentMidiPitch = instrumentTrack()->midiPitch(); @@ -722,10 +722,10 @@ void sf2Instrument::play( sampleFrame * _working_buffer ) void sf2Instrument::renderFrames( f_cnt_t frames, sampleFrame * buf ) { m_synthMutex.lock(); - if( m_internalSampleRate < engine::mixer()->processingSampleRate() && + if( m_internalSampleRate < Engine::mixer()->processingSampleRate() && m_srcState != NULL ) { - const fpp_t f = frames * m_internalSampleRate / engine::mixer()->processingSampleRate(); + const fpp_t f = frames * m_internalSampleRate / Engine::mixer()->processingSampleRate(); #ifdef __GNUC__ sampleFrame tmp[f]; #else @@ -1084,7 +1084,7 @@ void sf2InstrumentView::showFileDialog() if( f != "" ) { k->openFile( f ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } } diff --git a/plugins/sfxr/sfxr.cpp b/plugins/sfxr/sfxr.cpp index 66d412ff7..cd14af241 100644 --- a/plugins/sfxr/sfxr.cpp +++ b/plugins/sfxr/sfxr.cpp @@ -39,7 +39,7 @@ float frnd(float range) #include #include "sfxr.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "knob.h" #include "NotePlayHandle.h" @@ -451,7 +451,7 @@ QString sfxrInstrument::nodeName() const void sfxrInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) { - float currentSampleRate = engine::mixer()->processingSampleRate(); + float currentSampleRate = Engine::mixer()->processingSampleRate(); fpp_t frameNum = _n->framesLeftForCurrentPeriod(); const f_cnt_t offset = _n->noteOffset(); diff --git a/plugins/sid/sid_instrument.cpp b/plugins/sid/sid_instrument.cpp index 4a219f9f9..6942daa2d 100644 --- a/plugins/sid/sid_instrument.cpp +++ b/plugins/sid/sid_instrument.cpp @@ -32,7 +32,7 @@ #include "sid.h" #include "sid_instrument.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "knob.h" #include "NotePlayHandle.h" @@ -230,7 +230,7 @@ QString sidInstrument::nodeName() const f_cnt_t sidInstrument::desiredReleaseFrames() const { - const float samplerate = engine::mixer()->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::mixer()->processingSampleRate(); + const int samplerate = Engine::mixer()->processingSampleRate(); if ( tfp == 0 ) { diff --git a/plugins/stereo_enhancer/stereo_enhancer.h b/plugins/stereo_enhancer/stereo_enhancer.h index 41ba7d4bc..931d906a5 100644 --- a/plugins/stereo_enhancer/stereo_enhancer.h +++ b/plugins/stereo_enhancer/stereo_enhancer.h @@ -28,7 +28,7 @@ #include "Effect.h" #include "DspEffectLibrary.h" -#include "engine.h" +#include "Engine.h" #include "stereoenhancer_controls.h" class stereoEnhancerEffect : public Effect diff --git a/plugins/triple_oscillator/TripleOscillator.cpp b/plugins/triple_oscillator/TripleOscillator.cpp index be54e0f91..97bd18de7 100644 --- a/plugins/triple_oscillator/TripleOscillator.cpp +++ b/plugins/triple_oscillator/TripleOscillator.cpp @@ -30,7 +30,7 @@ #include "TripleOscillator.h" #include "automatable_button.h" #include "debug.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "knob.h" #include "NotePlayHandle.h" @@ -175,7 +175,7 @@ void OscillatorObject::updateDetuningLeft() { m_detuningLeft = powf( 2.0f, ( (float)m_coarseModel.value() * 100.0f + (float)m_fineLeftModel.value() ) / 1200.0f ) - / engine::mixer()->processingSampleRate(); + / Engine::mixer()->processingSampleRate(); } @@ -185,7 +185,7 @@ void OscillatorObject::updateDetuningRight() { m_detuningRight = powf( 2.0f, ( (float)m_coarseModel.value() * 100.0f + (float)m_fineRightModel.value() ) / 1200.0f ) - / engine::mixer()->processingSampleRate(); + / Engine::mixer()->processingSampleRate(); } @@ -217,7 +217,7 @@ TripleOscillator::TripleOscillator( InstrumentTrack * _instrument_track ) : } - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateAllDetuning() ) ); } diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 7a165d6ac..4b3f7b386 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -32,7 +32,7 @@ #include #include -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "InstrumentPlayHandle.h" #include "InstrumentTrack.h" @@ -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, _instrument_track ); - engine::mixer()->addPlayHandle( iph ); + Engine::mixer()->addPlayHandle( iph ); } @@ -101,7 +101,7 @@ vestigeInstrument::~vestigeInstrument() knobFModel = NULL; } - engine::mixer()->removePlayHandles( instrumentTrack() ); + Engine::mixer()->removePlayHandles( instrumentTrack() ); closePlugin(); } @@ -302,7 +302,7 @@ void vestigeInstrument::play( sampleFrame * _buf ) m_plugin->process( NULL, _buf ); - const fpp_t frames = engine::mixer()->framesPerPeriod(); + const fpp_t frames = Engine::mixer()->framesPerPeriod(); instrumentTrack()->processAudioBuffer( _buf, frames, NULL ); @@ -647,7 +647,7 @@ void VestigeInstrumentView::openPlugin() { return; } - engine::mixer()->lock(); + Engine::mixer()->lock(); if (m_vi->p_subWindow != NULL) { delete m_vi->p_subWindow; @@ -655,7 +655,7 @@ void VestigeInstrumentView::openPlugin() } m_vi->loadFile( ofd.selectedFiles()[0] ); - engine::mixer()->unlock(); + Engine::mixer()->unlock(); if( m_vi->m_plugin && m_vi->m_plugin->pluginWidget() ) { m_vi->m_plugin->pluginWidget()->setWindowIcon( @@ -881,7 +881,7 @@ manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrume widget = new QWidget(this); l = new QGridLayout( this ); - m_vi->m_subWindow = engine::mainWindow()->workspace()->addSubWindow(new QMdiSubWindow, Qt::SubWindow | + m_vi->m_subWindow = Engine::mainWindow()->workspace()->addSubWindow(new QMdiSubWindow, Qt::SubWindow | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint); m_vi->m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::MinimumExpanding ); m_vi->m_subWindow->setFixedWidth( 960 ); diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 248944102..3368bebe7 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -27,7 +27,7 @@ #include #include "vibed.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "NotePlayHandle.h" #include "tooltip.h" @@ -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::mixer()->processingSampleRate(), + Engine::mixer()->processingSampleRate(), __sampleLength ); for( int i = 0; i < 9; ++i ) @@ -690,7 +690,7 @@ void vibedView::showString( int _string ) void vibedView::sinWaveClicked() { m_graph->model()->setWaveToSine(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -698,7 +698,7 @@ void vibedView::sinWaveClicked() void vibedView::triangleWaveClicked() { m_graph->model()->setWaveToTriangle(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -706,7 +706,7 @@ void vibedView::triangleWaveClicked() void vibedView::sawWaveClicked() { m_graph->model()->setWaveToSaw(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -714,7 +714,7 @@ void vibedView::sawWaveClicked() void vibedView::sqrWaveClicked() { m_graph->model()->setWaveToSquare(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -722,7 +722,7 @@ void vibedView::sqrWaveClicked() void vibedView::noiseWaveClicked() { m_graph->model()->setWaveToNoise(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -731,7 +731,7 @@ void vibedView::usrWaveClicked() { QString fileName = m_graph->model()->setWaveToUser(); toolTip::add( m_usrWaveBtn, fileName ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -739,7 +739,7 @@ void vibedView::usrWaveClicked() void vibedView::smoothClicked() { m_graph->model()->smooth(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -747,7 +747,7 @@ void vibedView::smoothClicked() void vibedView::normalizeClicked() { m_graph->model()->normalize(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } diff --git a/plugins/vibed/vibrating_string.cpp b/plugins/vibed/vibrating_string.cpp index 494f987c0..37d0ab709 100644 --- a/plugins/vibed/vibrating_string.cpp +++ b/plugins/vibed/vibrating_string.cpp @@ -27,7 +27,7 @@ #include "templates.h" #include "interpolation.h" #include "Mixer.h" -#include "engine.h" +#include "Engine.h" vibratingString::vibratingString( float _pitch, @@ -42,7 +42,7 @@ vibratingString::vibratingString( float _pitch, float _detune, bool _state ) : m_oversample( 2 * _oversample / (int)( _sample_rate / - engine::mixer()->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 683e25951..f6a38adc8 100644 --- a/plugins/vst_base/VstPlugin.cpp +++ b/plugins/vst_base/VstPlugin.cpp @@ -46,7 +46,7 @@ #endif #include "ConfigManager.h" -#include "engine.h" +#include "Engine.h" #include "MainWindow.h" #include "Song.h" #include "templates.h" @@ -108,11 +108,11 @@ VstPlugin::VstPlugin( const QString & _plugin ) : } #endif - setTempo( engine::getSong()->getTempo() ); + setTempo( Engine::getSong()->getTempo() ); - connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), + connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), this, SLOT( setTempo( bpm_t ) ) ); - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); // update once per second @@ -237,7 +237,7 @@ void VstPlugin::showEditor( QWidget * _parent, bool isEffect ) if( _parent == NULL ) { vstSubWin * sw = new vstSubWin( - engine::mainWindow()->workspace() ); + Engine::mainWindow()->workspace() ); if( isEffect ) { sw->setAttribute( Qt::WA_TranslucentBackground ); @@ -377,7 +377,7 @@ void VstPlugin::updateSampleRate() { lock(); sendMessage( message( IdSampleRateInformation ). - addInt( engine::mixer()->processingSampleRate() ) ); + addInt( Engine::mixer()->processingSampleRate() ) ); unlock(); } diff --git a/plugins/watsyn/Watsyn.cpp b/plugins/watsyn/Watsyn.cpp index 8deb012a2..1d2f8e59b 100644 --- a/plugins/watsyn/Watsyn.cpp +++ b/plugins/watsyn/Watsyn.cpp @@ -26,7 +26,7 @@ #include "Watsyn.h" #include "base64.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "templates.h" #include "tooltip.h" @@ -337,8 +337,8 @@ void WatsynInstrument::playNote( NotePlayHandle * _n, &B1_wave[0], &B2_wave[0], m_amod.value(), m_bmod.value(), - engine::mixer()->processingSampleRate(), _n, - engine::mixer()->framesPerPeriod(), this ); + Engine::mixer()->processingSampleRate(), _n, + Engine::mixer()->framesPerPeriod(), this ); _n->m_pluginData = w; } @@ -983,19 +983,19 @@ void WatsynView::sinWaveClicked() { case A1_OSC: a1_graph->model()->setWaveToSine(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case A2_OSC: a2_graph->model()->setWaveToSine(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B1_OSC: b1_graph->model()->setWaveToSine(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B2_OSC: b2_graph->model()->setWaveToSine(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } @@ -1007,19 +1007,19 @@ void WatsynView::triWaveClicked() { case A1_OSC: a1_graph->model()->setWaveToTriangle(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case A2_OSC: a2_graph->model()->setWaveToTriangle(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B1_OSC: b1_graph->model()->setWaveToTriangle(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B2_OSC: b2_graph->model()->setWaveToTriangle(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } @@ -1031,19 +1031,19 @@ void WatsynView::sawWaveClicked() { case A1_OSC: a1_graph->model()->setWaveToSaw(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case A2_OSC: a2_graph->model()->setWaveToSaw(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B1_OSC: b1_graph->model()->setWaveToSaw(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B2_OSC: b2_graph->model()->setWaveToSaw(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } @@ -1055,19 +1055,19 @@ void WatsynView::sqrWaveClicked() { case A1_OSC: a1_graph->model()->setWaveToSquare(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case A2_OSC: a2_graph->model()->setWaveToSquare(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B1_OSC: b1_graph->model()->setWaveToSquare(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B2_OSC: b2_graph->model()->setWaveToSquare(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } @@ -1079,19 +1079,19 @@ void WatsynView::normalizeClicked() { case A1_OSC: a1_graph->model()->normalize(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case A2_OSC: a2_graph->model()->normalize(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B1_OSC: b1_graph->model()->normalize(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B2_OSC: b2_graph->model()->normalize(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } @@ -1103,19 +1103,19 @@ void WatsynView::invertClicked() { case A1_OSC: a1_graph->model()->invert(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case A2_OSC: a2_graph->model()->invert(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B1_OSC: b1_graph->model()->invert(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B2_OSC: b2_graph->model()->invert(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } @@ -1127,19 +1127,19 @@ void WatsynView::smoothClicked() { case A1_OSC: a1_graph->model()->smooth(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case A2_OSC: a2_graph->model()->smooth(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B1_OSC: b1_graph->model()->smooth(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B2_OSC: b2_graph->model()->smooth(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } @@ -1151,19 +1151,19 @@ void WatsynView::phaseLeftClicked() { case A1_OSC: a1_graph->model()->shiftPhase( -15 ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case A2_OSC: a2_graph->model()->shiftPhase( -15 ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B1_OSC: b1_graph->model()->shiftPhase( -15 ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B2_OSC: b2_graph->model()->shiftPhase( -15 ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } @@ -1175,19 +1175,19 @@ void WatsynView::phaseRightClicked() { case A1_OSC: a1_graph->model()->shiftPhase( 15 ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case A2_OSC: a2_graph->model()->shiftPhase( 15 ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B1_OSC: b1_graph->model()->shiftPhase( 15 ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B2_OSC: b2_graph->model()->shiftPhase( 15 ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } @@ -1200,19 +1200,19 @@ void WatsynView::loadClicked() { case A1_OSC: a1_graph->model()->setWaveToUser(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case A2_OSC: a2_graph->model()->setWaveToUser(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B1_OSC: b1_graph->model()->setWaveToUser(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; case B2_OSC: b2_graph->model()->setWaveToUser(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } diff --git a/plugins/waveshaper/waveshaper_controls.cpp b/plugins/waveshaper/waveshaper_controls.cpp index 6b612234b..5091861a6 100644 --- a/plugins/waveshaper/waveshaper_controls.cpp +++ b/plugins/waveshaper/waveshaper_controls.cpp @@ -30,7 +30,7 @@ #include "waveshaper.h" #include "base64.h" #include "graph.h" -#include "engine.h" +#include "Engine.h" #include "Song.h" @@ -55,7 +55,7 @@ waveShaperControls::waveShaperControls( waveShaperEffect * _eff ) : void waveShaperControls::samplesChanged( int _begin, int _end) { - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -115,13 +115,13 @@ void waveShaperControls::setDefaultShape() void waveShaperControls::resetClicked() { setDefaultShape(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } void waveShaperControls::smoothClicked() { m_wavegraphModel.smoothNonCyclic(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } void waveShaperControls::addOneClicked() @@ -130,7 +130,7 @@ void waveShaperControls::addOneClicked() { m_wavegraphModel.setSampleAt( i, qBound( 0.0f, m_wavegraphModel.samples()[i] * onedB, 1.0f ) ); } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } void waveShaperControls::subOneClicked() @@ -139,7 +139,7 @@ void waveShaperControls::subOneClicked() { m_wavegraphModel.setSampleAt( i, qBound( 0.0f, m_wavegraphModel.samples()[i] / onedB, 1.0f ) ); } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index 91b8f43b5..52f6f2a01 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -32,7 +32,7 @@ #include #include "ZynAddSubFx.h" -#include "engine.h" +#include "Engine.h" #include "knob.h" #include "led_checkbox.h" #include "DataFile.h" @@ -130,9 +130,9 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument( // now we need a play-handle which cares for calling play() InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrumentTrack ); - engine::mixer()->addPlayHandle( iph ); + Engine::mixer()->addPlayHandle( iph ); - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( reloadPlugin() ) ); connect( instrumentTrack()->pitchRangeModel(), SIGNAL( dataChanged() ), @@ -144,7 +144,7 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument( ZynAddSubFxInstrument::~ZynAddSubFxInstrument() { - engine::mixer()->removePlayHandles( instrumentTrack() ); + Engine::mixer()->removePlayHandles( instrumentTrack() ); m_pluginMutex.lock(); delete m_plugin; @@ -333,7 +333,7 @@ void ZynAddSubFxInstrument::play( sampleFrame * _buf ) m_plugin->processAudio( _buf ); } m_pluginMutex.unlock(); - instrumentTrack()->processAudioBuffer( _buf, engine::mixer()->framesPerPeriod(), NULL ); + instrumentTrack()->processAudioBuffer( _buf, Engine::mixer()->framesPerPeriod(), NULL ); } @@ -443,11 +443,11 @@ void ZynAddSubFxInstrument::initPlugin() QString( ConfigManager::inst()->factoryPresetsDir() + QDir::separator() + "ZynAddSubFX" ) ) ) ); - m_remotePlugin->updateSampleRate( engine::mixer()->processingSampleRate() ); + m_remotePlugin->updateSampleRate( Engine::mixer()->processingSampleRate() ); // temporary workaround until the VST synchronization feature gets stripped out of the RemotePluginClient class // causing not to send buffer size information requests - m_remotePlugin->sendMessage( RemotePlugin::message( IdBufferSizeInformation ).addInt( engine::mixer()->framesPerPeriod() ) ); + m_remotePlugin->sendMessage( RemotePlugin::message( IdBufferSizeInformation ).addInt( Engine::mixer()->framesPerPeriod() ) ); m_remotePlugin->showUI(); m_remotePlugin->unlock(); @@ -455,8 +455,8 @@ void ZynAddSubFxInstrument::initPlugin() else { m_plugin = new LocalZynAddSubFx; - m_plugin->setSampleRate( engine::mixer()->processingSampleRate() ); - m_plugin->setBufferSize( engine::mixer()->framesPerPeriod() ); + m_plugin->setSampleRate( Engine::mixer()->processingSampleRate() ); + m_plugin->setBufferSize( Engine::mixer()->framesPerPeriod() ); } m_pluginMutex.unlock(); diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index b527f3673..9549f5ad1 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -52,7 +52,7 @@ AutomatableModel::AutomatableModel( DataType type, m_hasStrictStepSize( false ), m_hasLinkedModels( false ), m_controllerConnection( NULL ), - m_valueBuffer( static_cast( engine::mixer()->framesPerPeriod() ) ), + m_valueBuffer( static_cast( Engine::mixer()->framesPerPeriod() ) ), m_lastUpdatedPeriod( -1 ), m_hasSampleExactData( false ) diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index 79f009e05..c5aa7a02b 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -79,10 +79,10 @@ AutomationPattern::AutomationPattern( const AutomationPattern & _pat_to_copy ) : AutomationPattern::~AutomationPattern() { - if( engine::automationEditor() && - engine::automationEditor()->currentPattern() == this ) + if( Engine::automationEditor() && + Engine::automationEditor()->currentPattern() == this ) { - engine::automationEditor()->setCurrentPattern( NULL ); + Engine::automationEditor()->setCurrentPattern( NULL ); } } @@ -186,9 +186,9 @@ MidiTime AutomationPattern::putValue( const MidiTime & _time, { cleanObjects(); - MidiTime newTime = _quant_pos && engine::automationEditor() ? + MidiTime newTime = _quant_pos && Engine::automationEditor() ? note::quantized( _time, - engine::automationEditor()->quantization() ) : + Engine::automationEditor()->quantization() ) : _time; m_timeMap[newTime] = _value; @@ -219,9 +219,9 @@ void AutomationPattern::removeValue( const MidiTime & _time, { cleanObjects(); - MidiTime newTime = _quant_pos && engine::automationEditor() ? + MidiTime newTime = _quant_pos && Engine::automationEditor() ? note::quantized( _time, - engine::automationEditor()->quantization() ) : + Engine::automationEditor()->quantization() ) : _time; m_timeMap.remove( newTime ); @@ -259,9 +259,9 @@ MidiTime AutomationPattern::setDragValue( const MidiTime & _time, const float _v { if( m_dragging == false ) { - MidiTime newTime = _quant_pos && engine::automationEditor() ? + MidiTime newTime = _quant_pos && Engine::automationEditor() ? note::quantized( _time, - engine::automationEditor()->quantization() ) : + Engine::automationEditor()->quantization() ) : _time; this->removeValue( newTime ); m_oldTimeMap = m_timeMap; @@ -523,9 +523,9 @@ trackContentObjectView * AutomationPattern::createView( trackView * _tv ) bool AutomationPattern::isAutomated( const AutomatableModel * _m ) { TrackContainer::TrackList l; - l += engine::getSong()->tracks(); - l += engine::getBBTrackContainer()->tracks(); - l += engine::getSong()->globalAutomationTrack(); + l += Engine::getSong()->tracks(); + l += Engine::getBBTrackContainer()->tracks(); + l += Engine::getSong()->globalAutomationTrack(); for( TrackContainer::TrackList::ConstIterator it = l.begin(); it != l.end(); ++it ) { @@ -560,9 +560,9 @@ QVector AutomationPattern::patternsForModel( const Automata { QVector patterns; TrackContainer::TrackList l; - l += engine::getSong()->tracks(); - l += engine::getBBTrackContainer()->tracks(); - l += engine::getSong()->globalAutomationTrack(); + l += Engine::getSong()->tracks(); + l += Engine::getBBTrackContainer()->tracks(); + l += Engine::getSong()->globalAutomationTrack(); // go through all tracks... for( TrackContainer::TrackList::ConstIterator it = l.begin(); it != l.end(); ++it ) @@ -604,7 +604,7 @@ QVector AutomationPattern::patternsForModel( const Automata AutomationPattern * AutomationPattern::globalAutomationPattern( AutomatableModel * _m ) { - AutomationTrack * t = engine::getSong()->globalAutomationTrack(); + AutomationTrack * t = Engine::getSong()->globalAutomationTrack(); Track::tcoVector v = t->getTCOs(); for( Track::tcoVector::const_iterator j = v.begin(); j != v.end(); ++j ) { @@ -632,9 +632,9 @@ AutomationPattern * AutomationPattern::globalAutomationPattern( void AutomationPattern::resolveAllIDs() { - TrackContainer::TrackList l = engine::getSong()->tracks() + - engine::getBBTrackContainer()->tracks(); - l += engine::getSong()->globalAutomationTrack(); + TrackContainer::TrackList l = Engine::getSong()->tracks() + + Engine::getBBTrackContainer()->tracks(); + l += Engine::getSong()->globalAutomationTrack(); for( TrackContainer::TrackList::iterator it = l.begin(); it != l.end(); ++it ) { @@ -651,7 +651,7 @@ void AutomationPattern::resolveAllIDs() for( QVector::Iterator k = a->m_idsToResolve.begin(); k != a->m_idsToResolve.end(); ++k ) { - JournallingObject * o = engine::projectJournal()-> + JournallingObject * o = Engine::projectJournal()-> journallingObject( *k ); if( o && dynamic_cast( o ) ) { @@ -676,10 +676,10 @@ void AutomationPattern::clear() emit dataChanged(); - if( engine::automationEditor() && - engine::automationEditor()->currentPattern() == this ) + if( Engine::automationEditor() && + Engine::automationEditor()->currentPattern() == this ) { - engine::automationEditor()->update(); + Engine::automationEditor()->update(); } } @@ -688,9 +688,9 @@ void AutomationPattern::clear() void AutomationPattern::openInAutomationEditor() { - engine::automationEditor()->setCurrentPattern( this ); - engine::automationEditor()->parentWidget()->show(); - engine::automationEditor()->setFocus(); + Engine::automationEditor()->setCurrentPattern( this ); + Engine::automationEditor()->parentWidget()->show(); + Engine::automationEditor()->setFocus(); } diff --git a/src/core/BBTrackContainer.cpp b/src/core/BBTrackContainer.cpp index dc43ac660..a2e78e6e4 100644 --- a/src/core/BBTrackContainer.cpp +++ b/src/core/BBTrackContainer.cpp @@ -27,7 +27,7 @@ #include "bb_track.h" #include "combobox.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "Song.h" @@ -82,9 +82,9 @@ bool BBTrackContainer::play( MidiTime _start, fpp_t _frames, void BBTrackContainer::updateAfterTrackAdd() { - if( numOfBBs() == 0 && !engine::getSong()->isLoadingProject() ) + if( numOfBBs() == 0 && !Engine::getSong()->isLoadingProject() ) { - engine::getSong()->addBBTrack(); + Engine::getSong()->addBBTrack(); } // make sure, new track(s) have TCOs for every beat/bassline @@ -116,7 +116,7 @@ tact_t BBTrackContainer::lengthOfBB( int _bb ) int BBTrackContainer::numOfBBs() const { - return engine::getSong()->countTracks( Track::BBTrack ); + return Engine::getSong()->countTracks( Track::BBTrack ); } @@ -182,13 +182,13 @@ void BBTrackContainer::fixIncorrectPositions() void BBTrackContainer::play() { - if( engine::getSong()->playMode() != Song::Mode_PlayBB ) + if( Engine::getSong()->playMode() != Song::Mode_PlayBB ) { - engine::getSong()->playBB(); + Engine::getSong()->playBB(); } else { - engine::getSong()->togglePause(); + Engine::getSong()->togglePause(); } } @@ -197,7 +197,7 @@ void BBTrackContainer::play() void BBTrackContainer::stop() { - engine::getSong()->stop(); + Engine::getSong()->stop(); } @@ -227,7 +227,7 @@ void BBTrackContainer::currentBBChanged() // now update all track-labels (the current one has to become white, // the others gray) - TrackList tl = engine::getSong()->tracks(); + TrackList tl = Engine::getSong()->tracks(); for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it ) { if( ( *it )->type() == Track::BBTrack ) @@ -242,7 +242,7 @@ void BBTrackContainer::currentBBChanged() void BBTrackContainer::createTCOsForBB( int _bb ) { - if( numOfBBs() == 0 || engine::getSong()->isLoadingProject() ) + if( numOfBBs() == 0 || Engine::getSong()->isLoadingProject() ) { return; } diff --git a/src/core/Controller.cpp b/src/core/Controller.cpp index 3e1ee0ba5..71a6dca3a 100644 --- a/src/core/Controller.cpp +++ b/src/core/Controller.cpp @@ -30,7 +30,7 @@ #include "Song.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include "Controller.h" #include "ControllerConnection.h" @@ -49,7 +49,7 @@ Controller::Controller( ControllerTypes _type, Model * _parent, const QString & _display_name ) : Model( _parent, _display_name ), JournallingObject(), - m_valueBuffer( engine::mixer()->framesPerPeriod() ), + m_valueBuffer( Engine::mixer()->framesPerPeriod() ), m_bufferLastUpdated( -1 ), m_connectionCount( 0 ), m_type( _type ) @@ -95,9 +95,9 @@ Controller::~Controller() s_controllers.remove( idx ); } - if( engine::getSong() ) + if( Engine::getSong() ) { - engine::getSong()->removeController( this ); + Engine::getSong()->removeController( this ); } m_valueBuffer.clear(); @@ -153,7 +153,7 @@ void Controller::updateValueBuffer() // Get position in frames unsigned int Controller::runningFrames() { - return s_periods * engine::mixer()->framesPerPeriod(); + return s_periods * Engine::mixer()->framesPerPeriod(); } @@ -161,7 +161,7 @@ unsigned int Controller::runningFrames() // Get position in seconds float Controller::runningTime() { - return runningFrames() / engine::mixer()->processingSampleRate(); + return runningFrames() / Engine::mixer()->processingSampleRate(); } diff --git a/src/core/ControllerConnection.cpp b/src/core/ControllerConnection.cpp index 7ba723925..3c0266ab6 100644 --- a/src/core/ControllerConnection.cpp +++ b/src/core/ControllerConnection.cpp @@ -30,7 +30,7 @@ #include "Song.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include "ControllerConnection.h" @@ -160,9 +160,9 @@ void ControllerConnection::finalizeConnections() { ControllerConnection * c = s_connections[i]; if ( !c->isFinalized() && c->m_controllerId < - engine::getSong()->controllers().size() ) + Engine::getSong()->controllers().size() ) { - c->setController( engine::getSong()-> + c->setController( Engine::getSong()-> controllers().at( c->m_controllerId ) ); } } @@ -173,7 +173,7 @@ void ControllerConnection::finalizeConnections() void ControllerConnection::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - if( engine::getSong() ) + if( Engine::getSong() ) { if( m_ownsController ) { @@ -181,7 +181,7 @@ void ControllerConnection::saveSettings( QDomDocument & _doc, QDomElement & _thi } else { - int id = engine::getSong()->controllers().indexOf( m_controller ); + int id = Engine::getSong()->controllers().indexOf( m_controller ); if( id >= 0 ) { _this.setAttribute( "id", id ); @@ -198,7 +198,7 @@ void ControllerConnection::loadSettings( const QDomElement & _this ) QDomNode node = _this.firstChild(); if( !node.isNull() ) { - setController( Controller::create( node.toElement(), engine::getSong() ) ); + setController( Controller::create( node.toElement(), Engine::getSong() ) ); } else { diff --git a/src/core/Effect.cpp b/src/core/Effect.cpp index f83dd97ef..c6aeecb29 100644 --- a/src/core/Effect.cpp +++ b/src/core/Effect.cpp @@ -26,7 +26,7 @@ #include #include "Effect.h" -#include "engine.h" +#include "Engine.h" #include "EffectChain.h" #include "EffectControls.h" #include "EffectView.h" @@ -182,7 +182,7 @@ void Effect::reinitSRC() } int error; if( ( m_srcState[i] = src_new( - engine::mixer()->currentQualitySettings(). + Engine::mixer()->currentQualitySettings(). libsrcInterpolation(), DEFAULT_CHANNELS, &error ) ) == NULL ) { @@ -204,7 +204,7 @@ void Effect::resample( int _i, const sampleFrame * _src_buf, return; } m_srcData[_i].input_frames = _frames; - m_srcData[_i].output_frames = engine::mixer()->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 f5bd9b95c..f7a15bcf7 100644 --- a/src/core/EffectChain.cpp +++ b/src/core/EffectChain.cpp @@ -28,7 +28,7 @@ #include "EffectChain.h" #include "Effect.h" -#include "engine.h" +#include "Engine.h" #include "debug.h" #include "DummyEffect.h" #include "MixHelpers.h" @@ -121,9 +121,9 @@ void EffectChain::loadSettings( const QDomElement & _this ) void EffectChain::appendEffect( Effect * _effect ) { - engine::mixer()->lock(); + Engine::mixer()->lock(); m_effects.append( _effect ); - engine::mixer()->unlock(); + Engine::mixer()->unlock(); emit dataChanged(); } @@ -133,9 +133,9 @@ void EffectChain::appendEffect( Effect * _effect ) void EffectChain::removeEffect( Effect * _effect ) { - engine::mixer()->lock(); + Engine::mixer()->lock(); m_effects.erase( qFind( m_effects.begin(), m_effects.end(), _effect ) ); - engine::mixer()->unlock(); + Engine::mixer()->unlock(); emit dataChanged(); } @@ -195,7 +195,7 @@ bool EffectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, b { return false; } - const bool exporting = engine::getSong()->isExporting(); + const bool exporting = Engine::getSong()->isExporting(); if( exporting ) // strip infs/nans if exporting { MixHelpers::sanitize( _buf, _frames ); diff --git a/src/core/engine.cpp b/src/core/Engine.cpp similarity index 77% rename from src/core/engine.cpp rename to src/core/Engine.cpp index e42db7f4f..f2d1c3712 100644 --- a/src/core/engine.cpp +++ b/src/core/Engine.cpp @@ -1,5 +1,5 @@ /* - * engine.cpp - implementation of LMMS' engine-system + * Engine.cpp - implementation of LMMS' engine-system * * Copyright (c) 2006-2014 Tobias Doerffel * @@ -23,7 +23,7 @@ */ -#include "engine.h" +#include "Engine.h" #include "AutomationEditor.h" #include "bb_editor.h" #include "BBTrackContainer.h" @@ -46,30 +46,30 @@ #include "BandLimitedWave.h" -bool engine::s_hasGUI = true; -bool engine::s_suppressMessages = false; -float engine::s_framesPerTick; -Mixer* engine::s_mixer = NULL; -FxMixer * engine::s_fxMixer = NULL; -FxMixerView * engine::s_fxMixerView = NULL; -MainWindow * engine::s_mainWindow = NULL; -BBTrackContainer * engine::s_bbTrackContainer = NULL; -Song * engine::s_song = NULL; -SongEditor* engine::s_songEditor = NULL; -AutomationEditor * engine::s_automationEditor = NULL; -bbEditor * engine::s_bbEditor = NULL; -PianoRoll* engine::s_pianoRoll = NULL; -projectNotes * engine::s_projectNotes = NULL; -ProjectJournal * engine::s_projectJournal = NULL; -ladspa2LMMS * engine::s_ladspaManager = NULL; -DummyTrackContainer * engine::s_dummyTC = NULL; -ControllerRackView * engine::s_controllerRackView = NULL; -QMap engine::s_pluginFileHandling; +bool Engine::s_hasGUI = true; +bool Engine::s_suppressMessages = false; +float Engine::s_framesPerTick; +Mixer* Engine::s_mixer = NULL; +FxMixer * Engine::s_fxMixer = NULL; +FxMixerView * Engine::s_fxMixerView = NULL; +MainWindow * Engine::s_mainWindow = NULL; +BBTrackContainer * Engine::s_bbTrackContainer = NULL; +Song * Engine::s_song = NULL; +SongEditor* Engine::s_songEditor = NULL; +AutomationEditor * Engine::s_automationEditor = NULL; +bbEditor * Engine::s_bbEditor = NULL; +PianoRoll* Engine::s_pianoRoll = NULL; +projectNotes * Engine::s_projectNotes = NULL; +ProjectJournal * Engine::s_projectJournal = NULL; +ladspa2LMMS * Engine::s_ladspaManager = NULL; +DummyTrackContainer * Engine::s_dummyTC = NULL; +ControllerRackView * Engine::s_controllerRackView = NULL; +QMap Engine::s_pluginFileHandling; -void engine::init( const bool _has_gui ) +void Engine::init( const bool _has_gui ) { s_hasGUI = _has_gui; @@ -113,7 +113,7 @@ void engine::init( const bool _has_gui ) -void engine::destroy() +void Engine::destroy() { s_mixer->stopProcessing(); @@ -150,7 +150,7 @@ void engine::destroy() -void engine::updateFramesPerTick() +void Engine::updateFramesPerTick() { s_framesPerTick = s_mixer->processingSampleRate() * 60.0f * 4 / DefaultTicksPerTact / s_song->getTempo(); @@ -159,7 +159,7 @@ void engine::updateFramesPerTick() -void engine::initPluginFileHandling() +void Engine::initPluginFileHandling() { Plugin::DescriptorList pluginDescriptors; Plugin::getDescriptorsOfAvailPlugins( pluginDescriptors ); diff --git a/src/core/EnvelopeAndLfoParameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp index a0259fbb0..5685b46f6 100644 --- a/src/core/EnvelopeAndLfoParameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -26,7 +26,7 @@ #include "EnvelopeAndLfoParameters.h" #include "debug.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include "Oscillator.h" @@ -47,7 +47,7 @@ void EnvelopeAndLfoParameters::LfoInstances::trigger() it != m_lfos.end(); ++it ) { ( *it )->m_lfoFrame += - engine::mixer()->framesPerPeriod(); + Engine::mixer()->framesPerPeriod(); ( *it )->m_bad_lfoShapeData = true; } } @@ -157,12 +157,12 @@ EnvelopeAndLfoParameters::EnvelopeAndLfoParameters( connect( &m_x100Model, SIGNAL( dataChanged() ), this, SLOT( updateSampleVars() ) ); - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleVars() ) ); m_lfoShapeData = - new sample_t[engine::mixer()->framesPerPeriod()]; + new sample_t[Engine::mixer()->framesPerPeriod()]; updateSampleVars(); } @@ -242,7 +242,7 @@ inline sample_t EnvelopeAndLfoParameters::lfoShapeSample( fpp_t _frame_offset ) void EnvelopeAndLfoParameters::updateLfoShapeData() { - const fpp_t frames = engine::mixer()->framesPerPeriod(); + const fpp_t frames = Engine::mixer()->framesPerPeriod(); for( fpp_t offset = 0; offset < frames; ++offset ) { m_lfoShapeData[offset] = lfoShapeSample( offset ); @@ -404,7 +404,7 @@ void EnvelopeAndLfoParameters::loadSettings( const QDomElement & _this ) void EnvelopeAndLfoParameters::updateSampleVars() { const float frames_per_env_seg = SECS_PER_ENV_SEGMENT * - engine::mixer()->processingSampleRate(); + Engine::mixer()->processingSampleRate(); // TODO: Remove the expKnobVals, time should be linear const f_cnt_t predelay_frames = static_cast( frames_per_env_seg * @@ -502,7 +502,7 @@ void EnvelopeAndLfoParameters::updateSampleVars() const float frames_per_lfo_oscillation = SECS_PER_LFO_OSCILLATION * - engine::mixer()->processingSampleRate(); + Engine::mixer()->processingSampleRate(); m_lfoPredelayFrames = static_cast( frames_per_lfo_oscillation * expKnobVal( m_lfoPredelayModel.value() ) ); m_lfoAttackFrames = static_cast( frames_per_lfo_oscillation * diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index 8c20fdefc..6423965c6 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -63,7 +63,7 @@ FxChannel::FxChannel( int idx, Model * _parent ) : m_stillRunning( false ), m_peakLeft( 0.0f ), m_peakRight( 0.0f ), - m_buffer( new sampleFrame[engine::mixer()->framesPerPeriod()] ), + m_buffer( new sampleFrame[Engine::mixer()->framesPerPeriod()] ), m_muteModel( false, _parent ), m_soloModel( false, _parent ), m_volumeModel( 1.0, 0.0, 2.0, 0.001, _parent ), @@ -73,8 +73,8 @@ FxChannel::FxChannel( int idx, Model * _parent ) : m_queued( false ), m_dependenciesMet( 0 ) { - engine::mixer()->clearAudioBuffer( m_buffer, - engine::mixer()->framesPerPeriod() ); + Engine::mixer()->clearAudioBuffer( m_buffer, + Engine::mixer()->framesPerPeriod() ); } @@ -118,8 +118,8 @@ void FxChannel::unmuteForSolo() void FxChannel::doProcessing() { - const fpp_t fpp = engine::mixer()->framesPerPeriod(); - const bool exporting = engine::getSong()->isExporting(); + const fpp_t fpp = Engine::mixer()->framesPerPeriod(); + const bool exporting = Engine::getSong()->isExporting(); if( m_muted == false ) { @@ -177,8 +177,8 @@ void FxChannel::doProcessing() m_stillRunning = m_fxChain.processAudioBuffer( m_buffer, fpp, m_hasInput ); - m_peakLeft = qMax( m_peakLeft, engine::mixer()->peakValueLeft( m_buffer, fpp ) * v ); - m_peakRight = qMax( m_peakRight, engine::mixer()->peakValueRight( m_buffer, fpp ) * v ); + m_peakLeft = qMax( m_peakLeft, Engine::mixer()->peakValueLeft( m_buffer, fpp ) * v ); + m_peakRight = qMax( m_peakRight, Engine::mixer()->peakValueRight( m_buffer, fpp ) * v ); } else { @@ -289,8 +289,8 @@ void FxMixer::deleteChannel( int index ) // go through every instrument and adjust for the channel index change TrackContainer::TrackList tracks; - tracks += engine::getSong()->tracks(); - tracks += engine::getBBTrackContainer()->tracks(); + tracks += Engine::getSong()->tracks(); + tracks += Engine::getBBTrackContainer()->tracks(); foreach( Track* t, tracks ) { @@ -345,8 +345,8 @@ void FxMixer::moveChannelLeft( int index ) int a = index - 1, b = index; // go through every instrument and adjust for the channel index change - QVector songTrackList = engine::getSong()->tracks(); - QVector bbTrackList = engine::getBBTrackContainer()->tracks(); + QVector songTrackList = Engine::getSong()->tracks(); + QVector bbTrackList = Engine::getBBTrackContainer()->tracks(); QVector trackLists[] = {songTrackList, bbTrackList}; for(int tl=0; tl<2; ++tl) @@ -428,7 +428,7 @@ FxRoute * FxMixer::createRoute( FxChannel * from, FxChannel * to, float amount ) to->m_receives.append( route ); // add us to fxmixer's list - engine::fxMixer()->m_fxRoutes.append( route ); + Engine::fxMixer()->m_fxRoutes.append( route ); m_sendsMutex.unlock(); return route; @@ -462,7 +462,7 @@ void FxMixer::deleteChannelSend( FxRoute * route ) // remove us from to's receives route->receiver()->m_receives.remove( route->receiver()->m_receives.indexOf( route ) ); // remove us from fxmixer's list - engine::fxMixer()->m_fxRoutes.remove( engine::fxMixer()->m_fxRoutes.indexOf( route ) ); + Engine::fxMixer()->m_fxRoutes.remove( Engine::fxMixer()->m_fxRoutes.indexOf( route ) ); delete route; m_sendsMutex.unlock(); } @@ -534,7 +534,7 @@ void FxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch ) if( m_fxChannels[_ch]->m_muteModel.value() == false ) { m_fxChannels[_ch]->m_lock.lock(); - MixHelpers::add( m_fxChannels[_ch]->m_buffer, _buf, engine::mixer()->framesPerPeriod() ); + MixHelpers::add( m_fxChannels[_ch]->m_buffer, _buf, Engine::mixer()->framesPerPeriod() ); m_fxChannels[_ch]->m_hasInput = true; m_fxChannels[_ch]->m_lock.unlock(); } @@ -545,15 +545,15 @@ void FxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch ) void FxMixer::prepareMasterMix() { - engine::mixer()->clearAudioBuffer( m_fxChannels[0]->m_buffer, - engine::mixer()->framesPerPeriod() ); + Engine::mixer()->clearAudioBuffer( m_fxChannels[0]->m_buffer, + Engine::mixer()->framesPerPeriod() ); } void FxMixer::masterMix( sampleFrame * _buf ) { - const int fpp = engine::mixer()->framesPerPeriod(); + const int fpp = Engine::mixer()->framesPerPeriod(); if( m_sendsMutex.tryLock() ) { @@ -601,14 +601,14 @@ void FxMixer::masterMix( sampleFrame * _buf ) : m_fxChannels[0]->m_volumeModel.value(); MixHelpers::addSanitizedMultiplied( _buf, m_fxChannels[0]->m_buffer, v, fpp ); - m_fxChannels[0]->m_peakLeft *= engine::mixer()->masterGain(); - m_fxChannels[0]->m_peakRight *= engine::mixer()->masterGain(); + m_fxChannels[0]->m_peakLeft *= Engine::mixer()->masterGain(); + m_fxChannels[0]->m_peakRight *= Engine::mixer()->masterGain(); // clear all channel buffers and // reset channel process state for( int i = 0; i < numChannels(); ++i) { - engine::mixer()->clearAudioBuffer( m_fxChannels[i]->m_buffer, engine::mixer()->framesPerPeriod() ); + Engine::mixer()->clearAudioBuffer( m_fxChannels[i]->m_buffer, Engine::mixer()->framesPerPeriod() ); m_fxChannels[i]->reset(); m_fxChannels[i]->m_queued = false; // also reset hasInput diff --git a/src/core/ImportFilter.cpp b/src/core/ImportFilter.cpp index 9214f6f87..e126de512 100644 --- a/src/core/ImportFilter.cpp +++ b/src/core/ImportFilter.cpp @@ -26,7 +26,7 @@ #include #include "ImportFilter.h" -#include "engine.h" +#include "Engine.h" #include "TrackContainer.h" #include "ProjectJournal.h" @@ -60,8 +60,8 @@ void ImportFilter::import( const QString & _file_to_import, char * s = qstrdup( _file_to_import.toUtf8().constData() ); // do not record changes while importing files - const bool j = engine::projectJournal()->isJournalling(); - engine::projectJournal()->setJournalling( false ); + const bool j = Engine::projectJournal()->isJournalling(); + Engine::projectJournal()->setJournalling( false ); for( Plugin::DescriptorList::ConstIterator it = d.begin(); it != d.end(); ++it ) @@ -80,7 +80,7 @@ void ImportFilter::import( const QString & _file_to_import, } } - engine::projectJournal()->setJournalling( j ); + Engine::projectJournal()->setJournalling( j ); delete[] s; diff --git a/src/core/Instrument.cpp b/src/core/Instrument.cpp index 2e5cf39cb..f8b04fdb5 100644 --- a/src/core/Instrument.cpp +++ b/src/core/Instrument.cpp @@ -27,7 +27,7 @@ #include "DummyInstrument.h" #include "NotePlayHandle.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" Instrument::Instrument( InstrumentTrack * _instrument_track, @@ -100,7 +100,7 @@ bool Instrument::isFromTrack( const Track * _track ) const void Instrument::applyRelease( sampleFrame * buf, const NotePlayHandle * _n ) { const fpp_t frames = _n->framesLeftForCurrentPeriod(); - const fpp_t fpp = engine::mixer()->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 1afc1cb23..050d19d80 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -26,7 +26,7 @@ #include "InstrumentFunctions.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "NotePlayHandle.h" #include "PresetPreviewPlayHandle.h" @@ -260,7 +260,7 @@ void InstrumentFunctionNoteStacking::processNote( NotePlayHandle * _n ) // create sub-note-play-handle, only note is // different - engine::mixer()->addPlayHandle( + Engine::mixer()->addPlayHandle( NotePlayHandleManager::acquire( _n->instrumentTrack(), _n->offset(), _n->frames(), note_copy, _n, -1, NotePlayHandle::OriginNoteStacking ) ); @@ -369,7 +369,7 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) const int total_range = range * cnphv.size(); // number of frames that every note should be played - const f_cnt_t arp_frames = (f_cnt_t)( m_arpTimeModel.value() / 1000.0f * engine::mixer()->processingSampleRate() ); + const f_cnt_t arp_frames = (f_cnt_t)( m_arpTimeModel.value() / 1000.0f * Engine::mixer()->processingSampleRate() ); const f_cnt_t gated_frames = (f_cnt_t)( m_arpGateModel.value() * arp_frames / 100.0f ); // used for calculating remaining frames for arp-note, we have to add @@ -381,11 +381,11 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) // used for loop f_cnt_t frames_processed = ( m_arpModeModel.value() != FreeMode ) ? cnphv.first()->noteOffset() : _n->noteOffset(); - while( frames_processed < engine::mixer()->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::mixer()->framesPerPeriod() ) + if( remaining_frames_for_cur_arp > Engine::mixer()->framesPerPeriod() ) { // then we don't have to do something! break; @@ -458,7 +458,7 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) // range-checking if( sub_note_key >= NumKeys || sub_note_key < 0 || - engine::mixer()->criticalXRuns() ) + Engine::mixer()->criticalXRuns() ) { continue; } @@ -473,7 +473,7 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) // create sub-note-play-handle, only ptr to note is different // and is_arp_note=true - engine::mixer()->addPlayHandle( + Engine::mixer()->addPlayHandle( NotePlayHandleManager::acquire( _n->instrumentTrack(), frames_processed, gated_frames, diff --git a/src/core/InstrumentSoundShaping.cpp b/src/core/InstrumentSoundShaping.cpp index f815be85b..70d8f98d3 100644 --- a/src/core/InstrumentSoundShaping.cpp +++ b/src/core/InstrumentSoundShaping.cpp @@ -27,7 +27,7 @@ #include "InstrumentSoundShaping.h" #include "basic_filters.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "EnvelopeAndLfoParameters.h" #include "Instrument.h" #include "InstrumentTrack.h" @@ -119,7 +119,7 @@ float InstrumentSoundShaping::volumeLevel( NotePlayHandle* n, const f_cnt_t fram if( n->isReleased() == false ) { - envReleaseBegin += engine::mixer()->framesPerPeriod(); + envReleaseBegin += Engine::mixer()->framesPerPeriod(); } float level; @@ -161,7 +161,7 @@ void InstrumentSoundShaping::processAudioBuffer( sampleFrame* buffer, if( n->m_filter == NULL ) { - n->m_filter = new basicFilters<>( engine::mixer()->processingSampleRate() ); + n->m_filter = new basicFilters<>( Engine::mixer()->processingSampleRate() ); } n->m_filter->setFilterType( m_filterModel.value() ); diff --git a/src/core/JournallingObject.cpp b/src/core/JournallingObject.cpp index a169a550b..b2eea2d6d 100644 --- a/src/core/JournallingObject.cpp +++ b/src/core/JournallingObject.cpp @@ -30,13 +30,13 @@ #include "AutomatableModel.h" #include "ProjectJournal.h" #include "base64.h" -#include "engine.h" +#include "Engine.h" JournallingObject::JournallingObject() : SerializingObject(), - m_id( engine::projectJournal()->allocID( this ) ), + m_id( Engine::projectJournal()->allocID( this ) ), m_journalling( true ), m_journallingStateStack() { @@ -47,9 +47,9 @@ JournallingObject::JournallingObject() : JournallingObject::~JournallingObject() { - if( engine::projectJournal() ) + if( Engine::projectJournal() ) { - engine::projectJournal()->freeID( id() ); + Engine::projectJournal()->freeID( id() ); } } @@ -60,7 +60,7 @@ void JournallingObject::addJournalCheckPoint() { if( isJournalling() ) { - engine::projectJournal()->addJournalCheckPoint( this ); + Engine::projectJournal()->addJournalCheckPoint( this ); } } @@ -114,7 +114,7 @@ void JournallingObject::changeID( jo_id_t _id ) { if( id() != _id ) { - JournallingObject * jo = engine::projectJournal()-> + JournallingObject * jo = Engine::projectJournal()-> journallingObject( _id ); if( jo != NULL ) { @@ -131,7 +131,7 @@ void JournallingObject::changeID( jo_id_t _id ) return; } - engine::projectJournal()->reallocID( _id, this ); + Engine::projectJournal()->reallocID( _id, this ); m_id = _id; } } diff --git a/src/core/LfoController.cpp b/src/core/LfoController.cpp index f72191496..5d77ce06a 100644 --- a/src/core/LfoController.cpp +++ b/src/core/LfoController.cpp @@ -30,7 +30,7 @@ #include "Song.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include "LfoController.h" #include "ControllerDialog.h" @@ -60,12 +60,12 @@ LfoController::LfoController( Model * _parent ) : this, SLOT( updateDuration() ) ); connect( &m_multiplierModel, SIGNAL( dataChanged() ), this, SLOT( updateDuration() ) ); - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateDuration() ) ); - connect( engine::getSong(), SIGNAL( playbackStateChanged() ), + connect( Engine::getSong(), SIGNAL( playbackStateChanged() ), this, SLOT( updatePhase() ) ); - connect( engine::getSong(), SIGNAL( playbackPositionChanged() ), + connect( Engine::getSong(), SIGNAL( playbackPositionChanged() ), this, SLOT( updatePhase() ) ); updateDuration(); @@ -97,7 +97,7 @@ void LfoController::updateValueBuffer() if( m_bufferLastUpdated < s_periods ) { int diff = s_periods - m_bufferLastUpdated; - phase += static_cast( engine::mixer()->framesPerPeriod() * diff ) / m_duration; + phase += static_cast( Engine::mixer()->framesPerPeriod() * diff ) / m_duration; m_bufferLastUpdated += diff; } @@ -119,14 +119,14 @@ void LfoController::updateValueBuffer() void LfoController::updatePhase() { - m_currentPhase = ( engine::getSong()->getFrames() ) / m_duration; + m_currentPhase = ( Engine::getSong()->getFrames() ) / m_duration; m_bufferLastUpdated = s_periods - 1; } void LfoController::updateDuration() { - float newDurationF = engine::mixer()->processingSampleRate() * m_speedModel.value(); + float newDurationF = Engine::mixer()->processingSampleRate() * m_speedModel.value(); switch(m_multiplierModel.value() ) { diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 0ae8743e1..0630b8e47 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -34,7 +34,7 @@ #include "NotePlayHandle.h" #include "InstrumentTrack.h" #include "debug.h" -#include "engine.h" +#include "Engine.h" #include "ConfigManager.h" #include "SamplePlayHandle.h" #include "PianoRoll.h" @@ -86,7 +86,7 @@ Mixer::Mixer() : } // just rendering? - if( !engine::hasGUI() ) + if( !Engine::hasGUI() ) { m_framesPerPeriod = DEFAULT_BUFFER_SIZE; m_fifo = new fifo( 1 ); @@ -278,7 +278,7 @@ sample_rate_t Mixer::processingSampleRate() const bool Mixer::criticalXRuns() const { - return cpuLoad() >= 99 && engine::getSong()->isExporting() == false; + return cpuLoad() >= 99 && Engine::getSong()->isExporting() == false; } @@ -320,10 +320,10 @@ const surroundSampleFrame * Mixer::renderNextBuffer() static Song::playPos last_metro_pos = -1; - Song::playPos p = engine::getSong()->getPlayPos( + Song::playPos p = Engine::getSong()->getPlayPos( Song::Mode_PlayPattern ); - if( engine::getSong()->playMode() == Song::Mode_PlayPattern && - engine::pianoRoll()->isRecording() == true && + if( Engine::getSong()->playMode() == Song::Mode_PlayPattern && + Engine::pianoRoll()->isRecording() == true && p != last_metro_pos ) { if ( p.getTicks() % (MidiTime::ticksPerTact() / 1 ) == 0 ) @@ -331,7 +331,7 @@ const surroundSampleFrame * Mixer::renderNextBuffer() addPlayHandle( new SamplePlayHandle( "misc/metronome02.ogg" ) ); } else if ( p.getTicks() % (MidiTime::ticksPerTact() / - engine::getSong()->getTimeSigModel().getNumerator() ) == 0 ) + Engine::getSong()->getTimeSigModel().getNumerator() ) == 0 ) { addPlayHandle( new SamplePlayHandle( "misc/metronome01.ogg" ) ); } @@ -385,10 +385,10 @@ const surroundSampleFrame * Mixer::renderNextBuffer() clearAudioBuffer( m_writeBuf, m_framesPerPeriod ); // prepare master mix (clear internal buffers etc.) - engine::fxMixer()->prepareMasterMix(); + Engine::fxMixer()->prepareMasterMix(); // create play-handles for new notes, samples etc. - engine::getSong()->processNextBuffer(); + Engine::getSong()->processNextBuffer(); // add all play-handles that have to be added m_playHandleMutex.lock(); @@ -434,7 +434,7 @@ const surroundSampleFrame * Mixer::renderNextBuffer() // STAGE 3: do master mix in FX mixer - engine::fxMixer()->masterMix( m_writeBuf ); + Engine::fxMixer()->masterMix( m_writeBuf ); unlock(); diff --git a/src/core/MixerWorkerThread.cpp b/src/core/MixerWorkerThread.cpp index 9cc65c4c4..5a9ca166c 100644 --- a/src/core/MixerWorkerThread.cpp +++ b/src/core/MixerWorkerThread.cpp @@ -23,7 +23,7 @@ */ #include "MixerWorkerThread.h" -#include "engine.h" +#include "Engine.h" MixerWorkerThread::JobQueue MixerWorkerThread::globalJobQueue; diff --git a/src/core/NotePlayHandle.cpp b/src/core/NotePlayHandle.cpp index 53e277370..f8b1321e5 100644 --- a/src/core/NotePlayHandle.cpp +++ b/src/core/NotePlayHandle.cpp @@ -69,7 +69,7 @@ NotePlayHandle::NotePlayHandle( InstrumentTrack* instrumentTrack, m_hadChildren( false ), m_muted( false ), m_bbTrack( NULL ), - m_origTempo( engine::getSong()->getTempo() ), + m_origTempo( Engine::getSong()->getTempo() ), m_origBaseNote( instrumentTrack->baseNote() ), m_frequency( 0 ), m_unpitchedFrequency( 0 ), @@ -114,7 +114,7 @@ NotePlayHandle::NotePlayHandle( InstrumentTrack* instrumentTrack, // send MidiNoteOn event m_instrumentTrack->processOutEvent( MidiEvent( MidiNoteOn, midiChannel(), midiKey(), midiVelocity( baseVelocity ) ), - MidiTime::fromFrames( offset(), engine::framesPerTick() ), + MidiTime::fromFrames( offset(), Engine::framesPerTick() ), offset() ); } @@ -207,9 +207,9 @@ void NotePlayHandle::play( sampleFrame * _working_buffer ) } // if the note offset falls over to next period, then don't start playback yet - if( offset() >= engine::mixer()->framesPerPeriod() ) + if( offset() >= Engine::mixer()->framesPerPeriod() ) { - setOffset( offset() - engine::mixer()->framesPerPeriod() ); + setOffset( offset() - Engine::mixer()->framesPerPeriod() ); return; } @@ -221,8 +221,8 @@ void NotePlayHandle::play( sampleFrame * _working_buffer ) // number of frames that can be played this period f_cnt_t framesThisPeriod = m_totalFramesPlayed == 0 - ? engine::mixer()->framesPerPeriod() - offset() - : engine::mixer()->framesPerPeriod(); + ? Engine::mixer()->framesPerPeriod() - offset() + : Engine::mixer()->framesPerPeriod(); // check if we start release during this period if( m_released == false && @@ -261,7 +261,7 @@ void NotePlayHandle::play( sampleFrame * _working_buffer ) // are inserted by arpAndChordsTabWidget::processNote() if( ! m_subNotes.isEmpty() ) { - m_releaseFramesToDo = m_releaseFramesDone + 2 * engine::mixer()->framesPerPeriod(); + m_releaseFramesToDo = m_releaseFramesDone + 2 * Engine::mixer()->framesPerPeriod(); } // look whether we have frames left to be done before release if( m_framesBeforeRelease ) @@ -325,7 +325,7 @@ f_cnt_t NotePlayHandle::framesLeft() const { if( instrumentTrack()->isSustainPedalPressed() ) { - return 4*engine::mixer()->framesPerPeriod(); + return 4*Engine::mixer()->framesPerPeriod(); } else if( m_released && actualReleaseFramesToDo() == 0 ) { @@ -345,9 +345,9 @@ fpp_t NotePlayHandle::framesLeftForCurrentPeriod() const { if( m_totalFramesPlayed == 0 ) { - return (fpp_t) qMin( framesLeft(), engine::mixer()->framesPerPeriod() - offset() ); + return (fpp_t) qMin( framesLeft(), Engine::mixer()->framesPerPeriod() - offset() ); } - return (fpp_t) qMin( framesLeft(), engine::mixer()->framesPerPeriod() ); + return (fpp_t) qMin( framesLeft(), Engine::mixer()->framesPerPeriod() ); } @@ -386,14 +386,14 @@ void NotePlayHandle::noteOff( const f_cnt_t _s ) // send MidiNoteOff event m_instrumentTrack->processOutEvent( MidiEvent( MidiNoteOff, midiChannel(), midiKey(), 0 ), - MidiTime::fromFrames( _s, engine::framesPerTick() ), + MidiTime::fromFrames( _s, Engine::framesPerTick() ), _s ); } // inform attached components about MIDI finished (used for recording in Piano Roll) if( m_origin == OriginMidiInput ) { - setLength( MidiTime( static_cast( totalFramesPlayed() / engine::framesPerTick() ) ) ); + setLength( MidiTime( static_cast( totalFramesPlayed() / Engine::framesPerTick() ) ) ); m_instrumentTrack->midiNoteOff( *this ); } } @@ -445,7 +445,7 @@ void NotePlayHandle::mute() int NotePlayHandle::index() const { - const PlayHandleList & playHandles = engine::mixer()->playHandles(); + const PlayHandleList & playHandles = Engine::mixer()->playHandles(); int idx = 0; for( PlayHandleList::ConstIterator it = playHandles.begin(); it != playHandles.end(); ++it ) { @@ -468,7 +468,7 @@ int NotePlayHandle::index() const ConstNotePlayHandleList NotePlayHandle::nphsOfInstrumentTrack( const InstrumentTrack * _it, bool _all_ph ) { - const PlayHandleList & playHandles = engine::mixer()->playHandles(); + const PlayHandleList & playHandles = Engine::mixer()->playHandles(); ConstNotePlayHandleList cnphv; for( PlayHandleList::ConstIterator it = playHandles.begin(); it != playHandles.end(); ++it ) @@ -512,7 +512,7 @@ void NotePlayHandle::updateFrequency() const float pitch = ( key() - m_instrumentTrack->baseNoteModel()->value() + - engine::getSong()->masterPitch() + + Engine::getSong()->masterPitch() + m_baseDetuning->value() ) / 12.0f; m_frequency = BaseFreq * powf( 2.0f, pitch + m_instrumentTrack->pitchModel()->value() / ( 100 * 12.0f ) ); diff --git a/src/core/Oscillator.cpp b/src/core/Oscillator.cpp index b07699cc5..843e99688 100644 --- a/src/core/Oscillator.cpp +++ b/src/core/Oscillator.cpp @@ -23,7 +23,7 @@ */ #include "Oscillator.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include "AutomatableModel.h" @@ -55,7 +55,7 @@ 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::mixer()->processingSampleRate() / 2 ) + if( m_freq >= Engine::mixer()->processingSampleRate() / 2 ) { Mixer::clearAudioBuffer( _ab, _frames ); return; @@ -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::mixer()->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 af6493048..c8702f937 100644 --- a/src/core/PeakController.cpp +++ b/src/core/PeakController.cpp @@ -31,7 +31,7 @@ #include "Song.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include "PeakController.h" #include "EffectChain.h" @@ -60,7 +60,7 @@ PeakController::PeakController( Model * _parent, connect( m_peakEffect, SIGNAL( destroyed( ) ), this, SLOT( handleDestroyedEffect( ) ) ); } - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateCoeffs() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateCoeffs() ) ); connect( m_peakEffect->attackModel(), SIGNAL( dataChanged() ), this, SLOT( updateCoeffs() ) ); connect( m_peakEffect->decayModel(), SIGNAL( dataChanged() ), this, SLOT( updateCoeffs() ) ); m_coeffNeedsUpdate = true; @@ -86,7 +86,7 @@ void PeakController::updateValueBuffer() { if( m_coeffNeedsUpdate ) { - const float ratio = 44100.0f / engine::mixer()->processingSampleRate(); + const float ratio = 44100.0f / Engine::mixer()->processingSampleRate(); m_attackCoeff = 1.0f - powf( 2.0f, -0.3f * ( 1.0f - m_peakEffect->attackModel()->value() ) * ratio ); m_decayCoeff = 1.0f - powf( 2.0f, -0.3f * ( 1.0f - m_peakEffect->decayModel()->value() ) * ratio ); m_coeffNeedsUpdate = false; @@ -97,7 +97,7 @@ void PeakController::updateValueBuffer() float targetSample = m_peakEffect->lastSample(); if( m_currentSample != targetSample ) { - const f_cnt_t frames = engine::mixer()->framesPerPeriod(); + const f_cnt_t frames = Engine::mixer()->framesPerPeriod(); float * values = m_valueBuffer.values(); for( f_cnt_t f = 0; f < frames; ++f ) diff --git a/src/core/Plugin.cpp b/src/core/Plugin.cpp index 2894cc412..1078ae2d1 100644 --- a/src/core/Plugin.cpp +++ b/src/core/Plugin.cpp @@ -29,7 +29,7 @@ #include "Plugin.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include "ConfigManager.h" #include "DummyPlugin.h" @@ -96,7 +96,7 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent, QLibrary pluginLibrary( ConfigManager::inst()->pluginDir() + pluginName ); if( pluginLibrary.load() == false ) { - if( engine::hasGUI() ) + if( Engine::hasGUI() ) { QMessageBox::information( NULL, tr( "Plugin not found" ), @@ -110,7 +110,7 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent, InstantiationHook instantiationHook = ( InstantiationHook ) pluginLibrary.resolve( "lmms_plugin_main" ); if( instantiationHook == NULL ) { - if( engine::hasGUI() ) + if( Engine::hasGUI() ) { QMessageBox::information( NULL, tr( "Error while loading plugin" ), diff --git a/src/core/PresetPreviewPlayHandle.cpp b/src/core/PresetPreviewPlayHandle.cpp index d5ac70962..e4c95eb62 100644 --- a/src/core/PresetPreviewPlayHandle.cpp +++ b/src/core/PresetPreviewPlayHandle.cpp @@ -27,7 +27,7 @@ #include "PresetPreviewPlayHandle.h" #include "debug.h" -#include "engine.h" +#include "Engine.h" #include "Instrument.h" #include "InstrumentTrack.h" #include "MidiPort.h" @@ -123,10 +123,10 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, } - const bool j = engine::projectJournal()->isJournalling(); - engine::projectJournal()->setJournalling( false ); + const bool j = Engine::projectJournal()->isJournalling(); + Engine::projectJournal()->setJournalling( false ); - engine::setSuppressMessages( true ); + Engine::setSuppressMessages( true ); if( _load_by_plugin ) { @@ -137,7 +137,7 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, { i = s_previewTC->previewInstrumentTrack()-> loadInstrument( - engine::pluginFileHandling()[ext] ); + Engine::pluginFileHandling()[ext] ); } if( i != NULL ) { @@ -152,7 +152,7 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, dataFile.content().firstChild().toElement() ); } - engine::setSuppressMessages( false ); + Engine::setSuppressMessages( false ); // make sure, our preset-preview-track does not appear in any MIDI- // devices list, so just disable receiving/sending MIDI-events at all @@ -170,7 +170,7 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, s_previewTC->setPreviewNote( m_previewNote ); s_previewTC->unlockData(); - engine::projectJournal()->setJournalling( j ); + Engine::projectJournal()->setJournalling( j ); } diff --git a/src/core/ProjectJournal.cpp b/src/core/ProjectJournal.cpp index 662a694b6..8a8d8c466 100644 --- a/src/core/ProjectJournal.cpp +++ b/src/core/ProjectJournal.cpp @@ -25,7 +25,7 @@ #include #include "ProjectJournal.h" -#include "engine.h" +#include "Engine.h" #include "JournallingObject.h" #include "Song.h" @@ -66,7 +66,7 @@ void ProjectJournal::undo() setJournalling( false ); jo->restoreState( c.data.content().firstChildElement() ); setJournalling( prev ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } @@ -91,7 +91,7 @@ void ProjectJournal::redo() setJournalling( false ); jo->restoreState( c.data.content().firstChildElement() ); setJournalling( prev ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); break; } } diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index d076cd18a..d4f27d1fa 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -27,7 +27,7 @@ #include "ProjectRenderer.h" #include "Song.h" -#include "engine.h" +#include "Engine.h" #include "AudioFileWave.h" #include "AudioFileOgg.h" @@ -66,10 +66,10 @@ ProjectRenderer::ProjectRenderer( const Mixer::qualitySettings & _qs, const OutputSettings & _os, ExportFileFormats _file_format, const QString & _out_file ) : - QThread( engine::mixer() ), + QThread( Engine::mixer() ), m_fileDev( NULL ), m_qualitySettings( _qs ), - m_oldQualitySettings( engine::mixer()->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::mixer() ); + 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::mixer()->setAudioDevice( m_fileDev, + Engine::mixer()->setAudioDevice( m_fileDev, m_qualitySettings, false ); start( @@ -159,15 +159,15 @@ void ProjectRenderer::run() #endif - engine::getSong()->startExport(); + Engine::getSong()->startExport(); - Song::playPos & pp = engine::getSong()->getPlayPos( + Song::playPos & pp = Engine::getSong()->getPlayPos( Song::Mode_PlaySong ); m_progress = 0; - const int sl = ( engine::getSong()->length() + 1 ) * 192; + const int sl = ( Engine::getSong()->length() + 1 ) * 192; - while( engine::getSong()->isExportDone() == false && - engine::getSong()->isExporting() == true + while( Engine::getSong()->isExportDone() == false && + Engine::getSong()->isExporting() == true && !m_abort ) { m_fileDev->processNextBuffer(); @@ -179,12 +179,12 @@ void ProjectRenderer::run() } } - engine::getSong()->stopExport(); + Engine::getSong()->stopExport(); const QString f = m_fileDev->outputFile(); - engine::mixer()->restoreAudioDevice(); // also deletes audio-dev - engine::mixer()->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 f74ad9d94..c30f0c9e3 100644 --- a/src/core/RemotePlugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -30,7 +30,7 @@ #include "RemotePlugin.h" #include "Mixer.h" -#include "engine.h" +#include "Engine.h" #include "ConfigManager.h" #include @@ -163,13 +163,13 @@ bool RemotePlugin::init( const QString &pluginExecutable, bool RemotePlugin::process( const sampleFrame * _in_buf, sampleFrame * _out_buf ) { - const fpp_t frames = engine::mixer()->framesPerPeriod(); + const fpp_t frames = Engine::mixer()->framesPerPeriod(); if( m_failed || !isRunning() ) { if( _out_buf != NULL ) { - engine::mixer()->clearAudioBuffer( _out_buf, + Engine::mixer()->clearAudioBuffer( _out_buf, frames ); } return false; @@ -189,7 +189,7 @@ bool RemotePlugin::process( const sampleFrame * _in_buf, } if( _out_buf != NULL ) { - engine::mixer()->clearAudioBuffer( _out_buf, + Engine::mixer()->clearAudioBuffer( _out_buf, frames ); } return false; @@ -264,7 +264,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::mixer()->clearAudioBuffer( _out_buf, frames ); + Engine::mixer()->clearAudioBuffer( _out_buf, frames ); for( ch_cnt_t ch = 0; ch < qMin( DEFAULT_CHANNELS, outputs ); ++ch ) @@ -302,7 +302,7 @@ void RemotePlugin::processMidiEvent( const MidiEvent & _e, void RemotePlugin::resizeSharedProcessingMemory() { const size_t s = ( m_inputCount+m_outputCount ) * - engine::mixer()->framesPerPeriod() * + Engine::mixer()->framesPerPeriod() * sizeof( float ); if( m_shm != NULL ) { @@ -355,12 +355,12 @@ bool RemotePlugin::processMessage( const message & _m ) case IdSampleRateInformation: reply = true; - reply_message.addInt( engine::mixer()->processingSampleRate() ); + reply_message.addInt( Engine::mixer()->processingSampleRate() ); break; case IdBufferSizeInformation: reply = true; - reply_message.addInt( engine::mixer()->framesPerPeriod() ); + reply_message.addInt( Engine::mixer()->framesPerPeriod() ); break; case IdChangeInputCount: diff --git a/src/core/RingBuffer.cpp b/src/core/RingBuffer.cpp index aa878c299..ce4117be0 100644 --- a/src/core/RingBuffer.cpp +++ b/src/core/RingBuffer.cpp @@ -24,15 +24,15 @@ */ #include "RingBuffer.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" #include #include "MixHelpers.h" RingBuffer::RingBuffer( f_cnt_t size ) : - m_fpp( engine::mixer()->framesPerPeriod() ), - m_samplerate( engine::mixer()->processingSampleRate() ), + m_fpp( Engine::mixer()->framesPerPeriod() ), + m_samplerate( Engine::mixer()->processingSampleRate() ), m_size( size + m_fpp ) { m_buffer = new sampleFrame[ m_size ]; @@ -41,8 +41,8 @@ RingBuffer::RingBuffer( f_cnt_t size ) : RingBuffer::RingBuffer( float size ) : - m_fpp( engine::mixer()->framesPerPeriod() ), - m_samplerate( engine::mixer()->processingSampleRate() ) + m_fpp( Engine::mixer()->framesPerPeriod() ), + m_samplerate( Engine::mixer()->processingSampleRate() ) { m_size = msToFrames( size ) + m_fpp; m_buffer = new sampleFrame[ m_size ]; @@ -93,11 +93,11 @@ void RingBuffer::setSamplerateAware( bool b ) { if( b ) { - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ), Qt::UniqueConnection ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ), Qt::UniqueConnection ); } else { - disconnect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); + disconnect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); } } @@ -310,9 +310,9 @@ void RingBuffer::updateSamplerate() { lock(); - float newsize = static_cast( ( m_size - m_fpp ) * engine::mixer()->processingSampleRate() ) / m_samplerate; + float newsize = static_cast( ( m_size - m_fpp ) * Engine::mixer()->processingSampleRate() ) / m_samplerate; m_size = static_cast( ceilf( newsize ) ) + m_fpp; - m_samplerate = engine::mixer()->processingSampleRate(); + m_samplerate = Engine::mixer()->processingSampleRate(); delete m_buffer; m_buffer = new sampleFrame[ m_size ]; memset( m_buffer, 0, m_size * sizeof( sampleFrame ) ); diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index eaeb62471..8ebbd9716 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -56,7 +56,7 @@ #include "debug.h" #include "DrumSynth.h" #include "endian_handling.h" -#include "engine.h" +#include "Engine.h" #include "interpolation.h" #include "templates.h" @@ -78,13 +78,13 @@ SampleBuffer::SampleBuffer( const QString & _audio_file, m_amplification( 1.0f ), m_reversed( false ), m_frequency( BaseFreq ), - m_sampleRate( engine::mixer()->baseSampleRate() ) + m_sampleRate( Engine::mixer()->baseSampleRate() ) { if( _is_base64_data == true ) { loadFromBase64( _audio_file ); } - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) ); update(); } @@ -104,7 +104,7 @@ SampleBuffer::SampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ) : m_amplification( 1.0f ), m_reversed( false ), m_frequency( BaseFreq ), - m_sampleRate( engine::mixer()->baseSampleRate() ) + m_sampleRate( Engine::mixer()->baseSampleRate() ) { if( _frames > 0 ) { @@ -112,7 +112,7 @@ SampleBuffer::SampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ) : memcpy( m_origData, _data, _frames * BYTES_PER_FRAME ); m_origFrames = _frames; } - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) ); update(); } @@ -132,7 +132,7 @@ SampleBuffer::SampleBuffer( const f_cnt_t _frames ) : m_amplification( 1.0f ), m_reversed( false ), m_frequency( BaseFreq ), - m_sampleRate( engine::mixer()->baseSampleRate() ) + m_sampleRate( Engine::mixer()->baseSampleRate() ) { if( _frames > 0 ) { @@ -140,7 +140,7 @@ SampleBuffer::SampleBuffer( const f_cnt_t _frames ) : memset( m_origData, 0, _frames * BYTES_PER_FRAME ); m_origFrames = _frames; } - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) ); update(); } @@ -194,7 +194,7 @@ void SampleBuffer::update( bool _keep_settings ) int_sample_t * buf = NULL; sample_t * fbuf = NULL; ch_cnt_t channels = DEFAULT_CHANNELS; - sample_rate_t samplerate = engine::mixer()->baseSampleRate(); + sample_rate_t samplerate = Engine::mixer()->baseSampleRate(); m_frames = 0; const QFileInfo fileInfo( file ); @@ -359,10 +359,10 @@ void SampleBuffer::normalizeSampleRate( const sample_rate_t _src_sr, bool _keep_settings ) { // do samplerate-conversion to our default-samplerate - if( _src_sr != engine::mixer()->baseSampleRate() ) + if( _src_sr != Engine::mixer()->baseSampleRate() ) { SampleBuffer * resampled = resample( this, _src_sr, - engine::mixer()->baseSampleRate() ); + Engine::mixer()->baseSampleRate() ); MM_FREE( m_data ); m_frames = resampled->frames(); m_data = MM_ALLOC( sampleFrame, m_frames ); @@ -621,7 +621,7 @@ bool SampleBuffer::play( sampleFrame * _ab, handleState * _state, bool is_backwards = _state->isBackwards(); const double freq_factor = (double) _freq / (double) m_frequency * - m_sampleRate / engine::mixer()->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( ( diff --git a/src/core/SamplePlayHandle.cpp b/src/core/SamplePlayHandle.cpp index af29aa8a4..e1b9d99dd 100644 --- a/src/core/SamplePlayHandle.cpp +++ b/src/core/SamplePlayHandle.cpp @@ -25,7 +25,7 @@ #include "SamplePlayHandle.h" #include "AudioPort.h" #include "bb_track.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "Pattern.h" #include "SampleBuffer.h" @@ -105,7 +105,7 @@ void SamplePlayHandle::play( sampleFrame * buffer ) } sampleFrame * workingBuffer = buffer; - const fpp_t fpp = engine::mixer()->framesPerPeriod(); + const fpp_t fpp = Engine::mixer()->framesPerPeriod(); f_cnt_t frames = fpp; // apply offset for the first period @@ -153,7 +153,7 @@ bool SamplePlayHandle::isFromTrack( const Track * _track ) const f_cnt_t SamplePlayHandle::totalFrames() const { - return ( m_sampleBuffer->endFrame() - m_sampleBuffer->startFrame() ) * ( engine::mixer()->processingSampleRate() / engine::mixer()->baseSampleRate() ); + return ( m_sampleBuffer->endFrame() - m_sampleBuffer->startFrame() ) * ( Engine::mixer()->processingSampleRate() / Engine::mixer()->baseSampleRate() ); } diff --git a/src/core/SampleRecordHandle.cpp b/src/core/SampleRecordHandle.cpp index 8e6702f4a..abfb78051 100644 --- a/src/core/SampleRecordHandle.cpp +++ b/src/core/SampleRecordHandle.cpp @@ -25,7 +25,7 @@ #include "SampleRecordHandle.h" #include "bb_track.h" -#include "engine.h" +#include "Engine.h" #include "InstrumentTrack.h" #include "Pattern.h" #include "SampleBuffer.h" @@ -68,12 +68,12 @@ SampleRecordHandle::~SampleRecordHandle() void SampleRecordHandle::play( sampleFrame * /*_working_buffer*/ ) { - const sampleFrame * recbuf = engine::mixer()->inputBuffer(); - const f_cnt_t frames = engine::mixer()->inputBufferFrames(); + const sampleFrame * recbuf = Engine::mixer()->inputBuffer(); + const f_cnt_t frames = Engine::mixer()->inputBufferFrames(); writeBuffer( recbuf, frames ); m_framesRecorded += frames; - MidiTime len = (tick_t)( m_framesRecorded / engine::framesPerTick() ); + MidiTime len = (tick_t)( m_framesRecorded / Engine::framesPerTick() ); if( len > m_minLength ) { // m_tco->changeLength( len ); @@ -129,7 +129,7 @@ void SampleRecordHandle::createSampleBuffer( SampleBuffer** sampleBuf ) } // create according sample-buffer out of big buffer *sampleBuf = new SampleBuffer( data, frames ); - ( *sampleBuf)->setSampleRate( engine::mixer()->inputSampleRate() ); + ( *sampleBuf)->setSampleRate( Engine::mixer()->inputSampleRate() ); delete[] data; } diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 6fae3eea3..2969c2ebe 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -104,7 +104,7 @@ Song::Song() : this, SLOT( setTimeSignature() ) ); - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateFramesPerTick() ) ); connect( &m_masterVolumeModel, SIGNAL( dataChanged() ), @@ -129,7 +129,7 @@ Song::~Song() void Song::masterVolumeChanged() { - engine::mixer()->setMasterGain( m_masterVolumeModel.value() / + Engine::mixer()->setMasterGain( m_masterVolumeModel.value() / 100.0f ); } @@ -138,9 +138,9 @@ void Song::masterVolumeChanged() void Song::setTempo() { - engine::mixer()->lockPlayHandleRemoval(); + Engine::mixer()->lockPlayHandleRemoval(); const bpm_t tempo = (bpm_t) m_tempoModel.value(); - PlayHandleList & playHandles = engine::mixer()->playHandles(); + PlayHandleList & playHandles = Engine::mixer()->playHandles(); for( PlayHandleList::Iterator it = playHandles.begin(); it != playHandles.end(); ++it ) { @@ -152,9 +152,9 @@ void Song::setTempo() nph->unlock(); } } - engine::mixer()->unlockPlayHandleRemoval(); + Engine::mixer()->unlockPlayHandleRemoval(); - engine::updateFramesPerTick(); + Engine::updateFramesPerTick(); m_vstSyncController.setTempo( tempo ); @@ -216,9 +216,9 @@ void Song::processNextBuffer() break; case Mode_PlayBB: - if( engine::getBBTrackContainer()->numOfBBs() > 0 ) + if( Engine::getBBTrackContainer()->numOfBBs() > 0 ) { - tco_num = engine::getBBTrackContainer()-> + tco_num = Engine::getBBTrackContainer()-> currentBB(); track_list.push_back( bbTrack::findBBTrack( tco_num ) ); @@ -261,14 +261,14 @@ void Song::processNextBuffer() } f_cnt_t total_frames_played = 0; - const float frames_per_tick = engine::framesPerTick(); + const float frames_per_tick = Engine::framesPerTick(); while( total_frames_played - < engine::mixer()->framesPerPeriod() ) + < Engine::mixer()->framesPerPeriod() ) { m_vstSyncController.update(); - f_cnt_t played_frames = engine::mixer()->framesPerPeriod() - total_frames_played; + f_cnt_t played_frames = Engine::mixer()->framesPerPeriod() - total_frames_played; float current_frame = m_playPos[m_playMode].currentFrame(); // did we play a tick? @@ -291,7 +291,7 @@ void Song::processNextBuffer() // or to loop back to first tact if( m_playMode == Mode_PlayBB ) { - max_tact = engine::getBBTrackContainer() + max_tact = Engine::getBBTrackContainer() ->lengthOfCurrentBB(); } else if( m_playMode == Mode_PlayPattern && @@ -606,7 +606,7 @@ void Song::stop() m_vstSyncController.setAbsolutePosition( m_playPos[m_playMode].getTicks() ); // remove all note-play-handles that are active - engine::mixer()->clear(); + Engine::mixer()->clear(); m_playMode = Mode_None; @@ -673,7 +673,7 @@ void Song::removeBar() void Song::addBBTrack() { Track * t = Track::create( Track::BBTrack, this ); - engine::getBBTrackContainer()->setCurrentBB( dynamic_cast( t )->index() ); + Engine::getBBTrackContainer()->setCurrentBB( dynamic_cast( t )->index() ); } @@ -713,7 +713,7 @@ AutomationPattern * Song::tempoAutomationPattern() void Song::clearProject() { - engine::projectJournal()->setJournalling( false ); + Engine::projectJournal()->setJournalling( false ); if( m_playing ) { @@ -726,33 +726,33 @@ void Song::clearProject() } - engine::mixer()->lock(); - if( engine::getBBEditor() ) + Engine::mixer()->lock(); + if( Engine::getBBEditor() ) { - engine::getBBEditor()->clearAllTracks(); + Engine::getBBEditor()->clearAllTracks(); } - if( engine::songEditor() ) + if( Engine::songEditor() ) { - engine::songEditor()->clearAllTracks(); + Engine::songEditor()->clearAllTracks(); } - if( engine::fxMixerView() ) + if( Engine::fxMixerView() ) { - engine::fxMixerView()->clear(); + Engine::fxMixerView()->clear(); } QCoreApplication::sendPostedEvents(); - engine::getBBTrackContainer()->clearAllTracks(); + Engine::getBBTrackContainer()->clearAllTracks(); clearAllTracks(); - engine::fxMixer()->clear(); + Engine::fxMixer()->clear(); - if( engine::automationEditor() ) + if( Engine::automationEditor() ) { - engine::automationEditor()->setCurrentPattern( NULL ); + Engine::automationEditor()->setCurrentPattern( NULL ); } - if( engine::pianoRoll() ) + if( Engine::pianoRoll() ) { - engine::pianoRoll()->reset(); + Engine::pianoRoll()->reset(); } m_tempoModel.reset(); @@ -766,11 +766,11 @@ void Song::clearProject() AutomationPattern::globalAutomationPattern( &m_masterPitchModel )-> clear(); - engine::mixer()->unlock(); + Engine::mixer()->unlock(); - if( engine::getProjectNotes() ) + if( Engine::getProjectNotes() ) { - engine::getProjectNotes()->clear(); + Engine::getProjectNotes()->clear(); } // Move to function @@ -781,9 +781,9 @@ void Song::clearProject() emit dataChanged(); - engine::projectJournal()->clearJournal(); + Engine::projectJournal()->clearJournal(); - engine::projectJournal()->setJournalling( true ); + Engine::projectJournal()->setJournalling( true ); InstrumentTrackView::cleanupWindowCache(); } @@ -816,7 +816,7 @@ void Song::createNewProject() clearProject(); - engine::projectJournal()->setJournalling( false ); + Engine::projectJournal()->setJournalling( false ); m_fileName = m_oldFileName = ""; @@ -825,7 +825,7 @@ void Song::createNewProject() dynamic_cast( t )->loadInstrument( "tripleoscillator" ); t = Track::create( Track::InstrumentTrack, - engine::getBBTrackContainer() ); + Engine::getBBTrackContainer() ); dynamic_cast( t )->loadInstrument( "kicker" ); Track::create( Track::SampleTrack, this ); @@ -841,17 +841,17 @@ void Song::createNewProject() m_loadingProject = false; - engine::getBBTrackContainer()->updateAfterTrackAdd(); + Engine::getBBTrackContainer()->updateAfterTrackAdd(); - engine::projectJournal()->setJournalling( true ); + Engine::projectJournal()->setJournalling( true ); QCoreApplication::sendPostedEvents(); m_modified = false; - if( engine::mainWindow() ) + if( Engine::mainWindow() ) { - engine::mainWindow()->resetWindowTitle(); + Engine::mainWindow()->resetWindowTitle(); } } @@ -865,9 +865,9 @@ void Song::createNewProjectFromTemplate( const QString & _template ) // saving... m_fileName = m_oldFileName = ""; // update window title - if( engine::mainWindow() ) + if( Engine::mainWindow() ) { - engine::mainWindow()->resetWindowTitle(); + Engine::mainWindow()->resetWindowTitle(); } } @@ -882,7 +882,7 @@ void Song::loadProject( const QString & _file_name ) m_loadingProject = true; - engine::projectJournal()->setJournalling( false ); + Engine::projectJournal()->setJournalling( false ); m_fileName = _file_name; m_oldFileName = _file_name; @@ -899,7 +899,7 @@ void Song::loadProject( const QString & _file_name ) DataFile::LocaleHelper localeHelper( DataFile::LocaleHelper::ModeLoad ); - engine::mixer()->lock(); + Engine::mixer()->lock(); // get the header information from the DOM m_tempoModel.loadSettings( dataFile.head(), "bpm" ); @@ -923,14 +923,14 @@ void Song::loadProject( const QString & _file_name ) PeakController::initGetControllerBySetting(); // Load mixer first to be able to set the correct range for FX channels - node = dataFile.content().firstChildElement( engine::fxMixer()->nodeName() ); + node = dataFile.content().firstChildElement( Engine::fxMixer()->nodeName() ); if( !node.isNull() ) { - engine::fxMixer()->restoreState( node.toElement() ); - if( engine::hasGUI() ) + Engine::fxMixer()->restoreState( node.toElement() ); + if( Engine::hasGUI() ) { // refresh FxMixerView - engine::fxMixerView()->refreshDisplay(); + Engine::fxMixerView()->refreshDisplay(); } } @@ -947,23 +947,23 @@ void Song::loadProject( const QString & _file_name ) { restoreControllerStates( node.toElement() ); } - else if( engine::hasGUI() ) + else if( Engine::hasGUI() ) { - if( node.nodeName() == engine::getControllerRackView()->nodeName() ) + if( node.nodeName() == Engine::getControllerRackView()->nodeName() ) { - engine::getControllerRackView()->restoreState( node.toElement() ); + Engine::getControllerRackView()->restoreState( node.toElement() ); } - else if( node.nodeName() == engine::pianoRoll()->nodeName() ) + else if( node.nodeName() == Engine::pianoRoll()->nodeName() ) { - engine::pianoRoll()->restoreState( node.toElement() ); + Engine::pianoRoll()->restoreState( node.toElement() ); } - else if( node.nodeName() == engine::automationEditor()->nodeName() ) + else if( node.nodeName() == Engine::automationEditor()->nodeName() ) { - engine::automationEditor()->restoreState( node.toElement() ); + Engine::automationEditor()->restoreState( node.toElement() ); } - else if( node.nodeName() == engine::getProjectNotes()->nodeName() ) + else if( node.nodeName() == Engine::getProjectNotes()->nodeName() ) { - engine::getProjectNotes()->SerializingObject::restoreState( node.toElement() ); + Engine::getProjectNotes()->SerializingObject::restoreState( node.toElement() ); } else if( node.nodeName() == m_playPos[Mode_PlaySong].m_timeLine->nodeName() ) { @@ -976,7 +976,7 @@ void Song::loadProject( const QString & _file_name ) // quirk for fixing projects with broken positions of TCOs inside // BB-tracks - engine::getBBTrackContainer()->fixIncorrectPositions(); + Engine::getBBTrackContainer()->fixIncorrectPositions(); // Connect controller links to their controllers // now that everything is loaded @@ -986,20 +986,20 @@ void Song::loadProject( const QString & _file_name ) AutomationPattern::resolveAllIDs(); - engine::mixer()->unlock(); + Engine::mixer()->unlock(); ConfigManager::inst()->addRecentlyOpenedProject( _file_name ); - engine::projectJournal()->setJournalling( true ); + Engine::projectJournal()->setJournalling( true ); emit projectLoaded(); m_loadingProject = false; m_modified = false; - if( engine::mainWindow() ) + if( Engine::mainWindow() ) { - engine::mainWindow()->resetWindowTitle(); + Engine::mainWindow()->resetWindowTitle(); } } @@ -1019,13 +1019,13 @@ bool Song::saveProjectFile( const QString & _filename ) saveState( dataFile, dataFile.content() ); m_globalAutomationTrack->saveState( dataFile, dataFile.content() ); - engine::fxMixer()->saveState( dataFile, dataFile.content() ); - if( engine::hasGUI() ) + Engine::fxMixer()->saveState( dataFile, dataFile.content() ); + if( Engine::hasGUI() ) { - engine::getControllerRackView()->saveState( dataFile, dataFile.content() ); - engine::pianoRoll()->saveState( dataFile, dataFile.content() ); - engine::automationEditor()->saveState( dataFile, dataFile.content() ); - engine::getProjectNotes()->SerializingObject::saveState( dataFile, dataFile.content() ); + Engine::getControllerRackView()->saveState( dataFile, dataFile.content() ); + Engine::pianoRoll()->saveState( dataFile, dataFile.content() ); + Engine::automationEditor()->saveState( dataFile, dataFile.content() ); + Engine::getProjectNotes()->SerializingObject::saveState( dataFile, dataFile.content() ); m_playPos[Mode_PlaySong].m_timeLine->saveState( dataFile, dataFile.content() ); } @@ -1041,7 +1041,7 @@ bool Song::guiSaveProject() { DataFile dataFile( DataFile::SongProject ); m_fileName = dataFile.nameWithExtension( m_fileName ); - if( saveProjectFile( m_fileName ) && engine::hasGUI() ) + if( saveProjectFile( m_fileName ) && Engine::hasGUI() ) { textFloat::displayMessage( tr( "Project saved" ), tr( "The project %1 is now saved." @@ -1050,9 +1050,9 @@ bool Song::guiSaveProject() 2000 ); ConfigManager::inst()->addRecentlyOpenedProject( m_fileName ); m_modified = false; - engine::mainWindow()->resetWindowTitle(); + Engine::mainWindow()->resetWindowTitle(); } - else if( engine::hasGUI() ) + else if( Engine::hasGUI() ) { textFloat::displayMessage( tr( "Project NOT saved." ), tr( "The project %1 was not saved!" ).arg( @@ -1136,7 +1136,7 @@ void Song::restoreControllerStates( const QDomElement & _this ) * This line removes the previously added controller for PeakController * without affecting the order of controllers in Controller Rack */ - engine::getSong()->removeController( c ); + Engine::getSong()->removeController( c ); addController( c ); node = node.nextSibling(); @@ -1153,7 +1153,7 @@ void Song::exportProject(bool multiExport) { if( isEmpty() ) { - QMessageBox::information( engine::mainWindow(), + QMessageBox::information( Engine::mainWindow(), tr( "Empty project" ), tr( "This project is empty so exporting makes " "no sense. Please put some items into " @@ -1161,7 +1161,7 @@ void Song::exportProject(bool multiExport) return; } - FileDialog efd( engine::mainWindow() ); + FileDialog efd( Engine::mainWindow() ); if (multiExport) { efd.setFileMode( FileDialog::Directory); @@ -1221,7 +1221,7 @@ void Song::exportProject(bool multiExport) } const QString export_file_name = efd.selectedFiles()[0] + suffix; - exportProjectDialog epd( export_file_name, engine::mainWindow(), multiExport ); + exportProjectDialog epd( export_file_name, Engine::mainWindow(), multiExport ); epd.exec(); } } @@ -1231,7 +1231,7 @@ void Song::exportProject(bool multiExport) void Song::updateFramesPerTick() { - engine::updateFramesPerTick(); + Engine::updateFramesPerTick(); } @@ -1242,10 +1242,10 @@ void Song::setModified() if( !m_loadingProject ) { m_modified = true; - if( engine::mainWindow() && - QThread::currentThread() == engine::mainWindow()->thread() ) + if( Engine::mainWindow() && + QThread::currentThread() == Engine::mainWindow()->thread() ) { - engine::mainWindow()->resetWindowTitle(); + Engine::mainWindow()->resetWindowTitle(); } } } @@ -1272,9 +1272,9 @@ void Song::removeController( Controller * _controller ) { m_controllers.remove( index ); - if( engine::getSong() ) + if( Engine::getSong() ) { - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } emit dataChanged(); } diff --git a/src/core/TempoSyncKnobModel.cpp b/src/core/TempoSyncKnobModel.cpp index 7d6235898..c3583f88a 100644 --- a/src/core/TempoSyncKnobModel.cpp +++ b/src/core/TempoSyncKnobModel.cpp @@ -27,7 +27,7 @@ #include #include "TempoSyncKnobModel.h" -#include "engine.h" +#include "Engine.h" #include "Song.h" @@ -41,7 +41,7 @@ TempoSyncKnobModel::TempoSyncKnobModel( const float _val, const float _min, m_scale( _scale ), m_custom( _parent ) { - connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), + connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), this, SLOT( calculateTempoSyncTime( bpm_t ) ) ); } @@ -66,7 +66,7 @@ void TempoSyncKnobModel::setTempoSync( QAction * _item ) void TempoSyncKnobModel::setTempoSync( int _note_type ) { setSyncMode( ( TempoSyncMode ) _note_type ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -157,7 +157,7 @@ void TempoSyncKnobModel::setSyncMode( TempoSyncMode _new_mode ) this, SLOT( updateCustom() ) ); } } - calculateTempoSyncTime( engine::getSong()->getTempo() ); + calculateTempoSyncTime( Engine::getSong()->getTempo() ); } @@ -166,7 +166,7 @@ void TempoSyncKnobModel::setSyncMode( TempoSyncMode _new_mode ) void TempoSyncKnobModel::setScale( float _new_scale ) { m_scale = _new_scale; - calculateTempoSyncTime( engine::getSong()->getTempo() ); + calculateTempoSyncTime( Engine::getSong()->getTempo() ); emit scaleChanged( _new_scale ); } diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 23a09f4e3..923c8f792 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -55,7 +55,7 @@ #include "ConfigManager.h" #include "Clipboard.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "InstrumentTrack.h" #include "MainWindow.h" @@ -151,7 +151,7 @@ void trackContentObject::movePosition( const MidiTime & _pos ) if( m_startPosition != _pos ) { m_startPosition = _pos; - engine::getSong()->updateLength(); + Engine::getSong()->updateLength(); } emit positionChanged(); } @@ -171,7 +171,7 @@ void trackContentObject::changeLength( const MidiTime & _length ) if( m_length != _length ) { m_length = _length; - engine::getSong()->updateLength(); + Engine::getSong()->updateLength(); } emit lengthChanged(); } @@ -1102,7 +1102,7 @@ void trackContentWidget::removeTCOView( trackContentObjectView * _tcov ) if( it != m_tcoViews.end() ) { m_tcoViews.erase( it ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } } @@ -1134,9 +1134,9 @@ void trackContentWidget::update() */ void trackContentWidget::changePosition( const MidiTime & _new_pos ) { - if( m_trackView->trackContainerView() == engine::getBBEditor() ) + if( m_trackView->trackContainerView() == Engine::getBBEditor() ) { - const int cur_bb = engine::getBBTrackContainer()->currentBB(); + const int cur_bb = Engine::getBBTrackContainer()->currentBB(); setUpdatesEnabled( false ); // first show TCO for current BB... @@ -1466,7 +1466,7 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe ) int ppt = static_cast( tcv->pixelsPerTact() ); QPainter p( this ); // Don't draw background on BB-Editor - if( m_trackView->trackContainerView() != engine::getBBEditor() ) + if( m_trackView->trackContainerView() != Engine::getBBEditor() ) { p.drawTiledPixmap( rect(), m_background, QPoint( tcv->currentPosition().getTact() * ppt, 0 ) ); @@ -2076,10 +2076,10 @@ void Track::removeTCO( trackContentObject * _tco ) if( it != m_trackContentObjects.end() ) { m_trackContentObjects.erase( it ); - if( engine::getSong() ) + if( Engine::getSong() ) { - engine::getSong()->updateLength(); - engine::getSong()->setModified(); + Engine::getSong()->updateLength(); + Engine::getSong()->setModified(); } } } diff --git a/src/core/TrackContainer.cpp b/src/core/TrackContainer.cpp index fb529d159..400113b88 100644 --- a/src/core/TrackContainer.cpp +++ b/src/core/TrackContainer.cpp @@ -30,7 +30,7 @@ #include "TrackContainer.h" #include "InstrumentTrack.h" -#include "engine.h" +#include "Engine.h" #include "MainWindow.h" #include "Song.h" @@ -82,14 +82,14 @@ void TrackContainer::loadSettings( const QDomElement & _this ) static QProgressDialog * pd = NULL; bool was_null = ( pd == NULL ); int start_val = 0; - if( !journalRestore && engine::hasGUI() ) + if( !journalRestore && Engine::hasGUI() ) { if( pd == NULL ) { pd = new QProgressDialog( tr( "Loading project..." ), tr( "Cancel" ), 0, _this.childNodes().count(), - engine::mainWindow() ); + Engine::mainWindow() ); pd->setWindowModality( Qt::ApplicationModal ); pd->setWindowTitle( tr( "Please wait..." ) ); pd->show(); @@ -185,9 +185,9 @@ void TrackContainer::removeTrack( Track * _track ) m_tracks.remove( index ); m_tracksMutex.unlock(); - if( engine::getSong() ) + if( Engine::getSong() ) { - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } } } diff --git a/src/core/VstSyncController.cpp b/src/core/VstSyncController.cpp index 36c7ec544..1e1294c32 100644 --- a/src/core/VstSyncController.cpp +++ b/src/core/VstSyncController.cpp @@ -26,7 +26,7 @@ #include #include "ConfigManager.h" -#include "engine.h" +#include "Engine.h" #include "lmmsconfig.h" #include "Mixer.h" #include "VstSyncController.h" @@ -54,7 +54,7 @@ VstSyncController::VstSyncController() : { if( ConfigManager::inst()->value( "ui", "syncvstplugins" ).toInt() ) { - connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); + connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); #ifdef USE_QT_SHMEM if ( m_shm.create( sizeof( VstSyncData ) ) ) @@ -104,7 +104,7 @@ VstSyncController::VstSyncController() : } m_syncData->isPlaying = false; - m_syncData->m_bufferSize = engine::mixer()->framesPerPeriod(); + m_syncData->m_bufferSize = Engine::mixer()->framesPerPeriod(); m_syncData->timeSigNumer = 4; m_syncData->timeSigDenom = 4; @@ -176,7 +176,7 @@ void VstSyncController::startCycle( int startTick, int endTick ) void VstSyncController::update() { - m_syncData->m_bufferSize = engine::mixer()->framesPerPeriod(); + m_syncData->m_bufferSize = Engine::mixer()->framesPerPeriod(); #ifdef VST_SNC_LATENCY m_syncData->m_latency = m_syncData->m_bufferSize * m_syncData->m_bpm / ( (float) m_syncData->m_sampleRate * 60 ); @@ -187,7 +187,7 @@ void VstSyncController::update() void VstSyncController::updateSampleRate() { - m_syncData->m_sampleRate = engine::mixer()->processingSampleRate(); + m_syncData->m_sampleRate = Engine::mixer()->processingSampleRate(); #ifdef VST_SNC_LATENCY m_syncData->m_latency = m_syncData->m_bufferSize * m_syncData->m_bpm / ( (float) m_syncData->m_sampleRate * 60 ); diff --git a/src/core/audio/AudioAlsa.cpp b/src/core/audio/AudioAlsa.cpp index 1edbfae9d..04594f855 100644 --- a/src/core/audio/AudioAlsa.cpp +++ b/src/core/audio/AudioAlsa.cpp @@ -31,7 +31,7 @@ #include "endian_handling.h" #include "ConfigManager.h" -#include "engine.h" +#include "Engine.h" #include "LcdSpinBox.h" #include "gui_templates.h" #include "templates.h" @@ -202,7 +202,7 @@ void AudioAlsa::applyQualitySettings() { if( hqAudio() ) { - setSampleRate( engine::mixer()->processingSampleRate() ); + setSampleRate( Engine::mixer()->processingSampleRate() ); if( m_handle != NULL ) { diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp index 2766eb211..004f1e504 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -33,7 +33,7 @@ #include #include "debug.h" -#include "engine.h" +#include "Engine.h" #include "templates.h" #include "gui_templates.h" #include "ConfigManager.h" @@ -106,7 +106,7 @@ void AudioJack::restartAfterZombified() { m_active = false; startProcessing(); - QMessageBox::information( engine::mainWindow(), + QMessageBox::information( Engine::mainWindow(), tr( "JACK client restarted" ), tr( "LMMS was kicked by JACK for some reason. " "Therefore the JACK backend of LMMS has been " @@ -115,7 +115,7 @@ void AudioJack::restartAfterZombified() } else { - QMessageBox::information( engine::mainWindow(), + QMessageBox::information( Engine::mainWindow(), tr( "JACK server down" ), tr( "The JACK server seems to have been shutdown " "and starting a new instance failed. " @@ -259,7 +259,7 @@ void AudioJack::applyQualitySettings() { if( hqAudio() ) { - setSampleRate( engine::mixer()->processingSampleRate() ); + setSampleRate( Engine::mixer()->processingSampleRate() ); if( jack_get_sample_rate( m_client ) != sampleRate() ) { diff --git a/src/core/audio/AudioOss.cpp b/src/core/audio/AudioOss.cpp index 224a5763d..0e43793fd 100644 --- a/src/core/audio/AudioOss.cpp +++ b/src/core/audio/AudioOss.cpp @@ -32,7 +32,7 @@ #include "endian_handling.h" #include "LcdSpinBox.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "templates.h" @@ -268,7 +268,7 @@ void AudioOss::applyQualitySettings() { if( hqAudio() ) { - setSampleRate( engine::mixer()->processingSampleRate() ); + setSampleRate( Engine::mixer()->processingSampleRate() ); unsigned int value = sampleRate(); if ( ioctl( m_audioFD, SNDCTL_DSP_SPEED, &value ) < 0 ) diff --git a/src/core/audio/AudioPort.cpp b/src/core/audio/AudioPort.cpp index 1fecc8d9e..b913babd1 100644 --- a/src/core/audio/AudioPort.cpp +++ b/src/core/audio/AudioPort.cpp @@ -26,7 +26,7 @@ #include "AudioDevice.h" #include "EffectChain.h" #include "FxMixer.h" -#include "engine.h" +#include "Engine.h" #include "MixHelpers.h" #include "BufferManager.h" #include "ValueBuffer.h" @@ -44,7 +44,7 @@ AudioPort::AudioPort( const QString & _name, bool _has_effect_chain, m_volumeModel( volumeModel ), m_panningModel( panningModel ) { - engine::mixer()->addAudioPort( this ); + Engine::mixer()->addAudioPort( this ); setExtOutputEnabled( true ); } @@ -54,7 +54,7 @@ AudioPort::AudioPort( const QString & _name, bool _has_effect_chain, AudioPort::~AudioPort() { setExtOutputEnabled( false ); - engine::mixer()->removeAudioPort( this ); + Engine::mixer()->removeAudioPort( this ); delete m_effects; } @@ -68,11 +68,11 @@ void AudioPort::setExtOutputEnabled( bool _enabled ) m_extOutputEnabled = _enabled; if( m_extOutputEnabled ) { - engine::mixer()->audioDev()->registerPort( this ); + Engine::mixer()->audioDev()->registerPort( this ); } else { - engine::mixer()->audioDev()->unregisterPort( this ); + Engine::mixer()->audioDev()->unregisterPort( this ); } } } @@ -83,7 +83,7 @@ void AudioPort::setExtOutputEnabled( bool _enabled ) void AudioPort::setName( const QString & _name ) { m_name = _name; - engine::mixer()->audioDev()->renamePort( this ); + Engine::mixer()->audioDev()->renamePort( this ); } @@ -93,7 +93,7 @@ bool AudioPort::processEffects() { if( m_effects ) { - bool more = m_effects->processAudioBuffer( m_portBuffer, engine::mixer()->framesPerPeriod(), m_bufferUsage ); + bool more = m_effects->processAudioBuffer( m_portBuffer, Engine::mixer()->framesPerPeriod(), m_bufferUsage ); return more; } return false; @@ -102,11 +102,11 @@ bool AudioPort::processEffects() void AudioPort::doProcessing() { - const fpp_t fpp = engine::mixer()->framesPerPeriod(); + const fpp_t fpp = Engine::mixer()->framesPerPeriod(); m_portBuffer = BufferManager::acquire(); // get buffer for processing - engine::mixer()->clearAudioBuffer( m_portBuffer, fpp ); // clear the audioport buffer so we can use it + Engine::mixer()->clearAudioBuffer( m_portBuffer, fpp ); // clear the audioport buffer so we can use it //qDebug( "Playhandles: %d", m_playHandles.size() ); foreach( PlayHandle * ph, m_playHandles ) // now we mix all playhandle buffers into the audioport buffer @@ -215,7 +215,7 @@ void AudioPort::doProcessing() const bool me = processEffects(); if( me || m_bufferUsage ) { - engine::fxMixer()->mixToChannel( m_portBuffer, m_nextFxChannel ); // send output to fx mixer + Engine::fxMixer()->mixToChannel( m_portBuffer, m_nextFxChannel ); // send output to fx mixer // TODO: improve the flow here - convert to pull model m_bufferUsage = false; } diff --git a/src/core/audio/AudioPortAudio.cpp b/src/core/audio/AudioPortAudio.cpp index f9a110f32..05edcbd87 100644 --- a/src/core/audio/AudioPortAudio.cpp +++ b/src/core/audio/AudioPortAudio.cpp @@ -41,7 +41,7 @@ void AudioPortAudioSetupUtil::updateChannels() #include #include -#include "engine.h" +#include "Engine.h" #include "debug.h" #include "ConfigManager.h" #include "gui_templates.h" diff --git a/src/core/audio/AudioPulseAudio.cpp b/src/core/audio/AudioPulseAudio.cpp index 6ab5525a1..ca80d6eec 100644 --- a/src/core/audio/AudioPulseAudio.cpp +++ b/src/core/audio/AudioPulseAudio.cpp @@ -34,7 +34,7 @@ #include "LcdSpinBox.h" #include "gui_templates.h" #include "templates.h" -#include "engine.h" +#include "Engine.h" static void stream_write_callback(pa_stream *s, size_t length, void *userdata) @@ -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::mixer()->framesPerPeriod() ) / + double latency = (double)( Engine::mixer()->framesPerPeriod() ) / (double)_this->sampleRate(); // ask PulseAudio for the desired latency (which might not be approved) diff --git a/src/core/audio/AudioSdl.cpp b/src/core/audio/AudioSdl.cpp index a5f678155..6285b4d4b 100644 --- a/src/core/audio/AudioSdl.cpp +++ b/src/core/audio/AudioSdl.cpp @@ -29,7 +29,7 @@ #include #include -#include "engine.h" +#include "Engine.h" #include "debug.h" #include "ConfigManager.h" #include "gui_templates.h" @@ -131,7 +131,7 @@ void AudioSdl::applyQualitySettings() { SDL_CloseAudio(); - setSampleRate( engine::mixer()->processingSampleRate() ); + setSampleRate( Engine::mixer()->processingSampleRate() ); m_audioHandle.freq = sampleRate(); diff --git a/src/core/main.cpp b/src/core/main.cpp index 5f303bba3..14dce4091 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -68,7 +68,7 @@ #include "ConfigManager.h" #include "NotePlayHandle.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "LmmsStyle.h" #include "ImportFilter.h" #include "MainWindow.h" @@ -437,7 +437,7 @@ int main( int argc, char * * argv ) qApp->processEvents(); // init central engine which handles all components of LMMS - engine::init(); + Engine::init(); splashScreen.hide(); @@ -449,7 +449,7 @@ int main( int argc, char * * argv ) QString recoveryFile = ConfigManager::inst()->recoveryFile(); if( QFileInfo(recoveryFile).exists() && - QMessageBox::question( engine::mainWindow(), MainWindow::tr( "Project recovery" ), + QMessageBox::question( Engine::mainWindow(), MainWindow::tr( "Project recovery" ), MainWindow::tr( "It looks like the last session did not end properly. " "Do you want to recover the project of this session?" ), QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes ) @@ -460,54 +460,54 @@ int main( int argc, char * * argv ) // we try to load given file if( !file_to_load.isEmpty() ) { - engine::mainWindow()->show(); + Engine::mainWindow()->show(); if( fullscreen ) { - engine::mainWindow()->showMaximized(); + Engine::mainWindow()->showMaximized(); } if( file_to_load == recoveryFile ) { - engine::getSong()->createNewProjectFromTemplate( file_to_load ); + Engine::getSong()->createNewProjectFromTemplate( file_to_load ); } else { - engine::getSong()->loadProject( file_to_load ); + Engine::getSong()->loadProject( file_to_load ); } } else if( !file_to_import.isEmpty() ) { - ImportFilter::import( file_to_import, engine::getSong() ); + ImportFilter::import( file_to_import, Engine::getSong() ); if( exit_after_import ) { return 0; } - engine::mainWindow()->show(); + Engine::mainWindow()->show(); if( fullscreen ) { - engine::mainWindow()->showMaximized(); + Engine::mainWindow()->showMaximized(); } } else { - engine::getSong()->createNewProject(); + Engine::getSong()->createNewProject(); // [Settel] workaround: showMaximized() doesn't work with // FVWM2 unless the window is already visible -> show() first - engine::mainWindow()->show(); + Engine::mainWindow()->show(); if( fullscreen ) { - engine::mainWindow()->showMaximized(); + Engine::mainWindow()->showMaximized(); } } } else { // we're going to render our song - engine::init( false ); + Engine::init( false ); printf( "loading project...\n" ); - engine::getSong()->loadProject( file_to_load ); + Engine::getSong()->loadProject( file_to_load ); printf( "done\n" ); // create renderer @@ -527,7 +527,7 @@ int main( int argc, char * * argv ) if( profilerOutputFile.isEmpty() == false ) { - engine::mixer()->profiler().setOutputFile( profilerOutputFile ); + Engine::mixer()->profiler().setOutputFile( profilerOutputFile ); } // start now! diff --git a/src/core/midi/MidiAlsaSeq.cpp b/src/core/midi/MidiAlsaSeq.cpp index 7dec9e676..7923fc659 100644 --- a/src/core/midi/MidiAlsaSeq.cpp +++ b/src/core/midi/MidiAlsaSeq.cpp @@ -27,7 +27,7 @@ #include "MidiAlsaSeq.h" #include "ConfigManager.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "Song.h" #include "MidiPort.h" @@ -96,14 +96,14 @@ MidiAlsaSeq::MidiAlsaSeq() : snd_seq_queue_tempo_t * tempo; snd_seq_queue_tempo_malloc( &tempo ); snd_seq_queue_tempo_set_tempo( tempo, 6000000 / - engine::getSong()->getTempo() ); + Engine::getSong()->getTempo() ); snd_seq_queue_tempo_set_ppq( tempo, 16 ); snd_seq_set_queue_tempo( m_seqHandle, m_queueID, tempo ); snd_seq_queue_tempo_free( tempo ); snd_seq_start_queue( m_seqHandle, m_queueID, NULL ); - changeQueueTempo( engine::getSong()->getTempo() ); - connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), + changeQueueTempo( Engine::getSong()->getTempo() ); + connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), this, SLOT( changeQueueTempo( bpm_t ) ) ); // initial list-update diff --git a/src/core/midi/MidiController.cpp b/src/core/midi/MidiController.cpp index 99e846016..7ff057c6f 100644 --- a/src/core/midi/MidiController.cpp +++ b/src/core/midi/MidiController.cpp @@ -28,7 +28,7 @@ #include #include "Song.h" -#include "engine.h" +#include "Engine.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::mixer()->midiClient(), this, this, MidiPort::Input ), + Engine::mixer()->midiClient(), this, this, MidiPort::Input ), m_lastValue( 0.0f ) { setSampleExact( true ); diff --git a/src/core/midi/MidiPort.cpp b/src/core/midi/MidiPort.cpp index 5219bbf0a..7185c6dc7 100644 --- a/src/core/midi/MidiPort.cpp +++ b/src/core/midi/MidiPort.cpp @@ -340,7 +340,7 @@ void MidiPort::updateMidiPortMode() emit writablePortsChanged(); emit modeChanged(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } diff --git a/src/core/midi/MidiWinMM.cpp b/src/core/midi/MidiWinMM.cpp index fe6dbc597..67c1319bc 100644 --- a/src/core/midi/MidiWinMM.cpp +++ b/src/core/midi/MidiWinMM.cpp @@ -27,7 +27,7 @@ #include "MidiWinMM.h" #include "ConfigManager.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "MidiPort.h" #include "note.h" diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index 90a1dcde8..9bc004df8 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -33,7 +33,7 @@ #include "timeline.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "templates.h" #include "nstate_button.h" #include "MainWindow.h" @@ -111,7 +111,7 @@ timeLine::timeLine( const int _xoff, const int _yoff, const float _ppt, timeLine::~timeLine() { - if( engine::songEditor() ) + if( Engine::songEditor() ) { m_pos.m_timeLine = NULL; } @@ -339,7 +339,7 @@ void timeLine::mouseMoveEvent( QMouseEvent* event ) { case MovePositionMarker: m_pos.setTicks( t.getTicks() ); - engine::getSong()->setMilliSeconds(((((t.getTicks()))*60*1000/48)/engine::getSong()->getTempo())); + Engine::getSong()->setMilliSeconds(((((t.getTicks()))*60*1000/48)/Engine::getSong()->getTempo())); m_pos.setCurrentFrame( 0 ); updatePosition(); break; diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index a314adfcc..98926f714 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -177,7 +177,7 @@ void AutomatableModelViewSlots::execConnectionDialog() AutomatableModel* m = m_amv->modelUntyped(); m->displayName(); - ControllerConnectionDialog d( (QWidget*) engine::mainWindow(), m ); + ControllerConnectionDialog d( (QWidget*) Engine::mainWindow(), m ); if( d.exec() == 1 ) { diff --git a/src/gui/AutomationEditor.cpp b/src/gui/AutomationEditor.cpp index 33b1c1921..b7c8c0845 100644 --- a/src/gui/AutomationEditor.cpp +++ b/src/gui/AutomationEditor.cpp @@ -50,7 +50,7 @@ #include "SongEditor.h" #include "MainWindow.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "pixmap_button.h" #include "templates.h" #include "gui_templates.h" @@ -105,7 +105,7 @@ AutomationEditor::AutomationEditor() : connect( this, SIGNAL( currentPatternChanged() ), this, SLOT( updateAfterPatternChange() ), Qt::QueuedConnection ); - connect( engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), + connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), this, SLOT( update() ) ); // init pixmaps if( s_toolDraw == NULL ) @@ -133,7 +133,7 @@ AutomationEditor::AutomationEditor() : // add time-line m_timeLine = new timeLine( VALUES_WIDTH, 32, m_ppt, - engine::getSong()->getPlayPos( + Engine::getSong()->getPlayPos( Song::Mode_PlayAutomationPattern ), m_currentPosition, this ); connect( this, SIGNAL( positionChanged( const MidiTime & ) ), @@ -435,9 +435,9 @@ AutomationEditor::AutomationEditor() : setMinimumSize( tb_layout->minimumSize().width(), 128 ); // add us to workspace - if( engine::mainWindow()->workspace() ) + if( Engine::mainWindow()->workspace() ) { - engine::mainWindow()->workspace()->addSubWindow( this ); + Engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->resize( INITIAL_WIDTH, INITIAL_HEIGHT ); parentWidget()->move( 5, 5 ); parentWidget()->hide(); @@ -587,7 +587,7 @@ void AutomationEditor::update() // Note detuning? if( m_pattern && !m_pattern->getTrack() ) { - engine::pianoRoll()->update(); + Engine::pianoRoll()->update(); } } @@ -725,7 +725,7 @@ void AutomationEditor::keyPressEvent( QKeyEvent * _ke ) break; case Qt::Key_Space: - if( engine::getSong()->isPlaying() ) + if( Engine::getSong()->isPlaying() ) { stop(); } @@ -911,7 +911,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent * _me ) QCursor c( Qt::SizeAllCursor ); QApplication::setOverrideCursor( c ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } else if( ( _me->button() == Qt::RightButton && m_editMode == DRAW ) || @@ -921,7 +921,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent * _me ) if( it != time_map.end() ) { m_pattern->removeValue( it.key() ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } m_action = NONE; } @@ -954,7 +954,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent * _me ) m_action = MOVE_SELECTION; - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } else if( _me->button() == Qt::RightButton && m_editMode == MOVE ) @@ -1039,7 +1039,7 @@ void AutomationEditor::mouseMoveEvent( QMouseEvent * _me ) level ); } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } else if( ( _me->buttons() & Qt::RightButton && @@ -1492,7 +1492,7 @@ void AutomationEditor::paintEvent( QPaintEvent * _pe ) } // Then beat grid int ticksPerBeat = DefaultTicksPerTact / - engine::getSong()->getTimeSigModel().getDenominator(); + Engine::getSong()->getTimeSigModel().getDenominator(); for( tick = m_currentPosition - m_currentPosition % ticksPerBeat, x = xCoordOfTick( tick ); x<=width(); @@ -1817,9 +1817,9 @@ void AutomationEditor::resizeEvent( QResizeEvent * ) m_topBottomScroll->setValue( (int) m_scrollLevel ); - if( engine::getSong() ) + if( Engine::getSong() ) { - engine::getSong()->getPlayPos( Song::Mode_PlayAutomationPattern + Engine::getSong()->getPlayPos( Song::Mode_PlayAutomationPattern ).m_timeLine->setFixedWidth( width() ); } m_toolBar->setFixedWidth( width() ); @@ -1914,7 +1914,7 @@ inline bool AutomationEditor::inBBEditor() { QMutexLocker m( &m_patternMutex ); return( validPattern() && - m_pattern->getTrack()->trackContainer() == engine::getBBTrackContainer() ); + m_pattern->getTrack()->trackContainer() == Engine::getBBTrackContainer() ); } @@ -1931,37 +1931,37 @@ void AutomationEditor::play() if( !m_pattern->getTrack() ) { - if( engine::getSong()->playMode() != Song::Mode_PlayPattern ) + if( Engine::getSong()->playMode() != Song::Mode_PlayPattern ) { - engine::getSong()->stop(); - engine::getSong()->playPattern( (Pattern *) engine::pianoRoll()->currentPattern() ); + Engine::getSong()->stop(); + Engine::getSong()->playPattern( (Pattern *) Engine::pianoRoll()->currentPattern() ); } - else if( engine::getSong()->isStopped() == false ) + else if( Engine::getSong()->isStopped() == false ) { - engine::getSong()->togglePause(); + Engine::getSong()->togglePause(); } else { - engine::getSong()->playPattern( (Pattern *) engine::pianoRoll()->currentPattern() ); + Engine::getSong()->playPattern( (Pattern *) Engine::pianoRoll()->currentPattern() ); } } else if( inBBEditor() ) { - engine::getBBTrackContainer()->play(); + Engine::getBBTrackContainer()->play(); } else { - if( engine::getSong()->isStopped() == true ) + if( Engine::getSong()->isStopped() == true ) { - engine::getSong()->playSong(); + Engine::getSong()->playSong(); } else { - engine::getSong()->togglePause(); + Engine::getSong()->togglePause(); } } - setPauseIcon( engine::getSong()->isPlaying() ); + setPauseIcon( Engine::getSong()->isPlaying() ); } @@ -1977,11 +1977,11 @@ void AutomationEditor::stop() } if( m_pattern->getTrack() && inBBEditor() ) { - engine::getBBTrackContainer()->stop(); + Engine::getBBTrackContainer()->stop(); } else { - engine::getSong()->stop(); + Engine::getSong()->stop(); } m_scrollBack = true; } @@ -2058,7 +2058,7 @@ void AutomationEditor::discreteButtonToggled() disableTensionKnob(); m_pattern->setProgressionType( AutomationPattern::DiscreteProgression ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); } } @@ -2074,7 +2074,7 @@ void AutomationEditor::linearButtonToggled() disableTensionKnob(); m_pattern->setProgressionType( AutomationPattern::LinearProgression ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); } } @@ -2096,7 +2096,7 @@ void AutomationEditor::cubicHermiteButtonToggled() "level off at each control point." ) ); m_pattern->setProgressionType( AutomationPattern::CubicHermiteProgression ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); } } @@ -2235,7 +2235,7 @@ void AutomationEditor::cutSelectedValues() if( !selected_values.isEmpty() ) { - engine::getSong()->setModified(); + Engine::getSong()->setModified(); for( timeMap::iterator it = selected_values.begin(); it != selected_values.end(); ++it ) @@ -2246,7 +2246,7 @@ void AutomationEditor::cutSelectedValues() } update(); - engine::songEditor()->update(); + Engine::songEditor()->update(); } @@ -2266,9 +2266,9 @@ void AutomationEditor::pasteValues() // we only have to do the following lines if we pasted at // least one value... - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); - engine::songEditor()->update(); + Engine::songEditor()->update(); } } @@ -2296,9 +2296,9 @@ void AutomationEditor::deleteSelectedValues() if( update_after_delete == true ) { - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); - engine::songEditor()->update(); + Engine::songEditor()->update(); } } @@ -2307,8 +2307,8 @@ void AutomationEditor::deleteSelectedValues() void AutomationEditor::updatePosition( const MidiTime & _t ) { - if( ( engine::getSong()->isPlaying() && - engine::getSong()->playMode() == + if( ( Engine::getSong()->isPlaying() && + Engine::getSong()->playMode() == Song::Mode_PlayAutomationPattern ) || m_scrollBack == true ) { diff --git a/src/gui/AutomationPatternView.cpp b/src/gui/AutomationPatternView.cpp index 56c0d1309..ad90a92e9 100644 --- a/src/gui/AutomationPatternView.cpp +++ b/src/gui/AutomationPatternView.cpp @@ -30,7 +30,7 @@ #include "AutomationEditor.h" #include "AutomationPattern.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "ProjectJournal.h" #include "rename_dialog.h" @@ -49,7 +49,7 @@ AutomationPatternView::AutomationPatternView( AutomationPattern * _pattern, { connect( m_pat, SIGNAL( dataChanged() ), this, SLOT( update() ) ); - connect( engine::automationEditor(), SIGNAL( currentPatternChanged() ), + connect( Engine::automationEditor(), SIGNAL( currentPatternChanged() ), this, SLOT( update() ) ); setAttribute( Qt::WA_OpaquePaintEvent, true ); @@ -110,7 +110,7 @@ void AutomationPatternView::changeName() void AutomationPatternView::disconnectObject( QAction * _a ) { - JournallingObject * j = engine::projectJournal()-> + JournallingObject * j = Engine::projectJournal()-> journallingObject( _a->data().toInt() ); if( j && dynamic_cast( j ) ) { @@ -123,9 +123,9 @@ void AutomationPatternView::disconnectObject( QAction * _a ) update(); //If automation editor is opened, update its display after disconnection - if( engine::automationEditor() ) + if( Engine::automationEditor() ) { - engine::automationEditor()->updateAfterPatternChange(); + Engine::automationEditor()->updateAfterPatternChange(); } //if there is no more connection connected to the AutomationPattern @@ -242,7 +242,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * ) lingrad.setColorAt( 0, c ); p.setBrush( lingrad ); - if( engine::automationEditor()->currentPattern() == m_pat ) + if( Engine::automationEditor()->currentPattern() == m_pat ) p.setPen( c.lighter( 160 ) ); else p.setPen( c.lighter( 130 ) ); @@ -325,7 +325,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * ) // outer edge p.setBrush( QBrush() ); - if( engine::automationEditor()->currentPattern() == m_pat ) + if( Engine::automationEditor()->currentPattern() == m_pat ) p.setPen( c.lighter( 130 ) ); else p.setPen( c.darker( 300 ) ); @@ -378,7 +378,7 @@ void AutomationPatternView::dropEvent( QDropEvent * _de ) if( type == "automatable_model" ) { AutomatableModel * mod = dynamic_cast( - engine::projectJournal()-> + Engine::projectJournal()-> journallingObject( val.toInt() ) ); if( mod != NULL ) { @@ -386,10 +386,10 @@ void AutomationPatternView::dropEvent( QDropEvent * _de ) } update(); - if( engine::automationEditor() && - engine::automationEditor()->currentPattern() == m_pat ) + if( Engine::automationEditor() && + Engine::automationEditor()->currentPattern() == m_pat ) { - engine::automationEditor()->setCurrentPattern( m_pat ); + Engine::automationEditor()->setCurrentPattern( m_pat ); } } else diff --git a/src/gui/ControllerConnectionDialog.cpp b/src/gui/ControllerConnectionDialog.cpp index 35f42df97..0a31cf075 100644 --- a/src/gui/ControllerConnectionDialog.cpp +++ b/src/gui/ControllerConnectionDialog.cpp @@ -70,7 +70,7 @@ public: { m_detectedMidiChannel = event.channel() + 1; m_detectedMidiController = event.controllerNumber() + 1; - m_detectedMidiPort = engine::mixer()->midiClient()->sourcePortName( event ); + m_detectedMidiPort = Engine::mixer()->midiClient()->sourcePortName( event ); emit valueChanged(); } @@ -165,7 +165,7 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, // when using with non-raw-clients we can provide buttons showing // our port-menus when being clicked - if( !engine::mixer()->midiClient()->isRaw() ) + if( !Engine::mixer()->midiClient()->isRaw() ) { m_readablePorts = new MidiPortMenu( MidiPort::Input ); connect( m_readablePorts, SIGNAL( triggered( QAction * ) ), @@ -189,9 +189,9 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, m_userController = new comboBox( m_userGroupBox, "Controller" ); m_userController->setGeometry( 10, 24, 200, 22 ); - for( int i = 0; i < engine::getSong()->controllers().size(); ++i ) + for( int i = 0; i < Engine::getSong()->controllers().size(); ++i ) { - Controller * c = engine::getSong()->controllers().at( i ); + Controller * c = Engine::getSong()->controllers().at( i ); m_userController->model()->addItem( c->name() ); } @@ -242,7 +242,7 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, { cc = m_targetModel->controllerConnection(); - if( cc && cc->getController()->type() != Controller::DummyController && engine::getSong() ) + if( cc && cc->getController()->type() != Controller::DummyController && Engine::getSong() ) { if ( cc->getController()->type() == Controller::MidiController ) { @@ -258,7 +258,7 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, } else { - int idx = engine::getSong()->controllers().indexOf( cc->getController() ); + int idx = Engine::getSong()->controllers().indexOf( cc->getController() ); if( idx >= 0 ) { @@ -298,7 +298,7 @@ void ControllerConnectionDialog::selectController() if( m_midiControllerSpinBox->model()->value() > 0 ) { MidiController * mc; - mc = m_midiController->copyToMidiController( engine::getSong() ); + mc = m_midiController->copyToMidiController( Engine::getSong() ); /* if( m_targetModel->getTrack() && @@ -321,9 +321,9 @@ void ControllerConnectionDialog::selectController() else { if( m_userGroupBox->model()->value() > 0 && - engine::getSong()->controllers().size() ) + Engine::getSong()->controllers().size() ) { - m_controller = engine::getSong()->controllers().at( + m_controller = Engine::getSong()->controllers().at( m_userController->model()->value() ); } @@ -353,7 +353,7 @@ void ControllerConnectionDialog::midiToggled() if( !m_midiController ) { - m_midiController = new AutoDetectMidiController( engine::getSong() ); + m_midiController = new AutoDetectMidiController( Engine::getSong() ); MidiPort::Map map = m_midiController->m_midiPort.readablePorts(); for( MidiPort::Map::Iterator it = map.begin(); it != map.end(); ++it ) diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 14a862872..117ad8000 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -37,7 +37,7 @@ #include "ConfigManager.h" #include "debug.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "ImportFilter.h" #include "Instrument.h" @@ -415,7 +415,7 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) m_pphMutex.lock(); if( m_previewPlayHandle != NULL ) { - engine::mixer()->removePlayHandle( + Engine::mixer()->removePlayHandle( m_previewPlayHandle ); m_previewPlayHandle = NULL; } @@ -446,7 +446,7 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) } if( m_previewPlayHandle != NULL ) { - if( !engine::mixer()->addPlayHandle( + if( !Engine::mixer()->addPlayHandle( m_previewPlayHandle ) ) { m_previewPlayHandle = NULL; @@ -524,7 +524,7 @@ void FileBrowserTreeWidget::mouseReleaseEvent(QMouseEvent * me ) SamplePlayHandle * s = dynamic_cast( m_previewPlayHandle ); if( s && s->totalFrames() - s->framesDone() <= - static_cast( engine::mixer()-> + static_cast( Engine::mixer()-> processingSampleRate() * 3 ) ) { s->setDoneMayReturnTrue( true ); @@ -533,7 +533,7 @@ void FileBrowserTreeWidget::mouseReleaseEvent(QMouseEvent * me ) return; } } - engine::mixer()->removePlayHandle( m_previewPlayHandle ); + Engine::mixer()->removePlayHandle( m_previewPlayHandle ); m_previewPlayHandle = NULL; } m_pphMutex.unlock(); @@ -545,13 +545,13 @@ void FileBrowserTreeWidget::mouseReleaseEvent(QMouseEvent * me ) void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it ) { - engine::mixer()->lock(); + Engine::mixer()->lock(); switch( f->handling() ) { case FileItem::LoadAsProject: - if( engine::mainWindow()->mayChangeProject() ) + if( Engine::mainWindow()->mayChangeProject() ) { - engine::getSong()->loadProject( f->fullName() ); + Engine::getSong()->loadProject( f->fullName() ); } break; @@ -563,7 +563,7 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it ) !i->descriptor()->supportsFileType( e ) ) { i = it->loadInstrument( - engine::pluginFileHandling()[e] ); + Engine::pluginFileHandling()[e] ); } i->loadFile( f->fullName() ); break; @@ -580,12 +580,12 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it ) case FileItem::ImportAsProject: if( f->type() == FileItem::FlpFile && - !engine::mainWindow()->mayChangeProject() ) + !Engine::mainWindow()->mayChangeProject() ) { break; } ImportFilter::import( f->fullName(), - engine::getSong() ); + Engine::getSong() ); break; case FileItem::NotSupported: @@ -593,7 +593,7 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it ) break; } - engine::mixer()->unlock(); + Engine::mixer()->unlock(); } @@ -618,7 +618,7 @@ void FileBrowserTreeWidget::activateListItem(QTreeWidgetItem * item, // engine::mixer()->lock(); InstrumentTrack * it = dynamic_cast( Track::create( Track::InstrumentTrack, - engine::getBBTrackContainer() ) ); + Engine::getBBTrackContainer() ) ); handleFile( f, it ); // engine::mixer()->unlock(); } @@ -645,7 +645,7 @@ void FileBrowserTreeWidget::openInNewInstrumentTrack( TrackContainer* tc ) void FileBrowserTreeWidget::openInNewInstrumentTrackBBE( void ) { - openInNewInstrumentTrack( engine::getBBTrackContainer() ); + openInNewInstrumentTrack( Engine::getBBTrackContainer() ); } @@ -653,7 +653,7 @@ void FileBrowserTreeWidget::openInNewInstrumentTrackBBE( void ) void FileBrowserTreeWidget::openInNewInstrumentTrackSE( void ) { - openInNewInstrumentTrack( engine::getSong() ); + openInNewInstrumentTrack( Engine::getSong() ); } @@ -663,7 +663,7 @@ void FileBrowserTreeWidget::sendToActiveInstrumentTrack( void ) { // get all windows opened in the workspace QList pl = - engine::mainWindow()->workspace()-> + Engine::mainWindow()->workspace()-> subWindowList( QMdiArea::StackingOrder ); QListIterator w( pl ); w.toBack(); @@ -988,7 +988,7 @@ void FileItem::determineFileType( void ) m_type = PresetFile; m_handling = LoadAsPreset; } - else if( ext == "xiz" && engine::pluginFileHandling().contains( ext ) ) + else if( ext == "xiz" && Engine::pluginFileHandling().contains( ext ) ) { m_type = PresetFile; m_handling = LoadByPlugin; @@ -1022,7 +1022,7 @@ void FileItem::determineFileType( void ) } if( m_handling == NotSupported && - !ext.isEmpty() && engine::pluginFileHandling().contains( ext ) ) + !ext.isEmpty() && Engine::pluginFileHandling().contains( ext ) ) { m_handling = LoadByPlugin; // classify as sample if not classified by anything yet but can diff --git a/src/gui/FxMixerView.cpp b/src/gui/FxMixerView.cpp index 5a84e1e64..4f1cb0f7f 100644 --- a/src/gui/FxMixerView.cpp +++ b/src/gui/FxMixerView.cpp @@ -39,7 +39,7 @@ #include "FxMixerView.h" #include "knob.h" -#include "engine.h" +#include "Engine.h" #include "embed.h" #include "MainWindow.h" #include "gui_templates.h" @@ -52,7 +52,7 @@ FxMixerView::FxMixerView() : ModelView( NULL, this ), SerializingObjectHook() { - FxMixer * m = engine::fxMixer(); + FxMixer * m = Engine::fxMixer(); m->setHook( this ); //QPalette pal = palette(); @@ -141,13 +141,13 @@ FxMixerView::FxMixerView() : updateGeometry(); // timer for updating faders - connect( engine::mainWindow(), SIGNAL( periodicUpdate() ), + connect( Engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( updateFaders() ) ); // add ourself to workspace QMdiSubWindow * subWin = - engine::mainWindow()->workspace()->addSubWindow( this ); + Engine::mainWindow()->workspace()->addSubWindow( this ); Qt::WindowFlags flags = subWin->windowFlags(); flags &= ~Qt::WindowMaximizeButtonHint; subWin->setWindowFlags( flags ); @@ -174,7 +174,7 @@ FxMixerView::~FxMixerView() void FxMixerView::addNewChannel() { // add new fx mixer channel and redraw the form. - FxMixer * mix = engine::fxMixer(); + FxMixer * mix = Engine::fxMixer(); int newChannelIndex = mix->createChannel(); m_fxChannelViews.push_back(new FxChannelView(m_channelAreaWidget, this, @@ -204,7 +204,7 @@ void FxMixerView::refreshDisplay() m_channelAreaWidget->adjustSize(); // re-add the views - m_fxChannelViews.resize(engine::fxMixer()->numChannels()); + m_fxChannelViews.resize(Engine::fxMixer()->numChannels()); for( int i = 1; i < m_fxChannelViews.size(); ++i ) { m_fxChannelViews[i] = new FxChannelView(m_channelAreaWidget, this, i); @@ -228,8 +228,8 @@ void FxMixerView::refreshDisplay() // update the and max. channel number for every instrument void FxMixerView::updateMaxChannelSelector() { - QVector songTrackList = engine::getSong()->tracks(); - QVector bbTrackList = engine::getBBTrackContainer()->tracks(); + QVector songTrackList = Engine::getSong()->tracks(); + QVector bbTrackList = Engine::getBBTrackContainer()->tracks(); QVector trackLists[] = {songTrackList, bbTrackList}; for(int tl=0; tl<2; ++tl) @@ -267,7 +267,7 @@ FxMixerView::FxChannelView::FxChannelView(QWidget * _parent, FxMixerView * _mv, { m_fxLine = new FxLine(_parent, _mv, _chIndex); - FxMixer * m = engine::fxMixer(); + FxMixer * m = Engine::fxMixer(); m_fader = new fader( &m->effectChannel(_chIndex)->m_volumeModel, tr( "FX Fader %1" ).arg( _chIndex ), m_fxLine ); m_fader->move( 16-m_fader->width()/2, @@ -304,7 +304,7 @@ FxMixerView::FxChannelView::FxChannelView(QWidget * _parent, FxMixerView * _mv, void FxMixerView::toggledSolo() { - engine::fxMixer()->toggledSolo(); + Engine::fxMixer()->toggledSolo(); } @@ -325,7 +325,7 @@ void FxMixerView::setCurrentFxLine( FxLine * _line ) void FxMixerView::updateFxLine(int index) { - FxMixer * mix = engine::fxMixer(); + FxMixer * mix = Engine::fxMixer(); // does current channel send to this channel? int selIndex = m_currentFxLine->channelIndex(); @@ -359,7 +359,7 @@ void FxMixerView::deleteChannel(int index) int selLine = m_currentFxLine->channelIndex(); // delete the real channel - engine::fxMixer()->deleteChannel(index); + Engine::fxMixer()->deleteChannel(index); // delete the view chLayout->removeWidget(m_fxChannelViews[index]->m_fxLine); @@ -402,7 +402,7 @@ void FxMixerView::moveChannelLeft(int index) int selIndex = m_currentFxLine->channelIndex(); - FxMixer * mix = engine::fxMixer(); + FxMixer * mix = Engine::fxMixer(); mix->moveChannelLeft(index); // refresh the two mixer views @@ -492,7 +492,7 @@ void FxMixerView::setCurrentFxLine( int _line ) void FxMixerView::clear() { - engine::fxMixer()->clear(); + Engine::fxMixer()->clear(); refreshDisplay(); } @@ -502,7 +502,7 @@ void FxMixerView::clear() void FxMixerView::updateFaders() { - FxMixer * m = engine::fxMixer(); + FxMixer * m = Engine::fxMixer(); for( int i = 0; i < m_fxChannelViews.size(); ++i ) { const float opl = m_fxChannelViews[i]->m_fader->getPeak_L(); diff --git a/src/gui/LfoControllerDialog.cpp b/src/gui/LfoControllerDialog.cpp index c52fd1930..b1415f73f 100644 --- a/src/gui/LfoControllerDialog.cpp +++ b/src/gui/LfoControllerDialog.cpp @@ -32,7 +32,7 @@ #include "caption_menu.h" #include "gui_templates.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "led_checkbox.h" #include "MainWindow.h" #include "tooltip.h" diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 9df27df61..1c6394f6e 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -42,7 +42,7 @@ #include "Song.h" #include "PianoRoll.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "FxMixerView.h" #include "InstrumentTrack.h" #include "PianoView.h" @@ -199,7 +199,7 @@ MainWindow::MainWindow() : m_autoSaveTimer.start(1000 * 60); // 1 minute } - connect( engine::getSong(), SIGNAL( playbackStateChanged() ), + connect( Engine::getSong(), SIGNAL( playbackStateChanged() ), this, SLOT( updatePlayPauseIcons() ) ); } @@ -217,7 +217,7 @@ MainWindow::~MainWindow() } // TODO: Close tools // destroy engine which will do further cleanups etc. - engine::destroy(); + Engine::destroy(); } @@ -266,16 +266,16 @@ void MainWindow::finalize() project_menu->addSeparator(); project_menu->addAction( embed::getIconPixmap( "project_import" ), tr( "Import..." ), - engine::getSong(), + Engine::getSong(), SLOT( importProject() ) ); project_menu->addAction( embed::getIconPixmap( "project_export" ), tr( "E&xport..." ), - engine::getSong(), + Engine::getSong(), SLOT( exportProject() ), Qt::CTRL + Qt::Key_E ); project_menu->addAction( embed::getIconPixmap( "project_export" ), tr( "E&xport tracks..." ), - engine::getSong(), + Engine::getSong(), SLOT( exportProjectTracks() ), Qt::CTRL + Qt::SHIFT + Qt::Key_E ); @@ -392,7 +392,7 @@ void MainWindow::finalize() toolButton * project_export = new toolButton( embed::getIconPixmap( "project_export" ), tr( "Export current project" ), - engine::getSong(), + Engine::getSong(), SLOT( exportProject() ), m_toolBar ); @@ -523,7 +523,7 @@ void MainWindow::finalize() sd.exec(); } // look whether mixer could use a audio-interface beside AudioDummy - else if( engine::mixer()->audioDevName() == AudioDummy::name() ) + else if( Engine::mixer()->audioDevName() == AudioDummy::name() ) { // no, so we offer setup-dialog with audio-settings... setupDialog sd( setupDialog::AudioSettings ); @@ -563,16 +563,16 @@ void MainWindow::addSpacingToToolBar( int _size ) void MainWindow::resetWindowTitle() { QString title = ""; - if( engine::getSong()->projectFileName() != "" ) + if( Engine::getSong()->projectFileName() != "" ) { - title = QFileInfo( engine::getSong()->projectFileName() + title = QFileInfo( Engine::getSong()->projectFileName() ).completeBaseName(); } if( title == "" ) { title = tr( "Untitled" ); } - if( engine::getSong()->isModified() ) + if( Engine::getSong()->isModified() ) { title += '*'; } @@ -584,9 +584,9 @@ void MainWindow::resetWindowTitle() bool MainWindow::mayChangeProject() { - engine::getSong()->stop(); + Engine::getSong()->stop(); - if( !engine::getSong()->isModified() ) + if( !Engine::getSong()->isModified() ) { return( true ); } @@ -693,7 +693,7 @@ void MainWindow::createNewProject() { if( mayChangeProject() ) { - engine::getSong()->createNewProject(); + Engine::getSong()->createNewProject(); } } @@ -708,7 +708,7 @@ void MainWindow::createNewProjectFromTemplate( QAction * _idx ) >= m_custom_templates_count ? ConfigManager::inst()->factoryProjectsDir() : ConfigManager::inst()->userProjectsDir(); - engine::getSong()->createNewProjectFromTemplate( + Engine::getSong()->createNewProjectFromTemplate( dir_base + "templates/" + _idx->text() + ".mpt" ); } } @@ -728,7 +728,7 @@ void MainWindow::openProject() !ofd.selectedFiles().isEmpty() ) { setCursor( Qt::WaitCursor ); - engine::getSong()->loadProject( + Engine::getSong()->loadProject( ofd.selectedFiles()[0] ); setCursor( Qt::ArrowCursor ); } @@ -758,7 +758,7 @@ void MainWindow::openRecentlyOpenedProject( QAction * _action ) { const QString & f = _action->text(); setCursor( Qt::WaitCursor ); - engine::getSong()->loadProject( f ); + Engine::getSong()->loadProject( f ); ConfigManager::inst()->addRecentlyOpenedProject( f ); setCursor( Qt::ArrowCursor ); } @@ -769,13 +769,13 @@ void MainWindow::openRecentlyOpenedProject( QAction * _action ) bool MainWindow::saveProject() { - if( engine::getSong()->projectFileName() == "" ) + if( Engine::getSong()->projectFileName() == "" ) { return( saveProjectAs() ); } else { - engine::getSong()->guiSaveProject(); + Engine::getSong()->guiSaveProject(); } return( true ); } @@ -788,7 +788,7 @@ bool MainWindow::saveProjectAs() VersionedSaveDialog sfd( this, tr( "Save project" ), "", tr( "LMMS Project (*.mmpz *.mmp);;" "LMMS Project Template (*.mpt)" ) ); - QString f = engine::getSong()->projectFileName(); + QString f = Engine::getSong()->projectFileName(); if( f != "" ) { sfd.setDirectory( QFileInfo( f ).absolutePath() ); @@ -802,7 +802,7 @@ bool MainWindow::saveProjectAs() if( sfd.exec () == FileDialog::Accepted && !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" ) { - engine::getSong()->guiSaveProjectAs( + Engine::getSong()->guiSaveProjectAs( sfd.selectedFiles()[0] ); return( true ); } @@ -814,7 +814,7 @@ bool MainWindow::saveProjectAs() bool MainWindow::saveProjectAsNewVersion() { - QString fileName = engine::getSong()->projectFileName(); + QString fileName = Engine::getSong()->projectFileName(); if( fileName == "" ) { return saveProjectAs(); @@ -824,7 +824,7 @@ bool MainWindow::saveProjectAsNewVersion() do VersionedSaveDialog::changeFileNameVersion( fileName, true ); while ( QFile( fileName ).exists() ); - engine::getSong()->guiSaveProjectAs( fileName ); + Engine::getSong()->guiSaveProjectAs( fileName ); return true; } } @@ -892,7 +892,7 @@ void MainWindow::toggleWindow( QWidget *window, bool forceShow ) void MainWindow::toggleBBEditorWin( bool forceShow ) { - toggleWindow( engine::getBBEditor(), forceShow ); + toggleWindow( Engine::getBBEditor(), forceShow ); } @@ -900,7 +900,7 @@ void MainWindow::toggleBBEditorWin( bool forceShow ) void MainWindow::toggleSongEditorWin() { - toggleWindow( engine::songEditor() ); + toggleWindow( Engine::songEditor() ); } @@ -908,7 +908,7 @@ void MainWindow::toggleSongEditorWin() void MainWindow::toggleProjectNotesWin() { - toggleWindow( engine::getProjectNotes() ); + toggleWindow( Engine::getProjectNotes() ); } @@ -916,7 +916,7 @@ void MainWindow::toggleProjectNotesWin() void MainWindow::togglePianoRollWin() { - toggleWindow( engine::pianoRoll() ); + toggleWindow( Engine::pianoRoll() ); } @@ -924,7 +924,7 @@ void MainWindow::togglePianoRollWin() void MainWindow::toggleAutomationEditorWin() { - toggleWindow( engine::automationEditor() ); + toggleWindow( Engine::automationEditor() ); } @@ -932,7 +932,7 @@ void MainWindow::toggleAutomationEditorWin() void MainWindow::toggleFxMixerWin() { - toggleWindow( engine::fxMixerView() ); + toggleWindow( Engine::fxMixerView() ); } @@ -940,7 +940,7 @@ void MainWindow::toggleFxMixerWin() void MainWindow::toggleControllerRack() { - toggleWindow( engine::getControllerRackView() ); + toggleWindow( Engine::getControllerRackView() ); } @@ -948,29 +948,29 @@ void MainWindow::toggleControllerRack() void MainWindow::updatePlayPauseIcons() { - engine::songEditor()->setPauseIcon( false ); - engine::automationEditor()->setPauseIcon( false ); - engine::getBBEditor()->setPauseIcon( false ); - engine::pianoRoll()->setPauseIcon( false ); + Engine::songEditor()->setPauseIcon( false ); + Engine::automationEditor()->setPauseIcon( false ); + Engine::getBBEditor()->setPauseIcon( false ); + Engine::pianoRoll()->setPauseIcon( false ); - if( engine::getSong()->isPlaying() ) + if( Engine::getSong()->isPlaying() ) { - switch( engine::getSong()->playMode() ) + switch( Engine::getSong()->playMode() ) { case Song::Mode_PlaySong: - engine::songEditor()->setPauseIcon( true ); + Engine::songEditor()->setPauseIcon( true ); break; case Song::Mode_PlayAutomationPattern: - engine::automationEditor()->setPauseIcon( true ); + Engine::automationEditor()->setPauseIcon( true ); break; case Song::Mode_PlayBB: - engine::getBBEditor()->setPauseIcon( true ); + Engine::getBBEditor()->setPauseIcon( true ); break; case Song::Mode_PlayPattern: - engine::pianoRoll()->setPauseIcon( true ); + Engine::pianoRoll()->setPauseIcon( true ); break; default: @@ -984,7 +984,7 @@ void MainWindow::updatePlayPauseIcons() void MainWindow::undo() { - engine::projectJournal()->undo(); + Engine::projectJournal()->undo(); } @@ -992,7 +992,7 @@ void MainWindow::undo() void MainWindow::redo() { - engine::projectJournal()->redo(); + Engine::projectJournal()->redo(); } @@ -1145,10 +1145,10 @@ void MainWindow::browseHelp() void MainWindow::autoSave() { - if( !( engine::getSong()->isPlaying() || - engine::getSong()->isExporting() ) ) + if( !( Engine::getSong()->isPlaying() || + Engine::getSong()->isExporting() ) ) { - engine::getSong()->saveProjectFile(ConfigManager::inst()->recoveryFile()); + Engine::getSong()->saveProjectFile(ConfigManager::inst()->recoveryFile()); } else { diff --git a/src/gui/PeakControllerDialog.cpp b/src/gui/PeakControllerDialog.cpp index 81528e7b0..f657999ce 100644 --- a/src/gui/PeakControllerDialog.cpp +++ b/src/gui/PeakControllerDialog.cpp @@ -33,7 +33,7 @@ #include "caption_menu.h" #include "gui_templates.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "MainWindow.h" #include "tooltip.h" diff --git a/src/gui/PianoRoll.cpp b/src/gui/PianoRoll.cpp index e981792dc..020fd3951 100644 --- a/src/gui/PianoRoll.cpp +++ b/src/gui/PianoRoll.cpp @@ -292,7 +292,7 @@ PianoRoll::PianoRoll() : // add time-line m_timeLine = new timeLine( WHITE_KEY_WIDTH, 32, m_ppt, - engine::getSong()->getPlayPos( + Engine::getSong()->getPlayPos( Song::Mode_PlayPattern ), m_currentPosition, this ); connect( this, SIGNAL( positionChanged( const MidiTime & ) ), @@ -301,7 +301,7 @@ PianoRoll::PianoRoll() : this, SLOT( updatePosition( const MidiTime & ) ) ); // update timeline when in record-accompany mode - connect( engine::getSong()->getPlayPos( Song::Mode_PlaySong ).m_timeLine, + connect( Engine::getSong()->getPlayPos( Song::Mode_PlaySong ).m_timeLine, SIGNAL( positionChanged( const MidiTime & ) ), this, SLOT( updatePositionAccompany( const MidiTime & ) ) ); @@ -678,9 +678,9 @@ PianoRoll::PianoRoll() : setMinimumSize( tb_layout->minimumSize().width(), 160 ); // add us to workspace - if( engine::mainWindow()->workspace() ) + if( Engine::mainWindow()->workspace() ) { - engine::mainWindow()->workspace()->addSubWindow( this ); + Engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->setMinimumSize( tb_layout->minimumSize().width()+10, 200 ); parentWidget()->resize( tb_layout->minimumSize().width()+10, INITIAL_PIANOROLL_HEIGHT ); @@ -694,7 +694,7 @@ PianoRoll::PianoRoll() : hide(); } - connect( engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), + connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), this, SLOT( update() ) ); } @@ -795,10 +795,10 @@ void PianoRoll::setCurrentPattern( Pattern* newPattern ) } // force the song-editor to stop playing if it played pattern before - if( engine::getSong()->isPlaying() && - engine::getSong()->playMode() == Song::Mode_PlayPattern ) + if( Engine::getSong()->isPlaying() && + Engine::getSong()->playMode() == Song::Mode_PlayPattern ) { - engine::getSong()->playPattern( NULL ); + Engine::getSong()->playPattern( NULL ); } // set new data @@ -1134,7 +1134,7 @@ void PianoRoll::shiftSemiTone( int amount ) // shift notes by amount semitones // we modified the song update(); - engine::songEditor()->update(); + Engine::songEditor()->update(); } @@ -1170,7 +1170,7 @@ void PianoRoll::shiftPos( int amount ) //shift notes pos by amount // we modified the song update(); - engine::songEditor()->update(); + Engine::songEditor()->update(); } @@ -1428,7 +1428,7 @@ void PianoRoll::keyPressEvent( QKeyEvent* event ) break; case Qt::Key_Space: - if( engine::getSong()->isPlaying() ) + if( Engine::getSong()->isPlaying() ) { stop(); } @@ -1879,9 +1879,9 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me ) } // added new notes, so must update engine, song, etc - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); - engine::songEditor()->update(); + Engine::songEditor()->update(); } } @@ -1889,7 +1889,7 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me ) testPlayNote( m_currentNote ); } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } else if( ( _me->buttons() == Qt::RightButton && m_editMode == ModeDraw ) || @@ -1909,7 +1909,7 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me ) ( *it )->setLength( 0 ); m_pattern->dataChanged(); } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } } else if( _me->button() == Qt::LeftButton && @@ -2658,7 +2658,7 @@ void PianoRoll::mouseMoveEvent( QMouseEvent * _me ) ( *it )->setLength( 0 ); m_pattern->dataChanged(); } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } } else @@ -2883,7 +2883,7 @@ void PianoRoll::dragNotes( int x, int y, bool alt, bool shift ) } m_pattern->dataChanged(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } static QString calculateNoteLabel(QString note, int octave) @@ -3482,7 +3482,7 @@ void PianoRoll::resizeEvent( QResizeEvent * ) } m_topBottomScroll->setValue( m_totalKeysToScroll - m_startKey ); - engine::getSong()->getPlayPos( Song::Mode_PlayPattern + Engine::getSong()->getPlayPos( Song::Mode_PlayPattern ).m_timeLine->setFixedWidth( width() ); m_toolBar->setFixedWidth( width() ); update(); @@ -3652,7 +3652,7 @@ int PianoRoll::getKey( int _y ) const Song::PlayModes PianoRoll::desiredPlayModeForAccompany() const { if( m_pattern->getTrack()->trackContainer() == - engine::getBBTrackContainer() ) + Engine::getBBTrackContainer() ) { return Song::Mode_PlayBB; } @@ -3669,13 +3669,13 @@ void PianoRoll::play() return; } - if( engine::getSong()->playMode() != Song::Mode_PlayPattern ) + if( Engine::getSong()->playMode() != Song::Mode_PlayPattern ) { - engine::getSong()->playPattern( m_pattern ); + Engine::getSong()->playPattern( m_pattern ); } else { - engine::getSong()->togglePause(); + Engine::getSong()->togglePause(); } } @@ -3684,7 +3684,7 @@ void PianoRoll::play() void PianoRoll::record() { - if( engine::getSong()->isPlaying() ) + if( Engine::getSong()->isPlaying() ) { stop(); } @@ -3695,7 +3695,7 @@ void PianoRoll::record() m_recording = true; - engine::getSong()->playPattern( m_pattern, false ); + Engine::getSong()->playPattern( m_pattern, false ); } @@ -3703,7 +3703,7 @@ void PianoRoll::record() void PianoRoll::recordAccompany() { - if( engine::getSong()->isPlaying() ) + if( Engine::getSong()->isPlaying() ) { stop(); } @@ -3714,13 +3714,13 @@ void PianoRoll::recordAccompany() m_recording = true; - if( m_pattern->getTrack()->trackContainer() == engine::getSong() ) + if( m_pattern->getTrack()->trackContainer() == Engine::getSong() ) { - engine::getSong()->playSong(); + Engine::getSong()->playSong(); } else { - engine::getSong()->playBB(); + Engine::getSong()->playBB(); } } @@ -3730,7 +3730,7 @@ void PianoRoll::recordAccompany() void PianoRoll::stop() { - engine::getSong()->stop(); + Engine::getSong()->stop(); m_recording = false; m_scrollBack = true; } @@ -3741,19 +3741,19 @@ void PianoRoll::stop() void PianoRoll::startRecordNote( const note & _n ) { if( m_recording == true && hasValidPattern() == true && - engine::getSong()->isPlaying() && - ( engine::getSong()->playMode() == + Engine::getSong()->isPlaying() && + ( Engine::getSong()->playMode() == desiredPlayModeForAccompany() || - engine::getSong()->playMode() == + Engine::getSong()->playMode() == Song::Mode_PlayPattern ) ) { MidiTime sub; - if( engine::getSong()->playMode() == Song::Mode_PlaySong ) + if( Engine::getSong()->playMode() == Song::Mode_PlaySong ) { sub = m_pattern->startPosition(); } - note n( 1, engine::getSong()->getPlayPos( - engine::getSong()->playMode() ) - sub, + note n( 1, Engine::getSong()->getPlayPos( + Engine::getSong()->playMode() ) - sub, _n.key(), _n.getVolume(), _n.getPanning() ); if( n.pos() >= 0 ) { @@ -3768,10 +3768,10 @@ void PianoRoll::startRecordNote( const note & _n ) void PianoRoll::finishRecordNote( const note & _n ) { if( m_recording == true && hasValidPattern() == true && - engine::getSong()->isPlaying() && - ( engine::getSong()->playMode() == + Engine::getSong()->isPlaying() && + ( Engine::getSong()->playMode() == desiredPlayModeForAccompany() || - engine::getSong()->playMode() == + Engine::getSong()->playMode() == Song::Mode_PlayPattern ) ) { for( QList::Iterator it = m_recordingNotes.begin(); @@ -4025,7 +4025,7 @@ void PianoRoll::cutSelectedNotes() { copy_to_clipboard( selected_notes ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); for( NoteVector::Iterator it = selected_notes.begin(); it != selected_notes.end(); ++it ) @@ -4037,7 +4037,7 @@ void PianoRoll::cutSelectedNotes() } update(); - engine::songEditor()->update(); + Engine::songEditor()->update(); } @@ -4084,11 +4084,11 @@ void PianoRoll::pasteNotes() // we only have to do the following lines if we pasted at // least one note... - engine::getSong()->setModified(); + Engine::getSong()->setModified(); m_ctrlMode = ModeDraw; m_drawButton->setChecked( true ); update(); - engine::songEditor()->update(); + Engine::songEditor()->update(); } } @@ -4130,9 +4130,9 @@ void PianoRoll::deleteSelectedNotes() if( update_after_delete == true ) { - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); - engine::songEditor()->update(); + Engine::songEditor()->update(); } } @@ -4163,8 +4163,8 @@ void PianoRoll::autoScroll( const MidiTime & _t ) void PianoRoll::updatePosition( const MidiTime & _t ) { - if( ( engine::getSong()->isPlaying() && - engine::getSong()->playMode() == + if( ( Engine::getSong()->isPlaying() && + Engine::getSong()->playMode() == Song::Mode_PlayPattern && m_timeLine->autoScroll() == timeLine::AutoScrollEnabled ) || m_scrollBack == true ) @@ -4178,7 +4178,7 @@ void PianoRoll::updatePosition( const MidiTime & _t ) void PianoRoll::updatePositionAccompany( const MidiTime & _t ) { - Song * s = engine::getSong(); + Song * s = Engine::getSong(); if( m_recording && hasValidPattern() && s->playMode() != Song::Mode_PlayPattern ) diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index c0a90a438..9e846d61f 100644 --- a/src/gui/PianoView.cpp +++ b/src/gui/PianoView.cpp @@ -47,7 +47,7 @@ #include "PianoView.h" #include "caption_menu.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "InstrumentTrack.h" #include "knob.h" diff --git a/src/gui/SongEditor.cpp b/src/gui/SongEditor.cpp index 194b2ed0d..c19d1883b 100644 --- a/src/gui/SongEditor.cpp +++ b/src/gui/SongEditor.cpp @@ -110,9 +110,9 @@ SongEditor::SongEditor( Song * _song ) : // add some essential widgets to global tool-bar - QWidget * tb = engine::mainWindow()->toolBar(); + QWidget * tb = Engine::mainWindow()->toolBar(); - engine::mainWindow()->addSpacingToToolBar( 10 ); + Engine::mainWindow()->addSpacingToToolBar( 10 ); m_tempoSpinBox = new LcdSpinBox( 3, tb, tr( "Tempo" ) ); m_tempoSpinBox->setModel( &m_song->m_tempoModel ); @@ -127,7 +127,7 @@ SongEditor::SongEditor( Song * _song ) : "should be played within a minute (or how many measures " "should be played within four minutes)." ) ); - int tempoSpinBoxCol = engine::mainWindow()->addWidgetToToolBar( m_tempoSpinBox, 0 ); + int tempoSpinBoxCol = Engine::mainWindow()->addWidgetToToolBar( m_tempoSpinBox, 0 ); #if 0 toolButton * hq_btn = new toolButton( embed::getIconPixmap( "hq_mode" ), @@ -140,15 +140,15 @@ SongEditor::SongEditor( Song * _song ) : engine::mainWindow()->addWidgetToToolBar( hq_btn, 1, col ); #endif - engine::mainWindow()->addWidgetToToolBar( new TimeDisplayWidget, 1, tempoSpinBoxCol ); + Engine::mainWindow()->addWidgetToToolBar( new TimeDisplayWidget, 1, tempoSpinBoxCol ); - engine::mainWindow()->addSpacingToToolBar( 10 ); + Engine::mainWindow()->addSpacingToToolBar( 10 ); m_timeSigDisplay = new MeterDialog( this, true ); m_timeSigDisplay->setModel( &m_song->m_timeSigModel ); - engine::mainWindow()->addWidgetToToolBar( m_timeSigDisplay ); + Engine::mainWindow()->addWidgetToToolBar( m_timeSigDisplay ); - engine::mainWindow()->addSpacingToToolBar( 10 ); + Engine::mainWindow()->addSpacingToToolBar( 10 ); QLabel * master_vol_lbl = new QLabel( tb ); @@ -177,11 +177,11 @@ SongEditor::SongEditor( Song * _song ) : m_mvsStatus->setTitle( tr( "Master volume" ) ); m_mvsStatus->setPixmap( embed::getIconPixmap( "master_volume" ) ); - engine::mainWindow()->addWidgetToToolBar( master_vol_lbl ); - engine::mainWindow()->addWidgetToToolBar( m_masterVolumeSlider ); + Engine::mainWindow()->addWidgetToToolBar( master_vol_lbl ); + Engine::mainWindow()->addWidgetToToolBar( m_masterVolumeSlider ); - engine::mainWindow()->addSpacingToToolBar( 10 ); + Engine::mainWindow()->addSpacingToToolBar( 10 ); QLabel * master_pitch_lbl = new QLabel( tb ); @@ -209,10 +209,10 @@ SongEditor::SongEditor( Song * _song ) : m_mpsStatus->setTitle( tr( "Master pitch" ) ); m_mpsStatus->setPixmap( embed::getIconPixmap( "master_pitch" ) ); - engine::mainWindow()->addWidgetToToolBar( master_pitch_lbl ); - engine::mainWindow()->addWidgetToToolBar( m_masterPitchSlider ); + Engine::mainWindow()->addWidgetToToolBar( master_pitch_lbl ); + Engine::mainWindow()->addWidgetToToolBar( m_masterPitchSlider ); - engine::mainWindow()->addSpacingToToolBar( 10 ); + Engine::mainWindow()->addSpacingToToolBar( 10 ); // create widget for visualization- and cpu-load-widget QWidget * vc_w = new QWidget( tb ); @@ -227,7 +227,7 @@ SongEditor::SongEditor( Song * _song ) : vcw_layout->addWidget( new cpuloadWidget( vc_w ) ); vcw_layout->addStretch(); - engine::mainWindow()->addWidgetToToolBar( vc_w ); + Engine::mainWindow()->addWidgetToToolBar( vc_w ); // create own toolbar @@ -269,7 +269,7 @@ SongEditor::SongEditor( Song * _song ) : m_recordButton->setDisabled( true ); // disable record buttons if capturing is not supported - if( !engine::mixer()->audioDev()->supportsCapture() ) + if( !Engine::mixer()->audioDev()->supportsCapture() ) { m_recordButton->setDisabled( true ); m_recordAccompanyButton->setDisabled( true ); @@ -390,7 +390,7 @@ SongEditor::SongEditor( Song * _song ) : this, SLOT( updateScrollBar( int ) ) ); - engine::mainWindow()->workspace()->addSubWindow( this ); + Engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false ); parentWidget()->resize( 600, 300 ); parentWidget()->move( 5, 5 ); @@ -409,7 +409,7 @@ SongEditor::~SongEditor() void SongEditor::setHighQuality( bool _hq ) { - engine::mixer()->changeQuality( Mixer::qualitySettings( + Engine::mixer()->changeQuality( Mixer::qualitySettings( _hq ? Mixer::qualitySettings::Mode_HighQuality : Mixer::qualitySettings::Mode_Draft ) ); } @@ -443,13 +443,13 @@ void SongEditor::setPauseIcon( bool pause ) void SongEditor::play() { - if( engine::getSong()->playMode() != Song::Mode_PlaySong ) + if( Engine::getSong()->playMode() != Song::Mode_PlaySong ) { - engine::getSong()->playSong(); + Engine::getSong()->playSong(); } else { - engine::getSong()->togglePause(); + Engine::getSong()->togglePause(); } } @@ -475,7 +475,7 @@ void SongEditor::recordAccompany() void SongEditor::stop() { m_song->stop(); - engine::pianoRoll()->stopRecording(); + Engine::pianoRoll()->stopRecording(); } @@ -484,13 +484,13 @@ void SongEditor::stop() void SongEditor::keyPressEvent( QKeyEvent * _ke ) { if( /*_ke->modifiers() & Qt::ShiftModifier*/ - engine::mainWindow()->isShiftPressed() == true && + Engine::mainWindow()->isShiftPressed() == true && _ke->key() == Qt::Key_Insert ) { m_song->insertBar(); } else if(/* _ke->modifiers() & Qt::ShiftModifier &&*/ - engine::mainWindow()->isShiftPressed() == true && + Engine::mainWindow()->isShiftPressed() == true && _ke->key() == Qt::Key_Delete ) { m_song->removeBar(); @@ -537,7 +537,7 @@ void SongEditor::keyPressEvent( QKeyEvent * _ke ) void SongEditor::wheelEvent( QWheelEvent * _we ) { - if( engine::mainWindow()->isCtrlPressed() == true ) + if( Engine::mainWindow()->isCtrlPressed() == true ) { if( _we->delta() > 0 ) { @@ -561,7 +561,7 @@ void SongEditor::wheelEvent( QWheelEvent * _we ) // and make sure, all TCO's are resized and relocated realignTracks(); } - else if( engine::mainWindow()->isShiftPressed() == true ) + else if( Engine::mainWindow()->isShiftPressed() == true ) { m_leftRightScroll->setValue( m_leftRightScroll->value() - _we->delta() / 30 ); @@ -587,7 +587,7 @@ void SongEditor::masterVolumeChanged( int _new_val ) QPoint( m_masterVolumeSlider->width() + 2, -2 ) ); m_mvsStatus->setVisibilityTimeOut( 1000 ); } - engine::mixer()->setMasterGain( _new_val / 100.0f ); + Engine::mixer()->setMasterGain( _new_val / 100.0f ); } @@ -777,7 +777,7 @@ void SongEditor::adjustUiAfterProjectLoad() // make sure to bring us to front as the song editor is the central // widget in a song and when just opening a song in order to listen to // it, it's very annyoing to manually bring up the song editor each time - engine::mainWindow()->workspace()->setActiveSubWindow( + Engine::mainWindow()->workspace()->setActiveSubWindow( qobject_cast( parentWidget() ) ); } scrolled( 0 ); diff --git a/src/gui/ToolPluginView.cpp b/src/gui/ToolPluginView.cpp index 2c0d6f1fe..72953c82c 100644 --- a/src/gui/ToolPluginView.cpp +++ b/src/gui/ToolPluginView.cpp @@ -30,14 +30,14 @@ #include #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "MainWindow.h" ToolPluginView::ToolPluginView( ToolPlugin * _toolPlugin ) : PluginView( _toolPlugin, NULL ) { - engine::mainWindow()->workspace()->addSubWindow( this ); + Engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false ); setWindowTitle( _toolPlugin->displayName() ); diff --git a/src/gui/TrackContainerView.cpp b/src/gui/TrackContainerView.cpp index 79a36aa5e..13b585106 100644 --- a/src/gui/TrackContainerView.cpp +++ b/src/gui/TrackContainerView.cpp @@ -81,7 +81,7 @@ TrackContainerView::TrackContainerView( TrackContainer * _tc ) : setAcceptDrops( true ); - connect( engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), + connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), this, SLOT( realignTracks() ) ); connect( m_tc, SIGNAL( trackAdded( Track * ) ), this, SLOT( createTrackView( Track * ) ), @@ -145,9 +145,9 @@ void TrackContainerView::removeTrackView( trackView * _tv ) m_scrollLayout->removeWidget( _tv ); realignTracks(); - if( engine::getSong() ) + if( Engine::getSong() ) { - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } } } @@ -336,7 +336,7 @@ void TrackContainerView::dropEvent( QDropEvent * _de ) Track::create( Track::InstrumentTrack, m_tc ) ); Instrument * i = it->loadInstrument( - engine::pluginFileHandling()[FileItem::extension( + Engine::pluginFileHandling()[FileItem::extension( value )]); i->loadFile( value ); //it->toggledInstrumentTrackButton( true ); diff --git a/src/gui/about_dialog.cpp b/src/gui/about_dialog.cpp index 9eee88cc8..f482f49ee 100644 --- a/src/gui/about_dialog.cpp +++ b/src/gui/about_dialog.cpp @@ -26,14 +26,14 @@ #include "lmmsversion.h" #include "about_dialog.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "MainWindow.h" #include "versioninfo.h" aboutDialog::aboutDialog() : - QDialog( engine::mainWindow() ), + QDialog( Engine::mainWindow() ), Ui::AboutDialog() { setupUi( this ); diff --git a/src/gui/bb_editor.cpp b/src/gui/bb_editor.cpp index de32e07c2..3aa0365f3 100644 --- a/src/gui/bb_editor.cpp +++ b/src/gui/bb_editor.cpp @@ -93,7 +93,7 @@ bbEditor::bbEditor( BBTrackContainer* tc ) : toolButton * add_bb_track = new toolButton( embed::getIconPixmap( "add_bb_track" ), tr( "Add beat/bassline" ), - engine::getSong(), SLOT( addBBTrack() ), + Engine::getSong(), SLOT( addBBTrack() ), m_toolBar ); toolButton * add_automation_track = new toolButton( @@ -138,7 +138,7 @@ bbEditor::bbEditor( BBTrackContainer* tc ) : tb_layout->addWidget( add_bar ); tb_layout->addSpacing( 15 ); - engine::mainWindow()->workspace()->addSubWindow( this ); + Engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false ); parentWidget()->layout()->setSizeConstraint( QLayout::SetMinimumSize ); parentWidget()->resize( minimumWidth(), 300 ); @@ -209,13 +209,13 @@ void bbEditor::setPauseIcon( bool pause ) void bbEditor::play() { - if( engine::getSong()->playMode() != Song::Mode_PlayBB ) + if( Engine::getSong()->playMode() != Song::Mode_PlayBB ) { - engine::getSong()->playBB(); + Engine::getSong()->playBB(); } else { - engine::getSong()->togglePause(); + Engine::getSong()->togglePause(); } } @@ -224,7 +224,7 @@ void bbEditor::play() void bbEditor::stop() { - engine::getSong()->stop(); + Engine::getSong()->stop(); } @@ -287,7 +287,7 @@ void bbEditor::keyPressEvent( QKeyEvent * _ke ) { if ( _ke->key() == Qt::Key_Space ) { - if( engine::getSong()->isPlaying() ) + if( Engine::getSong()->isPlaying() ) { stop(); } diff --git a/src/gui/export_project_dialog.cpp b/src/gui/export_project_dialog.cpp index 9ccd6e30f..931529944 100644 --- a/src/gui/export_project_dialog.cpp +++ b/src/gui/export_project_dialog.cpp @@ -28,7 +28,7 @@ #include "export_project_dialog.h" #include "Song.h" -#include "engine.h" +#include "Engine.h" #include "MainWindow.h" #include "BBTrackContainer.h" #include "bb_track.h" @@ -196,7 +196,7 @@ void exportProjectDialog::multiRender() int x = 1; - const TrackContainer::TrackList & tl = engine::getSong()->tracks(); + const TrackContainer::TrackList & tl = Engine::getSong()->tracks(); // Check for all unmuted tracks. Remember list. for( TrackContainer::TrackList::ConstIterator it = tl.begin(); @@ -223,7 +223,7 @@ void exportProjectDialog::multiRender() } - const TrackContainer::TrackList t2 = engine::getBBTrackContainer()->tracks(); + const TrackContainer::TrackList t2 = Engine::getBBTrackContainer()->tracks(); for( TrackContainer::TrackList::ConstIterator it = t2.begin(); it != t2.end(); ++it ) { Track* tk = (*it); @@ -259,7 +259,7 @@ ProjectRenderer* exportProjectDialog::prepRender() bitrateCB->currentText().section(" ", 0, 0).toUInt(), static_cast( depthCB->currentIndex() ) ); - engine::getSong()->setExportLoop( exportLoopCB->isChecked() ); + Engine::getSong()->setExportLoop( exportLoopCB->isChecked() ); ProjectRenderer* renderer = new ProjectRenderer( qs, os, m_ft, m_fileName ); @@ -278,7 +278,7 @@ void exportProjectDialog::render( ProjectRenderer* renderer ) connect( renderer, SIGNAL( progressChanged( int ) ), progressBar, SLOT( setValue( int ) ) ); connect( renderer, SIGNAL( progressChanged( int ) ), this, SLOT( updateTitleBar( int ) )) ; connect( renderer, SIGNAL( finished() ), this, SLOT( accept() ) ); - connect( renderer, SIGNAL( finished() ), engine::mainWindow(), SLOT( resetWindowTitle() ) ); + connect( renderer, SIGNAL( finished() ), Engine::mainWindow(), SLOT( resetWindowTitle() ) ); renderer->startProcessing(); } @@ -337,7 +337,7 @@ void exportProjectDialog::startBtnClicked() void exportProjectDialog::updateTitleBar( int _prog ) { - engine::mainWindow()->setWindowTitle( + Engine::mainWindow()->setWindowTitle( tr( "Rendering: %1%" ).arg( _prog ) ); } diff --git a/src/gui/setup_dialog.cpp b/src/gui/setup_dialog.cpp index e120094a9..3fd6b8750 100644 --- a/src/gui/setup_dialog.cpp +++ b/src/gui/setup_dialog.cpp @@ -40,7 +40,7 @@ #include "ProjectJournal.h" #include "ConfigManager.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "debug.h" #include "tooltip.h" #include "led_checkbox.h" @@ -129,7 +129,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : setWindowTitle( tr( "Setup LMMS" ) ); setModal( true ); - engine::projectJournal()->setJournalling( false ); + Engine::projectJournal()->setJournalling( false ); QVBoxLayout * vlayout = new QVBoxLayout( this ); vlayout->setSpacing( 0 ); @@ -631,8 +631,8 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : m_audioInterfaces->addItem( it.key() ); } m_audioInterfaces->setCurrentIndex( m_audioInterfaces->findText( - tr( engine::mixer()->audioDevName().toLatin1() ) ) ); - m_audioIfaceSetupWidgets[engine::mixer()->audioDevName()]->show(); + tr( Engine::mixer()->audioDevName().toLatin1() ) ) ); + m_audioIfaceSetupWidgets[Engine::mixer()->audioDevName()]->show(); connect( m_audioInterfaces, SIGNAL( activated( const QString & ) ), this, SLOT( audioInterfaceChanged( const QString & ) ) ); @@ -712,8 +712,8 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : } m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText( - tr( engine::mixer()->midiClientName().toLatin1() ) ) ); - m_midiIfaceSetupWidgets[engine::mixer()->midiClientName()]->show(); + tr( Engine::mixer()->midiClientName().toLatin1() ) ) ); + m_midiIfaceSetupWidgets[Engine::mixer()->midiClientName()]->show(); connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ), this, SLOT( midiInterfaceChanged( const QString & ) ) ); @@ -784,7 +784,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : setupDialog::~setupDialog() { - engine::projectJournal()->setJournalling( true ); + Engine::projectJournal()->setJournalling( true ); } @@ -896,7 +896,7 @@ void setupDialog::setBufferSize( int _value ) m_bufSizeLbl->setText( tr( "Frames: %1\nLatency: %2 ms" ).arg( m_bufferSize ).arg( 1000.0f * m_bufferSize / - engine::mixer()->processingSampleRate(), + Engine::mixer()->processingSampleRate(), 0, 'f', 1 ) ); } diff --git a/src/gui/string_pair_drag.cpp b/src/gui/string_pair_drag.cpp index 251c1f0b3..d1f84efb6 100644 --- a/src/gui/string_pair_drag.cpp +++ b/src/gui/string_pair_drag.cpp @@ -31,7 +31,7 @@ #include "string_pair_drag.h" -#include "engine.h" +#include "Engine.h" #include "MainWindow.h" @@ -64,9 +64,9 @@ stringPairDrag::~stringPairDrag() { // during a drag, we might have lost key-press-events, so reset // modifiers of main-win - if( engine::mainWindow() ) + if( Engine::mainWindow() ) { - engine::mainWindow()->clearKeyModifiers(); + Engine::mainWindow()->clearKeyModifiers(); } } diff --git a/src/gui/widgets/ControllerRackView.cpp b/src/gui/widgets/ControllerRackView.cpp index 906fe7e48..945c0f65a 100644 --- a/src/gui/widgets/ControllerRackView.cpp +++ b/src/gui/widgets/ControllerRackView.cpp @@ -66,7 +66,7 @@ ControllerRackView::ControllerRackView( ) : connect( m_addButton, SIGNAL( clicked() ), this, SLOT( addController() ) ); - connect( engine::getSong(), SIGNAL( dataChanged() ), + connect( Engine::getSong(), SIGNAL( dataChanged() ), this, SLOT( update() ) ); QVBoxLayout * layout = new QVBoxLayout(); @@ -75,7 +75,7 @@ ControllerRackView::ControllerRackView( ) : this->setLayout( layout ); QMdiSubWindow * subWin = - engine::mainWindow()->workspace()->addSubWindow( this ); + Engine::mainWindow()->workspace()->addSubWindow( this ); // No maximize button Qt::WindowFlags flags = subWin->windowFlags(); @@ -148,7 +148,7 @@ void ControllerRackView::deleteController( ControllerView * _view ) void ControllerRackView::update() { QWidget * w = m_scrollArea->widget(); - Song * s = engine::getSong(); + Song * s = Engine::getSong(); setUpdatesEnabled( false ); @@ -184,7 +184,7 @@ void ControllerRackView::addController() { // TODO: Eventually let the user pick from available controller types - engine::getSong()->addController( new LfoController( engine::getSong() ) ); + Engine::getSong()->addController( new LfoController( Engine::getSong() ) ); update(); // fix bug which always made ControllerRackView loose focus when adding diff --git a/src/gui/widgets/ControllerView.cpp b/src/gui/widgets/ControllerView.cpp index 3d0185ab4..6dc281935 100644 --- a/src/gui/widgets/ControllerView.cpp +++ b/src/gui/widgets/ControllerView.cpp @@ -38,7 +38,7 @@ #include "ControllerDialog.h" #include "gui_templates.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "led_checkbox.h" #include "MainWindow.h" #include "tooltip.h" @@ -62,9 +62,9 @@ ControllerView::ControllerView( Controller * _model, QWidget * _parent ) : connect( ctls_btn, SIGNAL( clicked() ), this, SLOT( editControls() ) ); - m_controllerDlg = getController()->createDialog( engine::mainWindow()->workspace() ); + m_controllerDlg = getController()->createDialog( Engine::mainWindow()->workspace() ); - m_subWindow = engine::mainWindow()->workspace()->addSubWindow( + m_subWindow = Engine::mainWindow()->workspace()->addSubWindow( m_controllerDlg ); Qt::WindowFlags flags = m_subWindow->windowFlags(); diff --git a/src/gui/widgets/EffectView.cpp b/src/gui/widgets/EffectView.cpp index 3ecb785c3..0036667e6 100644 --- a/src/gui/widgets/EffectView.cpp +++ b/src/gui/widgets/EffectView.cpp @@ -36,7 +36,7 @@ #include "EffectControls.h" #include "EffectControlDialog.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "knob.h" #include "led_checkbox.h" @@ -109,7 +109,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : m_controlView = effect()->controls()->createView(); if( m_controlView ) { - m_subWindow = engine::mainWindow()->workspace()->addSubWindow( + m_subWindow = Engine::mainWindow()->workspace()->addSubWindow( m_controlView, Qt::SubWindow | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint ); diff --git a/src/gui/widgets/EnvelopeAndLfoView.cpp b/src/gui/widgets/EnvelopeAndLfoView.cpp index 3de7751db..44cbf2fbb 100644 --- a/src/gui/widgets/EnvelopeAndLfoView.cpp +++ b/src/gui/widgets/EnvelopeAndLfoView.cpp @@ -29,7 +29,7 @@ #include "EnvelopeAndLfoView.h" #include "EnvelopeAndLfoParameters.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "knob.h" #include "led_checkbox.h" @@ -491,7 +491,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::mixer()->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/FxLine.cpp b/src/gui/widgets/FxLine.cpp index b97e551d7..0304d3d8e 100644 --- a/src/gui/widgets/FxLine.cpp +++ b/src/gui/widgets/FxLine.cpp @@ -34,7 +34,7 @@ #include "FxMixer.h" #include "FxMixerView.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "SendButtonIndicator.h" #include "gui_templates.h" #include "caption_menu.h" @@ -154,7 +154,7 @@ void FxLine::drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name, void FxLine::paintEvent( QPaintEvent * ) { - FxMixer * mix = engine::fxMixer(); + FxMixer * mix = Engine::fxMixer(); bool sendToThis = mix->channelSendModel( m_mv->currentFxLine()->m_channelIndex, m_channelIndex ) != NULL; bool receiveFromThis = mix->channelSendModel( @@ -182,7 +182,7 @@ void FxLine::mouseDoubleClickEvent( QMouseEvent * ) void FxLine::contextMenuEvent( QContextMenuEvent * ) { - FxMixer * mix = engine::fxMixer(); + FxMixer * mix = Engine::fxMixer(); QPointer contextMenu = new captionMenu( mix->effectChannel( m_channelIndex )->m_name, this ); if( m_channelIndex != 0 ) // no move-options in master { @@ -208,7 +208,7 @@ void FxLine::contextMenuEvent( QContextMenuEvent * ) void FxLine::renameChannel() { bool ok; - FxMixer * mix = engine::fxMixer(); + FxMixer * mix = Engine::fxMixer(); QString new_name = QInputDialog::getText( this, FxMixerView::tr( "Rename FX channel" ), FxMixerView::tr( "Enter the new name for this " @@ -224,21 +224,21 @@ void FxLine::renameChannel() void FxLine::removeChannel() { - FxMixerView * mix = engine::fxMixerView(); + FxMixerView * mix = Engine::fxMixerView(); mix->deleteChannel( m_channelIndex ); } void FxLine::moveChannelLeft() { - FxMixerView * mix = engine::fxMixerView(); + FxMixerView * mix = Engine::fxMixerView(); mix->moveChannelLeft( m_channelIndex ); } void FxLine::moveChannelRight() { - FxMixerView * mix = engine::fxMixerView(); + FxMixerView * mix = Engine::fxMixerView(); mix->moveChannelRight( m_channelIndex ); } diff --git a/src/gui/widgets/InstrumentFunctionViews.cpp b/src/gui/widgets/InstrumentFunctionViews.cpp index 192ab5b22..c93e4160c 100644 --- a/src/gui/widgets/InstrumentFunctionViews.cpp +++ b/src/gui/widgets/InstrumentFunctionViews.cpp @@ -29,7 +29,7 @@ #include "InstrumentFunctionViews.h" #include "combobox.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "group_box.h" #include "gui_templates.h" #include "knob.h" diff --git a/src/gui/widgets/InstrumentMidiIOView.cpp b/src/gui/widgets/InstrumentMidiIOView.cpp index 80f2a881a..c741b4751 100644 --- a/src/gui/widgets/InstrumentMidiIOView.cpp +++ b/src/gui/widgets/InstrumentMidiIOView.cpp @@ -29,7 +29,7 @@ #include "InstrumentMidiIOView.h" #include "MidiPortMenu.h" -#include "engine.h" +#include "Engine.h" #include "embed.h" #include "group_box.h" #include "gui_templates.h" @@ -117,7 +117,7 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_fixedOutputNoteSpinBox, SLOT( setEnabled( bool ) ) ); - if( !engine::mixer()->midiClient()->isRaw() ) + if( !Engine::mixer()->midiClient()->isRaw() ) { m_rpBtn = new QToolButton; m_rpBtn->setMinimumSize( 32, 32 ); diff --git a/src/gui/widgets/LcdSpinBox.cpp b/src/gui/widgets/LcdSpinBox.cpp index 8fedbfd2d..4d0eec342 100644 --- a/src/gui/widgets/LcdSpinBox.cpp +++ b/src/gui/widgets/LcdSpinBox.cpp @@ -33,7 +33,7 @@ #include "LcdSpinBox.h" #include "caption_menu.h" -#include "engine.h" +#include "Engine.h" #include "embed.h" #include "gui_templates.h" #include "templates.h" @@ -126,7 +126,7 @@ void LcdSpinBox::mouseMoveEvent( QMouseEvent* event ) if( m_mouseMoving ) { int dy = event->globalY() - m_origMousePos.y(); - if( engine::mainWindow()->isShiftPressed() ) + if( Engine::mainWindow()->isShiftPressed() ) dy = qBound( -4, dy/4, 4 ); if( dy > 1 || dy < -1 ) { diff --git a/src/gui/widgets/LcdWidget.cpp b/src/gui/widgets/LcdWidget.cpp index 67f04d3f3..eab4870f3 100644 --- a/src/gui/widgets/LcdWidget.cpp +++ b/src/gui/widgets/LcdWidget.cpp @@ -33,7 +33,7 @@ #include #include "LcdWidget.h" -#include "engine.h" +#include "Engine.h" #include "embed.h" #include "gui_templates.h" #include "MainWindow.h" diff --git a/src/gui/widgets/SendButtonIndicator.cpp b/src/gui/widgets/SendButtonIndicator.cpp index e77c0e965..5ac55b761 100644 --- a/src/gui/widgets/SendButtonIndicator.cpp +++ b/src/gui/widgets/SendButtonIndicator.cpp @@ -1,6 +1,6 @@ #include "SendButtonIndicator.h" -#include "engine.h" +#include "Engine.h" #include "FxMixer.h" #include "Model.h" @@ -31,7 +31,7 @@ SendButtonIndicator:: SendButtonIndicator( QWidget * _parent, FxLine * _owner, void SendButtonIndicator::mousePressEvent( QMouseEvent * e ) { - FxMixer * mix = engine::fxMixer(); + FxMixer * mix = Engine::fxMixer(); int from = m_mv->currentFxLine()->channelIndex(); int to = m_parent->channelIndex(); FloatModel * sendModel = mix->channelSendModel(from, to); @@ -52,7 +52,7 @@ void SendButtonIndicator::mousePressEvent( QMouseEvent * e ) FloatModel * SendButtonIndicator::getSendModel() { - FxMixer * mix = engine::fxMixer(); + FxMixer * mix = Engine::fxMixer(); return mix->channelSendModel( m_mv->currentFxLine()->channelIndex(), m_parent->channelIndex()); } diff --git a/src/gui/widgets/TimeDisplayWidget.cpp b/src/gui/widgets/TimeDisplayWidget.cpp index 66c243bc9..93375f0b9 100644 --- a/src/gui/widgets/TimeDisplayWidget.cpp +++ b/src/gui/widgets/TimeDisplayWidget.cpp @@ -26,7 +26,7 @@ #include "TimeDisplayWidget.h" #include "MainWindow.h" -#include "engine.h" +#include "Engine.h" #include "tooltip.h" #include "Song.h" @@ -53,7 +53,7 @@ TimeDisplayWidget::TimeDisplayWidget() : // update labels of LCD spinboxes setDisplayMode( m_displayMode ); - connect( engine::mainWindow(), SIGNAL( periodicUpdate() ), + connect( Engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( updateTime() ) ); } @@ -95,7 +95,7 @@ void TimeDisplayWidget::setDisplayMode( DisplayMode displayMode ) void TimeDisplayWidget::updateTime() { - Song* s = engine::getSong(); + Song* s = Engine::getSong(); switch( m_displayMode ) { diff --git a/src/gui/widgets/automatable_button.cpp b/src/gui/widgets/automatable_button.cpp index acc8bc81b..9c1e11328 100644 --- a/src/gui/widgets/automatable_button.cpp +++ b/src/gui/widgets/automatable_button.cpp @@ -29,7 +29,7 @@ #include #include "caption_menu.h" -#include "engine.h" +#include "Engine.h" #include "embed.h" #include "MainWindow.h" #include "string_pair_drag.h" diff --git a/src/gui/widgets/automatable_slider.cpp b/src/gui/widgets/automatable_slider.cpp index 610ee2009..b604ce757 100644 --- a/src/gui/widgets/automatable_slider.cpp +++ b/src/gui/widgets/automatable_slider.cpp @@ -30,7 +30,7 @@ #include "caption_menu.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "MainWindow.h" diff --git a/src/gui/widgets/combobox.cpp b/src/gui/widgets/combobox.cpp index 2082284af..8e857eb0f 100644 --- a/src/gui/widgets/combobox.cpp +++ b/src/gui/widgets/combobox.cpp @@ -35,7 +35,7 @@ #include #include "caption_menu.h" -#include "engine.h" +#include "Engine.h" #include "embed.h" #include "gui_templates.h" #include "MainWindow.h" diff --git a/src/gui/widgets/cpuload_widget.cpp b/src/gui/widgets/cpuload_widget.cpp index f81d227ca..522c9e5b8 100644 --- a/src/gui/widgets/cpuload_widget.cpp +++ b/src/gui/widgets/cpuload_widget.cpp @@ -28,7 +28,7 @@ #include "cpuload_widget.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "Mixer.h" @@ -92,7 +92,7 @@ void cpuloadWidget::paintEvent( QPaintEvent * ) void cpuloadWidget::updateCpuLoad() { // smooth load-values a bit - int new_load = ( m_currentLoad + engine::mixer()->cpuLoad() ) / 2; + int new_load = ( m_currentLoad + Engine::mixer()->cpuLoad() ) / 2; if( new_load != m_currentLoad ) { m_currentLoad = new_load; diff --git a/src/gui/widgets/fader.cpp b/src/gui/widgets/fader.cpp index 08ddbccef..38d6fcbe8 100644 --- a/src/gui/widgets/fader.cpp +++ b/src/gui/widgets/fader.cpp @@ -52,7 +52,7 @@ #include "fader.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "caption_menu.h" #include "ConfigManager.h" #include "text_float.h" diff --git a/src/gui/widgets/graph.cpp b/src/gui/widgets/graph.cpp index 7d8052f54..fcab26f1c 100644 --- a/src/gui/widgets/graph.cpp +++ b/src/gui/widgets/graph.cpp @@ -31,7 +31,7 @@ #include "string_pair_drag.h" #include "SampleBuffer.h" #include "Oscillator.h" -#include "engine.h" +#include "Engine.h" graph::graph( QWidget * _parent, graphStyle _style, int _width, diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index 4302fb099..941a77f13 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -41,7 +41,7 @@ #include "ConfigManager.h" #include "ControllerConnection.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "MainWindow.h" #include "ProjectJournal.h" @@ -462,7 +462,7 @@ float knob::getValue( const QPoint & _p ) value = ( ( _p.y() + _p.y() * qMin( qAbs( _p.y() / 2.5f ), 6.0f ) ) ) / 12.0f; // if shift pressed we want slower movement - if( engine::mainWindow()->isShiftPressed() ) + if( Engine::mainWindow()->isShiftPressed() ) { value /= 4.0f; value = qBound( -4.0f, value, 4.0f ); @@ -520,7 +520,7 @@ void knob::dropEvent( QDropEvent * _de ) else if( type == "automatable_model" ) { AutomatableModel * mod = dynamic_cast( - engine::projectJournal()-> + Engine::projectJournal()-> journallingObject( val.toInt() ) ); if( mod != NULL ) { @@ -561,7 +561,7 @@ void knob::mousePressEvent( QMouseEvent * _me ) m_buttonPressed = true; } else if( _me->button() == Qt::LeftButton && - engine::mainWindow()->isShiftPressed() == true ) + Engine::mainWindow()->isShiftPressed() == true ) { new stringPairDrag( "float_value", QString::number( model()->value() ), diff --git a/src/gui/widgets/project_notes.cpp b/src/gui/widgets/project_notes.cpp index 81383ad4c..e94b0f549 100644 --- a/src/gui/widgets/project_notes.cpp +++ b/src/gui/widgets/project_notes.cpp @@ -38,14 +38,14 @@ #include #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "MainWindow.h" #include "Song.h" projectNotes::projectNotes() : - QMainWindow( engine::mainWindow()->workspace() ) + QMainWindow( Engine::mainWindow()->workspace() ) { m_edit = new QTextEdit( this ); m_edit->setAutoFillBackground( true ); @@ -62,7 +62,7 @@ projectNotes::projectNotes() : // connect( m_edit, SIGNAL( currentAlignmentChanged( int ) ), // this, SLOT( alignmentChanged( int ) ) ); connect( m_edit, SIGNAL( textChanged() ), - engine::getSong(), SLOT( setModified() ) ); + Engine::getSong(), SLOT( setModified() ) ); setupActions(); @@ -70,7 +70,7 @@ projectNotes::projectNotes() : setWindowTitle( tr( "Project notes" ) ); setWindowIcon( embed::getIconPixmap( "project_notes" ) ); - engine::mainWindow()->workspace()->addSubWindow( this ); + Engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false ); parentWidget()->move( 700, 10 ); parentWidget()->resize( 400, 300 ); @@ -250,7 +250,7 @@ void projectNotes::textBold() { m_edit->setFontWeight( m_actionTextBold->isChecked() ? QFont::Bold : QFont::Normal ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -259,7 +259,7 @@ void projectNotes::textBold() void projectNotes::textUnderline() { m_edit->setFontUnderline( m_actionTextUnderline->isChecked() ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -268,7 +268,7 @@ void projectNotes::textUnderline() void projectNotes::textItalic() { m_edit->setFontItalic( m_actionTextItalic->isChecked() ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -278,7 +278,7 @@ void projectNotes::textFamily( const QString & _f ) { m_edit->setFontFamily( _f ); m_edit->viewport()->setFocus(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -288,7 +288,7 @@ void projectNotes::textSize( const QString & _p ) { m_edit->setFontPointSize( _p.toInt() ); m_edit->viewport()->setFocus(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -346,7 +346,7 @@ void projectNotes::formatChanged( const QTextCharFormat & _f ) pix.fill( _f.foreground().color() ); m_actionTextColor->setIcon( pix ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -370,7 +370,7 @@ void projectNotes::alignmentChanged( int _a ) { m_actionAlignJustify->setChecked( true ); } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } diff --git a/src/gui/widgets/tempo_sync_knob.cpp b/src/gui/widgets/tempo_sync_knob.cpp index 94365b1e9..21149592a 100644 --- a/src/gui/widgets/tempo_sync_knob.cpp +++ b/src/gui/widgets/tempo_sync_knob.cpp @@ -27,7 +27,7 @@ #include #include "TempoSyncKnob.h" -#include "engine.h" +#include "Engine.h" #include "caption_menu.h" #include "embed.h" #include "MainWindow.h" @@ -87,7 +87,7 @@ void TempoSyncKnob::contextMenuEvent( QContextMenuEvent * ) addDefaultActions( &contextMenu ); contextMenu.addSeparator(); - float limit = 60000.0f / ( engine::getSong()->getTempo() * + float limit = 60000.0f / ( Engine::getSong()->getTempo() * model()->m_scale ); QMenu * syncMenu = contextMenu.addMenu( m_tempoSyncIcon, @@ -291,8 +291,8 @@ void TempoSyncKnob::showCustom() { if( m_custom == NULL ) { - m_custom = new MeterDialog( engine::mainWindow()->workspace() ); - engine::mainWindow()->workspace()->addSubWindow( m_custom ); + m_custom = new MeterDialog( Engine::mainWindow()->workspace() ); + Engine::mainWindow()->workspace()->addSubWindow( m_custom ); m_custom->setWindowTitle( "Meter" ); m_custom->setModel( &model()->m_custom ); } diff --git a/src/gui/widgets/text_float.cpp b/src/gui/widgets/text_float.cpp index b3775b884..cd063c580 100644 --- a/src/gui/widgets/text_float.cpp +++ b/src/gui/widgets/text_float.cpp @@ -29,12 +29,12 @@ #include "text_float.h" #include "gui_templates.h" #include "MainWindow.h" -#include "engine.h" +#include "Engine.h" textFloat::textFloat() : - QWidget( engine::mainWindow(), Qt::ToolTip ), + QWidget( Engine::mainWindow(), Qt::ToolTip ), m_title(), m_text(), m_pixmap() @@ -89,7 +89,7 @@ void textFloat::setVisibilityTimeOut( int _msecs ) textFloat * textFloat::displayMessage( const QString & _msg, int _timeout, QWidget * _parent, int _add_y_margin ) { - QWidget * mw = engine::mainWindow(); + QWidget * mw = Engine::mainWindow(); textFloat * tf = new textFloat; if( _parent != NULL ) { diff --git a/src/gui/widgets/track_label_button.cpp b/src/gui/widgets/track_label_button.cpp index 4ac33728c..53ff02bcd 100644 --- a/src/gui/widgets/track_label_button.cpp +++ b/src/gui/widgets/track_label_button.cpp @@ -34,7 +34,7 @@ #include "InstrumentTrack.h" #include "Instrument.h" #include "ConfigManager.h" -#include "engine.h" +#include "Engine.h" diff --git a/src/gui/widgets/visualization_widget.cpp b/src/gui/widgets/visualization_widget.cpp index 0d3fac3cf..c6a738b1c 100644 --- a/src/gui/widgets/visualization_widget.cpp +++ b/src/gui/widgets/visualization_widget.cpp @@ -30,7 +30,7 @@ #include "gui_templates.h" #include "MainWindow.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "tooltip.h" #include "Song.h" @@ -42,17 +42,17 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p, visualizationTypes _vtype ) : QWidget( _p ), s_background( _bg ), - m_points( new QPointF[engine::mixer()->framesPerPeriod()] ), + m_points( new QPointF[Engine::mixer()->framesPerPeriod()] ), m_active( false ) { setFixedSize( s_background.width(), s_background.height() ); setAttribute( Qt::WA_OpaquePaintEvent, true ); setActive( ConfigManager::inst()->value( "ui", "displaywaveform").toInt() ); - const fpp_t frames = engine::mixer()->framesPerPeriod(); + const fpp_t frames = Engine::mixer()->framesPerPeriod(); m_buffer = new sampleFrame[frames]; - engine::mixer()->clearAudioBuffer( m_buffer, frames ); + Engine::mixer()->clearAudioBuffer( m_buffer, frames ); toolTip::add( this, tr( "click to enable/disable visualization of " @@ -73,11 +73,11 @@ visualizationWidget::~visualizationWidget() void visualizationWidget::updateAudioBuffer() { - if( !engine::getSong()->isExporting() ) + if( !Engine::getSong()->isExporting() ) { - const surroundSampleFrame * c = engine::mixer()-> + const surroundSampleFrame * c = Engine::mixer()-> currentReadBuffer(); - const fpp_t fpp = engine::mixer()->framesPerPeriod(); + const fpp_t fpp = Engine::mixer()->framesPerPeriod(); memcpy( m_buffer, c, sizeof( surroundSampleFrame ) * fpp ); } } @@ -90,19 +90,19 @@ void visualizationWidget::setActive( bool _active ) m_active = _active; if( m_active ) { - connect( engine::mainWindow(), + connect( Engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); - connect( engine::mixer(), + connect( Engine::mixer(), SIGNAL( nextAudioBuffer() ), this, SLOT( updateAudioBuffer() ) ); } else { - disconnect( engine::mainWindow(), + disconnect( Engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); - disconnect( engine::mixer(), + disconnect( Engine::mixer(), SIGNAL( nextAudioBuffer() ), this, SLOT( updateAudioBuffer() ) ); // we have to update (remove last waves), @@ -120,9 +120,9 @@ void visualizationWidget::paintEvent( QPaintEvent * ) p.drawPixmap( 0, 0, s_background ); - if( m_active && !engine::getSong()->isExporting() ) + if( m_active && !Engine::getSong()->isExporting() ) { - float master_output = engine::mixer()->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; @@ -132,7 +132,7 @@ void visualizationWidget::paintEvent( QPaintEvent * ) const fpp_t frames = - engine::mixer()->framesPerPeriod(); + Engine::mixer()->framesPerPeriod(); const float max_level = qMax( Mixer::peakValueLeft( m_buffer, frames ), Mixer::peakValueRight( m_buffer, frames ) ); diff --git a/src/tracks/AutomationTrack.cpp b/src/tracks/AutomationTrack.cpp index 2cf14ba4a..9d6a22e89 100644 --- a/src/tracks/AutomationTrack.cpp +++ b/src/tracks/AutomationTrack.cpp @@ -26,7 +26,7 @@ #include "AutomationTrack.h" #include "AutomationPattern.h" -#include "engine.h" +#include "Engine.h" #include "embed.h" #include "ProjectJournal.h" #include "string_pair_drag.h" @@ -67,7 +67,7 @@ bool AutomationTrack::play( const MidiTime & _start, const fpp_t _frames, else { getTCOsInRange( tcos, _start, _start + static_cast( - _frames / engine::framesPerTick()) ); + _frames / Engine::framesPerTick()) ); } for( tcoVector::iterator it = tcos.begin(); it != tcos.end(); ++it ) @@ -164,7 +164,7 @@ void AutomationTrackView::dropEvent( QDropEvent * _de ) if( type == "automatable_model" ) { AutomatableModel * mod = dynamic_cast( - engine::projectJournal()-> + Engine::projectJournal()-> journallingObject( val.toInt() ) ); if( mod != NULL ) { diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 1ac7fd15f..1fee7d06b 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -48,7 +48,7 @@ #include "EffectChain.h" #include "EffectRackView.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "FileBrowser.h" #include "FxMixer.h" #include "FxMixerView.h" @@ -95,7 +95,7 @@ const int INSTRUMENT_WINDOW_CACHE_SIZE = 8; InstrumentTrack::InstrumentTrack( TrackContainer* tc ) : Track( Track::InstrumentTrack, tc ), MidiEventProcessor(), - m_midiPort( tr( "unnamed_track" ), engine::mixer()->midiClient(), + m_midiPort( tr( "unnamed_track" ), Engine::mixer()->midiClient(), this, this ), m_notes(), m_sustainPedalPressed( false ), @@ -122,7 +122,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) : connect( &m_pitchModel, SIGNAL( dataChanged() ), this, SLOT( updatePitch() ) ); connect( &m_pitchRangeModel, SIGNAL( dataChanged() ), this, SLOT( updatePitchRange() ) ); - m_effectChannelModel.setRange( 0, engine::fxMixer()->numChannels()-1, 1); + m_effectChannelModel.setRange( 0, Engine::fxMixer()->numChannels()-1, 1); for( int i = 0; i < NumKeys; ++i ) { @@ -138,7 +138,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) : int InstrumentTrack::baseNote() const { - return m_baseNoteModel.value() - engine::getSong()->masterPitch(); + return m_baseNoteModel.value() - Engine::getSong()->masterPitch(); } @@ -260,7 +260,7 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti NULL, event.channel(), NotePlayHandle::OriginMidiInput ); m_notes[event.key()] = nph; - if( ! engine::mixer()->addPlayHandle( nph ) ) + if( ! Engine::mixer()->addPlayHandle( nph ) ) { m_notes[event.key()] = NULL; } @@ -421,7 +421,7 @@ void InstrumentTrack::silenceAllNotes( bool removeIPH ) lock(); // invalidate all NotePlayHandles linked to this track m_processHandles.clear(); - engine::mixer()->removePlayHandles( this, removeIPH ); + Engine::mixer()->removePlayHandles( this, removeIPH ); unlock(); } @@ -571,7 +571,7 @@ bool InstrumentTrack::play( const MidiTime & _start, const fpp_t _frames, { return false; } - const float frames_per_tick = engine::framesPerTick(); + const float frames_per_tick = Engine::framesPerTick(); tcoVector tcos; bbTrack * bb_track = NULL; @@ -654,7 +654,7 @@ bool InstrumentTrack::play( const MidiTime & _start, const fpp_t _frames, notePlayHandle->setSongGlobalParentOffset( p->startPosition() ); } - engine::mixer()->addPlayHandle( notePlayHandle ); + Engine::mixer()->addPlayHandle( notePlayHandle ); played_a_note = true; } ++nit; @@ -720,7 +720,7 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement m_panningModel.loadSettings( thisElement, "pan" ); m_pitchRangeModel.loadSettings( thisElement, "pitchrange" ); m_pitchModel.loadSettings( thisElement, "pitch" ); - m_effectChannelModel.setRange( 0, engine::fxMixer()->numChannels()-1 ); + m_effectChannelModel.setRange( 0, Engine::fxMixer()->numChannels()-1 ); m_effectChannelModel.loadSettings( thisElement, "fxch" ); m_baseNoteModel.loadSettings( thisElement, "basenote" ); @@ -866,7 +866,7 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV m_midiMenu = new QMenu( tr( "MIDI" ), this ); // sequenced MIDI? - if( !engine::mixer()->midiClient()->isRaw() ) + if( !Engine::mixer()->midiClient()->isRaw() ) { _it->m_midiPort.m_readablePortsMenu = new MidiPortMenu( MidiPort::Input ); @@ -935,7 +935,7 @@ InstrumentTrackWindow * InstrumentTrackView::topLevelInstrumentTrackWindow() { InstrumentTrackWindow * w = NULL; foreach( QMdiSubWindow * sw, - engine::mainWindow()->workspace()->subWindowList( + Engine::mainWindow()->workspace()->subWindowList( QMdiArea::ActivationHistoryOrder ) ) { if( sw->isVisible() && sw->widget()->inherits( "InstrumentTrackWindow" ) ) @@ -1129,10 +1129,10 @@ class fxLineLcdSpinBox : public LcdSpinBox protected: virtual void mouseDoubleClickEvent ( QMouseEvent * _me ) { - engine::fxMixerView()->setCurrentFxLine( model()->value() ); + Engine::fxMixerView()->setCurrentFxLine( model()->value() ); - engine::fxMixerView()->show();// show fxMixer window - engine::fxMixerView()->setFocus();// set focus to fxMixer window + Engine::fxMixerView()->show();// show fxMixer window + Engine::fxMixerView()->setFocus();// set focus to fxMixer window //engine::getFxMixerView()->raise(); } }; @@ -1274,7 +1274,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : setFixedWidth( INSTRUMENT_WIDTH ); resize( sizeHint() ); - QMdiSubWindow * subWin = engine::mainWindow()->workspace()->addSubWindow( this ); + QMdiSubWindow * subWin = Engine::mainWindow()->workspace()->addSubWindow( this ); Qt::WindowFlags flags = subWin->windowFlags(); flags |= Qt::MSWindowsFixedSizeDialogHint; flags &= ~Qt::WindowMaximizeButtonHint; @@ -1300,7 +1300,7 @@ InstrumentTrackWindow::~InstrumentTrackWindow() delete m_instrumentView; - if( engine::mainWindow()->workspace() ) + if( Engine::mainWindow()->workspace() ) { parentWidget()->hide(); parentWidget()->deleteLater(); @@ -1439,7 +1439,7 @@ void InstrumentTrackWindow::updateInstrumentView() void InstrumentTrackWindow::textChanged( const QString& newName ) { m_track->setName( newName ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } @@ -1466,7 +1466,7 @@ void InstrumentTrackWindow::closeEvent( QCloseEvent* event ) { event->ignore(); - if( engine::mainWindow()->workspace() ) + if( Engine::mainWindow()->workspace() ) { parentWidget()->hide(); } @@ -1515,7 +1515,7 @@ void InstrumentTrackWindow::dropEvent( QDropEvent* event ) { m_track->loadInstrument( value ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); event->accept(); } @@ -1526,7 +1526,7 @@ void InstrumentTrackWindow::dropEvent( QDropEvent* event ) m_track->setSimpleSerializing(); m_track->loadSettings( dataFile.content().toElement() ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); event->accept(); } @@ -1537,7 +1537,7 @@ void InstrumentTrackWindow::dropEvent( QDropEvent* event ) if( !i->descriptor()->supportsFileType( ext ) ) { - i = m_track->loadInstrument( engine::pluginFileHandling()[ext] ); + i = m_track->loadInstrument( Engine::pluginFileHandling()[ext] ); } i->loadFile( value ); diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index 63768df91..e43b1d1ec 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -38,7 +38,7 @@ #include "templates.h" #include "gui_templates.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "PianoRoll.h" #include "TrackContainer.h" #include "rename_dialog.h" @@ -104,7 +104,7 @@ Pattern::~Pattern() void Pattern::init() { - connect( engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), + connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), this, SLOT( changeTimeSignature() ) ); saveJournallingState( false ); @@ -170,9 +170,9 @@ MidiTime Pattern::beatPatternLength() const note * Pattern::addNote( const note & _new_note, const bool _quant_pos ) { note * new_note = new note( _new_note ); - if( _quant_pos && engine::pianoRoll() ) + if( _quant_pos && Engine::pianoRoll() ) { - new_note->quantizePos( engine::pianoRoll()->quantization() ); + new_note->quantizePos( Engine::pianoRoll()->quantization() ); } instrumentTrack()->lock(); @@ -534,14 +534,14 @@ void Pattern::ensureBeatNotes() void Pattern::updateBBTrack() { - if( getTrack()->trackContainer() == engine::getBBTrackContainer() ) + if( getTrack()->trackContainer() == Engine::getBBTrackContainer() ) { - engine::getBBTrackContainer()->updateBBTrack( this ); + Engine::getBBTrackContainer()->updateBBTrack( this ); } - if( engine::pianoRoll() && engine::pianoRoll()->currentPattern() == this ) + if( Engine::pianoRoll() && Engine::pianoRoll()->currentPattern() == this ) { - engine::pianoRoll()->update(); + Engine::pianoRoll()->update(); } } @@ -607,7 +607,7 @@ PatternView::PatternView( Pattern* pattern, trackView* parent ) : m_paintPixmap(), m_needsUpdate( true ) { - connect( engine::pianoRoll(), SIGNAL( currentPatternChanged() ), + connect( Engine::pianoRoll(), SIGNAL( currentPatternChanged() ), this, SLOT( update() ) ); if( s_stepBtnOn == NULL ) @@ -668,9 +668,9 @@ void PatternView::update() void PatternView::openInPianoRoll() { - engine::pianoRoll()->setCurrentPattern( m_pat ); - engine::pianoRoll()->parentWidget()->show(); - engine::pianoRoll()->setFocus(); + Engine::pianoRoll()->setCurrentPattern( m_pat ); + Engine::pianoRoll()->parentWidget()->show(); + Engine::pianoRoll()->setFocus(); } @@ -798,12 +798,12 @@ void PatternView::mousePressEvent( QMouseEvent * _me ) } } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); - if( engine::pianoRoll()->currentPattern() == m_pat ) + if( Engine::pianoRoll()->currentPattern() == m_pat ) { - engine::pianoRoll()->update(); + Engine::pianoRoll()->update(); } } else @@ -860,11 +860,11 @@ void PatternView::wheelEvent( QWheelEvent * _we ) n->setVolume( qMax( 0, vol - 5 ) ); } - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); - if( engine::pianoRoll()->currentPattern() == m_pat ) + if( Engine::pianoRoll()->currentPattern() == m_pat ) { - engine::pianoRoll()->update(); + Engine::pianoRoll()->update(); } } _we->accept(); @@ -924,7 +924,7 @@ void PatternView::paintEvent( QPaintEvent * ) } p.setBrush( lingrad ); - if( engine::pianoRoll()->currentPattern() == m_pat && m_pat->m_patternType != Pattern::BeatPattern ) + if( Engine::pianoRoll()->currentPattern() == m_pat && m_pat->m_patternType != Pattern::BeatPattern ) p.setPen( c.lighter( 130 ) ); else p.setPen( c.darker( 300 ) ); @@ -933,7 +933,7 @@ void PatternView::paintEvent( QPaintEvent * ) p.setBrush( QBrush() ); if( m_pat->m_patternType != Pattern::BeatPattern ) { - if( engine::pianoRoll()->currentPattern() == m_pat ) + if( Engine::pianoRoll()->currentPattern() == m_pat ) p.setPen( c.lighter( 160 ) ); else p.setPen( c.lighter( 130 ) ); diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index 959b02a96..802ce00a2 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -36,7 +36,7 @@ #include "SampleTrack.h" #include "Song.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "tooltip.h" #include "AudioPort.h" #include "SamplePlayHandle.h" @@ -59,7 +59,7 @@ SampleTCO::SampleTCO( Track * _track ) : // we need to receive bpm-change-events, because then we have to // change length of this TCO - connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), + connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), this, SLOT( updateLength( bpm_t ) ) ); } @@ -130,7 +130,7 @@ void SampleTCO::updateLength( bpm_t ) MidiTime SampleTCO::sampleLength() const { - return (int)( m_sampleBuffer->frames() / engine::framesPerTick() ); + return (int)( m_sampleBuffer->frames() / Engine::framesPerTick() ); } @@ -291,7 +291,7 @@ void SampleTCOView::dropEvent( QDropEvent * _de ) m_tco->updateLength(); update(); _de->accept(); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } else { @@ -325,7 +325,7 @@ void SampleTCOView::mouseDoubleClickEvent( QMouseEvent * ) if( af != "" && af != m_tco->m_sampleBuffer->audioFile() ) { m_tco->setSampleFile( af ); - engine::getSong()->setModified(); + Engine::getSong()->setModified(); } } @@ -415,7 +415,7 @@ SampleTrack::SampleTrack( TrackContainer* tc ) : SampleTrack::~SampleTrack() { - engine::mixer()->removePlayHandles( this ); + Engine::mixer()->removePlayHandles( this ); } @@ -440,7 +440,7 @@ bool SampleTrack::play( const MidiTime & _start, const fpp_t _frames, PlayHandle* handle; if( st->isRecord() ) { - if( !engine::getSong()->isRecording() ) + if( !Engine::getSong()->isRecording() ) { return played_a_note; } @@ -457,7 +457,7 @@ bool SampleTrack::play( const MidiTime & _start, const fpp_t _frames, // handle->setBBTrack( _tco_num ); handle->setOffset( _offset ); // send it to the mixer - engine::mixer()->addPlayHandle( handle ); + Engine::mixer()->addPlayHandle( handle ); played_a_note = true; } } @@ -553,7 +553,7 @@ SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) : m_effectRack = new EffectRackView( _t->audioPort()->effects() ); m_effectRack->setFixedSize( 240, 242 ); - m_effWindow = engine::mainWindow()->workspace()->addSubWindow( m_effectRack ); + m_effWindow = Engine::mainWindow()->workspace()->addSubWindow( m_effectRack ); m_effWindow->setAttribute( Qt::WA_DeleteOnClose, false ); m_effWindow->layout()->setSizeConstraint( QLayout::SetFixedSize ); m_effWindow->setWindowTitle( _t->name() ); diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index a55672fc7..d537cc62e 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -31,7 +31,7 @@ #include "bb_track.h" #include "BBTrackContainer.h" #include "embed.h" -#include "engine.h" +#include "Engine.h" #include "gui_templates.h" #include "MainWindow.h" #include "Mixer.h" @@ -51,7 +51,7 @@ bbTCO::bbTCO( Track * _track ) : m_color( 128, 128, 128 ), m_useStyleColor( true ) { - tact_t t = engine::getBBTrackContainer()->lengthOfBB( bbTrackIndex() ); + tact_t t = Engine::getBBTrackContainer()->lengthOfBB( bbTrackIndex() ); if( t > 0 ) { saveJournallingState( false ); @@ -234,7 +234,7 @@ void bbTCOView::paintEvent( QPaintEvent * ) lingrad.setColorAt( 1, col.light( 70 ) ); p.fillRect( rect(), lingrad ); - tact_t t = engine::getBBTrackContainer()->lengthOfBB( m_bbTCO->bbTrackIndex() ); + tact_t t = Engine::getBBTrackContainer()->lengthOfBB( m_bbTCO->bbTrackIndex() ); if( m_bbTCO->length() > MidiTime::ticksPerTact() && t > 0 ) { for( int x = static_cast( t * pixelsPerTact() ); @@ -273,9 +273,9 @@ void bbTCOView::paintEvent( QPaintEvent * ) void bbTCOView::openInBBEditor() { - engine::getBBTrackContainer()->setCurrentBB( m_bbTCO->bbTrackIndex() ); + Engine::getBBTrackContainer()->setCurrentBB( m_bbTCO->bbTrackIndex() ); - engine::mainWindow()->toggleBBEditorWin( true ); + Engine::mainWindow()->toggleBBEditorWin( true ); } @@ -310,7 +310,7 @@ void bbTCOView::changeColor() if( isSelected() ) { QVector selected = - engine::songEditor()->selectedObjects(); + Engine::songEditor()->selectedObjects(); for( QVector::iterator it = selected.begin(); it != selected.end(); ++it ) @@ -335,7 +335,7 @@ void bbTCOView::resetColor() if( ! m_bbTCO->m_useStyleColor ) { m_bbTCO->m_useStyleColor = true; - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); } bbTrack::clearLastTCOColor(); @@ -349,7 +349,7 @@ void bbTCOView::setColor( QColor new_color ) { m_bbTCO->setColor( new_color ); m_bbTCO->m_useStyleColor = false; - engine::getSong()->setModified(); + Engine::getSong()->setModified(); update(); } bbTrack::setLastTCOColor( new_color ); @@ -368,11 +368,11 @@ bbTrack::bbTrack( TrackContainer* tc ) : s_infoMap[this] = bbNum; setName( tr( "Beat/Bassline %1" ).arg( bbNum ) ); - engine::getBBTrackContainer()->setCurrentBB( bbNum ); - engine::getBBTrackContainer()->updateComboBox(); + Engine::getBBTrackContainer()->setCurrentBB( bbNum ); + Engine::getBBTrackContainer()->updateComboBox(); connect( this, SIGNAL( nameChanged() ), - engine::getBBTrackContainer(), SLOT( updateComboBox() ) ); + Engine::getBBTrackContainer(), SLOT( updateComboBox() ) ); } @@ -380,10 +380,10 @@ bbTrack::bbTrack( TrackContainer* tc ) : bbTrack::~bbTrack() { - engine::mixer()->removePlayHandles( this ); + Engine::mixer()->removePlayHandles( this ); const int bb = s_infoMap[this]; - engine::getBBTrackContainer()->removeBB( bb ); + Engine::getBBTrackContainer()->removeBB( bb ); for( infoMap::iterator it = s_infoMap.begin(); it != s_infoMap.end(); ++it ) { @@ -397,7 +397,7 @@ bbTrack::~bbTrack() // remove us from TC so bbTrackContainer::numOfBBs() returns a smaller // value and thus combobox-updating in bbTrackContainer works well trackContainer()->removeTrack( this ); - engine::getBBTrackContainer()->updateComboBox(); + Engine::getBBTrackContainer()->updateComboBox(); } @@ -414,11 +414,11 @@ bool bbTrack::play( const MidiTime & _start, const fpp_t _frames, if( _tco_num >= 0 ) { - return engine::getBBTrackContainer()->play( _start, _frames, _offset, s_infoMap[this] ); + return Engine::getBBTrackContainer()->play( _start, _frames, _offset, s_infoMap[this] ); } tcoVector tcos; - getTCOsInRange( tcos, _start, _start + static_cast( _frames / engine::framesPerTick() ) ); + getTCOsInRange( tcos, _start, _start + static_cast( _frames / Engine::framesPerTick() ) ); if( tcos.size() == 0 ) { @@ -439,7 +439,7 @@ bool bbTrack::play( const MidiTime & _start, const fpp_t _frames, if( _start - lastPosition < lastLen ) { - return engine::getBBTrackContainer()->play( _start - lastPosition, _frames, _offset, s_infoMap[this] ); + return Engine::getBBTrackContainer()->play( _start - lastPosition, _frames, _offset, s_infoMap[this] ); } return false; } @@ -479,7 +479,7 @@ void bbTrack::saveTrackSpecificSettings( QDomDocument & _doc, _this.parentNode().parentNode().nodeName() != "clone" && _this.parentNode().parentNode().nodeName() != "journaldata" ) { - ( (JournallingObject *)( engine::getBBTrackContainer() ) )-> + ( (JournallingObject *)( Engine::getBBTrackContainer() ) )-> saveState( _doc, _this ); } if( _this.parentNode().parentNode().nodeName() == "clone" ) @@ -502,9 +502,9 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this ) { const int src = _this.attribute( "clonebbt" ).toInt(); const int dst = s_infoMap[this]; - engine::getBBTrackContainer()->createTCOsForBB( dst ); + Engine::getBBTrackContainer()->createTCOsForBB( dst ); TrackContainer::TrackList tl = - engine::getBBTrackContainer()->tracks(); + Engine::getBBTrackContainer()->tracks(); // copy TCOs of all tracks from source BB (at bar "src") to destination // TCOs (which are created if they do not exist yet) for( TrackContainer::TrackList::iterator it = tl.begin(); @@ -522,7 +522,7 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this ) TrackContainer::classNodeName() ); if( node.isElement() ) { - ( (JournallingObject *)engine::getBBTrackContainer() )-> + ( (JournallingObject *)Engine::getBBTrackContainer() )-> restoreState( node.toElement() ); } } @@ -562,9 +562,9 @@ void bbTrack::swapBBTracks( Track * _track1, Track * _track2 ) if( t1 != NULL && t2 != NULL ) { qSwap( s_infoMap[t1], s_infoMap[t2] ); - engine::getBBTrackContainer()->swapBB( s_infoMap[t1], + Engine::getBBTrackContainer()->swapBB( s_infoMap[t1], s_infoMap[t2] ); - engine::getBBTrackContainer()->setCurrentBB( s_infoMap[t1] ); + Engine::getBBTrackContainer()->setCurrentBB( s_infoMap[t1] ); } } @@ -599,7 +599,7 @@ bbTrackView::bbTrackView( bbTrack * _bbt, TrackContainerView* tcv ) : bbTrackView::~bbTrackView() { - engine::getBBEditor()->removeBBView( bbTrack::s_infoMap[m_bbTrack] ); + Engine::getBBEditor()->removeBBView( bbTrack::s_infoMap[m_bbTrack] ); } @@ -607,7 +607,7 @@ bbTrackView::~bbTrackView() bool bbTrackView::close() { - engine::getBBEditor()->removeBBView( bbTrack::s_infoMap[m_bbTrack] ); + Engine::getBBEditor()->removeBBView( bbTrack::s_infoMap[m_bbTrack] ); return trackView::close(); } @@ -616,8 +616,8 @@ bool bbTrackView::close() void bbTrackView::clickedTrackLabel() { - engine::getBBTrackContainer()->setCurrentBB( m_bbTrack->index() ); - engine::getBBEditor()->show(); + Engine::getBBTrackContainer()->setCurrentBB( m_bbTrack->index() ); + Engine::getBBEditor()->show(); /* foreach( bbTrackView * tv, trackContainerView()->findChildren() ) {