Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename engine to Engine
  • Loading branch information
lukas-w committed Nov 25, 2014
commit 968909c07c0d1968e01d901f6d404234262ba137
4 changes: 2 additions & 2 deletions include/BandLimitedWave.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -104,7 +104,7 @@ class EXPORT BandLimitedWave
*/
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.
Expand Down
2 changes: 1 addition & 1 deletion include/BufferManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "MemoryManager.h"
#include "lmms_basics.h"
#include "engine.h"
#include "Engine.h"
#include "Mixer.h"
#include <QtCore/QAtomicInt>
#include <QtCore/QReadWriteLock>
Expand Down
4 changes: 2 additions & 2 deletions include/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "export.h"
#include "MemoryManager.h"

class engine;
class Engine;


const QString PROJECTS_PATH = "projects/";
Expand Down Expand Up @@ -221,7 +221,7 @@ class EXPORT ConfigManager
settingsMap m_settings;


friend class engine;
friend class Engine;

} ;

Expand Down
2 changes: 1 addition & 1 deletion include/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
16 changes: 8 additions & 8 deletions include/Effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -102,8 +102,8 @@ class EXPORT Effect : public Plugin

inline f_cnt_t timeout() const
{
const float samples = engine::mixer()->processingSampleRate() * m_autoQuitModel.value() / 1000.0f;
return 1 + ( static_cast<int>( samples ) / engine::mixer()->framesPerPeriod() );
const float samples = Engine::mixer()->processingSampleRate() * m_autoQuitModel.value() / 1000.0f;
return 1 + ( static_cast<int>( samples ) / Engine::mixer()->framesPerPeriod() );
}

inline float wetLevel() const
Expand Down Expand Up @@ -176,19 +176,19 @@ class EXPORT Effect : public Plugin
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,
sampleFrame * _dst_buf,
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();

Expand Down
4 changes: 2 additions & 2 deletions include/engine.h → include/Engine.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* engine.h - engine-system of LMMS
* Engine.h - engine-system of LMMS
*
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
Expand Down Expand Up @@ -50,7 +50,7 @@ class ladspa2LMMS;
class ControllerRackView;


class EXPORT engine
class EXPORT Engine
{
public:
static void init( const bool _has_gui = true );
Expand Down
2 changes: 1 addition & 1 deletion include/FxMixerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion include/PianoRoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ protected slots:
// did we start a mouseclick with shift pressed
bool m_startedWithShift;

friend class engine;
friend class Engine;

// qproperty fields
QColor m_gridColor;
Expand Down
4 changes: 2 additions & 2 deletions include/Song.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private slots:

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 );
Expand Down Expand Up @@ -364,7 +364,7 @@ private slots:
VstSyncController m_vstSyncController;


friend class engine;
friend class Engine;
friend class SongEditor;
friend class mainWindow;
friend class ControllerRackView;
Expand Down
2 changes: 1 addition & 1 deletion plugins/Amplifier/AmplifierControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "AmplifierControls.h"
#include "Amplifier.h"
#include "engine.h"
#include "Engine.h"
#include "Song.h"


Expand Down
2 changes: 1 addition & 1 deletion plugins/BassBooster/BassBooster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion plugins/BassBooster/BassBoosterControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) );
}


Expand Down
4 changes: 2 additions & 2 deletions plugins/DualFilter/DualFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions plugins/DualFilter/DualFilterControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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() ) );
}


Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions plugins/HydrogenImport/HydrogenImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -143,7 +143,7 @@ bool HydrogenImport::readSong()
QHash<QString, int> pattern_length;
QHash<QString, int> pattern_id;

Song *s = engine::getSong();
Song *s = Engine::getSong();
int song_num_tracks = s->tracks().size();
if ( QFile( filename ).exists() == false )
{
Expand Down Expand Up @@ -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" );
Expand All @@ -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() )
Expand Down
26 changes: 13 additions & 13 deletions plugins/LadspaEffect/LadspaEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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." ).
Expand All @@ -89,7 +89,7 @@ LadspaEffect::LadspaEffect( Model * _parent,

pluginInstantiation();

connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
connect( Engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( changeSampleRate() ) );
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 );

Expand Down Expand Up @@ -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++;
}
Expand All @@ -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
Expand Down Expand Up @@ -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++ )
Expand Down Expand Up @@ -587,7 +587,7 @@ sample_rate_t LadspaEffect::maxSamplerate( const QString & _name )
{
return( __buggy_plugins[_name] );
}
return( engine::mixer()->processingSampleRate() );
return( Engine::mixer()->processingSampleRate() );
}


Expand Down
8 changes: 4 additions & 4 deletions plugins/LadspaEffect/LadspaSubPluginFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 ) );
Expand Down Expand Up @@ -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 )
Expand All @@ -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 ) );
}
Expand Down
Loading