Rename engine to Engine

This commit is contained in:
Lukas W
2014-11-26 00:49:55 +01:00
parent 84d9215880
commit 968909c07c
148 changed files with 1058 additions and 1058 deletions

View File

@@ -52,7 +52,7 @@ AutomatableModel::AutomatableModel( DataType type,
m_hasStrictStepSize( false ),
m_hasLinkedModels( false ),
m_controllerConnection( NULL ),
m_valueBuffer( static_cast<int>( engine::mixer()->framesPerPeriod() ) ),
m_valueBuffer( static_cast<int>( Engine::mixer()->framesPerPeriod() ) ),
m_lastUpdatedPeriod( -1 ),
m_hasSampleExactData( false )

View File

@@ -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 *> AutomationPattern::patternsForModel( const Automata
{
QVector<AutomationPattern *> 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 *> 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<jo_id_t>::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<AutomatableModel *>( 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();
}

View File

@@ -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;
}

View File

@@ -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();
}

View File

@@ -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
{

View File

@@ -26,7 +26,7 @@
#include <QDomElement>
#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;

View File

@@ -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 );

View File

@@ -1,5 +1,5 @@
/*
* engine.cpp - implementation of LMMS' engine-system
* Engine.cpp - implementation of LMMS' engine-system
*
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -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<QString, QString> 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<QString, QString> 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 );

View File

@@ -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<f_cnt_t>(
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<f_cnt_t>( frames_per_lfo_oscillation *
expKnobVal( m_lfoPredelayModel.value() ) );
m_lfoAttackFrames = static_cast<f_cnt_t>( frames_per_lfo_oscillation *

View File

@@ -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<Track *> songTrackList = engine::getSong()->tracks();
QVector<Track *> bbTrackList = engine::getBBTrackContainer()->tracks();
QVector<Track *> songTrackList = Engine::getSong()->tracks();
QVector<Track *> bbTrackList = Engine::getBBTrackContainer()->tracks();
QVector<Track *> 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

View File

@@ -26,7 +26,7 @@
#include <QMessageBox>
#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;

View File

@@ -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 )
{

View File

@@ -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,

View File

@@ -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() );

View File

@@ -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;
}
}

View File

@@ -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<float>( engine::mixer()->framesPerPeriod() * diff ) / m_duration;
phase += static_cast<float>( 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() )
{

View File

@@ -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();

View File

@@ -23,7 +23,7 @@
*/
#include "MixerWorkerThread.h"
#include "engine.h"
#include "Engine.h"
MixerWorkerThread::JobQueue MixerWorkerThread::globalJobQueue;

View File

@@ -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<f_cnt_t>( framesLeft(), engine::mixer()->framesPerPeriod() - offset() );
return (fpp_t) qMin<f_cnt_t>( framesLeft(), Engine::mixer()->framesPerPeriod() - offset() );
}
return (fpp_t) qMin<f_cnt_t>( framesLeft(), engine::mixer()->framesPerPeriod() );
return (fpp_t) qMin<f_cnt_t>( 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<f_cnt_t>( totalFramesPlayed() / engine::framesPerTick() ) ) );
setLength( MidiTime( static_cast<f_cnt_t>( 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 ) );

View File

@@ -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 )
{

View File

@@ -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 )

View File

@@ -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" ),

View File

@@ -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 );
}

View File

@@ -25,7 +25,7 @@
#include <cstdlib>
#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;
}
}

View File

@@ -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 )

View File

@@ -30,7 +30,7 @@
#include "RemotePlugin.h"
#include "Mixer.h"
#include "engine.h"
#include "Engine.h"
#include "ConfigManager.h"
#include <QDir>
@@ -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<int>( 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:

View File

@@ -24,15 +24,15 @@
*/
#include "RingBuffer.h"
#include "engine.h"
#include "Engine.h"
#include "Mixer.h"
#include <string.h>
#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<float>( ( m_size - m_fpp ) * engine::mixer()->processingSampleRate() ) / m_samplerate;
float newsize = static_cast<float>( ( m_size - m_fpp ) * Engine::mixer()->processingSampleRate() ) / m_samplerate;
m_size = static_cast<f_cnt_t>( 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 ) );

View File

@@ -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<f_cnt_t>( (

View File

@@ -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() );
}

View File

@@ -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;
}

View File

@@ -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<bbTrack *>( t )->index() );
Engine::getBBTrackContainer()->setCurrentBB( dynamic_cast<bbTrack *>( 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<InstrumentTrack * >( t )->loadInstrument(
"tripleoscillator" );
t = Track::create( Track::InstrumentTrack,
engine::getBBTrackContainer() );
Engine::getBBTrackContainer() );
dynamic_cast<InstrumentTrack * >( 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();
}

View File

@@ -27,7 +27,7 @@
#include <QDomElement>
#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 );
}

View File

@@ -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<int>( 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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -26,7 +26,7 @@
#include <QDebug>
#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 );

View File

@@ -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 )
{

View File

@@ -33,7 +33,7 @@
#include <stdlib.h>
#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() )
{

View File

@@ -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 )

View File

@@ -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;
}

View File

@@ -41,7 +41,7 @@ void AudioPortAudioSetupUtil::updateChannels()
#include <QLabel>
#include <QLineEdit>
#include "engine.h"
#include "Engine.h"
#include "debug.h"
#include "ConfigManager.h"
#include "gui_templates.h"

View File

@@ -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)

View File

@@ -29,7 +29,7 @@
#include <QLabel>
#include <QLineEdit>
#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();

View File

@@ -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!

View File

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

View File

@@ -28,7 +28,7 @@
#include <QVector>
#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 );

View File

@@ -340,7 +340,7 @@ void MidiPort::updateMidiPortMode()
emit writablePortsChanged();
emit modeChanged();
engine::getSong()->setModified();
Engine::getSong()->setModified();
}

View File

@@ -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"

View File

@@ -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;

View File

@@ -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 )
{

View File

@@ -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 )
{

View File

@@ -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<AutomatableModel *>( 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<AutomatableModel *>(
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

View File

@@ -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 )

View File

@@ -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<SamplePlayHandle *>(
m_previewPlayHandle );
if( s && s->totalFrames() - s->framesDone() <=
static_cast<f_cnt_t>( engine::mixer()->
static_cast<f_cnt_t>( 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<InstrumentTrack *>(
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<QMdiSubWindow*> pl =
engine::mainWindow()->workspace()->
Engine::mainWindow()->workspace()->
subWindowList( QMdiArea::StackingOrder );
QListIterator<QMdiSubWindow *> 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

View File

@@ -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<Track *> songTrackList = engine::getSong()->tracks();
QVector<Track *> bbTrackList = engine::getBBTrackContainer()->tracks();
QVector<Track *> songTrackList = Engine::getSong()->tracks();
QVector<Track *> bbTrackList = Engine::getBBTrackContainer()->tracks();
QVector<Track *> 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();

View File

@@ -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"

View File

@@ -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
{

View File

@@ -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"

View File

@@ -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<note>::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 )

View File

@@ -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"

View File

@@ -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<QMdiSubWindow *>( parentWidget() ) );
}
scrolled( 0 );

View File

@@ -30,14 +30,14 @@
#include <QMdiArea>
#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() );

View File

@@ -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 );

View File

@@ -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 );

View File

@@ -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();
}

View File

@@ -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<ProjectRenderer::Depths>( 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 ) );
}

View File

@@ -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 ) );
}

View File

@@ -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();
}
}

View File

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

View File

@@ -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();

View File

@@ -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 );

View File

@@ -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<float>() );
p.setPen( QPen( QColor( static_cast<int>( 96 * lfo_gray_amount ),

View File

@@ -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<captionMenu> 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 );
}

View File

@@ -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"

View File

@@ -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 );

View File

@@ -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 )
{

View File

@@ -33,7 +33,7 @@
#include <QStyleOptionFrameV2>
#include "LcdWidget.h"
#include "engine.h"
#include "Engine.h"
#include "embed.h"
#include "gui_templates.h"
#include "MainWindow.h"

View File

@@ -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());
}

View File

@@ -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 )
{

View File

@@ -29,7 +29,7 @@
#include <QMouseEvent>
#include "caption_menu.h"
#include "engine.h"
#include "Engine.h"
#include "embed.h"
#include "MainWindow.h"
#include "string_pair_drag.h"

View File

@@ -30,7 +30,7 @@
#include "caption_menu.h"
#include "embed.h"
#include "engine.h"
#include "Engine.h"
#include "MainWindow.h"

View File

@@ -35,7 +35,7 @@
#include <QStyleOptionFrame>
#include "caption_menu.h"
#include "engine.h"
#include "Engine.h"
#include "embed.h"
#include "gui_templates.h"
#include "MainWindow.h"

View File

@@ -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;

View File

@@ -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"

View File

@@ -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,

View File

@@ -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<AutomatableModel *>(
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() ),

View File

@@ -38,14 +38,14 @@
#include <QDomCDATASection>
#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();
}

View File

@@ -27,7 +27,7 @@
#include <QMdiArea>
#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 );
}

View File

@@ -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 )
{

View File

@@ -34,7 +34,7 @@
#include "InstrumentTrack.h"
#include "Instrument.h"
#include "ConfigManager.h"
#include "engine.h"
#include "Engine.h"

View File

@@ -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<float>(
Mixer::peakValueLeft( m_buffer, frames ),
Mixer::peakValueRight( m_buffer, frames ) );

View File

@@ -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<int>(
_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<AutomatableModel *>(
engine::projectJournal()->
Engine::projectJournal()->
journallingObject( val.toInt() ) );
if( mod != NULL )
{

View File

@@ -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 );

View File

@@ -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 ) );

View File

@@ -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() );

View File

@@ -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<int>( 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<selectableObject *> selected =
engine::songEditor()->selectedObjects();
Engine::songEditor()->selectedObjects();
for( QVector<selectableObject *>::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<int>( _frames / engine::framesPerTick() ) );
getTCOsInRange( tcos, _start, _start + static_cast<int>( _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<bbTrackView *>() )
{