static engine, chunked audio buffer, pat fix, MIME type

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@472 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Javier Serrano Polo
2007-04-19 06:52:29 +00:00
parent e121fe84cd
commit 16a61bf8fe
198 changed files with 2709 additions and 2137 deletions

View File

@@ -65,8 +65,7 @@ audioALSA::audioALSA( const sample_rate_t _sample_rate, bool & _success_ful,
m_handle( NULL ),
m_hwParams( NULL ),
m_swParams( NULL ),
m_convertEndian( FALSE ),
m_quit( FALSE )
m_convertEndian( FALSE )
{
_success_ful = FALSE;
@@ -204,7 +203,6 @@ void audioALSA::stopProcessing( void )
{
if( isRunning() )
{
m_quit = TRUE;
wait( 1000 );
terminate();
}
@@ -223,13 +221,13 @@ void audioALSA::run( void )
channels() );
int_sample_t * pcmbuf = bufferAllocator::alloc<int_sample_t>(
m_periodSize * channels() );
m_quit = FALSE;
int outbuf_size = getMixer()->framesPerAudioBuffer() * channels();
int outbuf_pos = 0;
int pcmbuf_size = m_periodSize * channels();
while( m_quit == FALSE )
bool quit = FALSE;
while( quit == FALSE )
{
int_sample_t * ptr = pcmbuf;
int len = pcmbuf_size;
@@ -239,6 +237,13 @@ void audioALSA::run( void )
{
// frames depend on the sample rate
const fpab_t frames = getNextBuffer( temp );
if( !frames )
{
quit = TRUE;
memset( ptr, 0, len
* sizeof( int_sample_t ) );
break;
}
outbuf_size = frames * channels();
convertToS16( temp, frames,
@@ -488,7 +493,7 @@ audioALSA::setupWidget::setupWidget( QWidget * _parent ) :
dev_lbl->setGeometry( 10, 40, 160, 10 );
m_channels = new lcdSpinBox( DEFAULT_CHANNELS, SURROUND_CHANNELS, 1,
this, NULL, NULL, NULL );
this, NULL, NULL );
m_channels->setStep( 2 );
m_channels->setLabel( tr( "CHANNELS" ) );
m_channels->setValue( configManager::inst()->value( "audioalsa",

View File

@@ -3,7 +3,7 @@
/*
* audio_device.cpp - base-class for audio-devices used by LMMS-mixer
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -85,10 +85,15 @@ audioDevice::~audioDevice()
void audioDevice::processNextBuffer( void )
bool audioDevice::processNextBuffer( void )
{
const fpab_t frames = getNextBuffer( m_buffer );
if( !frames )
{
return( FALSE );
}
writeBuffer( m_buffer, frames, getMixer()->masterGain() );
return( TRUE );
}
@@ -97,7 +102,11 @@ void audioDevice::processNextBuffer( void )
fpab_t audioDevice::getNextBuffer( surroundSampleFrame * _ab )
{
fpab_t frames = getMixer()->framesPerAudioBuffer();
const surroundSampleFrame * b = getMixer()->renderNextBuffer();
const surroundSampleFrame * b = getMixer()->nextBuffer();
if( !b )
{
return( 0 );
}
// make sure, no other thread is accessing device
lock();
@@ -117,12 +126,22 @@ fpab_t audioDevice::getNextBuffer( surroundSampleFrame * _ab )
// release lock
unlock();
delete[] b;
return( frames );
}
void audioDevice::stopProcessing( void )
{
while( processNextBuffer() );
}
void audioDevice::registerPort( audioPort * )
{
}
@@ -348,4 +367,6 @@ void FASTCALL audioDevice::clearS16Buffer( int_sample_t * _outbuf,
}
#endif

View File

@@ -3,7 +3,7 @@
/*
* audio_jack.cpp - support for JACK-transport
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -65,8 +65,9 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
DEFAULT_CHANNELS, SURROUND_CHANNELS ),
_mixer ),
m_client( NULL ),
m_stopped( FALSE ),
m_processCallbackMutex(),
m_active( FALSE ),
// m_processCallbackMutex(),
m_stop_semaphore( 1 ),
m_outBuf( bufferAllocator::alloc<surroundSampleFrame>(
getMixer()->framesPerAudioBuffer() ) ),
m_framesDoneInCurBuf( 0 ),
@@ -94,7 +95,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
server_name );
if( m_client == NULL )
{
printf( "jack_client_open() failed with status %d\n", status );
printf( "jack_client_open() failed, status 0x%2.0x\n", status );
if( status & JackServerFailed )
{
printf( "Could not connect to JACK server.\n" );
@@ -165,6 +166,48 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
}
}
m_stop_semaphore += m_stop_semaphore.total();
_success_ful = TRUE;
}
audioJACK::~audioJACK()
{
m_stop_semaphore -= m_stop_semaphore.total();
while( m_portMap.size() )
{
unregisterPort( m_portMap.begin().key() );
}
if( m_client != NULL )
{
if( m_active )
{
jack_deactivate( m_client );
}
jack_client_close( m_client );
}
bufferAllocator::free( m_outBuf );
}
void audioJACK::startProcessing( void )
{
m_stopped = FALSE;
if( m_active )
{
return;
}
if( jack_activate( m_client ) )
{
@@ -172,6 +215,8 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
return;
}
m_active = TRUE;
// make sure, JACK transport is rolling
if( jack_transport_query( m_client, NULL ) != JackTransportRolling )
@@ -209,37 +254,6 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
}
free( ports );
_success_ful = TRUE;
}
audioJACK::~audioJACK()
{
while( m_portMap.size() )
{
unregisterPort( m_portMap.begin().key() );
}
if( m_client != NULL )
{
jack_deactivate( m_client );
jack_client_close( m_client );
}
bufferAllocator::free( m_outBuf );
}
void audioJACK::startProcessing( void )
{
m_stopped = FALSE;
}
@@ -247,7 +261,7 @@ void audioJACK::startProcessing( void )
void audioJACK::stopProcessing( void )
{
m_stopped = TRUE;
m_stop_semaphore++;
}
@@ -329,7 +343,7 @@ void audioJACK::renamePort( audioPort * _port )
int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
{
audioJACK * _this = static_cast<audioJACK *>( _udata );
_this->m_processCallbackMutex.lock();
// _this->m_processCallbackMutex.lock();
/* printf( "%f\n", jack_cpu_load( _this->m_client ) );*/
@@ -397,6 +411,11 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
{
_this->m_framesToDoInCurBuf = _this->getNextBuffer(
_this->m_outBuf );
if( !_this->m_framesToDoInCurBuf )
{
_this->m_stopped = TRUE;
_this->m_stop_semaphore--;
}
_this->m_framesDoneInCurBuf = 0;
}
}
@@ -405,12 +424,12 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
{
for( Uint8 ch = 0; ch < _this->channels(); ++ch )
{
jack_default_audio_sample_t * b = outbufs[ch];
memset( b, 0, sizeof( *b ) * _nframes );
jack_default_audio_sample_t * b = outbufs[ch] + done;
memset( b, 0, sizeof( *b ) * ( _nframes - done ) );
}
}
_this->m_processCallbackMutex.unlock();
// _this->m_processCallbackMutex.unlock();
return( 0 );
}
@@ -451,7 +470,7 @@ audioJACK::setupWidget::setupWidget( QWidget * _parent ) :
cn_lbl->setGeometry( 10, 40, 160, 10 );
m_channels = new lcdSpinBox( DEFAULT_CHANNELS, SURROUND_CHANNELS, 1,
this, NULL, NULL, NULL );
this, NULL, NULL );
m_channels->setStep( 2 );
m_channels->setLabel( tr( "CHANNELS" ) );
m_channels->setValue( configManager::inst()->value( "audiojack",

View File

@@ -99,8 +99,7 @@ audioOSS::audioOSS( const sample_rate_t _sample_rate, bool & _success_ful,
configManager::inst()->value( "audiooss", "channels" ).toInt(),
DEFAULT_CHANNELS, SURROUND_CHANNELS ),
_mixer ),
m_convertEndian( FALSE ),
m_quit( FALSE )
m_convertEndian( FALSE )
{
_success_ful = FALSE;
@@ -307,7 +306,6 @@ void audioOSS::stopProcessing( void )
{
if( isRunning() )
{
m_quit = TRUE;
wait( 1000 );
terminate();
}
@@ -324,11 +322,14 @@ void audioOSS::run( void )
int_sample_t * outbuf = bufferAllocator::alloc<int_sample_t>(
getMixer()->framesPerAudioBuffer() *
channels() );
m_quit = FALSE;
while( m_quit == FALSE )
while( TRUE )
{
const fpab_t frames = getNextBuffer( temp );
if( !frames )
{
break;
}
int bytes = convertToS16( temp, frames,
getMixer()->masterGain(), outbuf,
@@ -354,7 +355,7 @@ audioOSS::setupWidget::setupWidget( QWidget * _parent ) :
dev_lbl->setGeometry( 10, 40, 160, 10 );
m_channels = new lcdSpinBox( DEFAULT_CHANNELS, SURROUND_CHANNELS, 1,
this, NULL, NULL, NULL );
this, NULL, NULL );
m_channels->setStep( 2 );
m_channels->setLabel( tr( "CHANNELS" ) );
m_channels->setValue( configManager::inst()->value( "audiooss",

View File

@@ -3,7 +3,7 @@
/*
* audio_port.cpp - base-class for objects providing sound at a port
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -31,26 +31,26 @@
#include "audio_port.h"
#include "audio_device.h"
#include "buffer_allocator.h"
#include "engine.h"
audioPort::audioPort( const QString & _name, engine * _engine ) :
engineObject( _engine ),
audioPort::audioPort( const QString & _name ) :
m_bufferUsage( NONE ),
m_firstBuffer( bufferAllocator::alloc<surroundSampleFrame>(
eng()->getMixer()->framesPerAudioBuffer() ) ),
engine::getMixer()->framesPerAudioBuffer() ) ),
m_secondBuffer( bufferAllocator::alloc<surroundSampleFrame>(
eng()->getMixer()->framesPerAudioBuffer() ) ),
engine::getMixer()->framesPerAudioBuffer() ) ),
m_extOutputEnabled( FALSE ),
m_nextFxChannel( -1 ),
m_name( "unnamed port" )
{
eng()->getMixer()->clearAudioBuffer( m_firstBuffer,
eng()->getMixer()->framesPerAudioBuffer() );
eng()->getMixer()->clearAudioBuffer( m_secondBuffer,
eng()->getMixer()->framesPerAudioBuffer() );
eng()->getMixer()->addAudioPort( this );
engine::getMixer()->clearAudioBuffer( m_firstBuffer,
engine::getMixer()->framesPerAudioBuffer() );
engine::getMixer()->clearAudioBuffer( m_secondBuffer,
engine::getMixer()->framesPerAudioBuffer() );
engine::getMixer()->addAudioPort( this );
setExtOutputEnabled( TRUE );
m_frames = eng()->getMixer()->framesPerAudioBuffer();
m_effects = new effectChain( eng() );
m_frames = engine::getMixer()->framesPerAudioBuffer();
m_effects = new effectChain;
}
@@ -58,10 +58,10 @@ audioPort::audioPort( const QString & _name, engine * _engine ) :
audioPort::~audioPort()
{
eng()->getMixer()->removeAudioPort( this );
engine::getMixer()->removeAudioPort( this );
if( m_extOutputEnabled == TRUE )
{
eng()->getMixer()->audioDev()->unregisterPort( this );
engine::getMixer()->audioDev()->unregisterPort( this );
}
bufferAllocator::free( m_firstBuffer );
bufferAllocator::free( m_secondBuffer );
@@ -72,8 +72,8 @@ audioPort::~audioPort()
void audioPort::nextPeriod( void )
{
eng()->getMixer()->clearAudioBuffer( m_firstBuffer,
eng()->getMixer()->framesPerAudioBuffer() );
engine::getMixer()->clearAudioBuffer( m_firstBuffer,
engine::getMixer()->framesPerAudioBuffer() );
qSwap( m_firstBuffer, m_secondBuffer );
// this is how we decrease state of buffer-usage ;-)
m_bufferUsage = ( m_bufferUsage != NONE ) ?
@@ -90,11 +90,11 @@ void audioPort::setExtOutputEnabled( bool _enabled )
m_extOutputEnabled = _enabled;
if( m_extOutputEnabled )
{
eng()->getMixer()->audioDev()->registerPort( this );
engine::getMixer()->audioDev()->registerPort( this );
}
else
{
eng()->getMixer()->audioDev()->unregisterPort( this );
engine::getMixer()->audioDev()->unregisterPort( this );
}
}
}
@@ -105,7 +105,7 @@ void audioPort::setExtOutputEnabled( bool _enabled )
void audioPort::setName( const QString & _name )
{
m_name = _name;
eng()->getMixer()->audioDev()->renamePort( this );
engine::getMixer()->audioDev()->renamePort( this );
}

View File

@@ -5,7 +5,7 @@
* surround-audio-buffers into RAM, maybe later
* also harddisk
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -94,7 +94,7 @@ void audioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf )
data += ( *it ).second;
}
// create according sample-buffer out of big buffer
*_sample_buf = new sampleBuffer( ac.ptr(), frames, getMixer()->eng() );
*_sample_buf = new sampleBuffer( ac.ptr(), frames );
}

View File

@@ -57,7 +57,8 @@ audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful,
m_outBuf( bufferAllocator::alloc<surroundSampleFrame>(
getMixer()->framesPerAudioBuffer() ) ),
m_convertedBuf_pos( 0 ),
m_convertEndian( FALSE )
m_convertEndian( FALSE ),
m_stop_semaphore( 1 )
{
_success_ful = FALSE;
@@ -106,6 +107,8 @@ audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful,
}
m_convertEndian = ( m_audioHandle.format != actual.format );
m_stop_semaphore += m_stop_semaphore.total();
_success_ful = TRUE;
}
@@ -115,6 +118,7 @@ audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful,
audioSDL::~audioSDL()
{
stopProcessing();
m_stop_semaphore -= m_stop_semaphore.total();
SDL_CloseAudio();
SDL_Quit();
bufferAllocator::free( m_convertedBuf );
@@ -126,6 +130,8 @@ audioSDL::~audioSDL()
void audioSDL::startProcessing( void )
{
m_stopped = FALSE;
SDL_PauseAudio( 0 );
SDL_UnlockAudio();
}
@@ -137,6 +143,8 @@ void audioSDL::stopProcessing( void )
{
if( SDL_GetAudioStatus() == SDL_AUDIO_PLAYING )
{
m_stop_semaphore++;
SDL_LockAudio();
SDL_PauseAudio( 1 );
}
@@ -161,12 +169,25 @@ void audioSDL::sdlAudioCallback( void * _udata, Uint8 * _buf, int _len )
void audioSDL::sdlAudioCallback( Uint8 * _buf, int _len )
{
if( m_stopped )
{
memset( _buf, 0, _len );
return;
}
while( _len )
{
if( m_convertedBuf_pos == 0 )
{
// frames depend on the sample rate
const fpab_t frames = getNextBuffer( m_outBuf );
if( !frames )
{
m_stopped = TRUE;
m_stop_semaphore--;
memset( _buf, 0, _len );
return;
}
m_convertedBuf_size = frames * channels()
* sizeof( int_sample_t );

View File

@@ -194,18 +194,18 @@ const int ARP_GROUPBOX_HEIGHT = 240 - ARP_GROUPBOX_Y;
arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_track ) :
QWidget( _instrument_track->tabWidgetParent() ),
journallingObject( _instrument_track->eng() )
arpAndChordsTabWidget::arpAndChordsTabWidget(
instrumentTrack * _instrument_track ) :
QWidget( _instrument_track->tabWidgetParent() )
{
m_chordsGroupBox = new groupBox( tr( "CHORDS" ), this, eng(),
m_chordsGroupBox = new groupBox( tr( "CHORDS" ), this,
_instrument_track );
m_chordsGroupBox->setGeometry( CHORDS_GROUPBOX_X, CHORDS_GROUPBOX_Y,
CHORDS_GROUPBOX_WIDTH,
CHORDS_GROUPBOX_HEIGHT );
m_chordsComboBox = new comboBox( m_chordsGroupBox, tr( "Chord type" ),
eng(), _instrument_track );
_instrument_track );
m_chordsComboBox->setFont( pointSize<8>( m_chordsComboBox->font() ) );
m_chordsComboBox->setGeometry( 10, 25, 140, 22 );
@@ -219,8 +219,8 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
}
m_chordRangeKnob = new knob( knobBright_26, m_chordsGroupBox,
tr( "Chord range" ),
eng(), _instrument_track );
tr( "Chord range" ),
_instrument_track );
m_chordRangeKnob->setLabel( tr( "RANGE" ) );
m_chordRangeKnob->setRange( 1.0f, 9.0f, 1.0f );
m_chordRangeKnob->setInitValue( 1.0f );
@@ -239,7 +239,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
m_arpGroupBox = new groupBox( tr( "ARPEGGIO" ), this, eng(),
m_arpGroupBox = new groupBox( tr( "ARPEGGIO" ), this,
_instrument_track );
m_arpGroupBox->setGeometry( ARP_GROUPBOX_X, ARP_GROUPBOX_Y,
ARP_GROUPBOX_WIDTH,
@@ -259,7 +259,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
"major or minor triads. But there're a lot of other "
"possible chords, you can select." ) );
m_arpComboBox = new comboBox( m_arpGroupBox, tr( "Arpeggio type" ),
eng(), _instrument_track );
_instrument_track );
m_arpComboBox->setFont( pointSize<8>( m_arpComboBox->font() ) );
m_arpComboBox->setGeometry( 10, 25, 140, 22 );
@@ -274,8 +274,8 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
m_arpRangeKnob = new knob( knobBright_26, m_arpGroupBox,
tr( "Arpeggio range" ),
eng(), _instrument_track );
tr( "Arpeggio range" ),
_instrument_track );
m_arpRangeKnob->setLabel( tr( "RANGE" ) );
m_arpRangeKnob->setRange( 1.0f, 9.0f, 1.0f );
m_arpRangeKnob->setInitValue( 1.0f );
@@ -292,8 +292,8 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
"amount of octaves." ) );
m_arpTimeKnob = new tempoSyncKnob( knobBright_26, m_arpGroupBox,
tr( "Arpeggio time" ),
eng(), _instrument_track );
tr( "Arpeggio time" ),
_instrument_track );
m_arpTimeKnob->setLabel( tr( "TIME" ) );
m_arpTimeKnob->setRange( 25.0f, 2000.0f, 1.0f );
m_arpTimeKnob->setInitValue( 100.0f );
@@ -310,8 +310,8 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
"each arpeggio-tone should be played." ) );
m_arpGateKnob = new knob( knobBright_26, m_arpGroupBox,
tr( "Arpeggio gate" ),
eng(), _instrument_track );
tr( "Arpeggio gate" ),
_instrument_track );
m_arpGateKnob->setLabel( tr( "GATE" ) );
m_arpGateKnob->setRange( 1.0f, 200.0f, 1.0f );
m_arpGateKnob->setInitValue( 100.0f );
@@ -334,7 +334,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
pixmapButton * arp_up_btn = new pixmapButton( m_arpGroupBox, NULL,
eng(), NULL );
NULL );
arp_up_btn->move( 10, 74 );
arp_up_btn->setActiveGraphic( embed::getIconPixmap( "arp_up_on" ) );
arp_up_btn->setInactiveGraphic( embed::getIconPixmap( "arp_up_off" ) );
@@ -345,7 +345,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
pixmapButton * arp_down_btn = new pixmapButton( m_arpGroupBox, NULL,
eng(), NULL );
NULL );
arp_down_btn->move( 30, 74 );
arp_down_btn->setActiveGraphic( embed::getIconPixmap( "arp_down_on" ) );
arp_down_btn->setInactiveGraphic( embed::getIconPixmap(
@@ -357,7 +357,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
pixmapButton * arp_up_and_down_btn = new pixmapButton( m_arpGroupBox,
NULL, eng(), NULL );
NULL, NULL );
arp_up_and_down_btn->move( 50, 74 );
arp_up_and_down_btn->setActiveGraphic( embed::getIconPixmap(
"arp_up_and_down_on" ) );
@@ -371,7 +371,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
pixmapButton * arp_random_btn = new pixmapButton( m_arpGroupBox, NULL,
eng(), NULL );
NULL );
arp_random_btn->move( 70, 74 );
arp_random_btn->setActiveGraphic( embed::getIconPixmap(
"arp_random_on" ) );
@@ -384,7 +384,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
m_arpDirectionBtnGrp = new automatableButtonGroup( this,
tr( "Arpeggio direction" ),
eng(), _instrument_track );
_instrument_track );
m_arpDirectionBtnGrp->addButton( arp_up_btn );
m_arpDirectionBtnGrp->addButton( arp_down_btn );
m_arpDirectionBtnGrp->addButton( arp_up_and_down_btn );
@@ -398,7 +398,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( instrumentTrack * _instrument_trac
mode_lbl->setFont( pointSize<7>( mode_lbl->font() ) );
m_arpModeComboBox = new comboBox( m_arpGroupBox, tr( "Arpeggio mode" ),
eng(), _instrument_track );
_instrument_track );
m_arpModeComboBox->setFont( pointSize<8>( m_arpModeComboBox->font() ) );
m_arpModeComboBox->setGeometry( 10, 118, 128, 22 );
@@ -461,14 +461,14 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
break;
}
// create copy of base-note
note note_copy( NULL, _n->length(), 0,
note note_copy( _n->length(), 0,
(tones)( sub_note_key %
NOTES_PER_OCTAVE ),
(octaves)( sub_note_key /
NOTES_PER_OCTAVE ),
_n->getVolume(),
_n->getPanning() );
note_copy.setDetuning( _n->detuning() );
_n->getPanning(),
_n->detuning() );
// duplicate note-play-handle, only note is
// different
notePlayHandle * note_play_handle =
@@ -524,7 +524,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
// number of frames that every note should be played
const f_cnt_t arp_frames = (f_cnt_t)( m_arpTimeKnob->value() / 1000.0f *
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
const f_cnt_t gated_frames = (f_cnt_t)( m_arpGateKnob->value() *
arp_frames / 100.0f );
@@ -537,13 +537,13 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
// used for loop
f_cnt_t frames_processed = 0;
while( frames_processed < eng()->getMixer()->framesPerAudioBuffer() )
while( frames_processed < engine::getMixer()->framesPerAudioBuffer() )
{
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 >
eng()->getMixer()->framesPerAudioBuffer() )
engine::getMixer()->framesPerAudioBuffer() )
{
// then we don't have to do something!
break;
@@ -609,7 +609,8 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
// range-checking
if( sub_note_key >= NOTES_PER_OCTAVE * OCTAVES ||
sub_note_key < 0 || eng()->getMixer()->criticalXRuns() )
sub_note_key < 0 ||
engine::getMixer()->criticalXRuns() )
{
continue;
}
@@ -621,15 +622,14 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
}
// create new arp-note
note new_note( NULL, midiTime( 0 ), midiTime( 0 ),
note new_note( midiTime( 0 ), midiTime( 0 ),
static_cast<tones>( sub_note_key %
NOTES_PER_OCTAVE ),
static_cast<octaves>( sub_note_key /
NOTES_PER_OCTAVE ),
static_cast<volume>( _n->getVolume() *
vol_level ),
_n->getPanning() );
new_note.setDetuning( _n->detuning() );
_n->getPanning(), _n->detuning() );
// duplicate note-play-handle, only ptr to note is different
// and is_arp_note=TRUE

View File

@@ -85,9 +85,8 @@ QPixmap * automationEditor::s_toolSelect = NULL;
QPixmap * automationEditor::s_toolMove = NULL;
automationEditor::automationEditor( engine * _engine ) :
QWidget( _engine->getMainWindow()->workspace() ),
journallingObject( _engine ),
automationEditor::automationEditor( void ) :
QWidget( engine::getMainWindow()->workspace() ),
m_paintPixmap(),
m_pattern( NULL ),
m_min_level( 0 ),
@@ -129,14 +128,14 @@ automationEditor::automationEditor( engine * _engine ) :
#ifdef QT4
// add us to workspace
eng()->getMainWindow()->workspace()->addWindow( this );
engine::getMainWindow()->workspace()->addWindow( this );
#endif
// add time-line
m_timeLine = new timeLine( VALUES_WIDTH, 32, m_ppt,
eng()->getSongEditor()->getPlayPos(
engine::getSongEditor()->getPlayPos(
songEditor::PLAY_AUTOMATION_PATTERN ),
m_currentPosition, this, eng() );
m_currentPosition, this );
connect( this, SIGNAL( positionChanged( const midiTime & ) ),
m_timeLine, SLOT( updatePosition( const midiTime & ) ) );
connect( m_timeLine, SIGNAL( positionChanged( const midiTime & ) ),
@@ -321,7 +320,7 @@ automationEditor::automationEditor( engine * _engine ) :
QLabel * zoom_x_lbl = new QLabel( m_toolBar );
zoom_x_lbl->setPixmap( embed::getIconPixmap( "zoom_x" ) );
m_zoomingXComboBox = new comboBox( m_toolBar, NULL, eng(), NULL );
m_zoomingXComboBox = new comboBox( m_toolBar, NULL, NULL );
m_zoomingXComboBox->setFixedSize( 80, 22 );
for( int i = 0; i < 6; ++i )
{
@@ -335,7 +334,7 @@ automationEditor::automationEditor( engine * _engine ) :
QLabel * zoom_y_lbl = new QLabel( m_toolBar );
zoom_y_lbl->setPixmap( embed::getIconPixmap( "zoom_y" ) );
m_zoomingYComboBox = new comboBox( m_toolBar, NULL, eng(), NULL );
m_zoomingYComboBox = new comboBox( m_toolBar, NULL, NULL );
m_zoomingYComboBox->setFixedSize( 80, 22 );
m_zoomingYComboBox->addItem( "Auto" );
for( int i = 0; i < 6; ++i )
@@ -351,7 +350,7 @@ automationEditor::automationEditor( engine * _engine ) :
QLabel * quantize_lbl = new QLabel( m_toolBar );
quantize_lbl->setPixmap( embed::getIconPixmap( "quantize" ) );
m_quantizeComboBox = new comboBox( m_toolBar, NULL, eng(), NULL );
m_quantizeComboBox = new comboBox( m_toolBar, NULL, NULL );
m_quantizeComboBox->setFixedSize( 60, 22 );
for( int i = 0; i < 7; ++i )
{
@@ -737,7 +736,7 @@ void automationEditor::updatePaintPixmap( void )
is_selected = TRUE;
}
}
else if( level > sel_level_start &&
else if( level >= sel_level_start &&
level <= sel_level_end &&
pos_tact_64th >= sel_pos_start &&
pos_tact_64th + len_tact_64th <=
@@ -975,7 +974,7 @@ void automationEditor::keyPressEvent( QKeyEvent * _ke )
break;
case Qt::Key_Space:
if( eng()->getSongEditor()->playing() )
if( engine::getSongEditor()->playing() )
{
stop();
}
@@ -1095,7 +1094,7 @@ void automationEditor::mousePressEvent( QMouseEvent * _me )
QCursor c( Qt::SizeAllCursor );
QApplication::setOverrideCursor( c );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
else if( ( _me->button() == Qt::RightButton &&
m_editMode == DRAW ) ||
@@ -1106,7 +1105,7 @@ void automationEditor::mousePressEvent( QMouseEvent * _me )
if( it != time_map.end() )
{
m_pattern->removeValue( -it.key() );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
}
else if( _me->button() == Qt::LeftButton &&
@@ -1140,7 +1139,7 @@ void automationEditor::mousePressEvent( QMouseEvent * _me )
m_action = MOVE_SELECTION;
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
else if( _me->button() == Qt::RightButton &&
m_editMode == MOVE )
@@ -1222,7 +1221,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
level );
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
else if(
@@ -1658,9 +1657,9 @@ void automationEditor::resizeEvent( QResizeEvent * )
m_topBottomScroll->setValue( m_scroll_level );
if( eng()->getSongEditor() )
if( engine::getSongEditor() )
{
eng()->getSongEditor()->getPlayPos(
engine::getSongEditor()->getPlayPos(
songEditor::PLAY_AUTOMATION_PATTERN
).m_timeLine->setFixedWidth( width() );
}
@@ -1676,7 +1675,7 @@ void automationEditor::resizeEvent( QResizeEvent * )
void automationEditor::wheelEvent( QWheelEvent * _we )
{
_we->accept();
if( eng()->getMainWindow()->isCtrlPressed() == TRUE )
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
{
if( _we->delta() > 0 )
{
@@ -1696,7 +1695,7 @@ void automationEditor::wheelEvent( QWheelEvent * _we )
m_timeLine->setPixelsPerTact( m_ppt );
update();
}
else if( eng()->getMainWindow()->isShiftPressed() )
else if( engine::getMainWindow()->isShiftPressed() )
{
m_leftRightScroll->setValue( m_leftRightScroll->value() -
_we->delta() * 2 / 15 );
@@ -1745,23 +1744,23 @@ void automationEditor::play( void )
if( !m_pattern->getTrack() )
{
if( eng()->getSongEditor()->playMode() !=
if( engine::getSongEditor()->playMode() !=
songEditor::PLAY_PATTERN )
{
eng()->getSongEditor()->stop();
eng()->getSongEditor()->playPattern( (pattern *)
eng()->getPianoRoll()->currentPattern() );
engine::getSongEditor()->stop();
engine::getSongEditor()->playPattern( (pattern *)
engine::getPianoRoll()->currentPattern() );
m_playButton->setIcon( embed::getIconPixmap(
"pause" ) );
}
else if( eng()->getSongEditor()->playing() )
else if( engine::getSongEditor()->playing() )
{
eng()->getSongEditor()->pause();
engine::getSongEditor()->pause();
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
}
else if( eng()->getSongEditor()->paused() )
else if( engine::getSongEditor()->paused() )
{
eng()->getSongEditor()->resumeFromPause();
engine::getSongEditor()->resumeFromPause();
m_playButton->setIcon( embed::getIconPixmap(
"pause" ) );
}
@@ -1769,13 +1768,13 @@ void automationEditor::play( void )
{
m_playButton->setIcon( embed::getIconPixmap(
"pause" ) );
eng()->getSongEditor()->playPattern( (pattern *)
eng()->getPianoRoll()->currentPattern() );
engine::getSongEditor()->playPattern( (pattern *)
engine::getPianoRoll()->currentPattern() );
}
}
else if( inBBEditor() )
{
if( eng()->getSongEditor()->playing() )
if( engine::getSongEditor()->playing() )
{
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
}
@@ -1784,18 +1783,18 @@ void automationEditor::play( void )
m_playButton->setIcon( embed::getIconPixmap(
"pause" ) );
}
eng()->getBBEditor()->play();
engine::getBBEditor()->play();
}
else
{
if( eng()->getSongEditor()->playing() )
if( engine::getSongEditor()->playing() )
{
eng()->getSongEditor()->pause();
engine::getSongEditor()->pause();
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
}
else if( eng()->getSongEditor()->paused() )
else if( engine::getSongEditor()->paused() )
{
eng()->getSongEditor()->resumeFromPause();
engine::getSongEditor()->resumeFromPause();
m_playButton->setIcon( embed::getIconPixmap(
"pause" ) );
}
@@ -1803,7 +1802,7 @@ void automationEditor::play( void )
{
m_playButton->setIcon( embed::getIconPixmap(
"pause" ) );
eng()->getSongEditor()->play();
engine::getSongEditor()->play();
}
}
}
@@ -1819,11 +1818,11 @@ void automationEditor::stop( void )
}
if( m_pattern->getTrack() && inBBEditor() )
{
eng()->getBBEditor()->stop();
engine::getBBEditor()->stop();
}
else
{
eng()->getSongEditor()->stop();
engine::getSongEditor()->stop();
}
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
m_playButton->update();
@@ -1979,9 +1978,9 @@ void automationEditor::getSelectedValues( timeMap & _selected_values )
#endif
Sint32 pos_tact_64th = -it.key();
if( level > sel_level_start && level <= sel_level_end &&
if( level >= sel_level_start && level <= sel_level_end &&
pos_tact_64th >= sel_pos_start &&
pos_tact_64th+len_tact_64th <= sel_pos_end )
pos_tact_64th + len_tact_64th <= sel_pos_end )
{
_selected_values[it.key()] = level;
}
@@ -2033,7 +2032,7 @@ void automationEditor::cutSelectedValues( void )
if( !selected_values.isEmpty() )
{
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
for( timeMap::iterator it = selected_values.begin();
it != selected_values.end(); ++it )
@@ -2048,7 +2047,7 @@ void automationEditor::cutSelectedValues( void )
}
update();
eng()->getSongEditor()->update();
engine::getSongEditor()->update();
}
@@ -2076,9 +2075,9 @@ void automationEditor::pasteValues( void )
// we only have to do the following lines if we pasted at
// least one value...
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
update();
eng()->getSongEditor()->update();
engine::getSongEditor()->update();
}
}
@@ -2105,9 +2104,9 @@ void automationEditor::deleteSelectedValues( void )
if( update_after_delete == TRUE )
{
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
update();
eng()->getSongEditor()->update();
engine::getSongEditor()->update();
}
}
@@ -2116,8 +2115,8 @@ void automationEditor::deleteSelectedValues( void )
void automationEditor::updatePosition( const midiTime & _t )
{
if( ( eng()->getSongEditor()->playing() &&
eng()->getSongEditor()->playMode() ==
if( ( engine::getSongEditor()->playing() &&
engine::getSongEditor()->playMode() ==
songEditor::PLAY_AUTOMATION_PATTERN ) ||
m_scrollBack == TRUE )
{
@@ -2228,7 +2227,7 @@ void automationEditor::updateTopBottomLevels( void )
inline bool automationEditor::inBBEditor( void )
{
return( m_pattern->getTrack()->getTrackContainer()
== eng()->getBBEditor() );
== engine::getBBEditor() );
}
@@ -2240,7 +2239,7 @@ void automationEditor::update( void )
// Note detuning?
if( m_pattern && !m_pattern->getTrack() )
{
eng()->getPianoRoll()->update();
engine::getPianoRoll()->update();
}
}

View File

@@ -3,7 +3,7 @@
/*
* bb_editor.cpp - basic main-window for editing of beats and basslines
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -62,8 +62,7 @@ const int BBE_PPT = 192;
bbEditor::bbEditor( engine * _engine ) :
trackContainer( _engine )
bbEditor::bbEditor( void )
{
// create toolbar
m_toolBar = new QWidget( this );
@@ -91,7 +90,7 @@ bbEditor::bbEditor( engine * _engine ) :
DEFAULT_SCROLLBAR_SIZE );
QWidget * w = ( parentWidget() != NULL ) ? parentWidget() : this;
if( eng()->getMainWindow()->workspace() != NULL )
if( engine::getMainWindow()->workspace() != NULL )
{
resize( minimumWidth(), 300 );
w->move( 10, 340 );
@@ -117,7 +116,7 @@ bbEditor::bbEditor( engine * _engine ) :
toolButton * add_bb_track = new toolButton(
embed::getIconPixmap( "add_bb_track" ),
tr( "Add beat/bassline" ),
eng()->getSongEditor(), SLOT( addBBTrack() ),
engine::getSongEditor(), SLOT( addBBTrack() ),
m_toolBar );
@@ -140,7 +139,7 @@ bbEditor::bbEditor( engine * _engine ) :
QLabel * l = new QLabel( m_toolBar );
l->setPixmap( embed::getIconPixmap( "drum" ) );
m_bbComboBox = new comboBox( m_toolBar, NULL, eng(), NULL );
m_bbComboBox = new comboBox( m_toolBar, NULL, NULL );
m_bbComboBox->setFixedSize( 200, 22 );
connect( m_bbComboBox, SIGNAL( valueChanged( int ) ),
this, SLOT( setCurrentBB( int ) ) );
@@ -193,7 +192,7 @@ void bbEditor::setCurrentBB( int _bb )
// the others green)
for( csize i = 0; i < numOfBBs(); ++i )
{
bbTrack::findBBTrack( i, eng() )->trackLabel()->update();
bbTrack::findBBTrack( i )->trackLabel()->update();
}
emit positionChanged( m_currentPosition = midiTime(
@@ -257,7 +256,7 @@ bool FASTCALL bbEditor::play( midiTime _start, fpab_t _frames,
csize bbEditor::numOfBBs( void ) const
{
return( eng()->getSongEditor()->countTracks( track::BB_TRACK ) );
return( engine::getSongEditor()->countTracks( track::BB_TRACK ) );
}
@@ -281,7 +280,7 @@ void bbEditor::removeBB( csize _bb )
void bbEditor::updateBBTrack( trackContentObject * _tco )
{
bbTrack * t = bbTrack::findBBTrack( _tco->startPosition() / 64, eng() );
bbTrack * t = bbTrack::findBBTrack( _tco->startPosition() / 64 );
if( t != NULL )
{
t->getTrackContentWidget()->updateTCOs();
@@ -302,7 +301,7 @@ void bbEditor::updateComboBox( void )
for( csize i = 0; i < numOfBBs(); ++i )
{
bbTrack * bbt = bbTrack::findBBTrack( i, eng() );
bbTrack * bbt = bbTrack::findBBTrack( i );
m_bbComboBox->addItem( bbt->trackLabel()->text(),
bbt->trackLabel()->pixmap() );
}
@@ -330,7 +329,7 @@ void bbEditor::keyPressEvent( QKeyEvent * _ke )
{
if ( _ke->key() == Qt::Key_Space )
{
if( eng()->getSongEditor()->playing() )
if( engine::getSongEditor()->playing() )
{
stop();
}
@@ -388,31 +387,31 @@ QRect bbEditor::scrollAreaRect( void ) const
void bbEditor::play( void )
{
if( eng()->getSongEditor()->playing() )
if( engine::getSongEditor()->playing() )
{
if( eng()->getSongEditor()->playMode() != songEditor::PLAY_BB )
if( engine::getSongEditor()->playMode() != songEditor::PLAY_BB )
{
eng()->getSongEditor()->stop();
eng()->getSongEditor()->playBB();
engine::getSongEditor()->stop();
engine::getSongEditor()->playBB();
m_playButton->setIcon( embed::getIconPixmap(
"pause" ) );
}
else
{
eng()->getSongEditor()->pause();
engine::getSongEditor()->pause();
m_playButton->setIcon( embed::getIconPixmap(
"play" ) );
}
}
else if( eng()->getSongEditor()->paused() )
else if( engine::getSongEditor()->paused() )
{
eng()->getSongEditor()->resumeFromPause();
engine::getSongEditor()->resumeFromPause();
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
}
else
{
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
eng()->getSongEditor()->playBB();
engine::getSongEditor()->playBB();
}
}
@@ -422,7 +421,7 @@ void bbEditor::play( void )
void bbEditor::stop( void )
{
eng()->getSongEditor()->stop();
engine::getSongEditor()->stop();
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
m_playButton->update();
}

View File

@@ -3,8 +3,8 @@
/*
* effect.cpp - base-class for effects
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -37,12 +37,14 @@
#include "effect.h"
#include "engine.h"
#include "dummy_effect.h"
effect::effect( const plugin::descriptor * _desc, constructionData * _cdata ) :
plugin( _desc, _cdata->eng ),
m_key( _cdata->key ),
effect::effect( const plugin::descriptor * _desc,
const descriptor::subPluginFeatures::key * _key ) :
plugin( _desc ),
m_key( *_key ),
m_okay( TRUE ),
m_noRun( FALSE ),
m_running( FALSE ),
@@ -77,15 +79,15 @@ void FASTCALL effect::setGate( float _level )
{
m_processLock.lock();
m_gate = _level * _level * m_processors *
eng()->getMixer()->framesPerAudioBuffer();
engine::getMixer()->framesPerAudioBuffer();
m_processLock.unlock();
}
effect * effect::instantiate( const QString & _plugin_name,
constructionData & _cdata )
descriptor::subPluginFeatures::key * _key )
{
plugin * p = plugin::instantiate( _plugin_name, &_cdata );
plugin * p = plugin::instantiate( _plugin_name, _key );
// check whether instantiated plugin is an instrument
if( dynamic_cast<effect *>( p ) != NULL )
{

View File

@@ -3,7 +3,7 @@
/*
* effect_chain.cpp - class for processing and effects chain
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -27,8 +27,7 @@
#include "effect_chain.h"
effectChain::effectChain( engine * _engine ):
engineObject( _engine ),
effectChain::effectChain( void ) :
m_bypassed( TRUE )
{
}

View File

@@ -4,7 +4,7 @@
* effect_control_dialog.cpp - base-class for effect-dialogs for displaying
* and editing control port values
*
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -48,7 +48,6 @@ effectControlDialog::effectControlDialog( QWidget * _parent, effect * _eff ) :
, "effectControlDialog"
#endif
),
journallingObject( _eff->eng() ),
m_effect( _eff )
{
setWindowTitle( m_effect->publicName() );

View File

@@ -47,9 +47,8 @@
#include "embed.h"
effectSelectDialog::effectSelectDialog( QWidget * _parent, engine * _engine ) :
QDialog( _parent ),
engineObject( _engine )
effectSelectDialog::effectSelectDialog( QWidget * _parent ) :
QDialog( _parent )
{
setWindowIcon( embed::getIconPixmap( "setup_audio" ) );
setWindowTitle( tr( "Effects Selector" ) );
@@ -59,7 +58,7 @@ effectSelectDialog::effectSelectDialog( QWidget * _parent, engine * _engine ) :
vlayout->setSpacing( 10 );
vlayout->setMargin( 10 );
effectList * elist = new effectList( this, eng() );
effectList * elist = new effectList( this );
elist->setMinimumSize( 500, 400 );
connect( elist, SIGNAL( doubleClicked( const effectKey & ) ),
this, SLOT( selectPlugin() ) );
@@ -123,13 +122,8 @@ effect * effectSelectDialog::instantiateSelectedPlugin( void )
{
if( !m_currentSelection.name.isEmpty() && m_currentSelection.desc )
{
effect::constructionData cd =
{
eng(),
m_currentSelection
} ;
return( effect::instantiate( m_currentSelection.desc->name,
cd ) );
&m_currentSelection ) );
}
return( NULL );
}
@@ -139,7 +133,7 @@ effect * effectSelectDialog::instantiateSelectedPlugin( void )
void effectSelectDialog::showPorts( void )
{
/* ladspaPortDialog ports( m_currentSelection, eng() );
/* ladspaPortDialog ports( m_currentSelection );
ports.exec();*/
}
@@ -165,9 +159,8 @@ void effectSelectDialog::selectPlugin( void )
effectList::effectList( QWidget * _parent, engine * _engine ) :
QWidget( _parent ),
engineObject( _engine )
effectList::effectList( QWidget * _parent ) :
QWidget( _parent )
{
plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
@@ -181,7 +174,7 @@ effectList::effectList( QWidget * _parent, engine * _engine ) :
}
if( it->sub_plugin_features )
{
it->sub_plugin_features->listSubPluginKeys( eng(),
it->sub_plugin_features->listSubPluginKeys(
// as iterators are always stated to be not
// equal with pointers, we dereference the
// iterator and take the address of the item,
@@ -267,7 +260,7 @@ void effectList::onHighlighted( int _pluginIndex )
{
m_currentSelection.desc->sub_plugin_features->
fillDescriptionWidget( m_descriptionWidget,
eng(), m_currentSelection );
&m_currentSelection );
m_descriptionWidget->show();
}
emit( highlighted( m_currentSelection ) );

View File

@@ -4,7 +4,7 @@
* effect_tab_widget.cpp - tab-widget in channel-track-window for setting up
* effects
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -59,7 +59,6 @@
effectTabWidget::effectTabWidget( instrumentTrack * _track,
audioPort * _port ) :
QWidget( _track->tabWidgetParent() ),
journallingObject( _track->eng() ),
m_track( dynamic_cast<track *>( _track ) ),
m_port( _port )
{
@@ -73,7 +72,6 @@ effectTabWidget::effectTabWidget( QWidget * _parent,
sampleTrack * _track,
audioPort * _port ) :
QWidget( _parent ),
journallingObject( _track->eng() ),
m_track( dynamic_cast<track *>( _track ) ),
m_port( _port )
{
@@ -92,13 +90,13 @@ effectTabWidget::~effectTabWidget()
void effectTabWidget::setupWidget( void )
{
m_effectsGroupBox = new groupBox( tr( "EFFECTS CHAIN" ),
this, eng(), m_track );
m_effectsGroupBox = new groupBox( tr( "EFFECTS CHAIN" ), this,
m_track );
connect( m_effectsGroupBox, SIGNAL( toggled( bool ) ),
this, SLOT( setBypass( bool ) ) );
m_effectsGroupBox->setGeometry( 2, 2, 242, 244 );
m_rack = new rackView( m_effectsGroupBox, eng(), m_track, m_port );
m_rack = new rackView( m_effectsGroupBox, m_track, m_port );
m_rack->move( 6, 22 );
m_addButton = new QPushButton( m_effectsGroupBox/*, "Add Effect"*/ );
@@ -145,7 +143,7 @@ void effectTabWidget::loadSettings( const QDomElement & _this )
void effectTabWidget::addEffect( void )
{
effectSelectDialog esd( this, eng() );
effectSelectDialog esd( this );
esd.exec();
if( esd.result() == QDialog::Rejected )

View File

@@ -42,75 +42,80 @@
#endif
engine::engine( const bool _has_gui ) :
m_hasGUI( _has_gui ),
m_mixer( NULL ),
m_mainWindow( NULL ),
m_songEditor( NULL ),
m_automationEditor( NULL ),
m_bbEditor( NULL ),
m_pianoRoll( NULL ),
m_projectJournal( NULL )
bool engine::s_hasGUI = TRUE;
float engine::s_frames_per_tact64th;
mixer * engine::s_mixer;
mainWindow * engine::s_mainWindow;
songEditor * engine::s_songEditor;
automationEditor * engine::s_automationEditor;
bbEditor * engine::s_bbEditor;
pianoRoll * engine::s_pianoRoll;
projectNotes * engine::s_projectNotes;
projectJournal * engine::s_projectJournal;
#ifdef LADSPA_SUPPORT
ladspa2LMMS * engine::s_ladspaManager;
#endif
QMap<QString, QString> engine::s_sample_extensions;
void engine::init( const bool _has_gui )
{
s_hasGUI = _has_gui;
load_extensions();
m_projectJournal = new projectJournal( this );
m_mainWindow = new mainWindow( this );
m_mixer = new mixer( this );
m_songEditor = new songEditor( this );
m_projectNotes = new projectNotes( this );
m_bbEditor = new bbEditor( this );
m_pianoRoll = new pianoRoll( this );
m_automationEditor = new automationEditor( this );
s_projectJournal = new projectJournal;
s_mainWindow = new mainWindow;
s_mixer = new mixer;
s_songEditor = new songEditor;
s_projectNotes = new projectNotes;
s_bbEditor = new bbEditor;
s_pianoRoll = new pianoRoll;
s_automationEditor = new automationEditor;
#ifdef LADSPA_SUPPORT
m_ladspaManager = new ladspa2LMMS( this );
s_ladspaManager = new ladspa2LMMS;
#endif
m_mixer->initDevices();
s_mixer->initDevices();
m_mainWindow->finalize();
s_mainWindow->finalize();
m_mixer->startProcessing();
s_mixer->startProcessing();
}
engine::~engine()
void engine::destroy( void )
{
}
s_mixer->stopProcessing();
delete s_projectNotes;
s_projectNotes = NULL;
delete s_songEditor;
s_songEditor = NULL;
delete s_bbEditor;
s_bbEditor = NULL;
delete s_pianoRoll;
s_pianoRoll = NULL;
delete s_automationEditor;
s_automationEditor = NULL;
void engine::close( void )
{
m_mixer->stopProcessing();
delete m_projectNotes;
m_projectNotes = NULL;
delete m_songEditor;
m_songEditor = NULL;
delete m_bbEditor;
m_bbEditor = NULL;
delete m_pianoRoll;
m_pianoRoll = NULL;
delete m_automationEditor;
m_automationEditor = NULL;
presetPreviewPlayHandle::cleanUp( this );
presetPreviewPlayHandle::cleanUp();
// now we can clean up all allocated buffer
//bufferAllocator::cleanUp( 0 );
delete m_mixer;
m_mixer = NULL;
delete s_mixer;
s_mixer = NULL;
//delete configManager::inst();
delete m_projectJournal;
m_projectJournal = NULL;
m_mainWindow = NULL;
delete s_projectJournal;
s_projectJournal = NULL;
s_mainWindow = NULL;
}
@@ -118,8 +123,8 @@ void engine::close( void )
void engine::updateFramesPerTact64th( void )
{
m_frames_per_tact64th = m_mixer->sampleRate() * 60.0f * BEATS_PER_TACT
/ 64.0f / m_songEditor->getTempo();
s_frames_per_tact64th = s_mixer->sampleRate() * 60.0f * BEATS_PER_TACT
/ 64.0f / s_songEditor->getTempo();
}
@@ -144,7 +149,7 @@ void engine::load_extensions( void )
ext.begin();
itExt != ext.end(); ++itExt )
{
m_sample_extensions[*itExt] = it->name;
s_sample_extensions[*itExt] = it->name;
}
}
}
@@ -154,18 +159,4 @@ void engine::load_extensions( void )
engineObject::engineObject( engine * _engine ) :
m_engine( _engine )
{
}
engineObject::~engineObject()
{
}
#endif

View File

@@ -4,7 +4,7 @@
* envelope_and_lfo_widget.cpp - widget which is m_used by envelope/lfo/filter-
* tab of channel-window
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -100,17 +100,14 @@ const int LFO_SHAPES_Y = LFO_GRAPH_Y + 50;
QPixmap * envelopeAndLFOWidget::s_envGraph = NULL;
QPixmap * envelopeAndLFOWidget::s_lfoGraph = NULL;
QMap<engine *, vvector<envelopeAndLFOWidget *> >
envelopeAndLFOWidget::s_EaLWidgets;
vvector<envelopeAndLFOWidget *> envelopeAndLFOWidget::s_EaLWidgets;
envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
QWidget * _parent,
engine * _engine,
track * _track ) :
QWidget( _parent ),
journallingObject( _engine ),
#ifdef QT4
specialBgHandlingWidget( palette().color( backgroundRole() ) ),
#else
@@ -123,7 +120,6 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
m_lfoFrame( 0 ),
m_lfoAmountIsZero( FALSE ),
m_lfoShapeData( NULL ),
m_userWave( eng() ),
m_lfoShape( SIN ),
m_busyMutex(
#ifdef QT3
@@ -143,11 +139,11 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
s_lfoGraph = new QPixmap( embed::getIconPixmap( "lfo_graph" ) );
}
s_EaLWidgets[eng()].push_back( this );
s_EaLWidgets.push_back( this );
m_predelayKnob = new knob( knobBright_26, this, tr( "Predelay-time" ),
eng(), _track );
_track );
m_predelayKnob->setLabel( tr( "DEL" ) );
m_predelayKnob->setRange( 0.0, 1.0, 0.001 );
m_predelayKnob->setInitValue( 0.0 );
@@ -165,7 +161,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
SLOT( updateAfterKnobChange( float ) ) );
m_attackKnob = new knob( knobBright_26, this, tr( "Attack-time" ),
eng(), _track );
_track );
m_attackKnob->setLabel( tr( "ATT" ) );
m_attackKnob->setRange( 0.0, 1.0, 0.001 );
m_attackKnob->setInitValue( 0.0 );
@@ -184,8 +180,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
connect( m_attackKnob, SIGNAL( valueChanged( float ) ), this,
SLOT( updateAfterKnobChange( float ) ) );
m_holdKnob = new knob( knobBright_26, this, tr( "Hold-time" ),
eng(), _track );
m_holdKnob = new knob( knobBright_26, this, tr( "Hold-time" ), _track );
m_holdKnob->setLabel( tr( "HOLD" ) );
m_holdKnob->setRange( 0.0, 1.0, 0.001 );
m_holdKnob->setInitValue( 0.5 );
@@ -204,7 +199,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
SLOT( updateAfterKnobChange( float ) ) );
m_decayKnob = new knob( knobBright_26, this, tr( "Decay-time" ),
eng(), _track );
_track );
m_decayKnob->setLabel( tr( "DEC" ) );
m_decayKnob->setRange( 0.0, 1.0, 0.001 );
m_decayKnob->setInitValue( 0.5 );
@@ -224,7 +219,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
SLOT( updateAfterKnobChange( float ) ) );
m_sustainKnob = new knob( knobBright_26, this, tr( "Sustain-level" ),
eng(), _track );
_track );
m_sustainKnob->setLabel( tr( "SUST" ) );
m_sustainKnob->setRange( 0.0, 1.0, 0.001 );
m_sustainKnob->setInitValue( 0.5 );
@@ -243,7 +238,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
SLOT( updateAfterKnobChange( float ) ) );
m_releaseKnob = new knob( knobBright_26, this, tr( "Release-time" ),
eng(), _track );
_track );
m_releaseKnob->setLabel( tr( "REL" ) );
m_releaseKnob->setRange( 0.0, 1.0, 0.001 );
m_releaseKnob->setInitValue( 0.1 );
@@ -264,7 +259,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
m_amountKnob = new knob( knobBright_26, this,
tr( "Modulation amount" ),
eng(), _track );
_track );
m_amountKnob->setLabel( tr( "AMT" ) );
m_amountKnob->setRange( -1.0, 1.0, 0.005 );
m_amountKnob->setInitValue( 0.0 );
@@ -286,7 +281,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
m_lfoPredelayKnob = new knob( knobBright_26, this,
tr( "LFO-predelay-time" ),
eng(), _track );
_track );
m_lfoPredelayKnob->setLabel( tr( "DEL" ) );
m_lfoPredelayKnob->setRange( 0.0, 1.0, 0.001 );
m_lfoPredelayKnob->setInitValue( 0.0 );
@@ -305,7 +300,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
m_lfoAttackKnob = new knob( knobBright_26, this,
tr( "LFO-attack-time" ),
eng(), _track );
_track );
m_lfoAttackKnob->setLabel( tr( "ATT" ) );
m_lfoAttackKnob->setRange( 0.0, 1.0, 0.001 );
m_lfoAttackKnob->setInitValue( 0.0 );
@@ -323,8 +318,8 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
SLOT( updateAfterKnobChange( float ) ) );
m_lfoSpeedKnob = new tempoSyncKnob( knobBright_26, this,
tr( "LFO-speed" ),
eng(), _track, 20000.0 );
tr( "LFO-speed" ),
_track, 20000.0 );
m_lfoSpeedKnob->setLabel( tr( "SPD" ) );
m_lfoSpeedKnob->setRange( 0.01, 1.0, 0.0001 );
m_lfoSpeedKnob->setInitValue( 0.1 );
@@ -343,7 +338,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
m_lfoAmountKnob = new knob( knobBright_26, this,
tr( "LFO-modulation-amount" ),
eng(), _track );
_track );
m_lfoAmountKnob->setLabel( tr( "AMT" ) );
m_lfoAmountKnob->setRange( -1.0, 1.0, 0.005 );
m_lfoAmountKnob->setInitValue( 0.0 );
@@ -362,8 +357,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
SLOT( updateAfterKnobChange( float ) ) );
pixmapButton * sin_lfo_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * sin_lfo_btn = new pixmapButton( this, NULL, NULL );
sin_lfo_btn->move( LFO_SHAPES_X, LFO_SHAPES_Y );
sin_lfo_btn->setActiveGraphic( embed::getIconPixmap(
"sin_wave_active" ) );
@@ -377,8 +371,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
tr( "Click here if you want a sine-wave for current "
"oscillator." ) );
pixmapButton * triangle_lfo_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * triangle_lfo_btn = new pixmapButton( this, NULL, NULL );
triangle_lfo_btn->move( LFO_SHAPES_X+15, LFO_SHAPES_Y );
triangle_lfo_btn->setActiveGraphic( embed::getIconPixmap(
"triangle_wave_active" ) );
@@ -392,8 +385,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
tr( "Click here if you want a triangle-wave for current "
"oscillator." ) );
pixmapButton * saw_lfo_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * saw_lfo_btn = new pixmapButton( this, NULL, NULL );
saw_lfo_btn->move( LFO_SHAPES_X+30, LFO_SHAPES_Y );
saw_lfo_btn->setActiveGraphic( embed::getIconPixmap(
"saw_wave_active" ) );
@@ -407,8 +399,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
tr( "Click here if you want a saw-wave for current "
"oscillator." ) );
pixmapButton * sqr_lfo_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * sqr_lfo_btn = new pixmapButton( this, NULL, NULL );
sqr_lfo_btn->move( LFO_SHAPES_X+45, LFO_SHAPES_Y );
sqr_lfo_btn->setActiveGraphic( embed::getIconPixmap(
"square_wave_active" ) );
@@ -422,7 +413,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
tr( "Click here if you want a square-wave for current "
"oscillator." ) );
m_userLfoBtn = new pixmapButton( this, NULL, eng(), NULL );
m_userLfoBtn = new pixmapButton( this, NULL, NULL );
m_userLfoBtn->move( LFO_SHAPES_X+60, LFO_SHAPES_Y );
m_userLfoBtn->setActiveGraphic( embed::getIconPixmap(
"usr_wave_active" ) );
@@ -442,7 +433,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
m_lfoWaveBtnGrp = new automatableButtonGroup( this,
tr( "LFO wave shape" ),
eng(), _track );
_track );
m_lfoWaveBtnGrp->addButton( sin_lfo_btn );
m_lfoWaveBtnGrp->addButton( triangle_lfo_btn );
m_lfoWaveBtnGrp->addButton( saw_lfo_btn );
@@ -454,7 +445,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
SLOT( lfoWaveCh( int ) ) );
m_x100Cb = new ledCheckBox( tr( "FREQ x 100" ), this,
tr( "Freq x 100" ), eng(), _track );
tr( "Freq x 100" ), _track );
m_x100Cb->setFont( pointSize<6>( m_x100Cb->font() ) );
m_x100Cb->move( LFO_PREDELAY_KNOB_X, LFO_GRAPH_Y + 36 );
#ifdef QT4
@@ -471,7 +462,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
m_controlEnvAmountCb = new ledCheckBox( tr( "MODULATE ENV-AMOUNT" ),
this, tr( "Modulate Env-Amount" ),
eng(), _track );
_track );
m_controlEnvAmountCb->move( LFO_PREDELAY_KNOB_X, LFO_GRAPH_Y + 54 );
m_controlEnvAmountCb->setFont( pointSize<6>(
m_controlEnvAmountCb->font() ) );
@@ -492,11 +483,11 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
#endif
setAcceptDrops( TRUE );
connect( eng()->getMixer(), SIGNAL( sampleRateChanged() ), this,
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ), this,
SLOT( updateSampleVars() ) );
m_lfoShapeData =
new sample_t[eng()->getMixer()->framesPerAudioBuffer()];
new sample_t[engine::getMixer()->framesPerAudioBuffer()];
updateSampleVars();
}
@@ -509,7 +500,7 @@ envelopeAndLFOWidget::~envelopeAndLFOWidget()
delete[] m_rEnv;
delete[] m_lfoShapeData;
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets[eng()];
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets;
if( qFind( v.begin(), v.end(), this ) != v.end() )
{
v.erase( qFind( v.begin(), v.end(), this ) );
@@ -521,7 +512,7 @@ envelopeAndLFOWidget::~envelopeAndLFOWidget()
void envelopeAndLFOWidget::updateLFOShapeData( void )
{
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
m_userWave.lock();
for( fpab_t offset = 0; offset < frames; ++offset )
{
@@ -534,14 +525,14 @@ void envelopeAndLFOWidget::updateLFOShapeData( void )
void envelopeAndLFOWidget::triggerLFO( engine * _engine )
void envelopeAndLFOWidget::triggerLFO( void )
{
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets[_engine];
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets;
for( vvector<envelopeAndLFOWidget *>::iterator it = v.begin();
it != v.end(); ++it )
{
( *it )->m_lfoFrame +=
_engine->getMixer()->framesPerAudioBuffer();
engine::getMixer()->framesPerAudioBuffer();
( *it )->m_bad_lfoShapeData = TRUE;
}
}
@@ -549,9 +540,9 @@ void envelopeAndLFOWidget::triggerLFO( engine * _engine )
void envelopeAndLFOWidget::resetLFO( engine * _engine )
void envelopeAndLFOWidget::resetLFO( void )
{
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets[_engine];
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets;
for( vvector<envelopeAndLFOWidget *>::iterator it = v.begin();
it != v.end(); ++it )
{
@@ -859,7 +850,7 @@ void envelopeAndLFOWidget::paintEvent( QPaintEvent * )
int graph_y_base = LFO_GRAPH_Y + 3 + LFO_GRAPH_H / 2;
const float frames_for_graph = SECS_PER_LFO_OSCILLATION *
eng()->getMixer()->sampleRate() / 10;
engine::getMixer()->sampleRate() / 10;
const float lfo_gray_amount = 1.0f - fabsf( m_lfoAmountKnob->value() );
p.setPen( QPen( QColor( static_cast<int>( 96 * lfo_gray_amount ),
@@ -950,7 +941,7 @@ void envelopeAndLFOWidget::updateSampleVars( void )
m_busyMutex.lock();
const float frames_per_env_seg = SECS_PER_ENV_SEGMENT *
eng()->getMixer()->sampleRate();
engine::getMixer()->sampleRate();
const f_cnt_t predelay_frames = static_cast<f_cnt_t>(
frames_per_env_seg *
expKnobVal( m_predelayKnob->value() ) );
@@ -1036,7 +1027,7 @@ void envelopeAndLFOWidget::updateSampleVars( void )
const float frames_per_lfo_oscillation = SECS_PER_LFO_OSCILLATION *
eng()->getMixer()->sampleRate();
engine::getMixer()->sampleRate();
m_lfoPredelayFrames = static_cast<f_cnt_t>( frames_per_lfo_oscillation *
expKnobVal( m_lfoPredelayKnob->value() ) );
m_lfoAttackFrames = static_cast<f_cnt_t>( frames_per_lfo_oscillation *
@@ -1107,7 +1098,7 @@ inline sample_t envelopeAndLFOWidget::lfoShapeSample( fpab_t _frame_offset )
void envelopeAndLFOWidget::x100Toggled( bool )
{
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
updateSampleVars();
}
@@ -1144,7 +1135,7 @@ void envelopeAndLFOWidget::lfoUserWaveCh( bool _on )
}
m_lfoShape = USER;
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
updateSampleVars();
}

View File

@@ -4,7 +4,7 @@
* envelope_tab_widget.cpp - widget for use in envelope/lfo/filter-tab of
* instrument-track-window
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -84,7 +84,6 @@ static const QString targetNames[envelopeTabWidget::TARGET_COUNT][2] =
envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
QWidget( _instrument_track->tabWidgetParent() ),
journallingObject( _instrument_track->eng() ),
m_instrumentTrack( _instrument_track )
{
@@ -122,7 +121,6 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
m_envLFOWidgets[i] = new envelopeAndLFOWidget(
value_for_zero_amount,
m_targetsTabWidget,
eng(),
_instrument_track );
m_targetsTabWidget->addTab( m_envLFOWidgets[i],
tr( targetNames[i][0]
@@ -138,14 +136,14 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
}
m_filterGroupBox = new groupBox( tr( "FILTER" ), this, eng(),
m_filterGroupBox = new groupBox( tr( "FILTER" ), this,
_instrument_track );
m_filterGroupBox->setGeometry( FILTER_GROUPBOX_X, FILTER_GROUPBOX_Y,
FILTER_GROUPBOX_WIDTH,
FILTER_GROUPBOX_HEIGHT );
m_filterComboBox = new comboBox( m_filterGroupBox, tr( "Filter type" ),
eng(), _instrument_track );
_instrument_track );
m_filterComboBox->setGeometry( 14, 22, 120, 22 );
m_filterComboBox->setFont( pointSize<8>( m_filterComboBox->font() ) );
@@ -179,7 +177,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
m_filterCutKnob = new knob( knobBright_26, m_filterGroupBox,
tr( "cutoff-frequency" ),
eng(), _instrument_track );
_instrument_track );
m_filterCutKnob->setLabel( tr( "CUTOFF" ) );
m_filterCutKnob->setRange( 0.0, 14000.0, 1.0 );
m_filterCutKnob->move( 140, 18 );
@@ -199,8 +197,8 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
"frequencies below cutoff-frequency and so on..." ) );
m_filterResKnob = new knob( knobBright_26, m_filterGroupBox,
tr( "Q/Resonance" ),
eng(), _instrument_track );
tr( "Q/Resonance" ),
_instrument_track );
m_filterResKnob->setLabel( tr( "Q/RESO" ) );
m_filterResKnob->setRange( basicFilters<>::minQ(), 10.0, 0.01 );
m_filterResKnob->move( 190, 18 );
@@ -236,7 +234,7 @@ float FASTCALL envelopeTabWidget::volumeLevel( notePlayHandle * _n,
if( _n->released() == FALSE )
{
release_begin += eng()->getMixer()->framesPerAudioBuffer();
release_begin += engine::getMixer()->framesPerAudioBuffer();
}
float volume_level;
@@ -261,7 +259,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
if( _n->released() == FALSE )
{
release_begin += eng()->getMixer()->framesPerAudioBuffer();
release_begin += engine::getMixer()->framesPerAudioBuffer();
}
// because of optimizations, there's special code for several cases:
@@ -281,7 +279,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
if( _n->m_filter == NULL )
{
_n->m_filter = new basicFilters<>(
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
}
m_envLFOWidgets[VOLUME]->lock();

View File

@@ -3,7 +3,7 @@
/*
* export_project_dialog.cpp - implementation of dialog for exporting project
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -129,10 +129,8 @@ Sint16 exportProjectDialog::s_availableBitrates[] =
// TODO: rewrite that crap using layouts!!
exportProjectDialog::exportProjectDialog( const QString & _file_name,
QWidget * _parent,
engine * _engine ) :
QWidget * _parent ) :
QDialog( _parent ),
engineObject( _engine ),
m_fileName( _file_name ),
m_hourglassLbl( NULL ),
m_deleteFile( FALSE )
@@ -153,7 +151,7 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name,
m_typeLbl->setGeometry( LABEL_X, TYPE_STUFF_Y, LABEL_WIDTH,
TYPE_HEIGHT );
m_typeCombo = new comboBox( this, NULL, eng(), NULL );
m_typeCombo = new comboBox( this, NULL, NULL );
m_typeCombo->setGeometry( LABEL_X + LABEL_WIDTH+LABEL_MARGIN,
TYPE_STUFF_Y, TYPE_COMBO_WIDTH,
TYPE_HEIGHT );
@@ -176,7 +174,7 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name,
m_kbpsLbl->setGeometry( LABEL_X, KBPS_STUFF_Y, LABEL_WIDTH,
KBPS_HEIGHT );
m_kbpsCombo = new comboBox( this, NULL, eng(), NULL );
m_kbpsCombo = new comboBox( this, NULL, NULL );
m_kbpsCombo->setGeometry( LABEL_X + LABEL_WIDTH + LABEL_MARGIN,
KBPS_STUFF_Y, KBPS_COMBO_WIDTH,
KBPS_HEIGHT );
@@ -192,15 +190,14 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name,
QString::number( 128 ) ) );
m_vbrCb = new ledCheckBox( tr( "variable bitrate" ), this, NULL, eng(),
NULL );
m_vbrCb = new ledCheckBox( tr( "variable bitrate" ), this, NULL, NULL );
m_vbrCb->setGeometry( LABEL_X + LABEL_WIDTH + 3 * LABEL_MARGIN +
KBPS_COMBO_WIDTH, KBPS_STUFF_Y + 3, 190, 20 );
m_vbrCb->setChecked( TRUE );
m_hqmCb = new ledCheckBox( tr( "use high-quality-mode (recommened)" ),
this, NULL, eng(), NULL );
this, NULL, NULL );
m_hqmCb->setGeometry( LABEL_X, HQ_MODE_CB_Y + 3, HQ_MODE_CB_WIDTH,
HQ_MODE_CB_HEIGHT );
m_hqmCb->setChecked( TRUE );
@@ -258,7 +255,7 @@ void exportProjectDialog::keyPressEvent( QKeyEvent * _ke )
{
if( _ke->key() == Qt::Key_Escape )
{
if( eng()->getSongEditor()->exporting() == FALSE )
if( engine::getSongEditor()->exporting() == FALSE )
{
accept();
}
@@ -274,7 +271,7 @@ void exportProjectDialog::keyPressEvent( QKeyEvent * _ke )
void exportProjectDialog::closeEvent( QCloseEvent * _ce )
{
if( eng()->getSongEditor()->exporting() == TRUE )
if( engine::getSongEditor()->exporting() == TRUE )
{
abortProjectExport();
_ce->ignore();
@@ -332,7 +329,7 @@ void exportProjectDialog::exportBtnClicked( void )
m_kbpsCombo->currentText().toInt(),
m_kbpsCombo->currentText().toInt() - 64,
m_kbpsCombo->currentText().toInt() + 64,
eng()->getMixer() );
engine::getMixer() );
if( success_ful == FALSE )
{
QMessageBox::information( this,
@@ -377,28 +374,29 @@ void exportProjectDialog::exportBtnClicked( void )
eng()->getMixer()->setAudioDevice( dev, m_hqmCb->isChecked() );
eng()->getSongEditor()->startExport();
engine::getMixer()->setAudioDevice( dev, m_hqmCb->isChecked() );
engine::getSongEditor()->startExport();
delete m_hqmCb;
songEditor::playPos & pp = eng()->getSongEditor()->getPlayPos(
songEditor::playPos & pp = engine::getSongEditor()->getPlayPos(
songEditor::PLAY_SONG );
while( eng()->getSongEditor()->exportDone() == FALSE &&
eng()->getSongEditor()->exporting() == TRUE )
while( engine::getSongEditor()->exportDone() == FALSE &&
engine::getSongEditor()->exporting() == TRUE )
{
dev->processNextBuffer();
int pval = pp * 100 /
( ( eng()->getSongEditor()->lengthInTacts() + 1 ) * 64 );
( ( engine::getSongEditor()->lengthInTacts() + 1 )
* 64 );
#ifdef QT4
m_exportProgressBar->setValue( pval );
#else
m_exportProgressBar->setProgress( pval );
#endif
// update lmms-main-win-caption
eng()->getMainWindow()->setWindowTitle( tr( "Rendering:" ) + " " +
QString::number( pval ) + "%" );
engine::getMainWindow()->setWindowTitle( tr( "Rendering:" )
+ " " + QString::number( pval ) + "%" );
// process paint-events etc.
qApp->processEvents();
}
@@ -418,7 +416,7 @@ void exportProjectDialog::exportBtnClicked( void )
void exportProjectDialog::cancelBtnClicked( void )
{
// is song-export-thread active?
if( eng()->getSongEditor()->exporting() == TRUE )
if( engine::getSongEditor()->exporting() == TRUE )
{
// then dispose abort of export
abortProjectExport();
@@ -443,7 +441,7 @@ void exportProjectDialog::abortProjectExport( void )
void exportProjectDialog::finishProjectExport( void )
{
eng()->getMixer()->restoreAudioDevice();
engine::getMixer()->restoreAudioDevice();
// if the user aborted export-process, the file has to be deleted
if( m_deleteFile )
@@ -452,9 +450,9 @@ void exportProjectDialog::finishProjectExport( void )
}
// restore window-title
eng()->getMainWindow()->resetWindowTitle();
engine::getMainWindow()->resetWindowTitle();
eng()->getSongEditor()->stopExport();
engine::getSongEditor()->stopExport();
// if we rendered file from command line, quit after export
if( file_to_render != "" )

View File

@@ -67,15 +67,14 @@
fileBrowser::fileBrowser( const QString & _directories, const QString & _filter,
const QString & _title, const QPixmap & _pm,
QWidget * _parent, engine * _engine ) :
QWidget * _parent ) :
sideBarWidget( _title, _pm, _parent ),
engineObject( _engine ),
m_contextMenuItem( NULL ),
m_directories( _directories ),
m_filter( _filter )
{
setWindowTitle( tr( "Browser" ) );
m_l = new listView( contentParent(), eng() );
m_l = new listView( contentParent() );
addContentWidget( m_l );
#ifdef QT4
@@ -179,7 +178,7 @@ void fileBrowser::addItems( const QString & _path )
{
// remove existing file-items
delete m_l->findItem( cur_file, 0 );
(void) new fileItem( m_l, cur_file, _path, eng() );
(void) new fileItem( m_l, cur_file, _path );
}
}
@@ -195,7 +194,7 @@ void fileBrowser::addItems( const QString & _path )
if( item == NULL )
{
(void) new directory( m_l, cur_file, _path,
m_filter, eng() );
m_filter );
}
else if( dynamic_cast<directory *>( item ) != NULL )
{
@@ -298,11 +297,11 @@ void fileBrowser::contextMenuRequest( QListViewItem * i, const QPoint &, int )
void fileBrowser::sendToActiveInstrumentTrack( void )
{
if( eng()->getMainWindow()->workspace() != NULL )
if( engine::getMainWindow()->workspace() != NULL )
{
// get all windows opened in the workspace
QWidgetList pl =
eng()->getMainWindow()->workspace()->windowList(
engine::getMainWindow()->workspace()->windowList(
#if QT_VERSION >= 0x030200
QWorkspace::StackingOrder
#endif
@@ -333,7 +332,7 @@ void fileBrowser::sendToActiveInstrumentTrack( void )
fileItem::SAMPLE_FILE )
{
instrument * afp = ct->loadInstrument(
eng()->sampleExtensions()
engine::sampleExtensions()
[m_contextMenuItem
->extension()] );
if( afp != NULL )
@@ -374,8 +373,9 @@ void fileBrowser::openInNewInstrumentTrack( trackContainer * _tc )
#ifdef LMMS_DEBUG
assert( ct != NULL );
#endif
instrument * afp = ct->loadInstrument( eng()->sampleExtensions()
[m_contextMenuItem
instrument * afp = ct->loadInstrument(
engine::sampleExtensions()
[m_contextMenuItem
->extension()] );
if( afp != NULL )
{
@@ -404,7 +404,7 @@ void fileBrowser::openInNewInstrumentTrack( trackContainer * _tc )
void fileBrowser::openInNewInstrumentTrackSE( void )
{
openInNewInstrumentTrack( eng()->getSongEditor() );
openInNewInstrumentTrack( engine::getSongEditor() );
}
@@ -412,7 +412,7 @@ void fileBrowser::openInNewInstrumentTrackSE( void )
void fileBrowser::openInNewInstrumentTrackBBE( void )
{
openInNewInstrumentTrack( eng()->getBBEditor() );
openInNewInstrumentTrack( engine::getBBEditor() );
}
@@ -422,9 +422,8 @@ void fileBrowser::openInNewInstrumentTrackBBE( void )
listView::listView( QWidget * _parent, engine * _engine ) :
listView::listView( QWidget * _parent ) :
Q3ListView( _parent ),
engineObject( _engine ),
m_mousePressed( FALSE ),
m_pressPos(),
m_previewPlayHandle( NULL )
@@ -460,12 +459,12 @@ void listView::contentsMouseDoubleClickEvent( QMouseEvent * _me )
// they're likely drum-samples etc.
instrumentTrack * it = dynamic_cast<instrumentTrack *>(
track::create( track::INSTRUMENT_TRACK,
eng()->getBBEditor() ) );
engine::getBBEditor() ) );
#ifdef LMMS_DEBUG
assert( it != NULL );
#endif
instrument * afp = it->loadInstrument(
eng()->sampleExtensions()[f->extension()] );
engine::sampleExtensions()[f->extension()] );
if( afp != NULL )
{
afp->setParameter( "samplefile",
@@ -478,7 +477,7 @@ void listView::contentsMouseDoubleClickEvent( QMouseEvent * _me )
// presets are per default opened in bb-editor
multimediaProject mmp( f->fullName() );
track * t = track::create( track::INSTRUMENT_TRACK,
eng()->getBBEditor() );
engine::getBBEditor() );
instrumentTrack * it = dynamic_cast<instrumentTrack *>(
t );
if( it != NULL )
@@ -491,9 +490,9 @@ void listView::contentsMouseDoubleClickEvent( QMouseEvent * _me )
}
else if( f->type() == fileItem::PROJECT_FILE )
{
if( eng()->getSongEditor()->mayChangeProject() == TRUE )
if( engine::getSongEditor()->mayChangeProject() )
{
eng()->getSongEditor()->loadProject(
engine::getSongEditor()->loadProject(
f->fullName() );
}
}
@@ -531,7 +530,7 @@ void listView::contentsMousePressEvent( QMouseEvent * _me )
{
if( m_previewPlayHandle != NULL )
{
eng()->getMixer()->removePlayHandle(
engine::getMixer()->removePlayHandle(
m_previewPlayHandle );
m_previewPlayHandle = NULL;
}
@@ -549,7 +548,7 @@ void listView::contentsMousePressEvent( QMouseEvent * _me )
qApp->processEvents();
#endif
samplePlayHandle * s = new samplePlayHandle(
f->fullName(), eng() );
f->fullName() );
s->setDoneMayReturnTrue( FALSE );
m_previewPlayHandle = s;
delete tf;
@@ -557,11 +556,12 @@ void listView::contentsMousePressEvent( QMouseEvent * _me )
else if( f->type() == fileItem::PRESET_FILE )
{
m_previewPlayHandle = new presetPreviewPlayHandle(
f->fullName(), eng() );
f->fullName() );
}
if( m_previewPlayHandle != NULL )
{
eng()->getMixer()->addPlayHandle( m_previewPlayHandle );
engine::getMixer()->addPlayHandle(
m_previewPlayHandle );
}
}
}
@@ -587,7 +587,7 @@ void listView::contentsMouseMoveEvent( QMouseEvent * _me )
f->fullName(),
embed::getIconPixmap(
"preset_file" ),
this, eng() );
this );
break;
case fileItem::SAMPLE_FILE:
@@ -595,7 +595,7 @@ void listView::contentsMouseMoveEvent( QMouseEvent * _me )
f->fullName(),
embed::getIconPixmap(
"sound_file" ),
this, eng() );
this );
break;
case fileItem::MIDI_FILE:
@@ -603,7 +603,7 @@ void listView::contentsMouseMoveEvent( QMouseEvent * _me )
f->fullName(),
embed::getIconPixmap(
"midi_file" ),
this, eng() );
this );
break;
default:
@@ -629,14 +629,14 @@ void listView::contentsMouseReleaseEvent( QMouseEvent * _me )
{
if( s->totalFrames() - s->framesDone() <=
static_cast<f_cnt_t>(
eng()->getMixer()->sampleRate() * 3 ) )
engine::getMixer()->sampleRate() * 3 ) )
{
s->setDoneMayReturnTrue( TRUE );
m_previewPlayHandle = NULL;
return;
}
}
eng()->getMixer()->removePlayHandle( m_previewPlayHandle );
engine::getMixer()->removePlayHandle( m_previewPlayHandle );
m_previewPlayHandle = NULL;
}
}
@@ -653,10 +653,8 @@ QPixmap * directory::s_folderLockedPixmap = NULL;
directory::directory( directory * _parent, const QString & _name,
const QString & _path, const QString & _filter,
engine * _engine ) :
const QString & _path, const QString & _filter ) :
Q3ListViewItem( _parent, _name ),
engineObject( _engine ),
m_p( _parent ),
m_pix( NULL ),
m_directories( _path ),
@@ -669,10 +667,8 @@ directory::directory( directory * _parent, const QString & _name,
directory::directory( Q3ListView * _parent, const QString & _name,
const QString & _path, const QString & _filter,
engine * _engine ) :
const QString & _path, const QString & _filter ) :
Q3ListViewItem( _parent, _name ),
engineObject( _engine ),
m_p( NULL ),
m_pix( NULL ),
m_directories( _path ),
@@ -797,7 +793,7 @@ bool directory::addItems( const QString & _path )
#endif
/*QDir::match( FILE_FILTER, cur_file )*/ )
{
(void) new fileItem( this, cur_file, _path, eng() );
(void) new fileItem( this, cur_file, _path );
added_something = TRUE;
}
}
@@ -814,7 +810,7 @@ bool directory::addItems( const QString & _path )
#endif
cur_file, m_filter ) )
{
new directory( this, cur_file, _path, m_filter, eng() );
new directory( this, cur_file, _path, m_filter );
added_something = TRUE;
#if 0
if( firstChild() == NULL )
@@ -860,10 +856,8 @@ QPixmap * fileItem::s_unknownFilePixmap = NULL;
fileItem::fileItem( Q3ListView * _parent, const QString & _name,
const QString & _path,
engine * _engine ) :
const QString & _path ) :
Q3ListViewItem( _parent, _name ),
engineObject( _engine ),
m_pix( NULL ),
m_path( _path )
{
@@ -876,10 +870,8 @@ fileItem::fileItem( Q3ListView * _parent, const QString & _name,
fileItem::fileItem( Q3ListViewItem * _parent, const QString & _name,
const QString & _path,
engine * _engine ) :
const QString & _path ) :
Q3ListViewItem( _parent, _name ),
engineObject( _engine ),
m_pix( NULL ),
m_path( _path )
{
@@ -974,7 +966,7 @@ void fileItem::determineFileType( void )
{
m_type = PRESET_FILE;
}
else if( eng()->sampleExtensions().contains( ext ) )
else if( engine::sampleExtensions().contains( ext ) )
{
m_type = SAMPLE_FILE;
}

View File

@@ -3,7 +3,7 @@
/*
* import_filter.cpp - base-class for all import-filters (MIDI, FLP etc)
*
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,6 +26,7 @@
#include "import_filter.h"
#include "engine.h"
#include "track_container.h"
#include "project_journal.h"
@@ -43,9 +44,8 @@
importFilter::importFilter( const QString & _file_name,
const descriptor * _descriptor,
engine * _eng ) :
plugin( _descriptor, _eng ),
const descriptor * _descriptor ) :
plugin( _descriptor ),
m_file( _file_name )
{
}
@@ -77,8 +77,8 @@ void importFilter::import( const QString & _file_to_import,
);
// do not record changes while importing files
const bool j = _tc->eng()->getProjectJournal()->isJournalling();
_tc->eng()->getProjectJournal()->setJournalling( FALSE );
const bool j = engine::getProjectJournal()->isJournalling();
engine::getProjectJournal()->setJournalling( FALSE );
for( vvector<plugin::descriptor>::iterator it = d.begin();
it != d.end(); ++it )
@@ -98,7 +98,7 @@ void importFilter::import( const QString & _file_to_import,
}
}
_tc->eng()->getProjectJournal()->setJournalling( j );
engine::getProjectJournal()->setJournalling( j );
delete[] s;

View File

@@ -3,7 +3,7 @@
/*
* instrument.cpp - base-class for all instrument-plugins (synths, samplers etc)
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -33,7 +33,7 @@
instrument::instrument( instrumentTrack * _instrument_track,
const descriptor * _descriptor ) :
QWidget( _instrument_track->tabWidgetParent() ),
plugin( _descriptor, _instrument_track->eng() ),
plugin( _descriptor ),
m_instrumentTrack( _instrument_track ),
m_valid( TRUE )
{

View File

@@ -52,6 +52,7 @@
#include "main_window.h"
#include "embed.h"
#include "engine.h"
#include "config_mgr.h"
#include "export_project_dialog.h"
#include "song_editor.h"
@@ -230,32 +231,32 @@ int main( int argc, char * * argv )
Qt::white );
#endif
engine * main_engine = new engine();
engine::init();
// we try to load given file
if( file_to_load != "" )
{
main_engine->getSongEditor()->loadProject( file_to_load );
engine::getSongEditor()->loadProject( file_to_load );
}
else
{
main_engine->getSongEditor()->createNewProject();
engine::getSongEditor()->createNewProject();
}
#ifndef QT4
app.setMainWidget( main_engine->getMainWindow() );
app.setMainWidget( engine::getMainWindow() );
#endif
// MDI-mode?
if( main_engine->getMainWindow()->workspace() != NULL )
if( engine::getMainWindow()->workspace() != NULL )
{
// then maximize
main_engine->getMainWindow()->showMaximized();
engine::getMainWindow()->showMaximized();
}
else
{
// otherwise arrange at top-left edge of screen
main_engine->getMainWindow()->show();
main_engine->getMainWindow()->move( 0, 0 );
main_engine->getMainWindow()->resize( 200, 500 );
engine::getMainWindow()->show();
engine::getMainWindow()->move( 0, 0 );
engine::getMainWindow()->resize( 200, 500 );
}
@@ -267,8 +268,7 @@ int main( int argc, char * * argv )
{
exportProjectDialog * e = new exportProjectDialog(
file_to_render,
main_engine->getMainWindow(),
main_engine );
engine::getMainWindow() );
e->show();
e->exportBtnClicked();
}

View File

@@ -67,6 +67,7 @@
#include "song_editor.h"
#include "piano_roll.h"
#include "embed.h"
#include "engine.h"
#include "about_dialog.h"
#include "file_browser.h"
#include "plugin_browser.h"
@@ -90,13 +91,12 @@ extern int splash_alignment_flags;
mainWindow::mainWindow( engine * _engine ) :
mainWindow::mainWindow( void ) :
QMainWindow(
#ifndef QT4
0 , NULL, WDestructiveClose
#endif
),
engineObject( _engine ),
m_workspace( NULL ),
m_templatesMenu( NULL ),
m_tools_menu( NULL )
@@ -129,7 +129,7 @@ mainWindow::mainWindow( engine * _engine ) :
#endif
QString sample_filter;
vlist<QString> ext_keys = eng()->sampleExtensions().keys();
vlist<QString> ext_keys = engine::sampleExtensions().keys();
for( vlist<QString>::iterator it = ext_keys.begin();
it != ext_keys.end(); ++it )
{
@@ -138,39 +138,34 @@ mainWindow::mainWindow( engine * _engine ) :
int id = 0;
QString wdir = configManager::inst()->workingDir();
side_bar->appendTab( new pluginBrowser( splitter, eng() ), ++id );
side_bar->appendTab( new pluginBrowser( splitter ), ++id );
side_bar->appendTab( new fileBrowser(
configManager::inst()->factoryProjectsDir() + "*" +
configManager::inst()->userProjectsDir(),
"*.mmp *.mmpz *.xml *.mid *.flp",
tr( "My projects" ),
embed::getIconPixmap( "project_file" ),
splitter, eng() ),
++id );
splitter ), ++id );
side_bar->appendTab( new fileBrowser(
configManager::inst()->factorySamplesDir() + "*" +
configManager::inst()->userSamplesDir(),
sample_filter, tr( "My samples" ),
embed::getIconPixmap( "sound_file" ),
splitter, eng() ),
++id );
splitter ), ++id );
side_bar->appendTab( new fileBrowser(
configManager::inst()->factoryPresetsDir() + "*" +
configManager::inst()->userPresetsDir(),
"*.cs.xml", tr( "My presets" ),
embed::getIconPixmap( "preset_file" ),
splitter, eng() ),
++id );
splitter ), ++id );
side_bar->appendTab( new fileBrowser( QDir::homePath(), "*",
tr( "My home" ),
embed::getIconPixmap( "home" ),
splitter, eng() ),
++id );
splitter ), ++id );
side_bar->appendTab( new fileBrowser( QDir::rootPath(), "*",
tr( "Root directory" ),
embed::getIconPixmap( "root" ),
splitter, eng() ),
++id );
splitter ), ++id );
if( no_mdi == FALSE )
{
@@ -224,20 +219,20 @@ mainWindow::mainWindow( engine * _engine ) :
mainWindow::~mainWindow()
{
/* // first make sure, there're no mixing/audio-device-threads any more
eng()->getMixer()->stopProcessing();
engine::getMixer()->stopProcessing();
// destroy editors with all their children
delete eng()->getSongEditor();
delete eng()->getBBEditor();
delete engine::getSongEditor();
delete engine::getBBEditor();
// destroy mixer
delete eng()->getMixer();
delete engine::getMixer();
// destroy config-manager (which automatically saves config-file)
*/
eng()->close();
engine::destroy();
}
@@ -305,7 +300,7 @@ void mainWindow::finalize( void )
toolButton * project_export = new toolButton(
embed::getIconPixmap( "project_export" ),
tr( "Export current project" ),
eng()->getSongEditor(),
engine::getSongEditor(),
SLOT( exportProject() ),
m_toolBar );
@@ -471,7 +466,7 @@ void mainWindow::finalize( void )
#endif
project_menu->addAction( /*embed::getIconPixmap( "project_import" ),*/
tr( "Import file" ),
eng()->getSongEditor(),
engine::getSongEditor(),
SLOT( importProject() ) );
#ifdef QT4
project_menu->addSeparator();
@@ -480,7 +475,7 @@ void mainWindow::finalize( void )
#endif
project_menu->addAction( embed::getIconPixmap( "project_export" ),
tr( "E&xport" ),
eng()->getSongEditor(),
engine::getSongEditor(),
SLOT( exportProject() ),
Qt::CTRL + Qt::Key_E );
#ifdef QT4
@@ -598,14 +593,14 @@ void mainWindow::finalize( void )
{
configManager::inst()->setValue( "app", "configured", "1" );
// no, so show it that user can setup everything
setupDialog sd( eng() );
setupDialog sd;
sd.exec();
}
// look whether mixer could use a audio-interface beside audioDummy
else if( eng()->getMixer()->audioDevName() == audioDummy::name() )
else if( engine::getMixer()->audioDevName() == audioDummy::name() )
{
// no, so we offer setup-dialog with audio-settings...
setupDialog sd( eng(), setupDialog::AUDIO_SETTINGS );
setupDialog sd( setupDialog::AUDIO_SETTINGS );
sd.exec();
}
}
@@ -646,9 +641,9 @@ void mainWindow::addSpacingToToolBar( int _size )
void mainWindow::resetWindowTitle( const QString & _add )
{
QString title = _add;
if( _add == "" && eng()->getSongEditor()->projectFileName() != "" )
if( _add == "" && engine::getSongEditor()->projectFileName() != "" )
{
title = QFileInfo( eng()->getSongEditor()->projectFileName()
title = QFileInfo( engine::getSongEditor()->projectFileName()
#ifdef QT4
).completeBaseName();
#else
@@ -717,9 +712,9 @@ void mainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de )
void mainWindow::createNewProject( void )
{
if( eng()->getSongEditor()->mayChangeProject() == TRUE )
if( engine::getSongEditor()->mayChangeProject() == TRUE )
{
eng()->getSongEditor()->createNewProject();
engine::getSongEditor()->createNewProject();
}
}
@@ -732,13 +727,13 @@ void mainWindow::createNewProjectFromTemplate( int _idx )
// TODO!!!
#else
if( m_templatesMenu != NULL &&
eng()->getSongEditor()->mayChangeProject() == TRUE )
engine::getSongEditor()->mayChangeProject() == TRUE )
{
QString dir_base = m_templatesMenu->indexOf( _idx )
>= m_custom_templates_count ?
configManager::inst()->factoryProjectsDir() :
configManager::inst()->userProjectsDir();
eng()->getSongEditor()->createNewProjectFromTemplate(
engine::getSongEditor()->createNewProjectFromTemplate(
dir_base + "templates/" +
m_templatesMenu->text( _idx ) + ".mpt" );
}
@@ -750,7 +745,7 @@ void mainWindow::createNewProjectFromTemplate( int _idx )
void mainWindow::openProject( void )
{
if( eng()->getSongEditor()->mayChangeProject() == TRUE )
if( engine::getSongEditor()->mayChangeProject() == TRUE )
{
#ifdef QT4
QFileDialog ofd( this, tr( "Open project" ), "",
@@ -766,7 +761,7 @@ void mainWindow::openProject( void )
if( ofd.exec () == QDialog::Accepted &&
!ofd.selectedFiles().isEmpty() )
{
eng()->getSongEditor()->loadProject(
engine::getSongEditor()->loadProject(
ofd.selectedFiles()[0] );
}
}
@@ -777,13 +772,13 @@ void mainWindow::openProject( void )
bool mainWindow::saveProject( void )
{
if( eng()->getSongEditor()->projectFileName() == "" )
if( engine::getSongEditor()->projectFileName() == "" )
{
return( saveProjectAs() );
}
else
{
eng()->getSongEditor()->saveProject();
engine::getSongEditor()->saveProject();
}
return( TRUE );
}
@@ -805,7 +800,7 @@ bool mainWindow::saveProjectAs( void )
sfd.setWindowTitle( tr( "Save project" ) );
#endif
sfd.setFileMode( QFileDialog::AnyFile );
QString f = eng()->getSongEditor()->projectFileName();
QString f = engine::getSongEditor()->projectFileName();
if( f != "" )
{
sfd.selectFile( QFileInfo( f ).fileName() );
@@ -829,9 +824,10 @@ bool mainWindow::saveProjectAs( void )
)
{
#ifdef QT4
eng()->getSongEditor()->saveProjectAs( sfd.selectedFiles()[0] );
engine::getSongEditor()->saveProjectAs(
sfd.selectedFiles()[0] );
#else
eng()->getSongEditor()->saveProjectAs( sfd.selectedFile() );
engine::getSongEditor()->saveProjectAs( sfd.selectedFile() );
#endif
return( TRUE );
}
@@ -843,7 +839,7 @@ bool mainWindow::saveProjectAs( void )
void mainWindow::showSettingsDialog( void )
{
setupDialog sd( eng() );
setupDialog sd;
sd.exec();
}
@@ -877,7 +873,7 @@ void mainWindow::ladspaPluginBrowser( void )
// moc for Qt 3.x doesn't recognize preprocessor directives,
// so we can't just block the whole thing out.
#ifdef LADSPA_SUPPORT
ladspaBrowser lb( eng() );
ladspaBrowser lb;
lb.exec();
#endif
}
@@ -887,16 +883,16 @@ void mainWindow::ladspaPluginBrowser( void )
void mainWindow::toggleBBEditorWin( void )
{
if( eng()->getBBEditor()->isHidden() == TRUE ||
if( engine::getBBEditor()->isHidden() == TRUE ||
( m_workspace != NULL &&
m_workspace->activeWindow() != eng()->getBBEditor() ) )
m_workspace->activeWindow() != engine::getBBEditor() ) )
{
eng()->getBBEditor()->show();
eng()->getBBEditor()->setFocus();
engine::getBBEditor()->show();
engine::getBBEditor()->setFocus();
}
else
{
eng()->getBBEditor()->hide();
engine::getBBEditor()->hide();
}
}
@@ -905,16 +901,16 @@ void mainWindow::toggleBBEditorWin( void )
void mainWindow::toggleSongEditorWin( void )
{
if( eng()->getSongEditor()->isHidden() == TRUE ||
( m_workspace != NULL &&
m_workspace->activeWindow() != eng()->getSongEditor() ) )
if( engine::getSongEditor()->isHidden() == TRUE ||
( m_workspace != NULL && m_workspace->activeWindow()
!= engine::getSongEditor() ) )
{
eng()->getSongEditor()->show();
eng()->getSongEditor()->setFocus();
engine::getSongEditor()->show();
engine::getSongEditor()->setFocus();
}
else
{
eng()->getSongEditor()->hide();
engine::getSongEditor()->hide();
}
}
@@ -923,16 +919,16 @@ void mainWindow::toggleSongEditorWin( void )
void mainWindow::toggleProjectNotesWin( void )
{
if( eng()->getProjectNotes()->isHidden() == TRUE ||
if( engine::getProjectNotes()->isHidden() == TRUE ||
( m_workspace != NULL && m_workspace->activeWindow() !=
eng()->getProjectNotes() ) )
engine::getProjectNotes() ) )
{
eng()->getProjectNotes()->show();
eng()->getProjectNotes()->setFocus();
engine::getProjectNotes()->show();
engine::getProjectNotes()->setFocus();
}
else
{
eng()->getProjectNotes()->hide();
engine::getProjectNotes()->hide();
}
}
@@ -941,16 +937,16 @@ void mainWindow::toggleProjectNotesWin( void )
void mainWindow::togglePianoRollWin( void )
{
if( eng()->getPianoRoll()->isHidden() == TRUE ||
( m_workspace != NULL &&
m_workspace->activeWindow() != eng()->getPianoRoll() ) )
if( engine::getPianoRoll()->isHidden() == TRUE ||
( m_workspace != NULL && m_workspace->activeWindow()
!= engine::getPianoRoll() ) )
{
eng()->getPianoRoll()->show();
eng()->getPianoRoll()->setFocus();
engine::getPianoRoll()->show();
engine::getPianoRoll()->setFocus();
}
else
{
eng()->getPianoRoll()->hide();
engine::getPianoRoll()->hide();
}
}
@@ -959,16 +955,16 @@ void mainWindow::togglePianoRollWin( void )
void mainWindow::toggleAutomationEditorWin( void )
{
if( eng()->getAutomationEditor()->isHidden() == TRUE ||
if( engine::getAutomationEditor()->isHidden() == TRUE ||
( m_workspace != NULL && m_workspace->activeWindow()
!= eng()->getAutomationEditor() ) )
!= engine::getAutomationEditor() ) )
{
eng()->getAutomationEditor()->show();
eng()->getAutomationEditor()->setFocus();
engine::getAutomationEditor()->show();
engine::getAutomationEditor()->setFocus();
}
else
{
eng()->getAutomationEditor()->hide();
engine::getAutomationEditor()->hide();
}
}
@@ -977,7 +973,7 @@ void mainWindow::toggleAutomationEditorWin( void )
void mainWindow::undo( void )
{
eng()->getProjectJournal()->undo();
engine::getProjectJournal()->undo();
}
@@ -985,7 +981,7 @@ void mainWindow::undo( void )
void mainWindow::redo( void )
{
eng()->getProjectJournal()->redo();
engine::getProjectJournal()->redo();
}
@@ -993,7 +989,7 @@ void mainWindow::redo( void )
void mainWindow::closeEvent( QCloseEvent * _ce )
{
if( eng()->getSongEditor()->mayChangeProject() == TRUE )
if( engine::getSongEditor()->mayChangeProject() == TRUE )
{
_ce->accept();
}

View File

@@ -1,9 +1,9 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* meter_dialog.cpp - diloag for entering meter settings
* meter_dialog.cpp - dialog for entering meter settings
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/yahoo.com>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/yahoo.com>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -53,9 +53,8 @@ meterDialog::meterDialog( QWidget * _parent, track * _track ):
QWidget * num = new QWidget( this );
QHBoxLayout * num_layout = new QHBoxLayout( num );
num_layout->setSpacing( 10 );
m_numerator = new lcdSpinBox( 1, 32, 2, num,
tr( "Meter Numerator" ),
_track->eng(), _track );
m_numerator = new lcdSpinBox( 1, 32, 2, num, tr( "Meter Numerator" ),
_track );
connect( m_numerator, SIGNAL( valueChanged( int ) ),
this, SIGNAL( numeratorChanged( int ) ) );
m_numerator->setValue( 4 );
@@ -71,7 +70,7 @@ meterDialog::meterDialog( QWidget * _parent, track * _track ):
dem_layout->setSpacing( 10 );
m_denominator = new lcdSpinBox( 1, 32, 2, dem,
tr( "Meter Denominator" ),
_track->eng(), _track );
_track );
connect( m_denominator, SIGNAL( valueChanged( int ) ),
this, SIGNAL( denominatorChanged( int ) ) );
m_denominator->setValue( 4 );

View File

@@ -4,7 +4,7 @@
* midi_tab_widget.cpp - tab-widget in channel-track-window for setting up
* MIDI-related stuff
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -63,7 +63,6 @@
midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
midiPort * _port ) :
QWidget( _instrument_track->tabWidgetParent() ),
journallingObject( _instrument_track->eng() ),
m_instrumentTrack( _instrument_track ),
m_midiPort( _port ),
m_readablePorts( NULL ),
@@ -75,9 +74,9 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
m_inputChannelSpinBox = new lcdSpinBox( 0, MIDI_CHANNEL_COUNT, 3,
m_setupTabWidget,
tr( "Input channel" ),
eng(), _instrument_track );
m_setupTabWidget,
tr( "Input channel" ),
_instrument_track );
m_inputChannelSpinBox->addTextForValue( 0, "---" );
m_inputChannelSpinBox->setValue( m_midiPort->inputChannel() + 1 );
m_inputChannelSpinBox->setLabel( tr( "CHANNEL" ) );
@@ -87,9 +86,9 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
inputChannelChanged( m_inputChannelSpinBox->value() );
m_outputChannelSpinBox = new lcdSpinBox( 1, MIDI_CHANNEL_COUNT, 3,
m_setupTabWidget,
tr( "Output channel" ),
eng(), _instrument_track );
m_setupTabWidget,
tr( "Output channel" ),
_instrument_track );
m_outputChannelSpinBox->setValue( m_midiPort->outputChannel() + 1 );
//m_outputChannelSpinBox->addTextForValue( 0, "---" );
m_outputChannelSpinBox->setLabel( tr( "CHANNEL" ) );
@@ -102,7 +101,7 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
m_receiveCheckBox = new ledCheckBox( tr( "Receive MIDI-events" ),
m_setupTabWidget,
tr( "Receive MIDI-events" ),
eng(), _instrument_track );
_instrument_track );
m_receiveCheckBox->move( 10, 34 );
connect( m_receiveCheckBox, SIGNAL( toggled( bool ) ),
this, SLOT( midiPortModeToggled( bool ) ) );
@@ -113,7 +112,7 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
"for all input-events" ),
m_setupTabWidget,
tr( "Default input velocity" ),
eng(), _instrument_track );
_instrument_track );
m_defaultVelocityInCheckBox->move( 28, 84 );
connect( m_defaultVelocityInCheckBox, SIGNAL( toggled( bool ) ),
this, SLOT( defaultVelInChanged( bool ) ) );
@@ -122,7 +121,7 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
m_sendCheckBox = new ledCheckBox( tr( "Send MIDI-events" ),
m_setupTabWidget,
tr( "Send MIDI-events" ),
eng(), _instrument_track );
_instrument_track );
m_sendCheckBox->move( 10, 114 );
connect( m_sendCheckBox, SIGNAL( toggled( bool ) ),
this, SLOT( midiPortModeToggled( bool ) ) );
@@ -133,7 +132,7 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
"for all output-events" ),
m_setupTabWidget,
tr( "Default output velocity" ),
eng(), _instrument_track );
_instrument_track );
m_defaultVelocityOutCheckBox->move( 28, 164 );
connect( m_defaultVelocityOutCheckBox, SIGNAL( toggled( bool ) ),
this, SLOT( defaultVelOutChanged( bool ) ) );
@@ -147,7 +146,7 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
// when using with non-raw-clients we can provide buttons showing
// our port-menus when being clicked
midiClient * mc = eng()->getMixer()->getMIDIClient();
midiClient * mc = engine::getMixer()->getMIDIClient();
if( mc->isRaw() == FALSE )
{
m_readablePorts = new QMenu( m_setupTabWidget );
@@ -374,7 +373,7 @@ void midiTabWidget::loadSettings( const QDomElement & _this )
void midiTabWidget::inputChannelChanged( int _new_chnl )
{
m_midiPort->setInputChannel( _new_chnl - 1 );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -383,7 +382,7 @@ void midiTabWidget::inputChannelChanged( int _new_chnl )
void midiTabWidget::outputChannelChanged( int _new_chnl )
{
m_midiPort->setOutputChannel( _new_chnl - 1 );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -465,7 +464,7 @@ void midiTabWidget::midiPortModeToggled( bool )
}
#endif
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -497,7 +496,7 @@ void midiTabWidget::readablePortsChanged( void )
#endif
m_readablePorts->clear();
const QStringList & rp = eng()->getMixer()->getMIDIClient()->
const QStringList & rp = engine::getMixer()->getMIDIClient()->
readablePorts();
// now insert new ports and restore selections
for( QStringList::const_iterator it = rp.begin(); it != rp.end(); ++it )
@@ -549,7 +548,7 @@ void midiTabWidget::writeablePortsChanged( void )
#endif
m_writeablePorts->clear();
const QStringList & wp = eng()->getMixer()->getMIDIClient()->
const QStringList & wp = engine::getMixer()->getMIDIClient()->
writeablePorts();
// now insert new ports and restore selections
for( QStringList::const_iterator it = wp.begin(); it != wp.end(); ++it )
@@ -584,7 +583,7 @@ void midiTabWidget::activatedReadablePort( QAction * _item )
{
m_receiveCheckBox->setChecked( TRUE );
}
eng()->getMixer()->getMIDIClient()->subscribeReadablePort( m_midiPort,
engine::getMixer()->getMIDIClient()->subscribeReadablePort( m_midiPort,
_item->text(), !_item->isChecked() );
}
@@ -600,7 +599,7 @@ void midiTabWidget::activatedWriteablePort( QAction * _item )
{
m_sendCheckBox->setChecked( TRUE );
}
eng()->getMixer()->getMIDIClient()->subscribeWriteablePort( m_midiPort,
engine::getMixer()->getMIDIClient()->subscribeWriteablePort( m_midiPort,
_item->text(), !_item->isChecked() );
}
@@ -622,7 +621,7 @@ void midiTabWidget::activatedReadablePort( int _id )
}
m_readablePorts->setItemChecked( _id,
!m_readablePorts->isItemChecked( _id ) );
eng()->getMixer()->getMIDIClient()->subscribeReadablePort(
engine::getMixer()->getMIDIClient()->subscribeReadablePort(
m_midiPort, m_readablePorts->text( _id ),
!m_readablePorts->isItemChecked( _id ) );
}
@@ -641,7 +640,7 @@ void midiTabWidget::activatedWriteablePort( int _id )
}
m_writeablePorts->setItemChecked( _id,
!m_writeablePorts->isItemChecked( _id ) );
eng()->getMixer()->getMIDIClient()->subscribeWriteablePort(
engine::getMixer()->getMIDIClient()->subscribeWriteablePort(
m_midiPort, m_writeablePorts->text( _id ),
!m_writeablePorts->isItemChecked( _id ) );
}

View File

@@ -3,7 +3,7 @@
/*
* mixer.cpp - audio-device-independent mixer for LMMS
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -34,6 +34,7 @@
#include "envelope_and_lfo_widget.h"
#include "buffer_allocator.h"
#include "debug.h"
#include "engine.h"
#include "config_mgr.h"
#include "audio_port.h"
#include "sample_play_handle.h"
@@ -61,9 +62,7 @@
sample_rate_t SAMPLE_RATES[QUALITY_LEVELS] = { 44100, 88200 } ;
mixer::mixer( engine * _engine ) :
QObject(),
engineObject( _engine ),
mixer::mixer( void ) :
m_framesPerAudioBuffer( DEFAULT_BUFFER_SIZE ),
m_readBuf( NULL ),
m_writeBuf( NULL ),
@@ -81,12 +80,24 @@ mixer::mixer( engine * _engine ) :
{
m_framesPerAudioBuffer = configManager::inst()->value( "mixer",
"framesperaudiobuffer" ).toInt();
if( m_framesPerAudioBuffer > DEFAULT_BUFFER_SIZE )
{
m_fifo = new fifo( m_framesPerAudioBuffer
/ DEFAULT_BUFFER_SIZE );
m_framesPerAudioBuffer = DEFAULT_BUFFER_SIZE;
}
else
{
m_fifo = new fifo( 1 );
}
}
else
{
configManager::inst()->setValue( "mixer",
"framesperaudiobuffer",
QString::number( m_framesPerAudioBuffer ) );
m_fifo = new fifo( 1 );
}
if( configManager::inst()->value( "mixer", "parallelizinglevel"
@@ -113,6 +124,12 @@ mixer::mixer( engine * _engine ) :
mixer::~mixer()
{
while( m_fifo->available() )
{
delete[] m_fifo->read();
}
delete m_fifo;
delete m_audioDev;
delete m_midiClient;
@@ -136,6 +153,9 @@ void mixer::initDevices( void )
void mixer::startProcessing( void )
{
m_fifo_writer = new fifoWriter( this, m_fifo );
m_fifo_writer->start();
m_audioDev->startProcessing();
}
@@ -144,6 +164,11 @@ void mixer::startProcessing( void )
void mixer::stopProcessing( void )
{
m_fifo_writer->finish();
m_fifo_writer->wait( 1000 );
m_fifo_writer->terminate();
delete m_fifo_writer;
m_audioDev->stopProcessing();
}
@@ -153,7 +178,7 @@ void mixer::stopProcessing( void )
bool mixer::criticalXRuns( void ) const
{
return( ( m_cpuLoad >= 99 &&
eng()->getSongEditor()->realTimeTask() == TRUE ) );
engine::getSongEditor()->realTimeTask() == TRUE ) );
}
@@ -209,14 +234,13 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
static songEditor::playPos last_metro_pos = -1;
songEditor::playPos p = eng()->getSongEditor()->getPlayPos(
songEditor::playPos p = engine::getSongEditor()->getPlayPos(
songEditor::PLAY_PATTERN );
if( eng()->getSongEditor()->playMode() == songEditor::PLAY_PATTERN &&
eng()->getPianoRoll()->isRecording() == TRUE &&
if( engine::getSongEditor()->playMode() == songEditor::PLAY_PATTERN &&
engine::getPianoRoll()->isRecording() == TRUE &&
p != last_metro_pos && p.getTact64th() % 16 == 0 )
{
addPlayHandle( new samplePlayHandle( "misc/metronome01.ogg",
eng() ) );
addPlayHandle( new samplePlayHandle( "misc/metronome01.ogg" ) );
last_metro_pos = p;
}
@@ -334,7 +358,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
}
}
eng()->getSongEditor()->processNextBuffer();
engine::getSongEditor()->processNextBuffer();
bool more_effects = FALSE;
for( vvector<audioPort *>::iterator it = m_audioPorts.begin();
@@ -357,7 +381,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
m_mixMutex.unlock();
// and trigger LFOs
envelopeAndLFOWidget::triggerLFO( eng() );
envelopeAndLFOWidget::triggerLFO();
const float new_cpu_load = timer.elapsed() / 10000.0f * sampleRate() /
m_framesPerAudioBuffer;
@@ -464,16 +488,14 @@ void FASTCALL mixer::bufferToPort( const sampleFrame * _buf,
void mixer::setHighQuality( bool _hq_on )
{
// delete (= close) our audio-device
delete m_audioDev;
// don't delete the audio-device
stopProcessing();
// set new quality-level...
m_qualityLevel = ( _hq_on == TRUE ) ? HIGH_QUALITY_LEVEL :
DEFAULT_QUALITY_LEVEL;
// and re-open device
m_audioDev = tryAudioDevices();
m_audioDev->startProcessing();
startProcessing();
emit( sampleRateChanged() );
@@ -484,7 +506,7 @@ void mixer::setHighQuality( bool _hq_on )
void FASTCALL mixer::setAudioDevice( audioDevice * _dev, bool _hq )
{
m_audioDev->stopProcessing();
stopProcessing();
m_oldAudioDev = m_audioDev;
@@ -501,6 +523,8 @@ void FASTCALL mixer::setAudioDevice( audioDevice * _dev, bool _hq )
m_qualityLevel = _hq ? HIGH_QUALITY_LEVEL : DEFAULT_QUALITY_LEVEL;
emit sampleRateChanged();
startProcessing();
}
@@ -510,8 +534,9 @@ void mixer::restoreAudioDevice( void )
{
if( m_oldAudioDev != NULL )
{
delete m_audioDev; // dtor automatically calls
// stopProcessing()
stopProcessing();
delete m_audioDev;
m_audioDev = m_oldAudioDev;
for( Uint8 qli = DEFAULT_QUALITY_LEVEL;
qli < QUALITY_LEVELS; ++qli )
@@ -525,7 +550,7 @@ void mixer::restoreAudioDevice( void )
}
}
m_oldAudioDev = NULL;
m_audioDev->startProcessing();
startProcessing();
}
}
@@ -640,7 +665,7 @@ midiClient * mixer::tryMIDIClients( void )
#ifdef ALSA_SUPPORT
if( client_name == midiALSASeq::name() || client_name == "" )
{
midiALSASeq * malsas = new midiALSASeq( eng() );
midiALSASeq * malsas = new midiALSASeq;
if( malsas->isRunning() )
{
m_midiClientName = midiALSASeq::name();
@@ -651,7 +676,7 @@ midiClient * mixer::tryMIDIClients( void )
if( client_name == midiALSARaw::name() || client_name == "" )
{
midiALSARaw * malsar = new midiALSARaw( eng() );
midiALSARaw * malsar = new midiALSARaw;
if( malsar->isRunning() )
{
m_midiClientName = midiALSARaw::name();
@@ -664,7 +689,7 @@ midiClient * mixer::tryMIDIClients( void )
#ifdef OSS_SUPPORT
if( client_name == midiOSS::name() || client_name == "" )
{
midiOSS * moss = new midiOSS( eng() );
midiOSS * moss = new midiOSS;
if( moss->isRunning() )
{
m_midiClientName = midiOSS::name();
@@ -679,7 +704,7 @@ midiClient * mixer::tryMIDIClients( void )
m_midiClientName = midiDummy::name();
return( new midiDummy( eng() ) );
return( new midiDummy );
}
@@ -779,6 +804,47 @@ void FASTCALL mixer::scaleClip( fpab_t _frame, ch_cnt_t _chnl )
}
mixer::fifoWriter::fifoWriter( mixer * _mixer, fifo * _fifo ) :
m_mixer( _mixer ),
m_fifo( _fifo ),
m_writing( TRUE )
{
}
void mixer::fifoWriter::finish( void )
{
m_writing = FALSE;
}
void mixer::fifoWriter::run( void )
{
while( m_writing )
{
fpab_t frames = m_mixer->framesPerAudioBuffer();
surroundSampleFrame * buffer = new surroundSampleFrame[frames];
const surroundSampleFrame * b = m_mixer->renderNextBuffer();
memcpy( buffer, b, frames * sizeof( surroundSampleFrame ) );
m_fifo->write( buffer );
}
m_fifo->write( NULL );
}
#include "mixer.moc"

View File

@@ -4,7 +4,7 @@
* name_label.cpp - implementation of class nameLabel, a label which
* is renamable by double-clicking it
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -49,13 +49,12 @@
#include "bb_track.h"
#include "gui_templates.h"
#include "config_mgr.h"
#include "engine.h"
nameLabel::nameLabel( const QString & _initial_name, QWidget * _parent,
engine * _engine ) :
nameLabel::nameLabel( const QString & _initial_name, QWidget * _parent ) :
QLabel( _initial_name, _parent ),
engineObject( _engine ),
m_pixmap(),
m_pixmapFile( "" )
{
@@ -287,7 +286,7 @@ void nameLabel::paintEvent( QPaintEvent * )
p.setPen( QColor( 0, 224, 0 ) );
bbTrack * bbt = bbTrack::findBBTrack(
eng()->getBBEditor()->currentBB(), eng() );
engine::getBBEditor()->currentBB() );
if( bbt != NULL && bbt->getTrackSettingsWidget() ==
dynamic_cast<trackSettingsWidget *>( parentWidget() ) )
{

View File

@@ -50,17 +50,15 @@ const float note::MAX_DETUNING = 4 * 12.0f;
note::note( engine * _engine, const midiTime & _length, const midiTime & _pos,
note::note( const midiTime & _length, const midiTime & _pos,
tones _tone, octaves _octave, volume _volume,
panning _panning ) :
journallingObject( _engine ),
panning _panning, knob * _detuning ) :
m_tone( C ),
m_octave( DEFAULT_OCTAVE ),
m_volume( DEFAULT_VOLUME ),
m_panning( DEFAULT_PANNING ),
m_length( _length ),
m_pos( _pos ),
m_detuning( NULL )
m_pos( _pos )
{
//saveJournallingState( FALSE );
setJournalling( FALSE );
@@ -70,7 +68,11 @@ note::note( engine * _engine, const midiTime & _length, const midiTime & _pos,
setVolume( _volume );
setPanning( _panning );
if( _engine )
if( _detuning )
{
setDetuning( _detuning );
}
else
{
createDetuning();
}
@@ -315,8 +317,8 @@ void note::createDetuning( void )
{
m_detuning = new knob( knobDark_28, NULL,
QObject::tr( "Note detuning" ),
eng(), NULL );
m_detuning->initAutomationPattern( eng() );
NULL );
m_detuning->initAutomationPattern();
m_detuning->setData( 0 );
m_detuning->setRange( -MAX_DETUNING, MAX_DETUNING, 0.1f );
}

View File

@@ -43,8 +43,8 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
const note & _n,
const bool _arp_note ) :
playHandle( NotePlayHandle ),
note( NULL, _n.length(), _n.pos(), _n.tone(), _n.octave(),
_n.getVolume(), _n.getPanning() ),
note( _n.length(), _n.pos(), _n.tone(), _n.octave(),
_n.getVolume(), _n.getPanning(), _n.detuning() ),
m_pluginData( NULL ),
m_filter( NULL ),
m_instrumentTrack( _it ),
@@ -62,9 +62,8 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
#if SINGERBOT_SUPPORT
m_patternIndex( 0 ),
#endif
m_orig_bpm( _it->eng()->getSongEditor()->getTempo() )
m_orig_bpm( engine::getSongEditor()->getTempo() )
{
setDetuning( _n.detuning() );
if( detuning() )
{
processMidiTime( pos() );
@@ -90,8 +89,8 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
(Uint16) ( ( getVolume() / 100.0f ) *
( m_instrumentTrack->getVolume() / 100.0f ) *
127 ), 0, 127 ) ),
midiTime::fromFrames( m_framesAhead, m_instrumentTrack
->eng()->framesPerTact64th() ) );
midiTime::fromFrames( m_framesAhead,
engine::framesPerTact64th() ) );
}
@@ -137,9 +136,8 @@ void notePlayHandle::play( bool _try_parallelizing )
}
if( m_released == FALSE &&
m_totalFramesPlayed +
m_instrumentTrack->eng()->getMixer()->framesPerAudioBuffer() >=
m_frames )
m_totalFramesPlayed + engine::getMixer()->framesPerAudioBuffer()
>= m_frames )
{
noteOff( m_frames - m_totalFramesPlayed );
}
@@ -149,8 +147,7 @@ void notePlayHandle::play( bool _try_parallelizing )
if( m_released == TRUE )
{
f_cnt_t todo =
m_instrumentTrack->eng()->getMixer()->framesPerAudioBuffer();
f_cnt_t todo = engine::getMixer()->framesPerAudioBuffer();
// if this note is base-note for arpeggio, always set
// m_releaseFramesToDo to bigger value than m_releaseFramesDone
// because we do not allow notePlayHandle::done() to be true
@@ -159,7 +156,7 @@ void notePlayHandle::play( bool _try_parallelizing )
if( arpBaseNote() == TRUE )
{
m_releaseFramesToDo = m_releaseFramesDone + 2 *
m_instrumentTrack->eng()->getMixer()->framesPerAudioBuffer();
engine::getMixer()->framesPerAudioBuffer();
}
// look whether we have frames left to be done before release
if( m_framesBeforeRelease )
@@ -167,7 +164,7 @@ void notePlayHandle::play( bool _try_parallelizing )
// yes, then look whether these samples can be played
// within one audio-buffer
if( m_framesBeforeRelease <=
m_instrumentTrack->eng()->getMixer()->framesPerAudioBuffer() )
engine::getMixer()->framesPerAudioBuffer() )
{
// yes, then we did less releaseFramesDone
todo -= m_framesBeforeRelease;
@@ -180,7 +177,7 @@ void notePlayHandle::play( bool _try_parallelizing )
// release-phase yet)
todo = 0;
m_framesBeforeRelease -=
m_instrumentTrack->eng()->getMixer()->framesPerAudioBuffer();
engine::getMixer()->framesPerAudioBuffer();
}
}
// look whether we're in release-phase
@@ -228,8 +225,7 @@ void notePlayHandle::play( bool _try_parallelizing )
}
// update internal data
m_totalFramesPlayed +=
m_instrumentTrack->eng()->getMixer()->framesPerAudioBuffer();
m_totalFramesPlayed += engine::getMixer()->framesPerAudioBuffer();
}
@@ -290,8 +286,7 @@ void notePlayHandle::noteOff( const f_cnt_t _s )
m_instrumentTrack->m_midiPort->outputChannel(),
key(), 0 ),
midiTime::fromFrames( m_framesBeforeRelease,
m_instrumentTrack->eng()
->framesPerTact64th() ) );
engine::framesPerTact64th() ) );
}
else
{
@@ -354,8 +349,7 @@ void notePlayHandle::mute( void )
int notePlayHandle::index( void ) const
{
const playHandleVector & phv =
m_instrumentTrack->eng()->getMixer()->playHandles();
const playHandleVector & phv = engine::getMixer()->playHandles();
int idx = 0;
for( constPlayHandleVector::const_iterator it = phv.begin();
it != phv.end(); ++it )
@@ -383,7 +377,7 @@ int notePlayHandle::index( void ) const
constNotePlayHandleVector notePlayHandle::nphsOfInstrumentTrack(
const instrumentTrack * _it, bool _all_ph )
{
const playHandleVector & phv = _it->eng()->getMixer()->playHandles();
const playHandleVector & phv = engine::getMixer()->playHandles();
constNotePlayHandleVector cnphv;
for( constPlayHandleVector::const_iterator it = phv.begin();

View File

@@ -135,9 +135,8 @@ pianoRoll::pianoRollKeyTypes pianoRoll::prKeyOrder[] =
const int DEFAULT_PR_PPT = KEY_LINE_HEIGHT * DEFAULT_STEPS_PER_TACT;
pianoRoll::pianoRoll( engine * _engine ) :
QWidget( _engine->getMainWindow()->workspace() ),
journallingObject( _engine ),
pianoRoll::pianoRoll( void ) :
QWidget( engine::getMainWindow()->workspace() ),
m_paintPixmap(),
m_pattern( NULL ),
m_currentPosition(),
@@ -198,15 +197,14 @@ pianoRoll::pianoRoll( engine * _engine ) :
#ifdef QT4
// add us to workspace
eng()->getMainWindow()->workspace()->addWindow( this );
engine::getMainWindow()->workspace()->addWindow( this );
#endif
// add time-line
m_timeLine = new timeLine( WHITE_KEY_WIDTH, 32, m_ppt,
eng()->getSongEditor()->getPlayPos(
engine::getSongEditor()->getPlayPos(
songEditor::PLAY_PATTERN ),
m_currentPosition, this,
eng() );
m_currentPosition, this );
connect( this, SIGNAL( positionChanged( const midiTime & ) ),
m_timeLine, SLOT( updatePosition( const midiTime & ) ) );
connect( m_timeLine, SIGNAL( positionChanged( const midiTime & ) ),
@@ -405,7 +403,7 @@ pianoRoll::pianoRoll( engine * _engine ) :
zoom_lbl->setPixmap( embed::getIconPixmap( "zoom" ) );
// setup zooming-stuff
m_zoomingComboBox = new comboBox( m_toolBar, NULL, eng(), NULL );
m_zoomingComboBox = new comboBox( m_toolBar, NULL, NULL );
m_zoomingComboBox->setFixedSize( 80, 22 );
for( int i = 0; i < 6; ++i )
{
@@ -421,7 +419,7 @@ pianoRoll::pianoRoll( engine * _engine ) :
QLabel * quantize_lbl = new QLabel( m_toolBar );
quantize_lbl->setPixmap( embed::getIconPixmap( "quantize" ) );
m_quantizeComboBox = new comboBox( m_toolBar, NULL, eng(), NULL );
m_quantizeComboBox = new comboBox( m_toolBar, NULL, NULL );
m_quantizeComboBox->setFixedSize( 60, 22 );
for( int i = 0; i < 7; ++i )
{
@@ -434,7 +432,7 @@ pianoRoll::pianoRoll( engine * _engine ) :
QLabel * note_len_lbl = new QLabel( m_toolBar );
note_len_lbl->setPixmap( embed::getIconPixmap( "note" ) );
m_noteLenComboBox = new comboBox( m_toolBar, NULL, eng(), NULL );
m_noteLenComboBox = new comboBox( m_toolBar, NULL, NULL );
m_noteLenComboBox->setFixedSize( 120, 22 );
m_noteLenComboBox->addItem( tr( "Last note" ),
embed::getIconPixmap( "edit_draw" ) );
@@ -1186,7 +1184,7 @@ void pianoRoll::keyPressEvent( QKeyEvent * _ke )
break;
case Qt::Key_Space:
if( eng()->getSongEditor()->playing() )
if( engine::getSongEditor()->playing() )
{
stop();
}
@@ -1363,8 +1361,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me )
midiTime note_pos( pos_tact_64th );
midiTime note_len( newNoteLen() );
note new_note( eng(),
note_len, note_pos,
note new_note( note_len, note_pos,
(tones)( key_num %
NOTES_PER_OCTAVE ),
(octaves)( key_num /
@@ -1415,7 +1412,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me )
QApplication::setOverrideCursor( c );
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
else if( ( _me->button() == Qt::RightButton &&
m_editMode == DRAW ) ||
@@ -1435,7 +1432,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me )
( *it )->setLength( 0 );
m_pattern->update();
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
}
else if( _me->button() == Qt::LeftButton &&
@@ -1474,7 +1471,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me )
m_action = MOVE_SELECTION;
play_note = FALSE;
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
else if( _me->button() == Qt::RightButton &&
m_editMode == MOVE )
@@ -1490,7 +1487,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me )
// was there an action where should be played the note?
if( play_note == TRUE && m_recording == FALSE &&
eng()->getSongEditor()->playing() == FALSE )
engine::getSongEditor()->playing() == FALSE )
{
m_lastKey = key_num;
m_pattern->getInstrumentTrack()->processInEvent(
@@ -1579,7 +1576,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
m_action != SELECT_NOTES &&
m_action != MOVE_SELECTION &&
m_recording == FALSE &&
eng()->getSongEditor()->playing() == FALSE )
engine::getSongEditor()->playing() == FALSE )
{
m_lastKey = key_num;
m_pattern->getInstrumentTrack()->processInEvent(
@@ -1662,7 +1659,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
m_pattern->update();
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
else if(
@@ -2116,7 +2113,7 @@ void pianoRoll::resizeEvent( QResizeEvent * )
}
m_topBottomScroll->setValue( m_totalKeysToScroll - m_startKey );
eng()->getSongEditor()->getPlayPos( songEditor::PLAY_PATTERN
engine::getSongEditor()->getPlayPos( songEditor::PLAY_PATTERN
).m_timeLine->setFixedWidth( width() );
m_toolBar->setFixedWidth( width() );
update();
@@ -2128,7 +2125,7 @@ void pianoRoll::resizeEvent( QResizeEvent * )
void pianoRoll::wheelEvent( QWheelEvent * _we )
{
_we->accept();
if( eng()->getMainWindow()->isCtrlPressed() == TRUE )
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
{
if( _we->delta() > 0 )
{
@@ -2148,7 +2145,7 @@ void pianoRoll::wheelEvent( QWheelEvent * _we )
m_timeLine->setPixelsPerTact( m_ppt );
update();
}
else if( eng()->getMainWindow()->isShiftPressed() )
else if( engine::getMainWindow()->isShiftPressed() )
{
m_leftRightScroll->setValue( m_leftRightScroll->value() -
_we->delta() * 2 / 15 );
@@ -2194,31 +2191,31 @@ void pianoRoll::play( void )
return;
}
if( eng()->getSongEditor()->playing() )
if( engine::getSongEditor()->playing() )
{
if( eng()->getSongEditor()->playMode() !=
if( engine::getSongEditor()->playMode() !=
songEditor::PLAY_PATTERN )
{
eng()->getSongEditor()->stop();
eng()->getSongEditor()->playPattern( m_pattern );
engine::getSongEditor()->stop();
engine::getSongEditor()->playPattern( m_pattern );
m_playButton->setIcon( embed::getIconPixmap(
"pause" ) );
}
else
{
eng()->getSongEditor()->pause();
engine::getSongEditor()->pause();
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
}
}
else if( eng()->getSongEditor()->paused() )
else if( engine::getSongEditor()->paused() )
{
eng()->getSongEditor()->resumeFromPause();
engine::getSongEditor()->resumeFromPause();
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
}
else
{
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
eng()->getSongEditor()->playPattern( m_pattern );
engine::getSongEditor()->playPattern( m_pattern );
}
}
@@ -2227,7 +2224,7 @@ void pianoRoll::play( void )
void pianoRoll::record( void )
{
if( eng()->getSongEditor()->playing() )
if( engine::getSongEditor()->playing() )
{
stop();
}
@@ -2237,7 +2234,7 @@ void pianoRoll::record( void )
}
m_recording = TRUE;
eng()->getSongEditor()->playPattern( m_pattern, FALSE );
engine::getSongEditor()->playPattern( m_pattern, FALSE );
}
@@ -2245,7 +2242,7 @@ void pianoRoll::record( void )
void pianoRoll::stop( void )
{
eng()->getSongEditor()->stop();
engine::getSongEditor()->stop();
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
m_playButton->update();
m_recording = FALSE;
@@ -2259,7 +2256,7 @@ void pianoRoll::recordNote( const note & _n )
{
if( m_recording == TRUE && validPattern() == TRUE )
{
note n( eng(), _n.length(), eng()->getSongEditor()->getPlayPos(
note n( _n.length(), engine::getSongEditor()->getPlayPos(
songEditor::PLAY_PATTERN ) - _n.length(),
_n.tone(), _n.octave(),
_n.getVolume(), _n.getPanning() );
@@ -2272,7 +2269,7 @@ void pianoRoll::recordNote( const note & _n )
#ifndef QT4
qApp->unlock();
#endif
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
}
@@ -2500,7 +2497,7 @@ void pianoRoll::cutSelectedNotes( void )
if( selected_notes.empty() == FALSE )
{
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
midiTime start_pos( selected_notes.front()->pos().getTact(),
0 );
@@ -2519,7 +2516,7 @@ void pianoRoll::cutSelectedNotes( void )
}
update();
eng()->getSongEditor()->update();
engine::getSongEditor()->update();
}
@@ -2545,9 +2542,9 @@ void pianoRoll::pasteNotes( void )
// we only have to do the following lines if we pasted at
// least one note...
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
update();
eng()->getSongEditor()->update();
engine::getSongEditor()->update();
}
}
@@ -2574,9 +2571,9 @@ void pianoRoll::deleteSelectedNotes( void )
if( update_after_delete == TRUE )
{
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
update();
eng()->getSongEditor()->update();
engine::getSongEditor()->update();
}
}
@@ -2585,8 +2582,8 @@ void pianoRoll::deleteSelectedNotes( void )
void pianoRoll::updatePosition( const midiTime & _t )
{
if( ( eng()->getSongEditor()->playing() &&
eng()->getSongEditor()->playMode() ==
if( ( engine::getSongEditor()->playing() &&
engine::getSongEditor()->playMode() ==
songEditor::PLAY_PATTERN ) ||
m_scrollBack == TRUE )
{

View File

@@ -4,7 +4,7 @@
* piano_widget.cpp - implementation of piano-widget used in channel-window
* for testing channel
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -153,8 +153,7 @@ pianoWidget::pianoWidget( instrumentTrack * _parent ) :
setBackgroundMode( Qt::NoBackground );
#endif
m_noteKnob = new knob( knobDark_28, NULL, tr ( "Base note" ),
_parent->eng(), _parent );
m_noteKnob = new knob( knobDark_28, NULL, tr( "Base note" ), _parent );
m_noteKnob->setRange( 0, NOTES_PER_OCTAVE * OCTAVES - 1, 1.0f );
m_noteKnob->setInitValue( DEFAULT_OCTAVE * NOTES_PER_OCTAVE + A );

View File

@@ -3,7 +3,7 @@
/*
* plugin.cpp - implementation of plugin-class including plugin-loader
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -63,8 +63,7 @@ static plugin::descriptor dummy_plugin_descriptor =
plugin::plugin( const descriptor * _descriptor, engine * _engine ) :
journallingObject( _engine ),
plugin::plugin( const descriptor * _descriptor ) :
m_descriptor( _descriptor )
{
if( dummy_plugin_descriptor.logo == NULL )

View File

@@ -3,7 +3,7 @@
/*
* plugin_browser.cpp - implementation of the plugin-browser
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -52,10 +52,9 @@
pluginBrowser::pluginBrowser( QWidget * _parent, engine * _engine ) :
pluginBrowser::pluginBrowser( QWidget * _parent ) :
sideBarWidget( tr( "Instrument plugins" ),
embed::getIconPixmap( "plugins" ), _parent ),
engineObject( _engine )
embed::getIconPixmap( "plugins" ), _parent )
{
setWindowTitle( tr( "Plugin browser" ) );
m_view = new QWidget( contentParent() );
@@ -91,7 +90,7 @@ pluginBrowser::pluginBrowser( QWidget * _parent, engine * _engine ) :
if( it->type == plugin::Instrument )
{
pluginDescWidget * p = new pluginDescWidget( *it,
m_view, eng() );
m_view );
p->show();
view_layout->addWidget( p );
}
@@ -114,9 +113,8 @@ pluginBrowser::~pluginBrowser()
pluginDescWidget::pluginDescWidget( const plugin::descriptor & _pd,
QWidget * _parent, engine * _engine ) :
QWidget * _parent ) :
QWidget( _parent ),
engineObject( _engine ),
m_updateTimer( this ),
m_pluginDescriptor( _pd ),
m_logo( *_pd.logo ),
@@ -242,7 +240,7 @@ void pluginDescWidget::mousePressEvent( QMouseEvent * _me )
if( _me->button() == Qt::LeftButton )
{
new stringPairDrag( "instrument", m_pluginDescriptor.name,
m_logo, this, eng() );
m_logo, this );
leaveEvent( _me );
}
}

View File

@@ -4,7 +4,7 @@
* preset_preview_play_handle.cpp - implementation of class
* presetPreviewPlayHandle
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -55,8 +55,7 @@
class previewTrackContainer : public trackContainer
{
public:
previewTrackContainer( engine * _engine ) :
trackContainer( _engine ),
previewTrackContainer( void ) :
m_previewInstrumentTrack( NULL ),
m_previewNote( NULL ),
m_dataMutex()
@@ -119,58 +118,55 @@ private:
} ;
QMap<const engine *, previewTrackContainer *>
presetPreviewPlayHandle::s_previewTCs;
previewTrackContainer * presetPreviewPlayHandle::s_previewTC;
presetPreviewPlayHandle::presetPreviewPlayHandle(
const QString & _preset_file,
engine * _engine ) :
const QString & _preset_file ) :
playHandle( PresetPreviewHandle ),
engineObject( _engine ),
m_previewNote( NULL )
{
if( s_previewTCs.contains( _engine ) == FALSE )
if( !s_previewTC )
{
s_previewTCs[_engine] = new previewTrackContainer( eng() );
s_previewTC = new previewTrackContainer;
}
previewTC()->lockData();
s_previewTC->lockData();
if( previewTC()->previewNote() != NULL )
if( s_previewTC->previewNote() != NULL )
{
previewTC()->previewNote()->mute();
s_previewTC->previewNote()->mute();
}
const bool j = eng()->getProjectJournal()->isJournalling();
eng()->getProjectJournal()->setJournalling( FALSE );
const bool j = engine::getProjectJournal()->isJournalling();
engine::getProjectJournal()->setJournalling( FALSE );
multimediaProject mmp( _preset_file );
previewTC()->previewInstrumentTrack()->loadTrackSpecificSettings(
s_previewTC->previewInstrumentTrack()->loadTrackSpecificSettings(
mmp.content().firstChild().toElement() );
// preset also contains information about window-states etc. that's why
// here we have to make sure that the instrument-track-window is hidden
previewTC()->previewInstrumentTrack()->hide();
s_previewTC->previewInstrumentTrack()->hide();
// make sure, our preset-preview-track does not appear in any MIDI-
// devices list, so just disable receiving/sending MIDI-events at all
previewTC()->previewInstrumentTrack()->m_midiPort->setMode(
s_previewTC->previewInstrumentTrack()->m_midiPort->setMode(
midiPort::DUMMY );
// create note-play-handle for it
m_previewNote = new notePlayHandle(
previewTC()->previewInstrumentTrack(), 0,
s_previewTC->previewInstrumentTrack(), 0,
valueRanges<f_cnt_t>::max,
note( NULL, 0, 0, static_cast<tones>( A ),
note( 0, 0, static_cast<tones>( A ),
static_cast<octaves>( DEFAULT_OCTAVE - 1 ), 100 ) );
previewTC()->setPreviewNote( m_previewNote );
s_previewTC->setPreviewNote( m_previewNote );
previewTC()->unlockData();
eng()->getProjectJournal()->setJournalling( j );
s_previewTC->unlockData();
engine::getProjectJournal()->setJournalling( j );
}
@@ -178,15 +174,15 @@ presetPreviewPlayHandle::presetPreviewPlayHandle(
presetPreviewPlayHandle::~presetPreviewPlayHandle()
{
previewTC()->lockData();
s_previewTC->lockData();
// not muted by other preset-preview-handle?
if( m_previewNote->muted() == FALSE )
{
// then set according state
previewTC()->setPreviewNote( NULL );
s_previewTC->setPreviewNote( NULL );
}
delete m_previewNote;
previewTC()->unlockData();
s_previewTC->unlockData();
}
@@ -208,13 +204,10 @@ bool presetPreviewPlayHandle::done( void ) const
void presetPreviewPlayHandle::cleanUp( engine * _engine )
void presetPreviewPlayHandle::cleanUp( void )
{
if( s_previewTCs.contains( _engine ) == TRUE )
{
delete s_previewTCs[_engine];
s_previewTCs.remove( _engine );
}
delete s_previewTC;
s_previewTC = NULL;
}
@@ -224,17 +217,13 @@ constNotePlayHandleVector presetPreviewPlayHandle::nphsOfInstrumentTrack(
const instrumentTrack * _it )
{
constNotePlayHandleVector cnphv;
if( s_previewTCs.contains( _it->eng() ) == TRUE )
s_previewTC->lockData();
if( s_previewTC->previewNote() != NULL &&
s_previewTC->previewNote()->getInstrumentTrack() == _it )
{
previewTrackContainer * tc = s_previewTCs[_it->eng()];
tc->lockData();
if( tc->previewNote() != NULL &&
tc->previewNote()->getInstrumentTrack() == _it )
{
cnphv.push_back( tc->previewNote() );
}
tc->unlockData();
cnphv.push_back( s_previewTC->previewNote() );
}
s_previewTC->unlockData();
return( cnphv );
}

View File

@@ -36,14 +36,12 @@
samplePlayHandle::samplePlayHandle( const QString & _sample_file,
engine * _engine ) :
samplePlayHandle::samplePlayHandle( const QString & _sample_file ) :
playHandle( SamplePlayHandle ),
engineObject( _engine ),
m_sampleBuffer( new sampleBuffer( eng(), _sample_file ) ),
m_sampleBuffer( new sampleBuffer( _sample_file ) ),
m_doneMayReturnTrue( TRUE ),
m_frame( 0 ),
m_audioPort( new audioPort( "samplePlayHandle", eng() ) ),
m_audioPort( new audioPort( "samplePlayHandle" ) ),
m_ownAudioPort( TRUE ),
m_volume( 1.0f ),
m_track( NULL ),
@@ -56,11 +54,10 @@ samplePlayHandle::samplePlayHandle( const QString & _sample_file,
samplePlayHandle::samplePlayHandle( sampleBuffer * _sample_buffer ) :
playHandle( SamplePlayHandle ),
engineObject( _sample_buffer->eng() ),
m_sampleBuffer( sharedObject::ref( _sample_buffer ) ),
m_doneMayReturnTrue( TRUE ),
m_frame( 0 ),
m_audioPort( new audioPort( "samplePlayHandle", eng() ) ),
m_audioPort( new audioPort( "samplePlayHandle" ) ),
m_ownAudioPort( TRUE ),
m_volume( 1.0f ),
m_track( NULL ),
@@ -73,7 +70,6 @@ samplePlayHandle::samplePlayHandle( sampleBuffer * _sample_buffer ) :
samplePlayHandle::samplePlayHandle( sampleTCO * _tco ) :
playHandle( SamplePlayHandle ),
engineObject( _tco->eng() ),
m_sampleBuffer( sharedObject::ref( _tco->getSampleBuffer() ) ),
m_doneMayReturnTrue( TRUE ),
m_frame( 0 ),
@@ -90,7 +86,6 @@ samplePlayHandle::samplePlayHandle( sampleTCO * _tco ) :
samplePlayHandle::samplePlayHandle( pattern * _pattern ) :
playHandle( SamplePlayHandle ),
engineObject( _pattern->eng() ),
m_sampleBuffer( sharedObject::ref( _pattern->getFrozenPattern() ) ),
m_doneMayReturnTrue( TRUE ),
m_frame( 0 ),
@@ -132,7 +127,7 @@ void samplePlayHandle::play( const fpab_t _frame_base, bool )
return;
}
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer()
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer()
- _frame_base;
if( !( m_track && m_track->muted() )
&& !( m_bbTrack && m_bbTrack->muted() ) )
@@ -145,7 +140,7 @@ void samplePlayHandle::play( const fpab_t _frame_base, bool )
#endif
} } ;
m_sampleBuffer->play( buf, &m_state, frames );
eng()->getMixer()->bufferToPort( buf, frames, _frame_base, v,
engine::getMixer()->bufferToPort( buf, frames, _frame_base, v,
m_audioPort );
bufferAllocator::free( buf );
@@ -167,7 +162,9 @@ bool samplePlayHandle::done( void ) const
f_cnt_t samplePlayHandle::totalFrames( void ) const
{
return( m_sampleBuffer->endFrame() - m_sampleBuffer->startFrame() );
return( ( m_sampleBuffer->endFrame() - m_sampleBuffer->startFrame() ) *
( engine::getMixer()->sampleRate() /
SAMPLE_RATES[DEFAULT_QUALITY_LEVEL] ) );
}

View File

@@ -58,6 +58,7 @@
#include "tab_widget.h"
#include "gui_templates.h"
#include "mixer.h"
#include "project_journal.h"
#include "config_mgr.h"
#include "embed.h"
#include "debug.h"
@@ -98,10 +99,9 @@ inline void labelWidget( QWidget * _w, const QString & _txt )
setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
QDialog(),
engineObject( _engine ),
m_bufferSize( eng()->getMixer()->framesPerAudioBuffer() ),
setupDialog::setupDialog( configTabs _tab_to_open ) :
m_bufferSize( configManager::inst()->value( "mixer",
"framesperaudiobuffer" ).toInt() ),
m_disableToolTips( configManager::inst()->value( "tooltips",
"disabled" ).toInt() ),
m_classicalKnobUsability( configManager::inst()->value( "knobs",
@@ -135,6 +135,8 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
setWindowTitle( tr( "Setup LMMS" ) );
setModal( TRUE );
engine::getProjectJournal()->setJournalling( FALSE );
QVBoxLayout * vlayout = new QVBoxLayout( this );
vlayout->setSpacing( 0 );
vlayout->setMargin( 0 );
@@ -170,10 +172,10 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
#else
m_bufSizeSlider->setMinimum( 1 );
m_bufSizeSlider->setMaximum( 256 );
m_bufSizeSlider->setLineStep( 4 );
m_bufSizeSlider->setLineStep( 8 );
m_bufSizeSlider->setTickmarks( QSlider::Below );
#endif
m_bufSizeSlider->setPageStep( 4 );
m_bufSizeSlider->setPageStep( 8 );
m_bufSizeSlider->setTickInterval( 8 );
m_bufSizeSlider->setGeometry( 10, 16, 340, 18 );
m_bufSizeSlider->setValue( m_bufferSize / 64 );
@@ -205,7 +207,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
ledCheckBox * disable_tooltips = new ledCheckBox(
tr( "Disable tooltips (no spurious "
"interrupts while playing)" ),
misc_tw, NULL, NULL, NULL );
misc_tw, NULL, NULL );
disable_tooltips->move( 10, 18 );
disable_tooltips->setChecked( m_disableToolTips );
connect( disable_tooltips, SIGNAL( toggled( bool ) ),
@@ -216,7 +218,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
tr( "Classical knob usability (move "
"cursor around knob to change "
"value)" ),
misc_tw, NULL, NULL, NULL );
misc_tw, NULL, NULL );
classical_knob_usability->move( 10, 36 );
classical_knob_usability->setChecked( m_classicalKnobUsability );
connect( classical_knob_usability, SIGNAL( toggled( bool ) ),
@@ -225,7 +227,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
ledCheckBox * gimp_like_windows = new ledCheckBox(
tr( "GIMP-like windows (no MDI)" ),
misc_tw, NULL, NULL, NULL );
misc_tw, NULL, NULL );
gimp_like_windows->move( 10, 54 );
gimp_like_windows->setChecked( m_gimpLikeWindows );
connect( gimp_like_windows, SIGNAL( toggled( bool ) ),
@@ -234,7 +236,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
ledCheckBox * no_wizard = new ledCheckBox(
tr( "Do not show wizard after up-/downgrade" ),
misc_tw, NULL, NULL, NULL );
misc_tw, NULL, NULL );
no_wizard->move( 10, 72 );
no_wizard->setChecked( m_noWizard );
connect( no_wizard, SIGNAL( toggled( bool ) ),
@@ -243,17 +245,16 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
ledCheckBox * no_msg = new ledCheckBox(
tr( "Do not show message after "
"closing this dialog" ),
misc_tw, NULL, NULL, NULL );
"closing this dialog" ),
misc_tw, NULL, NULL );
no_msg->move( 10, 90 );
no_msg->setChecked( m_noMsgAfterSetup );
connect( no_msg, SIGNAL( toggled( bool ) ),
this, SLOT( toggleNoMsgAfterSetup( bool ) ) );
ledCheckBox * dbv = new ledCheckBox(
tr( "Display volume as dbV " ),
misc_tw, NULL, NULL, NULL );
ledCheckBox * dbv = new ledCheckBox( tr( "Display volume as dbV " ),
misc_tw, NULL, NULL );
dbv->move( 10, 108 );
dbv->setChecked( m_displaydBV );
connect( dbv, SIGNAL( toggled( bool ) ),
@@ -262,7 +263,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
ledCheckBox * no_mmpz = new ledCheckBox(
tr( "Do not compress project files per default" ),
misc_tw, NULL, NULL, NULL );
misc_tw, NULL, NULL );
no_mmpz->move( 10, 126 );
no_mmpz->setChecked( m_noMMPZ );
connect( no_mmpz, SIGNAL( toggled( bool ) ),
@@ -436,7 +437,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
ledCheckBox * disable_ch_act_ind = new ledCheckBox(
tr( "Disable channel activity indicators" ),
ui_fx_tw, NULL, NULL, NULL );
ui_fx_tw, NULL, NULL );
disable_ch_act_ind->move( 10, 20 );
disable_ch_act_ind->setChecked( m_disableChActInd );
connect( disable_ch_act_ind, SIGNAL( toggled( bool ) ),
@@ -445,7 +446,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
ledCheckBox * manual_ch_piano = new ledCheckBox(
tr( "Only press keys on channel-piano manually" ),
ui_fx_tw, NULL, NULL, NULL );
ui_fx_tw, NULL, NULL );
manual_ch_piano->move( 10, 40 );
manual_ch_piano->setChecked( m_manualChPiano );
connect( manual_ch_piano, SIGNAL( toggled( bool ) ),
@@ -461,7 +462,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
smp_supp_tw );
par_level_lbl->move( 10, 15 );
lcdSpinBox * par_level = new lcdSpinBox( 1, 16, 2, smp_supp_tw, NULL,
NULL, NULL );
NULL );
par_level->setValue( m_parLevel );
connect( par_level, SIGNAL( valueChanged( int ) ),
this, SLOT( setParallelizingLevel( int ) ) );
@@ -571,12 +572,12 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
}
#ifdef QT4
m_audioInterfaces->setCurrentIndex( m_audioInterfaces->findText(
tr( eng()->getMixer()->audioDevName() ) ) );
tr( engine::getMixer()->audioDevName() ) ) );
#else
m_audioInterfaces->setCurrentText(
tr( eng()->getMixer()->audioDevName() ) );
tr( engine::getMixer()->audioDevName() ) );
#endif
m_audioIfaceSetupWidgets[eng()->getMixer()->audioDevName()]->show();
m_audioIfaceSetupWidgets[engine::getMixer()->audioDevName()]->show();
connect( m_audioInterfaces, SIGNAL( activated( const QString & ) ),
this, SLOT( audioInterfaceChanged( const QString & ) ) );
@@ -658,12 +659,12 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
#ifdef QT4
m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText(
tr( eng()->getMixer()->midiClientName() ) ) );
tr( engine::getMixer()->midiClientName() ) ) );
#else
m_midiInterfaces->setCurrentText(
tr( eng()->getMixer()->midiClientName() ) );
tr( engine::getMixer()->midiClientName() ) );
#endif
m_midiIfaceSetupWidgets[eng()->getMixer()->midiClientName()]->show();
m_midiIfaceSetupWidgets[engine::getMixer()->midiClientName()]->show();
connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ),
this, SLOT( midiInterfaceChanged( const QString & ) ) );
@@ -739,6 +740,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
setupDialog::~setupDialog()
{
engine::getProjectJournal()->setJournalling( TRUE );
}
@@ -822,6 +824,21 @@ void setupDialog::accept( void )
void setupDialog::setBufferSize( int _value )
{
const int step = DEFAULT_BUFFER_SIZE / 64;
if( _value > step && _value % step )
{
int mod_value = _value % step;
if( mod_value < step / 2 )
{
m_bufSizeSlider->setValue( _value - mod_value );
}
else
{
m_bufSizeSlider->setValue( _value + step - mod_value );
}
return;
}
if( m_bufSizeSlider->value() != _value )
{
m_bufSizeSlider->setValue( _value );
@@ -831,7 +848,7 @@ void setupDialog::setBufferSize( int _value )
m_bufSizeLbl->setText( tr( "Frames: %1\nLatency: %2 ms" ).arg(
m_bufferSize ).arg(
1000.0f * m_bufferSize /
eng()->getMixer()->sampleRate(),
engine::getMixer()->sampleRate(),
0, 'f', 1 ) );
}

View File

@@ -102,8 +102,7 @@
songEditor::songEditor( engine * _engine ) :
trackContainer( _engine ),
songEditor::songEditor( void ) :
m_fileName( "" ),
m_oldFileName( "" ),
m_exporting( FALSE ),
@@ -121,7 +120,7 @@ songEditor::songEditor( engine * _engine ) :
setWindowIcon( embed::getIconPixmap( "songeditor" ) );
QWidget * w = ( parentWidget() != NULL ) ? parentWidget() : this;
if( eng()->getMainWindow()->workspace() != NULL )
if( engine::getMainWindow()->workspace() != NULL )
{
resize( 680, 300 );
w->move( 10, 10 );
@@ -147,7 +146,7 @@ songEditor::songEditor( engine * _engine ) :
timeLine * tl = new timeLine( TRACK_OP_WIDTH +
DEFAULT_SETTINGS_WIDGET_WIDTH, 32,
pixelsPerTact(), m_playPos[PLAY_SONG],
m_currentPosition, cw, eng() );
m_currentPosition, cw );
connect( this, SIGNAL( positionChanged( const midiTime & ) ),
m_playPos[PLAY_SONG].m_timeLine,
SLOT( updatePosition( const midiTime & ) ) );
@@ -157,12 +156,12 @@ songEditor::songEditor( engine * _engine ) :
m_automation_track = track::create( track::AUTOMATION_TRACK, this );
// add some essential widgets to global tool-bar
QWidget * tb = eng()->getMainWindow()->toolBar();
QWidget * tb = engine::getMainWindow()->toolBar();
eng()->getMainWindow()->addSpacingToToolBar( 10 );
engine::getMainWindow()->addSpacingToToolBar( 10 );
m_bpmSpinBox = new lcdSpinBox( MIN_BPM, MAX_BPM, 3, tb, tr( "Tempo" ),
eng(), m_automation_track );
m_automation_track );
m_bpmSpinBox->setLabel( tr( "TEMPO/BPM" ) );
connect( m_bpmSpinBox, SIGNAL( valueChanged( int ) ), this,
SLOT( setTempo( int ) ) );
@@ -182,32 +181,33 @@ songEditor::songEditor( engine * _engine ) :
"should be played within a minute (or how many tacts "
"should be played within four minutes)." ) );
int col = eng()->getMainWindow()->addWidgetToToolBar( m_bpmSpinBox, 0 );
int col = engine::getMainWindow()->addWidgetToToolBar( m_bpmSpinBox,
0 );
toolButton * hq_btn = new toolButton( embed::getIconPixmap( "hq_mode" ),
tr( "High quality mode" ),
NULL, NULL, tb );
hq_btn->setCheckable( TRUE );
connect( hq_btn, SIGNAL( toggled( bool ) ), eng()->getMixer(),
connect( hq_btn, SIGNAL( toggled( bool ) ), engine::getMixer(),
SLOT( setHighQuality( bool ) ) );
hq_btn->setFixedWidth( 42 );
eng()->getMainWindow()->addWidgetToToolBar( hq_btn, 1, col );
engine::getMainWindow()->addWidgetToToolBar( hq_btn, 1, col );
toolButton * cp_btn = new toolButton( embed::getIconPixmap( "auto_limit" ),
tr( "Auto limiter" ),
NULL, NULL, tb );
cp_btn->setCheckable( TRUE );
connect( cp_btn, SIGNAL( toggled( bool ) ), eng()->getMixer(),
connect( cp_btn, SIGNAL( toggled( bool ) ), engine::getMixer(),
SLOT( setClipScaling( bool ) ) );
cp_btn->setFixedWidth( 30 );
eng()->getMainWindow()->addWidgetToToolBar( cp_btn, 1, col + 1 );
engine::getMainWindow()->addWidgetToToolBar( cp_btn, 1, col + 1 );
eng()->getMainWindow()->addSpacingToToolBar( 10 );
engine::getMainWindow()->addSpacingToToolBar( 10 );
connect( eng()->getMixer(), SIGNAL( sampleRateChanged() ), this,
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ), this,
SLOT( updateFramesPerTact64th() ) );
@@ -216,7 +216,7 @@ songEditor::songEditor( engine * _engine ) :
master_vol_lbl->setPixmap( embed::getIconPixmap( "master_volume" ) );
m_masterVolumeSlider = new automatableSlider( tb, tr( "Master volume" ),
eng(), m_automation_track );
m_automation_track );
m_masterVolumeSlider->setOrientation( Qt::Vertical );
m_masterVolumeSlider->setRange( 0, 200 );
m_masterVolumeSlider->setPageStep( 1 );
@@ -243,18 +243,18 @@ songEditor::songEditor( engine * _engine ) :
m_mvsStatus->setTitle( tr( "Master volume" ) );
m_mvsStatus->setPixmap( embed::getIconPixmap( "master_volume" ) );
eng()->getMainWindow()->addWidgetToToolBar( master_vol_lbl );
eng()->getMainWindow()->addWidgetToToolBar( m_masterVolumeSlider );
engine::getMainWindow()->addWidgetToToolBar( master_vol_lbl );
engine::getMainWindow()->addWidgetToToolBar( m_masterVolumeSlider );
eng()->getMainWindow()->addSpacingToToolBar( 10 );
engine::getMainWindow()->addSpacingToToolBar( 10 );
QLabel * master_pitch_lbl = new QLabel( tb );
master_pitch_lbl->setPixmap( embed::getIconPixmap( "master_pitch" ) );
master_pitch_lbl->setFixedHeight( 64 );
m_masterPitchSlider = new automatableSlider( tb, tr( "Master pitch" ),
eng(), m_automation_track );
m_automation_track );
m_masterPitchSlider->setOrientation( Qt::Vertical );
m_masterPitchSlider->setRange( -12, 12 );
m_masterPitchSlider->setPageStep( 1 );
@@ -280,10 +280,10 @@ songEditor::songEditor( engine * _engine ) :
m_mpsStatus->setTitle( tr( "Master pitch" ) );
m_mpsStatus->setPixmap( embed::getIconPixmap( "master_pitch" ) );
eng()->getMainWindow()->addWidgetToToolBar( master_pitch_lbl );
eng()->getMainWindow()->addWidgetToToolBar( m_masterPitchSlider );
engine::getMainWindow()->addWidgetToToolBar( master_pitch_lbl );
engine::getMainWindow()->addWidgetToToolBar( m_masterPitchSlider );
eng()->getMainWindow()->addSpacingToToolBar( 10 );
engine::getMainWindow()->addSpacingToToolBar( 10 );
// create widget for visualization- and cpu-load-widget
QWidget * vc_w = new QWidget( tb );
@@ -293,12 +293,12 @@ songEditor::songEditor( engine * _engine ) :
//vcw_layout->addStretch();
vcw_layout->addWidget( new visualizationWidget(
embed::getIconPixmap( "output_graph" ), vc_w, eng() ) );
embed::getIconPixmap( "output_graph" ), vc_w ) );
vcw_layout->addWidget( new cpuloadWidget( vc_w, eng() ) );
vcw_layout->addWidget( new cpuloadWidget( vc_w ) );
vcw_layout->addStretch();
eng()->getMainWindow()->addWidgetToToolBar( vc_w );
engine::getMainWindow()->addWidgetToToolBar( vc_w );
// create own toolbar
@@ -399,7 +399,7 @@ songEditor::songEditor( engine * _engine ) :
zoom_lbl->setPixmap( embed::getIconPixmap( "zoom" ) );
// setup zooming-stuff
m_zoomingComboBox = new comboBox( m_toolBar, NULL, eng(), NULL );
m_zoomingComboBox = new comboBox( m_toolBar, NULL, NULL );
m_zoomingComboBox->setFixedSize( 80, 22 );
m_zoomingComboBox->move( 580, 4 );
for( int i = 0; i < 7; ++i )
@@ -516,13 +516,13 @@ void songEditor::resizeEvent( QResizeEvent * _re )
void songEditor::keyPressEvent( QKeyEvent * _ke )
{
if( /*_ke->modifiers() & Qt::ShiftModifier*/
eng()->getMainWindow()->isShiftPressed() == TRUE &&
engine::getMainWindow()->isShiftPressed() == TRUE &&
_ke->key() == Qt::Key_Insert )
{
insertBar();
}
else if(/* _ke->modifiers() & Qt::ShiftModifier &&*/
eng()->getMainWindow()->isShiftPressed() == TRUE &&
engine::getMainWindow()->isShiftPressed() == TRUE &&
_ke->key() == Qt::Key_Delete )
{
removeBar();
@@ -583,7 +583,7 @@ void songEditor::scrolled( int _new_pos )
void songEditor::wheelEvent( QWheelEvent * _we )
{
if( eng()->getMainWindow()->isCtrlPressed() == TRUE )
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
{
if( _we->delta() > 0 )
{
@@ -605,7 +605,7 @@ void songEditor::wheelEvent( QWheelEvent * _we )
// and make sure, all TCO's are resized and relocated
realignTracks( TRUE );
}
else if( eng()->getMainWindow()->isShiftPressed() == TRUE )
else if( engine::getMainWindow()->isShiftPressed() == TRUE )
{
m_leftRightScroll->setValue( m_leftRightScroll->value() -
_we->delta() / 30 );
@@ -634,7 +634,7 @@ void songEditor::masterVolumeChanged( int _new_val )
QPoint( m_masterVolumeSlider->width() + 2, -2 ) );
m_mvsStatus->setVisibilityTimeOut( 1000 );
}
eng()->getMixer()->setMasterGain( _new_val / 100.0f );
engine::getMixer()->setMasterGain( _new_val / 100.0f );
}
@@ -756,7 +756,7 @@ void songEditor::zoomingChanged( const QString & _zfac )
void songEditor::setTempo( int _new_bpm )
{
playHandleVector & phv = eng()->getMixer()->playHandles();
playHandleVector & phv = engine::getMixer()->playHandles();
for( playHandleVector::iterator it = phv.begin(); it != phv.end();
++it )
{
@@ -768,7 +768,7 @@ void songEditor::setTempo( int _new_bpm )
}
m_bpmSpinBox->setInitValue( _new_bpm );
eng()->updateFramesPerTact64th();
engine::updateFramesPerTact64th();
emit tempoChanged( _new_bpm );
}
@@ -847,7 +847,7 @@ void songEditor::doActions( void )
updateTimeLinePosition();
// remove all note-play-handles that are active
eng()->getMixer()->clear();
engine::getMixer()->clear();
break;
}
@@ -935,7 +935,7 @@ void songEditor::processNextBuffer( void )
// at song-start we have to reset the LFOs
if( m_playPos[PLAY_SONG] == 0 )
{
envelopeAndLFOWidget::resetLFO( eng() );
envelopeAndLFOWidget::resetLFO();
}
break;
@@ -944,11 +944,10 @@ void songEditor::processNextBuffer( void )
break;
case PLAY_BB:
if( eng()->getBBEditor()->numOfBBs() > 0 )
if( engine::getBBEditor()->numOfBBs() > 0 )
{
tco_num = eng()->getBBEditor()->currentBB();
tv.push_back( bbTrack::findBBTrack( tco_num,
eng() ) );
tco_num = engine::getBBEditor()->currentBB();
tv.push_back( bbTrack::findBBTrack( tco_num ) );
}
break;
@@ -990,11 +989,12 @@ void songEditor::processNextBuffer( void )
}
f_cnt_t total_frames_played = 0;
float frames_per_tact64th = eng()->framesPerTact64th();
float frames_per_tact64th = engine::framesPerTact64th();
while( total_frames_played < eng()->getMixer()->framesPerAudioBuffer() )
while( total_frames_played
< engine::getMixer()->framesPerAudioBuffer() )
{
f_cnt_t played_frames = eng()->getMixer()
f_cnt_t played_frames = engine::getMixer()
->framesPerAudioBuffer() - total_frames_played;
float current_frame = m_playPos[m_playMode].currentFrame();
@@ -1016,7 +1016,7 @@ void songEditor::processNextBuffer( void )
// or to loop back to first tact
if( m_playMode == PLAY_BB )
{
max_tact = eng()->getBBEditor()
max_tact = engine::getBBEditor()
->lengthOfCurrentBB();
}
else if( m_playMode == PLAY_PATTERN &&
@@ -1129,7 +1129,7 @@ void songEditor::play( void )
if( m_playMode != PLAY_SONG )
{
// make sure, bb-editor updates/resets it play-button
eng()->getBBEditor()->stop();
engine::getBBEditor()->stop();
//pianoRoll::inst()->stop();
}
else
@@ -1374,7 +1374,7 @@ bool songEditor::mayChangeProject( void )
#else
information
#endif
( eng()->getMainWindow(),
( engine::getMainWindow(),
tr( "Project not saved" ),
tr( "The current project was "
"modified since last "
@@ -1395,12 +1395,12 @@ bool songEditor::mayChangeProject( void )
QMessageBox::Yes,
QMessageBox::No,
QMessageBox::Cancel,
eng()->getMainWindow() );
engine::getMainWindow() );
int answer = mb.exec();
if( answer == QMessageBox::Yes )
{
return( eng()->getMainWindow()->saveProject() );
return( engine::getMainWindow()->saveProject() );
}
else if( answer == QMessageBox::No )
{
@@ -1415,7 +1415,7 @@ bool songEditor::mayChangeProject( void )
void songEditor::clearProject( void )
{
eng()->getProjectJournal()->setJournalling( FALSE );
engine::getProjectJournal()->setJournalling( FALSE );
if( m_playing )
{
@@ -1427,8 +1427,8 @@ void songEditor::clearProject( void )
// make sure all running notes are cleared, otherwise the whole
// thing will end up in a SIGSEGV...
eng()->getMixer()->clear( TRUE );
while( eng()->getMixer()->haveNoRunningNotes() == FALSE )
engine::getMixer()->clear( TRUE );
while( engine::getMixer()->haveNoRunningNotes() == FALSE )
{
#ifdef QT4
QApplication::processEvents( QEventLoop::AllEvents );
@@ -1439,19 +1439,19 @@ void songEditor::clearProject( void )
clearAllTracks();
eng()->getAutomationEditor()->setCurrentPattern( NULL );
engine::getAutomationEditor()->setCurrentPattern( NULL );
m_bpmSpinBox->getAutomationPattern()->clear();
m_masterVolumeSlider->clearAutomationValues();
m_masterPitchSlider->clearAutomationValues();
eng()->getBBEditor()->clearAllTracks();
engine::getBBEditor()->clearAllTracks();
eng()->getProjectNotes()->clear();
engine::getProjectNotes()->clear();
eng()->getProjectJournal()->clearInvalidJournallingObjects();
eng()->getProjectJournal()->clearJournal();
engine::getProjectJournal()->clearInvalidJournallingObjects();
engine::getProjectJournal()->clearJournal();
eng()->getProjectJournal()->setJournalling( TRUE );
engine::getProjectJournal()->setJournalling( TRUE );
}
@@ -1479,14 +1479,14 @@ void songEditor::createNewProject( void )
clearProject();
eng()->getProjectJournal()->setJournalling( FALSE );
engine::getProjectJournal()->setJournalling( FALSE );
track * t;
t = track::create( track::INSTRUMENT_TRACK, this );
dynamic_cast< instrumentTrack * >( t )->loadInstrument(
"tripleoscillator" );
track::create( track::SAMPLE_TRACK, this );
t = track::create( track::INSTRUMENT_TRACK, eng()->getBBEditor() );
t = track::create( track::INSTRUMENT_TRACK, engine::getBBEditor() );
dynamic_cast< instrumentTrack * >( t )->loadInstrument(
"tripleoscillator" );
track::create( track::BB_TRACK, this );
@@ -1501,9 +1501,9 @@ void songEditor::createNewProject( void )
m_modified = FALSE;
eng()->getMainWindow()->resetWindowTitle( "" );
engine::getMainWindow()->resetWindowTitle( "" );
eng()->getProjectJournal()->setJournalling( TRUE );
engine::getProjectJournal()->setJournalling( TRUE );
}
@@ -1527,7 +1527,7 @@ void FASTCALL songEditor::loadProject( const QString & _file_name )
{
clearProject();
eng()->getProjectJournal()->setJournalling( FALSE );
engine::getProjectJournal()->setJournalling( FALSE );
m_fileName = _file_name;
m_oldFileName = _file_name;
@@ -1600,21 +1600,21 @@ void FASTCALL songEditor::loadProject( const QString & _file_name )
restoreState( node.toElement() );
}
else if( node.nodeName() ==
eng()->getPianoRoll()->nodeName() )
engine::getPianoRoll()->nodeName() )
{
eng()->getPianoRoll()->restoreState(
engine::getPianoRoll()->restoreState(
node.toElement() );
}
else if( node.nodeName() ==
eng()->getAutomationEditor()->nodeName() )
engine::getAutomationEditor()->nodeName() )
{
eng()->getAutomationEditor()->restoreState(
engine::getAutomationEditor()->restoreState(
node.toElement() );
}
else if( node.nodeName() ==
eng()->getProjectNotes()->nodeName() )
engine::getProjectNotes()->nodeName() )
{
( (journallingObject *)( eng()->
( (journallingObject *)( engine::
getProjectNotes() ) )->
restoreState( node.toElement() );
}
@@ -1633,9 +1633,9 @@ void FASTCALL songEditor::loadProject( const QString & _file_name )
m_loadingProject = FALSE;
eng()->getMainWindow()->resetWindowTitle( "" );
engine::getMainWindow()->resetWindowTitle( "" );
eng()->getProjectJournal()->setJournalling( TRUE );
engine::getProjectJournal()->setJournalling( TRUE );
}
@@ -1653,9 +1653,9 @@ bool songEditor::saveProject( void )
( (journallingObject *)( this ) )->saveState( mmp, mmp.content() );
eng()->getPianoRoll()->saveState( mmp, mmp.content() );
eng()->getAutomationEditor()->saveState( mmp, mmp.content() );
( (journallingObject *)( eng()->getProjectNotes() ) )->saveState( mmp,
engine::getPianoRoll()->saveState( mmp, mmp.content() );
engine::getAutomationEditor()->saveState( mmp, mmp.content() );
( (journallingObject *)( engine::getProjectNotes() ) )->saveState( mmp,
mmp.content() );
m_playPos[PLAY_SONG].m_timeLine->saveState( mmp, mmp.content() );
@@ -1669,7 +1669,7 @@ bool songEditor::saveProject( void )
).arg( m_fileName ),
embed::getIconPixmap( "project_save", 24, 24 ),
2000 );
eng()->getMainWindow()->resetWindowTitle( "" );
engine::getMainWindow()->resetWindowTitle( "" );
}
else
{
@@ -1739,7 +1739,7 @@ void songEditor::exportProject( void )
}
base_filename += fileEncodeDevices[0].m_extension;
QFileDialog efd( eng()->getMainWindow() );
QFileDialog efd( engine::getMainWindow() );
efd.setFileMode( QFileDialog::AnyFile );
int idx = 0;
@@ -1777,7 +1777,7 @@ void songEditor::exportProject( void )
const QString export_file_name = efd.selectedFile();
#endif
if( QFileInfo( export_file_name ).exists() == TRUE &&
QMessageBox::warning( eng()->getMainWindow(),
QMessageBox::warning( engine::getMainWindow(),
tr( "File already exists" ),
tr( "The file \"%1\" already "
"exists. Do you want "
@@ -1793,7 +1793,7 @@ void songEditor::exportProject( void )
return;
}
exportProjectDialog epd( export_file_name,
eng()->getMainWindow(), eng() );
engine::getMainWindow() );
epd.exec();
}
}
@@ -1803,7 +1803,7 @@ void songEditor::exportProject( void )
void songEditor::updateFramesPerTact64th( void )
{
eng()->updateFramesPerTact64th();
engine::updateFramesPerTact64th();
}

View File

@@ -4,7 +4,7 @@
* surround_area.cpp - a widget for setting position of a channel +
* calculation of volume for each speaker
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -75,7 +75,7 @@ QPixmap * surroundArea::s_backgroundArtwork = NULL;
surroundArea::surroundArea( QWidget * _parent, const QString & _name,
engine * _engine, track * _track ) :
track * _track ) :
QWidget( _parent
#ifndef QT4
, _name.ascii()
@@ -84,12 +84,12 @@ surroundArea::surroundArea( QWidget * _parent, const QString & _name,
m_sndSrcPos( QPoint() )
{
m_position_x = new knob( knobDark_28, NULL, tr ( "Surround area X" ),
_engine, _track );
_track );
m_position_x->setRange( -SURROUND_AREA_SIZE, SURROUND_AREA_SIZE, 1.0f );
m_position_x->setInitValue( 0.0f );
m_position_y = new knob( knobDark_28, NULL, tr ( "Surround area Y" ),
_engine, _track );
_track );
m_position_y->setRange( -SURROUND_AREA_SIZE, SURROUND_AREA_SIZE, 1.0f );
m_position_y->setInitValue( 0.0f );

View File

@@ -3,7 +3,7 @@
/*
* timeline.cpp - class timeLine, representing a time-line with position marker
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -49,6 +49,7 @@
#include "timeline.h"
#include "embed.h"
#include "engine.h"
#include "templates.h"
#include "nstate_button.h"
#include "main_window.h"
@@ -64,9 +65,8 @@ QPixmap * timeLine::s_loopPointDisabledPixmap = NULL;
timeLine::timeLine( const int _xoff, const int _yoff, const float _ppt,
songEditor::playPos & _pos, const midiTime & _begin,
QWidget * _parent, engine * _engine ) :
QWidget * _parent ) :
QWidget( _parent ),
journallingObject( _engine ),
m_autoScroll( AUTOSCROLL_ENABLED ),
m_loopPoints( LOOP_POINTS_DISABLED ),
m_behaviourAtStop( BACK_TO_ZERO ),
@@ -361,7 +361,7 @@ void timeLine::mouseMoveEvent( QMouseEvent * _me )
case MOVE_LOOP_END:
{
const Uint8 i = m_action - MOVE_LOOP_BEGIN;
if( eng()->getMainWindow()->isCtrlPressed() == TRUE )
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
{
// no ctrl-press-hint when having ctrl pressed
delete m_hint;

View File

@@ -3,7 +3,7 @@
/*
* tool.cpp - base class for all tool plugins (graphs, extensions, etc)
*
* Copyright (c) 2006 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -33,7 +33,7 @@
tool::tool( mainWindow * _window, const descriptor * _descriptor ) :
QWidget( _window->workspace() ),
plugin( _descriptor, _window->eng() )
plugin( _descriptor )
{
setWindowTitle( _descriptor->public_name );
setWindowIcon( *_descriptor->logo );

View File

@@ -4,7 +4,7 @@
* track.cpp - implementation of classes concerning tracks -> neccessary for
* all track-like objects (beat/bassline, sample-track...)
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -90,7 +90,6 @@ trackContentObject::trackContentObject( track * _track ) :
, Qt::WDestructiveClose
#endif
),
journallingObject( _track->eng() ),
m_track( _track ),
m_startPosition(),
m_length(),
@@ -147,7 +146,7 @@ void trackContentObject::movePosition( const midiTime & _pos )
{
if( m_startPosition != _pos )
{
//eng()->getSongEditor()->setModified();
//engine::getSongEditor()->setModified();
addJournalEntry( journalEntry( MOVE, m_startPosition - _pos ) );
m_startPosition = _pos;
}
@@ -164,7 +163,7 @@ void trackContentObject::changeLength( const midiTime & _length )
{
if( m_length != _length )
{
//eng()->getSongEditor()->setModified();
//engine::getSongEditor()->setModified();
addJournalEntry( journalEntry( RESIZE, m_length - _length ) );
m_length = _length;
}
@@ -231,7 +230,7 @@ void trackContentObject::mousePressEvent( QMouseEvent * _me )
// if rubberband is active, we can be selected
if( m_track->getTrackContainer()->rubberBandActive() == FALSE )
{
if( eng()->getMainWindow()->isCtrlPressed() == TRUE )
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
{
setSelected( !isSelected() );
}
@@ -247,13 +246,13 @@ void trackContentObject::mousePressEvent( QMouseEvent * _me )
}
return;
}
else if( eng()->getMainWindow()->isShiftPressed() == TRUE )
else if( engine::getMainWindow()->isShiftPressed() == TRUE )
{
// add/remove object to/from selection
selectableObject::mousePressEvent( _me );
}
else if( _me->button() == Qt::LeftButton &&
eng()->getMainWindow()->isCtrlPressed() == TRUE )
engine::getMainWindow()->isCtrlPressed() == TRUE )
{
// start drag-action
multimediaProject mmp( multimediaProject::DRAG_N_DROP_DATA );
@@ -270,11 +269,10 @@ void trackContentObject::mousePressEvent( QMouseEvent * _me )
convertToImage().smoothScale( s );
#endif
new stringPairDrag( QString( "tco_%1" ).arg( m_track->type() ),
mmp.toString(), thumbnail, this,
eng() );
mmp.toString(), thumbnail, this );
}
else if( _me->button() == Qt::LeftButton &&
/* eng()->getMainWindow()->isShiftPressed() == FALSE &&*/
/* engine::getMainWindow()->isShiftPressed() == FALSE &&*/
fixedTCOs() == FALSE )
{
// move or resize
@@ -315,7 +313,7 @@ void trackContentObject::mousePressEvent( QMouseEvent * _me )
}
else if( _me->button() == Qt::MidButton )
{
if( eng()->getMainWindow()->isCtrlPressed() )
if( engine::getMainWindow()->isCtrlPressed() )
{
toggleMute();
}
@@ -332,7 +330,7 @@ void trackContentObject::mousePressEvent( QMouseEvent * _me )
void trackContentObject::mouseMoveEvent( QMouseEvent * _me )
{
if( eng()->getMainWindow()->isCtrlPressed() == TRUE )
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
{
delete m_hint;
m_hint = NULL;
@@ -345,7 +343,7 @@ void trackContentObject::mouseMoveEvent( QMouseEvent * _me )
midiTime t = tMax( 0, (Sint32) m_track->getTrackContainer()->
currentPosition() +
static_cast<int>( x * 64 / ppt ) );
if( eng()->getMainWindow()->isCtrlPressed() ==
if( engine::getMainWindow()->isCtrlPressed() ==
FALSE && _me->button() == Qt::NoButton )
{
t = t.toNearestTact();
@@ -393,7 +391,7 @@ void trackContentObject::mouseMoveEvent( QMouseEvent * _me )
{
midiTime t = tMax( 64,
static_cast<int>( _me->x() * 64 / ppt ) );
if( eng()->getMainWindow()->isCtrlPressed() ==
if( engine::getMainWindow()->isCtrlPressed() ==
FALSE && _me->button() == Qt::NoButton )
{
t = t.toNearestTact();
@@ -594,7 +592,6 @@ void trackContentObject::setAutoResizeEnabled( bool _e )
// ===========================================================================
trackContentWidget::trackContentWidget( trackWidget * _parent ) :
QWidget( _parent ),
journallingObject( _parent->eng() ),
m_trackWidget( _parent )
{
#ifdef QT4
@@ -654,7 +651,7 @@ trackContentObject * trackContentWidget::addTCO( trackContentObject * _tco )
m_trackWidget->changePosition();
_tco->restoreJournallingState();
//eng()->getSongEditor()->setModified();
//engine::getSongEditor()->setModified();
return( _tco ); // just for convenience
}
@@ -690,7 +687,7 @@ void trackContentWidget::removeTCO( trackContentObject * _tco,
}
m_trackContentObjects.erase( it );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
}
@@ -830,7 +827,7 @@ void trackContentWidget::mousePressEvent( QMouseEvent * _me )
{
QWidget::mousePressEvent( _me );
}
else if( eng()->getMainWindow()->isShiftPressed() == TRUE )
else if( engine::getMainWindow()->isShiftPressed() == TRUE )
{
QWidget::mousePressEvent( _me );
}
@@ -898,8 +895,9 @@ void trackContentWidget::undoStep( journalEntry & _je )
{
QMap<QString, QVariant> map = _je.data().toMap();
trackContentObject * tco =
dynamic_cast<trackContentObject *>(
eng()->getProjectJournal()->getJournallingObject( map["id"].toInt() ) );
dynamic_cast<trackContentObject *>(
engine::getProjectJournal()->getJournallingObject(
map["id"].toInt() ) );
assert( tco != NULL );
multimediaProject mmp(
multimediaProject::JOURNAL_DATA );
@@ -997,7 +995,7 @@ trackOperationsWidget::trackOperationsWidget( trackWidget * _parent ) :
toolTip::add( m_trackOps, tr( "Actions for this track" ) );
m_muteBtn = new pixmapButton( this, tr( "Mute" ), m_trackWidget->eng(),
m_muteBtn = new pixmapButton( this, tr( "Mute" ),
m_trackWidget->getTrack() );
m_muteBtn->setActiveGraphic( embed::getIconPixmap( "mute_on" ) );
m_muteBtn->setInactiveGraphic( embed::getIconPixmap( "mute_off" ) );
@@ -1026,7 +1024,7 @@ trackOperationsWidget::trackOperationsWidget( trackWidget * _parent ) :
if( inBBEditor() )
{
connect( _parent->eng()->getBBEditor(),
connect( engine::getBBEditor(),
SIGNAL( positionChanged( const midiTime & ) ),
this, SLOT( update() ) );
}
@@ -1053,7 +1051,7 @@ bool trackOperationsWidget::muted( void ) const
void trackOperationsWidget::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() == Qt::LeftButton &&
m_trackWidget->eng()->getMainWindow()->isCtrlPressed() == TRUE &&
engine::getMainWindow()->isCtrlPressed() == TRUE &&
m_trackWidget->getTrack()->type() != track::BB_TRACK )
{
multimediaProject mmp( multimediaProject::DRAG_N_DROP_DATA );
@@ -1062,7 +1060,7 @@ void trackOperationsWidget::mousePressEvent( QMouseEvent * _me )
m_trackWidget->getTrack()->type() ),
mmp.toString(), QPixmap::grabWidget(
&m_trackWidget->getTrackSettingsWidget() ),
this, m_trackWidget->eng() );
this );
}
else if( _me->button() == Qt::LeftButton )
{
@@ -1252,8 +1250,7 @@ void trackOperationsWidget::disableAutomation( void )
bbTrack * trackOperationsWidget::currentBBTrack( void )
{
engine * eng = m_trackWidget->eng();
return( bbTrack::findBBTrack( eng->getBBEditor()->currentBB(), eng ) );
return( bbTrack::findBBTrack( engine::getBBEditor()->currentBB() ) );
}
@@ -1262,7 +1259,7 @@ bbTrack * trackOperationsWidget::currentBBTrack( void )
bool trackOperationsWidget::inBBEditor( void )
{
return( m_trackWidget->getTrack()->getTrackContainer()
== m_trackWidget->eng()->getBBEditor() );
== engine::getBBEditor() );
}
@@ -1276,7 +1273,6 @@ bool trackOperationsWidget::inBBEditor( void )
trackWidget::trackWidget( track * _track, QWidget * _parent ) :
QWidget( _parent ),
journallingObject( _track->eng() ),
m_track( _track ),
m_trackOperationsWidget( this ),
m_trackSettingsWidget( this ),
@@ -1452,7 +1448,7 @@ void trackWidget::mousePressEvent( QMouseEvent * _me )
}
else if( _me->button() == Qt::LeftButton )
{
if( eng()->getMainWindow()->isShiftPressed() == TRUE )
if( engine::getMainWindow()->isShiftPressed() == TRUE )
{
m_action = RESIZE_TRACK;
QCursor::setPos( mapToGlobal( QPoint( _me->x(),
@@ -1593,7 +1589,6 @@ midiTime trackWidget::endPosition( const midiTime & _pos_start )
// ===========================================================================
track::track( trackContainer * _tc, bool _create_widget ) :
journallingObject( _tc->eng() ),
m_trackContainer( _tc ),
m_trackWidget( NULL )
{
@@ -1611,9 +1606,10 @@ track::track( trackContainer * _tc, bool _create_widget ) :
track::~track()
{
if( m_trackContainer == eng()->getBBEditor() && eng()->getSongEditor() )
if( m_trackContainer == engine::getBBEditor()
&& engine::getSongEditor() )
{
trackVector tracks = eng()->getSongEditor()->tracks();
trackVector tracks = engine::getSongEditor()->tracks();
for( trackVector::iterator it = tracks.begin();
it != tracks.end(); ++it )
{
@@ -1653,7 +1649,7 @@ track * track::create( trackTypes _tt, trackContainer * _tc )
{
// while adding track, pause mixer for not getting into any trouble
// because of track being not created completely so far
_tc->eng()->getMixer()->pause();
engine::getMixer()->pause();
track * t = NULL;
@@ -1673,7 +1669,7 @@ track * track::create( trackTypes _tt, trackContainer * _tc )
#endif
// allow mixer to continue
_tc->eng()->getMixer()->play();
engine::getMixer()->play();
return( t );
}

View File

@@ -63,15 +63,15 @@
#include "rubberband.h"
#include "project_journal.h"
#include "debug.h"
#include "file_browser.h"
trackContainer::trackContainer( engine * _engine ) :
QMainWindow( _engine->getMainWindow()->workspace()
trackContainer::trackContainer( void ) :
QMainWindow( engine::getMainWindow()->workspace()
#ifdef QT3
, 0, Qt::WStyle_Title
#endif
),
journallingObject( _engine ),
m_currentPosition( 0, 0 ),
m_scrollArea( new scrollArea( this ) ),
m_ppt( DEFAULT_PIXELS_PER_TACT ),
@@ -79,9 +79,9 @@ trackContainer::trackContainer( engine * _engine ) :
m_origin()
{
#ifdef QT4
if( eng()->getMainWindow()->workspace() != NULL )
if( engine::getMainWindow()->workspace() != NULL )
{
eng()->getMainWindow()->workspace()->addWindow( this );
engine::getMainWindow()->workspace()->addWindow( this );
}
#endif
@@ -96,14 +96,14 @@ trackContainer::trackContainer( engine * _engine ) :
trackContainer::~trackContainer()
{
eng()->getProjectJournal()->setJournalling( FALSE );
engine::getProjectJournal()->setJournalling( FALSE );
while( m_trackWidgets.size() )
{
removeTrack( m_trackWidgets.front()->getTrack() );
}
eng()->getProjectJournal()->setJournalling( TRUE );
engine::getProjectJournal()->setJournalling( TRUE );
}
@@ -197,9 +197,9 @@ void trackContainer::loadSettings( const QDomElement & _this )
void trackContainer::cloneTrack( track * _track )
{
eng()->getMixer()->pause();
engine::getMixer()->pause();
track::clone( _track );
eng()->getMixer()->play();
engine::getMixer()->play();
}
@@ -237,7 +237,7 @@ void trackContainer::removeTrack( track * _track )
map["state"] = mmp.toString();
addJournalEntry( journalEntry( REMOVE_TRACK, map ) );
eng()->getMixer()->pause();
engine::getMixer()->pause();
#ifndef QT4
m_scrollArea->removeChild( _track->getTrackWidget() );
#endif
@@ -245,12 +245,12 @@ void trackContainer::removeTrack( track * _track )
delete _track;
eng()->getMixer()->play();
engine::getMixer()->play();
realignTracks();
if( eng()->getSongEditor() )
if( engine::getSongEditor() )
{
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
}
}
@@ -446,8 +446,9 @@ void trackContainer::undoStep( journalEntry & _je )
{
QMap<QString, QVariant> map = _je.data().toMap();
track * tr =
dynamic_cast<track *>(
eng()->getProjectJournal()->getJournallingObject( map["id"].toInt() ) );
dynamic_cast<track *>(
engine::getProjectJournal()->getJournallingObject(
map["id"].toInt() ) );
assert( tr != NULL );
multimediaProject mmp(
multimediaProject::JOURNAL_DATA );
@@ -521,7 +522,10 @@ void trackContainer::dropEvent( QDropEvent * _de )
instrumentTrack * it = dynamic_cast<instrumentTrack *>(
track::create( track::INSTRUMENT_TRACK,
this ) );
instrument * i = it->loadInstrument( "audiofileprocessor" );
QString iname = type == "sampledata" ? "audiofileprocessor" :
engine::sampleExtensions()[fileItem::extension(
value )];
instrument * i = it->loadInstrument( iname );
i->setParameter( type, value );
it->toggledInstrumentTrackButton( TRUE );
_de->accept();

View File

@@ -3,7 +3,7 @@
/*
* journalling_object.cpp - implementation of journalling-object related stuff
*
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -28,6 +28,7 @@
#include "journalling_object.h"
#include "project_journal.h"
#include "base64.h"
#include "engine.h"
#include "qt3support.h"
@@ -43,10 +44,8 @@
journallingObject::journallingObject( engine * _engine ) :
engineObject( _engine ),
m_id( ( eng() != NULL ) ? eng()->getProjectJournal()->allocID( this ) :
0 ),
journallingObject::journallingObject( void ) :
m_id( engine::getProjectJournal()->allocID( this ) ),
m_journalEntries(),
m_currentJournalEntry( m_journalEntries.end() ),
m_journalling( TRUE )
@@ -58,9 +57,9 @@ journallingObject::journallingObject( engine * _engine ) :
journallingObject::~journallingObject()
{
if( eng() && eng()->getProjectJournal() )
if( engine::getProjectJournal() )
{
eng()->getProjectJournal()->freeID( id() );
engine::getProjectJournal()->freeID( id() );
}
}
@@ -140,15 +139,13 @@ void journallingObject::restoreState( const QDomElement & _this )
void journallingObject::addJournalEntry( const journalEntry & _je )
{
if( !( eng() == NULL ||
eng()->getProjectJournal()->isJournalling() == FALSE ||
isJournalling() == FALSE ) )
if( engine::getProjectJournal()->isJournalling() && isJournalling() )
{
m_journalEntries.erase( m_currentJournalEntry,
m_journalEntries.end() );
m_journalEntries.push_back( _je );
m_currentJournalEntry = m_journalEntries.end();
eng()->getProjectJournal()->journalEntryAdded( id() );
engine::getProjectJournal()->journalEntryAdded( id() );
}
}
@@ -199,8 +196,8 @@ void journallingObject::loadJournal( const QDomElement & _this )
if( id() != new_id )
{
eng()->getProjectJournal()->forgetAboutID( id() );
eng()->getProjectJournal()->reallocID( new_id, this );
engine::getProjectJournal()->forgetAboutID( id() );
engine::getProjectJournal()->reallocID( new_id, this );
m_id = new_id;
}

View File

@@ -3,7 +3,7 @@
/*
* mmp.cpp - implementation of class multimediaProject
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -74,7 +74,7 @@ multimediaProject::multimediaProject( projectTypes _project_type ) :
m_head(),
m_type( _project_type )
{
QDomElement root = createElement( "multimediaproject" );
QDomElement root = createElement( "multimedia-project" );
root.setAttribute( "version", MMP_VERSION_STRING );
root.setAttribute( "type", typeName( _project_type ) );
root.setAttribute( "creator", "Linux MultiMedia Studio (LMMS)" );

View File

@@ -3,7 +3,7 @@
/*
* oscillator.cpp - implementation of powerful oscillator-class
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -94,136 +94,217 @@ void oscillator::update( sampleFrame * _ab, const fpab_t _frames,
// if we have no sub-osc, we can't do any modulation... just get our samples
void oscillator::updateNoSub( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
recalcPhase();
float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] = getSample( m_phase ) * *m_volume;
m_phase += osc_coeff;
}
}
// do pm by using sub-osc as modulator
void oscillator::updatePM( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] = getSample( m_phase + _ab[frame][_chnl] )
* *m_volume;
m_phase += osc_coeff;
}
}
// do am by using sub-osc as modulator
void oscillator::updateAM( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] *= getSample( m_phase ) * *m_volume;
m_phase += osc_coeff;
}
}
// do mix by using sub-osc as mix-sample
void oscillator::updateMix( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] += getSample( m_phase ) * *m_volume;
m_phase += osc_coeff;
}
}
// sync with sub-osc (every time sub-osc starts new period, we also start new
// period)
void oscillator::updateSync( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
const float sub_osc_coeff = m_subOsc->syncInit( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames ; ++frame )
{
if( m_subOsc->syncOk( sub_osc_coeff ) )
{
m_phase = m_phaseOffset;
}
_ab[frame][_chnl] = getSample( m_phase ) * *m_volume;
m_phase += osc_coeff;
}
}
// do fm by using sub-osc as modulator
void oscillator::updateFM( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
m_phase += _ab[frame][_chnl];
_ab[frame][_chnl] = getSample( m_phase ) * *m_volume;
m_phase += osc_coeff;
}
}
inline sample_t oscillator::getSample( const float _sample )
const ch_cnt_t _chnl )
{
switch( *m_waveShape )
{
case SIN_WAVE:
return( sinSample( _sample ) );
case TRIANGLE_WAVE:
return( triangleSample( _sample ) );
case SAW_WAVE:
return( sawSample( _sample ) );
case SQUARE_WAVE:
return( squareSample( _sample ) );
case MOOG_SAW_WAVE:
return( moogSawSample( _sample ) );
case EXP_WAVE:
return( expSample( _sample ) );
case WHITE_NOISE_WAVE:
return( noiseSample( _sample ) );
case USER_DEF_WAVE:
return( userWaveSample( _sample ) );
default:
return( sinSample( _sample ) );
updateNoSub<SIN_WAVE>( _ab, _frames, _chnl );
break;
case TRIANGLE_WAVE:
updateNoSub<TRIANGLE_WAVE>( _ab, _frames, _chnl );
break;
case SAW_WAVE:
updateNoSub<SAW_WAVE>( _ab, _frames, _chnl );
break;
case SQUARE_WAVE:
updateNoSub<SQUARE_WAVE>( _ab, _frames, _chnl );
break;
case MOOG_SAW_WAVE:
updateNoSub<MOOG_SAW_WAVE>( _ab, _frames, _chnl );
break;
case EXP_WAVE:
updateNoSub<EXP_WAVE>( _ab, _frames, _chnl );
break;
case WHITE_NOISE_WAVE:
updateNoSub<WHITE_NOISE_WAVE>( _ab, _frames, _chnl );
break;
case USER_DEF_WAVE:
updateNoSub<USER_DEF_WAVE>( _ab, _frames, _chnl );
break;
}
}
void oscillator::updatePM( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
switch( *m_waveShape )
{
case SIN_WAVE:
default:
updatePM<SIN_WAVE>( _ab, _frames, _chnl );
break;
case TRIANGLE_WAVE:
updatePM<TRIANGLE_WAVE>( _ab, _frames, _chnl );
break;
case SAW_WAVE:
updatePM<SAW_WAVE>( _ab, _frames, _chnl );
break;
case SQUARE_WAVE:
updatePM<SQUARE_WAVE>( _ab, _frames, _chnl );
break;
case MOOG_SAW_WAVE:
updatePM<MOOG_SAW_WAVE>( _ab, _frames, _chnl );
break;
case EXP_WAVE:
updatePM<EXP_WAVE>( _ab, _frames, _chnl );
break;
case WHITE_NOISE_WAVE:
updatePM<WHITE_NOISE_WAVE>( _ab, _frames, _chnl );
break;
case USER_DEF_WAVE:
updatePM<USER_DEF_WAVE>( _ab, _frames, _chnl );
break;
}
}
void oscillator::updateAM( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
switch( *m_waveShape )
{
case SIN_WAVE:
default:
updateAM<SIN_WAVE>( _ab, _frames, _chnl );
break;
case TRIANGLE_WAVE:
updateAM<TRIANGLE_WAVE>( _ab, _frames, _chnl );
break;
case SAW_WAVE:
updateAM<SAW_WAVE>( _ab, _frames, _chnl );
break;
case SQUARE_WAVE:
updateAM<SQUARE_WAVE>( _ab, _frames, _chnl );
break;
case MOOG_SAW_WAVE:
updateAM<MOOG_SAW_WAVE>( _ab, _frames, _chnl );
break;
case EXP_WAVE:
updateAM<EXP_WAVE>( _ab, _frames, _chnl );
break;
case WHITE_NOISE_WAVE:
updateAM<WHITE_NOISE_WAVE>( _ab, _frames, _chnl );
break;
case USER_DEF_WAVE:
updateAM<USER_DEF_WAVE>( _ab, _frames, _chnl );
break;
}
}
void oscillator::updateMix( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
switch( *m_waveShape )
{
case SIN_WAVE:
default:
updateMix<SIN_WAVE>( _ab, _frames, _chnl );
break;
case TRIANGLE_WAVE:
updateMix<TRIANGLE_WAVE>( _ab, _frames, _chnl );
break;
case SAW_WAVE:
updateMix<SAW_WAVE>( _ab, _frames, _chnl );
break;
case SQUARE_WAVE:
updateMix<SQUARE_WAVE>( _ab, _frames, _chnl );
break;
case MOOG_SAW_WAVE:
updateMix<MOOG_SAW_WAVE>( _ab, _frames, _chnl );
break;
case EXP_WAVE:
updateMix<EXP_WAVE>( _ab, _frames, _chnl );
break;
case WHITE_NOISE_WAVE:
updateMix<WHITE_NOISE_WAVE>( _ab, _frames, _chnl );
break;
case USER_DEF_WAVE:
updateMix<USER_DEF_WAVE>( _ab, _frames, _chnl );
break;
}
}
void oscillator::updateSync( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
switch( *m_waveShape )
{
case SIN_WAVE:
default:
updateSync<SIN_WAVE>( _ab, _frames, _chnl );
break;
case TRIANGLE_WAVE:
updateSync<TRIANGLE_WAVE>( _ab, _frames, _chnl );
break;
case SAW_WAVE:
updateSync<SAW_WAVE>( _ab, _frames, _chnl );
break;
case SQUARE_WAVE:
updateSync<SQUARE_WAVE>( _ab, _frames, _chnl );
break;
case MOOG_SAW_WAVE:
updateSync<MOOG_SAW_WAVE>( _ab, _frames, _chnl );
break;
case EXP_WAVE:
updateSync<EXP_WAVE>( _ab, _frames, _chnl );
break;
case WHITE_NOISE_WAVE:
updateSync<WHITE_NOISE_WAVE>( _ab, _frames, _chnl );
break;
case USER_DEF_WAVE:
updateSync<USER_DEF_WAVE>( _ab, _frames, _chnl );
break;
}
}
void oscillator::updateFM( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
switch( *m_waveShape )
{
case SIN_WAVE:
default:
updateFM<SIN_WAVE>( _ab, _frames, _chnl );
break;
case TRIANGLE_WAVE:
updateFM<TRIANGLE_WAVE>( _ab, _frames, _chnl );
break;
case SAW_WAVE:
updateFM<SAW_WAVE>( _ab, _frames, _chnl );
break;
case SQUARE_WAVE:
updateFM<SQUARE_WAVE>( _ab, _frames, _chnl );
break;
case MOOG_SAW_WAVE:
updateFM<MOOG_SAW_WAVE>( _ab, _frames, _chnl );
break;
case EXP_WAVE:
updateFM<EXP_WAVE>( _ab, _frames, _chnl );
break;
case WHITE_NOISE_WAVE:
updateFM<WHITE_NOISE_WAVE>( _ab, _frames, _chnl );
break;
case USER_DEF_WAVE:
updateFM<USER_DEF_WAVE>( _ab, _frames, _chnl );
break;
}
}
@@ -266,4 +347,207 @@ float oscillator::syncInit( sampleFrame * _ab, const fpab_t _frames,
return( *m_freq * *m_detuning );
}
// if we have no sub-osc, we can't do any modulation... just get our samples
template<oscillator::waveShapes W>
void oscillator::updateNoSub( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
recalcPhase();
float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] = getSample<W>( m_phase ) * *m_volume;
m_phase += osc_coeff;
}
}
// do pm by using sub-osc as modulator
template<oscillator::waveShapes W>
void oscillator::updatePM( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] = getSample<W>( m_phase + _ab[frame][_chnl] )
* *m_volume;
m_phase += osc_coeff;
}
}
// do am by using sub-osc as modulator
template<oscillator::waveShapes W>
void oscillator::updateAM( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] *= getSample<W>( m_phase ) * *m_volume;
m_phase += osc_coeff;
}
}
// do mix by using sub-osc as mix-sample
template<oscillator::waveShapes W>
void oscillator::updateMix( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] += getSample<W>( m_phase ) * *m_volume;
m_phase += osc_coeff;
}
}
// sync with sub-osc (every time sub-osc starts new period, we also start new
// period)
template<oscillator::waveShapes W>
void oscillator::updateSync( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
const float sub_osc_coeff = m_subOsc->syncInit( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames ; ++frame )
{
if( m_subOsc->syncOk( sub_osc_coeff ) )
{
m_phase = m_phaseOffset;
}
_ab[frame][_chnl] = getSample<W>( m_phase ) * *m_volume;
m_phase += osc_coeff;
}
}
// do fm by using sub-osc as modulator
template<oscillator::waveShapes W>
void oscillator::updateFM( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
m_phase += _ab[frame][_chnl];
_ab[frame][_chnl] = getSample<W>( m_phase ) * *m_volume;
m_phase += osc_coeff;
}
}
template<>
inline sample_t oscillator::getSample<oscillator::SIN_WAVE>(
const float _sample )
{
return( sinSample( _sample ) );
}
template<>
inline sample_t oscillator::getSample<oscillator::TRIANGLE_WAVE>(
const float _sample )
{
return( triangleSample( _sample ) );
}
template<>
inline sample_t oscillator::getSample<oscillator::SAW_WAVE>(
const float _sample )
{
return( sawSample( _sample ) );
}
template<>
inline sample_t oscillator::getSample<oscillator::SQUARE_WAVE>(
const float _sample )
{
return( squareSample( _sample ) );
}
template<>
inline sample_t oscillator::getSample<oscillator::MOOG_SAW_WAVE>(
const float _sample )
{
return( moogSawSample( _sample ) );
}
template<>
inline sample_t oscillator::getSample<oscillator::EXP_WAVE>(
const float _sample )
{
return( expSample( _sample ) );
}
template<>
inline sample_t oscillator::getSample<oscillator::WHITE_NOISE_WAVE>(
const float _sample )
{
return( noiseSample( _sample ) );
}
template<>
inline sample_t oscillator::getSample<oscillator::USER_DEF_WAVE>(
const float _sample )
{
return( userWaveSample( _sample ) );
}
#endif

View File

@@ -3,7 +3,7 @@
/*
* project_journal.cpp - implementation of project-journal
*
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -28,6 +28,7 @@
#include <cstdlib>
#include "project_journal.h"
#include "engine.h"
#include "journalling_object.h"
#include "song_editor.h"
@@ -37,8 +38,7 @@
projectJournal::projectJournal( engine * _engine ) :
engineObject( _engine ),
projectJournal::projectJournal( void ) :
m_joIDs(),
m_journalEntries(),
m_currentJournalEntry( m_journalEntries.end() )
@@ -68,7 +68,7 @@ void projectJournal::undo( void )
( jo = m_joIDs[*--m_currentJournalEntry] ) != NULL )
{
jo->undo();
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
}
@@ -89,7 +89,7 @@ void projectJournal::redo( void )
( jo = m_joIDs[*m_currentJournalEntry++] ) != NULL )
{
jo->redo();
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
}
@@ -101,7 +101,7 @@ void projectJournal::journalEntryAdded( const jo_id_t _id )
m_journalEntries.erase( m_currentJournalEntry, m_journalEntries.end() );
m_journalEntries.push_back( _id );
m_currentJournalEntry = m_journalEntries.end();
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
printf("history size: %d\n", m_journalEntries.size() );
}

View File

@@ -86,6 +86,7 @@
#include "templates.h"
#include "config_mgr.h"
#include "endian_handling.h"
#include "engine.h"
#include "base64.h"
#include "debug.h"
@@ -100,10 +101,8 @@
sampleBuffer::sampleBuffer( engine * _engine, const QString & _audio_file,
sampleBuffer::sampleBuffer( const QString & _audio_file,
bool _is_base64_data ) :
QObject(),
engineObject( _engine ),
m_audioFile( ( _is_base64_data == TRUE ) ? "" : _audio_file ),
m_origData( NULL ),
m_origFrames( 0 ),
@@ -116,6 +115,7 @@ sampleBuffer::sampleBuffer( engine * _engine, const QString & _audio_file,
m_amplification( 1.0f ),
m_reversed( FALSE ),
m_frequency( BASE_FREQ ),
m_sample_rate( SAMPLE_RATES[DEFAULT_QUALITY_LEVEL] ),
m_dataMutex(),
m_sample_fragment( NULL )
{
@@ -136,10 +136,7 @@ sampleBuffer::sampleBuffer( engine * _engine, const QString & _audio_file,
sampleBuffer::sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames,
engine * _engine ) :
QObject(),
engineObject( _engine ),
sampleBuffer::sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ) :
m_audioFile( "" ),
m_origData( NULL ),
m_origFrames( 0 ),
@@ -152,6 +149,7 @@ sampleBuffer::sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames,
m_amplification( 1.0f ),
m_reversed( FALSE ),
m_frequency( BASE_FREQ ),
m_sample_rate( SAMPLE_RATES[DEFAULT_QUALITY_LEVEL] ),
m_dataMutex(),
m_sample_fragment( NULL )
{
@@ -171,9 +169,7 @@ sampleBuffer::sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames,
sampleBuffer::sampleBuffer( const f_cnt_t _frames, engine * _engine ) :
QObject(),
engineObject( _engine ),
sampleBuffer::sampleBuffer( const f_cnt_t _frames ) :
m_audioFile( "" ),
m_origData( NULL ),
m_origFrames( 0 ),
@@ -186,6 +182,7 @@ sampleBuffer::sampleBuffer( const f_cnt_t _frames, engine * _engine ) :
m_amplification( 1.0f ),
m_reversed( FALSE ),
m_frequency( BASE_FREQ ),
m_sample_rate( SAMPLE_RATES[DEFAULT_QUALITY_LEVEL] ),
m_dataMutex(),
m_sample_fragment( NULL )
{
@@ -623,14 +620,15 @@ bool FASTCALL sampleBuffer::play( sampleFrame * _ab, handleState * _state,
const float _freq,
const bool _looped )
{
eng()->getMixer()->clearAudioBuffer( _ab, _frames );
engine::getMixer()->clearAudioBuffer( _ab, _frames );
if( m_data == NULL || m_frames == 0 || m_endFrame == 0 || _frames == 0 )
{
return( FALSE );
}
const double freq_factor = (double) _freq / (double) m_frequency;
const double freq_factor = (double) _freq / (double) m_frequency
* m_sample_rate / engine::getMixer()->sampleRate();
// calculate how many frames we have in requested pitch
const f_cnt_t total_frames_for_current_pitch = static_cast<f_cnt_t>( (
@@ -691,7 +689,7 @@ bool FASTCALL sampleBuffer::play( sampleFrame * _ab, handleState * _state,
// foo = f2;
// check whether we have to change pitch...
if( _freq != m_frequency || _state->m_varying_pitch )
if( freq_factor != 1.0 || _state->m_varying_pitch )
{
#ifdef HAVE_SAMPLERATE_H
// Generate output
@@ -725,7 +723,7 @@ bool FASTCALL sampleBuffer::play( sampleFrame * _ab, handleState * _state,
#else
f_cnt_t src_frame_base = 0;
// check whether we're in high-quality-mode
if( eng()->getMixer()->highQuality() == TRUE )
if( engine::getMixer()->highQuality() == TRUE )
{
// we are, so let's use cubic interpolation...
for( f_cnt_t frame = 0; frame < frames_to_process;
@@ -1130,7 +1128,7 @@ QString & sampleBuffer::toBase64( QString & _dst ) const
/* FLAC__stream_encoder_set_do_exhaustive_model_search( flac_enc, TRUE );
FLAC__stream_encoder_set_do_mid_side_stereo( flac_enc, TRUE );*/
FLAC__stream_encoder_set_sample_rate( flac_enc,
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
QBuffer ba_writer;
#ifdef QT4
ba_writer.open( QBuffer::WriteOnly );
@@ -1191,12 +1189,11 @@ QString & sampleBuffer::toBase64( QString & _dst ) const
sampleBuffer * sampleBuffer::resample( sampleFrame * _data,
const f_cnt_t _frames,
const sample_rate_t _src_sr,
const sample_rate_t _dst_sr,
engine * _engine )
const sample_rate_t _dst_sr )
{
const f_cnt_t dst_frames = static_cast<f_cnt_t>( _frames /
(float) _src_sr * (float) _dst_sr );
sampleBuffer * dst_sb = new sampleBuffer( dst_frames, _engine );
sampleBuffer * dst_sb = new sampleBuffer( dst_frames );
sampleFrame * dst_buf = dst_sb->m_origData;
#ifdef HAVE_SAMPLERATE_H
// yeah, libsamplerate, let's rock with sinc-interpolation!
@@ -1521,7 +1518,7 @@ sampleBuffer::handleState::handleState( bool _varying_pitch ) :
#ifdef HAVE_SAMPLERATE_H
int error;
if( ( m_resampling_data = src_new(/*
( eng()->getMixer()->highQuality() == TRUE ) ?
( engine::getMixer()->highQuality() == TRUE ) ?
SRC_SINC_FASTEST :*/
SRC_LINEAR,
DEFAULT_CHANNELS, &error ) ) == NULL )

View File

@@ -5,7 +5,7 @@
* for drag'n'drop of string-pairs and which is the base
* for all drag'n'drop-actions within LMMS
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -28,6 +28,7 @@
#include "string_pair_drag.h"
#include "engine.h"
#include "main_window.h"
#ifdef QT4
@@ -40,20 +41,18 @@
stringPairDrag::stringPairDrag( const QString & _key, const QString & _value,
const QPixmap & _icon, QWidget * _w,
engine * _engine ) :
const QPixmap & _icon, QWidget * _w ) :
#ifdef QT4
QDrag( _w ),
QDrag( _w )
#else
QStoredDrag( "lmms/stringpair", _w ),
QStoredDrag( mimeType(), _w )
#endif
engineObject( _engine )
{
setPixmap( _icon );
QString txt = _key + ":" + _value;
#ifdef QT4
QMimeData * m = new QMimeData();
m->setData( "lmms/stringpair", txt.toAscii() );
m->setData( mimeType(), txt.toAscii() );
setMimeData( m );
start( Qt::IgnoreAction );
#else
@@ -69,7 +68,7 @@ stringPairDrag::~stringPairDrag()
{
// during a drag, we might have lost key-press-events, so reset
// modifiers of main-win
eng()->getMainWindow()->clearKeyModifiers();
engine::getMainWindow()->clearKeyModifiers();
// TODO: do we have to delete anything???
}
@@ -80,11 +79,11 @@ bool stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee,
const QString & _allowed_keys )
{
#ifdef QT4
if( !_dee->mimeData()->hasFormat( "lmms/stringpair" ) )
if( !_dee->mimeData()->hasFormat( mimeType() ) )
{
return( FALSE );
}
QString txt = _dee->mimeData()->data( "lmms/stringpair" );
QString txt = _dee->mimeData()->data( mimeType() );
if( _allowed_keys.split( ',' ).contains( txt.section( ':', 0, 0 ) ) )
{
_dee->acceptProposedAction();
@@ -93,7 +92,7 @@ bool stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee,
_dee->ignore();
return( FALSE );
#else
QString txt = _dee->encodedData( "lmms/stringpair" );
QString txt = _dee->encodedData( mimeType() );
bool accepted = QStringList::split( ',', _allowed_keys ).contains(
txt.section( ':', 0, 0 ) );
_dee->accept( accepted );
@@ -107,10 +106,10 @@ bool stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee,
QString stringPairDrag::decodeKey( QDropEvent * _de )
{
#ifdef QT4
return( QString( _de->mimeData()->data( "lmms/stringpair"
return( QString( _de->mimeData()->data( mimeType()
) ).section( ':', 0, 0 ) );
#else
return( QString( _de->encodedData( "lmms/stringpair" ) ).section(
return( QString( _de->encodedData( mimeType() ) ).section(
':', 0, 0 ) );
#endif
}
@@ -121,10 +120,10 @@ QString stringPairDrag::decodeKey( QDropEvent * _de )
QString stringPairDrag::decodeValue( QDropEvent * _de )
{
#ifdef QT4
return( QString( _de->mimeData()->data( "lmms/stringpair"
return( QString( _de->mimeData()->data( mimeType()
) ).section( ':', 1, -1 ) );
#else
return( QString( _de->encodedData( "lmms/stringpair" ) ).section(
return( QString( _de->encodedData( mimeType() ) ).section(
':', 1, -1 ) );
#endif
}

View File

@@ -3,7 +3,7 @@
/*
* midi_alsa_raw.cpp - midi-client for RawMIDI via ALSA
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -49,9 +49,7 @@
#ifdef ALSA_SUPPORT
midiALSARaw::midiALSARaw( engine * _engine ) :
midiClientRaw( _engine ),
QThread(),
midiALSARaw::midiALSARaw( void ) :
m_inputp( &m_input ),
m_outputp( &m_output ),
m_quit( FALSE )

View File

@@ -3,7 +3,7 @@
/*
* midi_alsa_seq.cpp - ALSA-sequencer-client
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -43,6 +43,7 @@
#include "midi_alsa_seq.h"
#include "config_mgr.h"
#include "engine.h"
#include "gui_templates.h"
#include "song_editor.h"
#include "midi_port.h"
@@ -52,18 +53,11 @@
#ifdef ALSA_SUPPORT
midiALSASeq::midiALSASeq( engine * _engine ) :
#ifndef QT4
QObject(),
#endif
midiClient( _engine ),
QThread(),
midiALSASeq::midiALSASeq( void ) :
m_seqHandle( NULL ),
m_queueID( -1 ),
m_quit( FALSE ),
m_portListUpdateTimer( this ),
m_readablePorts(),
m_writeablePorts()
m_portListUpdateTimer( this )
{
int err;
if( ( err = snd_seq_open( &m_seqHandle,
@@ -84,13 +78,13 @@ midiALSASeq::midiALSASeq( engine * _engine ) :
snd_seq_queue_tempo_t * tempo;
snd_seq_queue_tempo_alloca( &tempo );
snd_seq_queue_tempo_set_tempo( tempo, 6000000 /
eng()->getSongEditor()->getTempo() );
engine::getSongEditor()->getTempo() );
snd_seq_queue_tempo_set_ppq( tempo, 16 );
snd_seq_set_queue_tempo( m_seqHandle, m_queueID, tempo );
snd_seq_start_queue( m_seqHandle, m_queueID, NULL );
changeQueueTempo( eng()->getSongEditor()->getTempo() );
connect( eng()->getSongEditor(), SIGNAL( tempoChanged( bpm_t ) ),
changeQueueTempo( engine::getSongEditor()->getTempo() );
connect( engine::getSongEditor(), SIGNAL( tempoChanged( bpm_t ) ),
this, SLOT( changeQueueTempo( bpm_t ) ) );
// initial list-update

View File

@@ -3,7 +3,7 @@
/*
* midi_client.cpp - base-class for MIDI-clients like ALSA-sequencer-client
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* This file partly contains code from Fluidsynth, Peter Hanappe
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
@@ -40,8 +40,7 @@
midiClient::midiClient( engine * _engine ) :
engineObject( _engine )
midiClient::midiClient( void )
{
}
@@ -130,8 +129,7 @@ void midiClient::subscribeWriteablePort( midiPort * , const QString & , bool)
midiClientRaw::midiClientRaw( engine * _engine ) :
midiClient( _engine )
midiClientRaw::midiClientRaw( void )
{
}

View File

@@ -3,7 +3,7 @@
/*
* midi_oss.cpp - OSS-raw-midi-client
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -55,9 +55,7 @@
midiOSS::midiOSS( engine * _engine ) :
midiClientRaw( _engine ),
QThread(),
midiOSS::midiOSS( void ) :
m_midiDev( probeDevice() ),
m_quit( FALSE )
{

View File

@@ -4,7 +4,7 @@
* automation_pattern.cpp - implementation of class automationPattern which
* holds dynamic values
*
* Copyright (c) 2006 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -43,12 +43,12 @@
#include "automation_pattern.h"
#include "templates.h"
#include "automation_editor.h"
#include "engine.h"
automationPattern::automationPattern( track * _track, levelObject * _object ) :
journallingObject( _track->eng() ),
m_track( _track ),
m_object( _object ),
m_update_first( TRUE )
@@ -59,21 +59,7 @@ automationPattern::automationPattern( track * _track, levelObject * _object ) :
automationPattern::automationPattern( engine * _engine,
levelObject * _object ) :
journallingObject( _engine ),
m_track( NULL ),
m_object( _object ),
m_update_first( TRUE )
{
init();
}
automationPattern::automationPattern( const automationPattern & _pat_to_copy ) :
journallingObject( _pat_to_copy.m_track->eng() ),
m_track( _pat_to_copy.m_track ),
m_object( _pat_to_copy.m_object ),
m_update_first( _pat_to_copy.m_update_first )
@@ -92,7 +78,6 @@ automationPattern::automationPattern( const automationPattern & _pat_to_copy ) :
automationPattern::automationPattern( const automationPattern & _pat_to_copy,
levelObject * _object ) :
journallingObject( _pat_to_copy.m_track->eng() ),
m_track( _pat_to_copy.m_track ),
m_object( _object ),
m_update_first( _pat_to_copy.m_update_first )
@@ -116,10 +101,10 @@ automationPattern::~automationPattern()
m_track->removeAutomationPattern( this );
}
if( eng()->getAutomationEditor()
&& eng()->getAutomationEditor()->currentPattern() == this )
if( engine::getAutomationEditor()
&& engine::getAutomationEditor()->currentPattern() == this )
{
eng()->getAutomationEditor()->setCurrentPattern( NULL );
engine::getAutomationEditor()->setCurrentPattern( NULL );
}
}
@@ -163,7 +148,7 @@ midiTime automationPattern::putValue( const midiTime & _time, const int _value,
{
midiTime new_time = _quant_pos ?
note::quantized( _time,
eng()->getAutomationEditor()->quantization() ) :
engine::getAutomationEditor()->quantization() ) :
_time;
m_time_map[-new_time] = _value;
@@ -188,9 +173,9 @@ void automationPattern::removeValue( const midiTime & _time )
void automationPattern::clear( void )
{
m_time_map.clear();
if( eng()->getAutomationEditor()->currentPattern() == this )
if( engine::getAutomationEditor()->currentPattern() == this )
{
eng()->getAutomationEditor()->update();
engine::getAutomationEditor()->update();
}
}
@@ -244,9 +229,9 @@ void automationPattern::loadSettings( const QDomElement & _this )
void automationPattern::openInAutomationEditor( void )
{
eng()->getAutomationEditor()->setCurrentPattern( this );
eng()->getAutomationEditor()->show();
eng()->getAutomationEditor()->setFocus();
engine::getAutomationEditor()->setCurrentPattern( this );
engine::getAutomationEditor()->show();
engine::getAutomationEditor()->setFocus();
}

View File

@@ -50,6 +50,7 @@
#include "gui_templates.h"
#include "name_label.h"
#include "embed.h"
#include "engine.h"
#include "rename_dialog.h"
#include "templates.h"
@@ -68,7 +69,7 @@ bbTCO::bbTCO( track * _track, const QColor & _c ) :
#ifndef QT4
setBackgroundMode( Qt::NoBackground );
#endif
tact t = eng()->getBBEditor()->lengthOfBB(
tact t = engine::getBBEditor()->lengthOfBB(
bbTrack::numOfBBTrack( getTrack() ) );
if( t > 0 )
{
@@ -165,7 +166,7 @@ void bbTCO::paintEvent( QPaintEvent * )
}
#endif
tact t = eng()->getBBEditor()->lengthOfBB( bbTrack::numOfBBTrack(
tact t = engine::getBBEditor()->lengthOfBB( bbTrack::numOfBBTrack(
getTrack() ) );
if( length() > 64 && t > 0 )
{
@@ -248,10 +249,10 @@ void bbTCO::loadSettings( const QDomElement & _this )
void bbTCO::openInBBEditor( bool )
{
eng()->getBBEditor()->setCurrentBB( bbTrack::numOfBBTrack(
engine::getBBEditor()->setCurrentBB( bbTrack::numOfBBTrack(
getTrack() ) );
eng()->getBBEditor()->show();
eng()->getBBEditor()->setFocus();
engine::getBBEditor()->show();
engine::getBBEditor()->setFocus();
}
@@ -296,7 +297,7 @@ void bbTCO::changeColor( void )
if( isSelected() )
{
vvector<selectableObject *> selected =
eng()->getSongEditor()->selectedObjects();
engine::getSongEditor()->selectedObjects();
for( vvector<selectableObject *>::iterator it =
selected.begin();
it != selected.end(); ++it )
@@ -322,7 +323,7 @@ void bbTCO::setColor( QColor _new_color )
if( _new_color != m_color )
{
m_color = _new_color;
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
update();
}
}
@@ -343,7 +344,7 @@ bbTrack::bbTrack( trackContainer * _tc ) :
s_infoMap[this] = bbNum;
m_trackLabel = new nameLabel( tr( "Beat/Baseline %1" ).arg( bbNum ),
getTrackSettingsWidget(), eng() );
getTrackSettingsWidget() );
m_trackLabel->setPixmap( embed::getIconPixmap( "bb_track" ) );
m_trackLabel->setGeometry( 1, 1, DEFAULT_SETTINGS_WIDGET_WIDTH - 2,
29 );
@@ -351,13 +352,13 @@ bbTrack::bbTrack( trackContainer * _tc ) :
connect( m_trackLabel, SIGNAL( clicked() ),
this, SLOT( clickedTrackLabel() ) );
connect( m_trackLabel, SIGNAL( nameChanged() ),
eng()->getBBEditor(), SLOT( updateComboBox() ) );
engine::getBBEditor(), SLOT( updateComboBox() ) );
connect( m_trackLabel, SIGNAL( pixmapChanged() ),
eng()->getBBEditor(), SLOT( updateComboBox() ) );
engine::getBBEditor(), SLOT( updateComboBox() ) );
eng()->getBBEditor()->setCurrentBB( bbNum );
eng()->getBBEditor()->updateComboBox();
engine::getBBEditor()->setCurrentBB( bbNum );
engine::getBBEditor()->updateComboBox();
_tc->updateAfterTrackAdd();
}
@@ -368,7 +369,7 @@ bbTrack::bbTrack( trackContainer * _tc ) :
bbTrack::~bbTrack()
{
csize bb = s_infoMap[this];
eng()->getBBEditor()->removeBB( bb );
engine::getBBEditor()->removeBB( bb );
for( infoMap::iterator it = s_infoMap.begin(); it != s_infoMap.end();
++it )
{
@@ -385,7 +386,7 @@ bbTrack::~bbTrack()
#endif
}
s_infoMap.remove( this );
eng()->getBBEditor()->updateComboBox();
engine::getBBEditor()->updateComboBox();
}
@@ -408,14 +409,14 @@ bool FASTCALL bbTrack::play( const midiTime & _start,
if( _tco_num >= 0 )
{
return( eng()->getBBEditor()->play( _start, _frames,
return( engine::getBBEditor()->play( _start, _frames,
_frame_base,
s_infoMap[this] ) );
}
vlist<trackContentObject *> tcos;
getTCOsInRange( tcos, _start, _start + static_cast<Sint32>( _frames /
eng()->framesPerTact64th() ) );
engine::framesPerTact64th() ) );
if ( tcos.size() == 0 )
{
@@ -436,7 +437,7 @@ bool FASTCALL bbTrack::play( const midiTime & _start,
}
if( _start - lastPosition < lastLen )
{
return( eng()->getBBEditor()->play( _start - lastPosition,
return( engine::getBBEditor()->play( _start - lastPosition,
_frames,
_frame_base,
s_infoMap[this] ) );
@@ -474,17 +475,17 @@ void bbTrack::saveTrackSpecificSettings( QDomDocument & _doc,
_this.setAttribute( "name", m_trackLabel->text() );
_this.setAttribute( "icon", m_trackLabel->pixmapFile() );
/* _this.setAttribute( "current", s_infoMap[this] ==
eng()->getBBEditor()->currentBB() );*/
engine::getBBEditor()->currentBB() );*/
if( s_infoMap[this] == 0 &&
_this.parentNode().parentNode().nodeName() != "clone" &&
_this.parentNode().nodeName() != "journaldata" )
{
( (journallingObject *)( eng()->getBBEditor() ) )->saveState(
( (journallingObject *)( engine::getBBEditor() ) )->saveState(
_doc, _this );
}
int track_num = 0;
trackVector tracks = eng()->getBBEditor()->tracks();
trackVector tracks = engine::getBBEditor()->tracks();
for( trackVector::iterator it = tracks.begin(); it != tracks.end();
++it, ++track_num )
{
@@ -508,12 +509,12 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this )
{
m_trackLabel->setPixmapFile( _this.attribute( "icon" ) );
}
eng()->getBBEditor()->updateComboBox();
engine::getBBEditor()->updateComboBox();
QDomNode node = _this.namedItem( trackContainer::classNodeName() );
if( node.isElement() )
{
( (journallingObject *)( eng()->getBBEditor() ) )->restoreState(
( (journallingObject *)engine::getBBEditor() )->restoreState(
node.toElement() );
}
/* doesn't work yet because bbTrack-ctor also sets current bb so if
@@ -521,10 +522,10 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this )
help at all....
if( _this.attribute( "current" ).toInt() )
{
eng()->getBBEditor()->setCurrentBB( s_infoMap[this] );
engine::getBBEditor()->setCurrentBB( s_infoMap[this] );
}*/
trackVector tracks = eng()->getBBEditor()->tracks();
trackVector tracks = engine::getBBEditor()->tracks();
node = _this.firstChild();
while( !node.isNull() )
{
@@ -542,15 +543,15 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this )
// return pointer to bbTrack specified by _bb_num
bbTrack * bbTrack::findBBTrack( csize _bb_num, engine * _engine )
bbTrack * bbTrack::findBBTrack( csize _bb_num )
{
for( infoMap::iterator it = s_infoMap.begin(); it != s_infoMap.end();
++it )
{
#ifdef QT4
if( it.value() == _bb_num && it.key()->eng() == _engine )
if( it.value() == _bb_num )
#else
if( it.data() == _bb_num && it.key()->eng() == _engine )
if( it.data() == _bb_num )
#endif
{
return( it.key() );
@@ -581,9 +582,8 @@ void bbTrack::swapBBTracks( track * _track1, track * _track2 )
if( t1 != NULL && t2 != NULL )
{
qSwap( s_infoMap[t1], s_infoMap[t2] );
_track1->eng()->getBBEditor()->swapBB( s_infoMap[t1],
s_infoMap[t2] );
_track1->eng()->getBBEditor()->setCurrentBB( s_infoMap[t1] );
engine::getBBEditor()->swapBB( s_infoMap[t1], s_infoMap[t2] );
engine::getBBEditor()->setCurrentBB( s_infoMap[t1] );
}
}
@@ -592,8 +592,8 @@ void bbTrack::swapBBTracks( track * _track1, track * _track2 )
void bbTrack::clickedTrackLabel( void )
{
eng()->getBBEditor()->setCurrentBB( s_infoMap[this] );
eng()->getBBEditor()->show();
engine::getBBEditor()->setCurrentBB( s_infoMap[this] );
engine::getBBEditor()->show();
}

View File

@@ -112,13 +112,13 @@ const int PIANO_HEIGHT = 84;
instrumentTrack::instrumentTrack( trackContainer * _tc ) :
QWidget( _tc->eng()->getMainWindow()->workspace() ),
QWidget( engine::getMainWindow()->workspace() ),
track( _tc ),
midiEventProcessor(),
m_trackType( INSTRUMENT_TRACK ),
m_midiPort( eng()->getMixer()->getMIDIClient()->addPort( this,
m_midiPort( engine::getMixer()->getMIDIClient()->addPort( this,
tr( "unnamed_channel" ) ) ),
m_audioPort( new audioPort( tr( "unnamed_channel" ), eng() ) ),
m_audioPort( new audioPort( tr( "unnamed_channel" ) ) ),
m_notes(),
m_notesMutex(),
m_baseTone( A ),
@@ -141,7 +141,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
#ifdef QT4
eng()->getMainWindow()->workspace()->addWindow( this );
engine::getMainWindow()->workspace()->addWindow( this );
#endif
setAcceptDrops( TRUE );
@@ -153,7 +153,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
// creation of widgets for track-settings-widget
m_tswVolumeKnob = new volumeKnob( knobSmall_17, getTrackSettingsWidget(),
tr( "Channel volume" ), eng(), this );
tr( "Channel volume" ), this );
m_tswVolumeKnob->setRange( MIN_VOLUME, MAX_VOLUME, 1.0f );
m_tswVolumeKnob->setInitValue( DEFAULT_VOLUME );
m_tswVolumeKnob->setHintText( tr( "Channel volume:" ) + " ", "%" );
@@ -224,7 +224,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
// setup volume-knob
m_volumeKnob = new volumeKnob( knobBright_26, m_generalSettingsWidget,
tr( "Channel volume" ), eng(), this );
tr( "Channel volume" ), this );
m_volumeKnob->move( 10, 44 );
m_volumeKnob->setRange( MIN_VOLUME, MAX_VOLUME, 1.0f );
m_volumeKnob->setInitValue( DEFAULT_VOLUME );
@@ -244,7 +244,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
// setup surround-area
m_surroundArea = new surroundArea( m_generalSettingsWidget,
tr( "Surround area" ), eng(), this );
tr( "Surround area" ), this );
m_surroundArea->move( 20 + m_volumeKnob->width(), 38 );
m_surroundArea->show();
#ifdef QT4
@@ -265,7 +265,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
MAX_EFFECT_CHANNEL, 2,
m_generalSettingsWidget,
tr( "FX channel" ),
eng(), this );
this );
m_effectChannelNumber->setInitValue( DEFAULT_EFFECT_CHANNEL );
m_effectChannelNumber->setLabel( tr( "FX CHNL" ) );
m_effectChannelNumber->move( m_surroundArea->x() +
@@ -394,7 +394,7 @@ instrumentTrack::~instrumentTrack()
{
invalidateAllMyNPH();
delete m_audioPort;
eng()->getMixer()->getMIDIClient()->removePort( m_midiPort );
engine::getMixer()->getMIDIClient()->removePort( m_midiPort );
}
@@ -524,7 +524,7 @@ void instrumentTrack::midiConfigChanged( bool )
float instrumentTrack::frequency( notePlayHandle * _n ) const
{
float pitch = (float)( _n->tone() - m_baseTone +
eng()->getSongEditor()->masterPitch() ) / 12.0f +
engine::getSongEditor()->masterPitch() ) / 12.0f +
(float)( _n->octave() - m_baseOctave );
if( _n->detuning() )
{
@@ -593,10 +593,10 @@ void instrumentTrack::processAudioBuffer( sampleFrame * _buf,
// last time we're called for current note?
if( ( _n->actualReleaseFramesToDo() == 0 &&
_n->totalFramesPlayed() +
eng()->getMixer()->framesPerAudioBuffer() >=
engine::getMixer()->framesPerAudioBuffer() >=
_n->frames() ) ||
( _n->released() && _n->releaseFramesDone() +
eng()->getMixer()->framesPerAudioBuffer() >=
engine::getMixer()->framesPerAudioBuffer() >=
_n->actualReleaseFramesToDo() ) )
{
// then do a soft fade-out at the end to avoid clicks
@@ -616,7 +616,7 @@ void instrumentTrack::processAudioBuffer( sampleFrame * _buf,
volumeVector v = m_surroundArea->getVolumeVector( v_scale );
eng()->getMixer()->bufferToPort( _buf, _frames,
engine::getMixer()->bufferToPort( _buf, _frames,
( _n != NULL ) ? _n->framesAhead() : 0, v,
m_audioPort );
}
@@ -650,7 +650,7 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
notePlayHandle * nph = new
notePlayHandle( this,
_time.frames(
eng()->framesPerTact64th() ),
engine::framesPerTact64th() ),
valueRanges<f_cnt_t>::max, n );
// as mixer::addPlayHandle() might
// delete note (when running into
@@ -659,7 +659,7 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
// this mutex, we have to unlock
// it here temporarily
m_notesMutex.unlock();
if( eng()->getMixer()->addPlayHandle(
if( engine::getMixer()->addPlayHandle(
nph ) )
{
m_notesMutex.lock();
@@ -680,10 +680,10 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
// to all slots connected to signal noteDone()
// this is for example needed by piano-roll for
// recording notes into a pattern
note done_note( NULL,
note done_note(
midiTime( static_cast<f_cnt_t>(
n->totalFramesPlayed() /
eng()->framesPerTact64th() ) ),
engine::framesPerTact64th() ) ),
0, n->tone(), n->octave(),
n->getVolume(), n->getPanning() );
n->noteOff();
@@ -817,9 +817,9 @@ void instrumentTrack::deleteNotePluginData( notePlayHandle * _n )
// Notes deleted when keys still pressed
if( m_notes[_n->key()] == _n )
{
note done_note( NULL, midiTime( static_cast<f_cnt_t>(
note done_note( midiTime( static_cast<f_cnt_t>(
_n->totalFramesPlayed() /
eng()->framesPerTact64th() ) ),
engine::framesPerTact64th() ) ),
0, _n->tone(), _n->octave(),
_n->getVolume(), _n->getPanning() );
_n->noteOff();
@@ -904,7 +904,7 @@ void instrumentTrack::setBaseNote( Uint32 _new_note, bool _modified )
setBaseOctave( (octaves)( _new_note / NOTES_PER_OCTAVE ) );
if( _modified )
{
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
emit baseNoteChanged();
}
@@ -937,7 +937,7 @@ void instrumentTrack::setBaseOctave( octaves _new_octave )
int instrumentTrack::masterKey( notePlayHandle * _n ) const
{
int key = baseTone() + baseOctave() * NOTES_PER_OCTAVE +
eng()->getSongEditor()->masterPitch();
engine::getSongEditor()->masterPitch();
return( tLimit<int>( _n->key() -
( key - A - DEFAULT_OCTAVE * NOTES_PER_OCTAVE ), 0, NOTES ) );
}
@@ -950,7 +950,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
const f_cnt_t _frame_base,
Sint16 _tco_num )
{
float frames_per_tact64th = eng()->framesPerTact64th();
float frames_per_tact64th = engine::framesPerTact64th();
vlist<trackContentObject *> tcos;
bbTrack * bb_track;
@@ -958,7 +958,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
{
trackContentObject * tco = getTCO( _tco_num );
tcos.push_back( tco );
bb_track = bbTrack::findBBTrack( _tco_num, eng() );
bb_track = bbTrack::findBBTrack( _tco_num );
if( !( bb_track->automationDisabled( this )
|| dynamic_cast<pattern *>( tco )->empty() ) )
{
@@ -1002,7 +1002,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
cur_start -= p->startPosition();
}
if( p->frozen() &&
eng()->getSongEditor()->exporting() == FALSE )
engine::getSongEditor()->exporting() == FALSE )
{
if( cur_start > 0 )
{
@@ -1022,7 +1022,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
else
{
// send it to the mixer
eng()->getMixer()->addPlayHandle( handle );
engine::getMixer()->addPlayHandle( handle );
}
played_a_note = TRUE;
continue;
@@ -1100,7 +1100,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
{
// no, then insert it into
// play-handle-vector of mixer
eng()->getMixer()->addPlayHandle(
engine::getMixer()->addPlayHandle(
note_play_handle );
}
else
@@ -1256,7 +1256,7 @@ instrument * instrumentTrack::loadInstrument( const QString & _plugin_name )
void instrumentTrack::surroundAreaPosChanged( const QPoint & _p )
{
setSurroundAreaPos( _p );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -1265,7 +1265,7 @@ void instrumentTrack::surroundAreaPosChanged( const QPoint & _p )
void instrumentTrack::textChanged( const QString & _new_name )
{
setName( _new_name );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -1324,7 +1324,7 @@ void instrumentTrack::dropEvent( QDropEvent * _de )
if( type == "instrument" )
{
loadInstrument( value );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
_de->accept();
}
else if( type == "presetfile" )
@@ -1332,7 +1332,7 @@ void instrumentTrack::dropEvent( QDropEvent * _de )
multimediaProject mmp( value );
loadTrackSpecificSettings( mmp.content().firstChild().
toElement() );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
_de->accept();
}
}
@@ -1356,7 +1356,7 @@ void instrumentTrack::invalidateAllMyNPH( void )
// invalidate all note-play-handles linked to this channel
m_processHandles.clear();
eng()->getMixer()->checkValidityOfPlayHandles();
engine::getMixer()->checkValidityOfPlayHandles();
m_trackType = INSTRUMENT_TRACK;
}

View File

@@ -126,16 +126,16 @@ pattern::pattern( const pattern & _pat_to_copy ) :
pattern::~pattern()
{
if( eng()->getPianoRoll()->currentPattern() == this )
if( engine::getPianoRoll()->currentPattern() == this )
{
eng()->getPianoRoll()->setCurrentPattern( NULL );
engine::getPianoRoll()->setCurrentPattern( NULL );
// we have to have the song-editor to stop playing if it played
// us before
if( eng()->getSongEditor()->playing() &&
eng()->getSongEditor()->playMode() ==
if( engine::getSongEditor()->playing() &&
engine::getSongEditor()->playMode() ==
songEditor::PLAY_PATTERN )
{
eng()->getSongEditor()->playPattern( NULL );
engine::getSongEditor()->playPattern( NULL );
}
}
@@ -248,7 +248,7 @@ note * pattern::addNote( const note & _new_note, const bool _quant_pos )
note * new_note = new note( _new_note );
if( _quant_pos )
{
new_note->quantizePos( eng()->getPianoRoll()->quantization() );
new_note->quantizePos( engine::getPianoRoll()->quantization() );
}
if( m_notes.size() == 0 || m_notes.back()->pos() <= new_note->pos() )
@@ -335,9 +335,9 @@ void pattern::clearNotes( void )
m_notes.clear();
checkType();
update();
if( eng()->getPianoRoll()->currentPattern() == this )
if( engine::getPianoRoll()->currentPattern() == this )
{
eng()->getPianoRoll()->update();
engine::getPianoRoll()->update();
}
}
@@ -460,7 +460,7 @@ void pattern::loadSettings( const QDomElement & _this )
if( node.isElement() &&
!node.toElement().attribute( "metadata" ).toInt() )
{
note * n = new note( eng() );
note * n = new note;
n->restoreState( node.toElement() );
m_notes.push_back( n );
}
@@ -505,9 +505,9 @@ void pattern::openInPianoRoll( void )
void pattern::openInPianoRoll( bool )
{
eng()->getPianoRoll()->setCurrentPattern( this );
eng()->getPianoRoll()->show();
eng()->getPianoRoll()->setFocus();
engine::getPianoRoll()->setCurrentPattern( this );
engine::getPianoRoll()->show();
engine::getPianoRoll()->setFocus();
}
@@ -541,7 +541,7 @@ void pattern::changeName( void )
void pattern::freeze( void )
{
if( eng()->getSongEditor()->playing() )
if( engine::getSongEditor()->playing() )
{
QMessageBox::information( 0, tr( "Cannot freeze pattern" ),
tr( "The pattern currently "
@@ -804,21 +804,21 @@ void pattern::mousePressEvent( QMouseEvent * _me )
{
n->setLength( -64 );
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
update();
if( eng()->getPianoRoll()->currentPattern() == this )
if( engine::getPianoRoll()->currentPattern() == this )
{
eng()->getPianoRoll()->update();
engine::getPianoRoll()->update();
}
}
else if( m_frozenPattern != NULL && _me->button() == Qt::LeftButton &&
eng()->getMainWindow()->isShiftPressed() == TRUE )
engine::getMainWindow()->isShiftPressed() == TRUE )
{
QString s;
new stringPairDrag( "sampledata",
m_frozenPattern->toBase64( s ),
embed::getIconPixmap( "freeze" ),
this, eng() );
embed::getIconPixmap( "freeze" ),
this );
}
else
{
@@ -868,11 +868,11 @@ void pattern::wheelEvent( QWheelEvent * _we )
n->setLength( 0 );
}
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
update();
if( eng()->getPianoRoll()->currentPattern() == this )
if( engine::getPianoRoll()->currentPattern() == this )
{
eng()->getPianoRoll()->update();
engine::getPianoRoll()->update();
}
_we->accept();
}
@@ -1151,7 +1151,7 @@ void pattern::ensureBeatNotes( void )
}
if( found == FALSE )
{
addNote( note( eng(), midiTime( 0 ), midiTime( i *
addNote( note( midiTime( 0 ), midiTime( i *
BEATS_PER_TACT ) ) );
}
}
@@ -1162,9 +1162,9 @@ void pattern::ensureBeatNotes( void )
void pattern::updateBBTrack( void )
{
if( getTrack()->getTrackContainer() == eng()->getBBEditor() )
if( getTrack()->getTrackContainer() == engine::getBBEditor() )
{
eng()->getBBEditor()->updateBBTrack( this );
engine::getBBEditor()->updateBBTrack( this );
}
}
@@ -1294,8 +1294,6 @@ void patternFreezeStatusDialog::updateProgress( void )
patternFreezeThread::patternFreezeThread( pattern * _pattern ) :
QThread(),
engineObject( _pattern->eng() ),
m_pattern( _pattern )
{
// create status-dialog
@@ -1327,15 +1325,15 @@ void patternFreezeThread::run( void )
// mixer::restoreAudioDevice(...) deletes old audio-dev and thus
// audioSampleRecorder would be destroyed two times...
audioSampleRecorder * freeze_recorder = new audioSampleRecorder(
eng()->getMixer()->sampleRate(),
engine::getMixer()->sampleRate(),
DEFAULT_CHANNELS, b,
eng()->getMixer() );
eng()->getMixer()->setAudioDevice( freeze_recorder,
eng()->getMixer()->highQuality() );
engine::getMixer() );
engine::getMixer()->setAudioDevice( freeze_recorder,
engine::getMixer()->highQuality() );
// prepare stuff for playing correct things later
eng()->getSongEditor()->playPattern( m_pattern, FALSE );
songEditor::playPos & ppp = eng()->getSongEditor()->getPlayPos(
engine::getSongEditor()->playPattern( m_pattern, FALSE );
songEditor::playPos & ppp = engine::getSongEditor()->getPlayPos(
songEditor::PLAY_PATTERN );
ppp.setTact( 0 );
ppp.setTact64th( 0 );
@@ -1358,7 +1356,7 @@ void patternFreezeThread::run( void )
m_pattern->m_freezing = FALSE;
// reset song-editor settings
eng()->getSongEditor()->stop();
engine::getSongEditor()->stop();
ppp.m_timeLineUpdate = TRUE;
// create final sample-buffer if freezing was successful
@@ -1373,7 +1371,7 @@ void patternFreezeThread::run( void )
bufferAllocator::disableAutoCleanup( FALSE );
// restore original audio-device
eng()->getMixer()->restoreAudioDevice();
engine::getMixer()->restoreAudioDevice();
m_statusDlg->setProgress( -1 ); // we're finished

View File

@@ -4,7 +4,7 @@
* sample_track.cpp - implementation of class sampleTrack, a track which
* provides arrangement of samples
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -60,7 +60,7 @@
sampleTCO::sampleTCO( track * _track ) :
trackContentObject( _track ),
m_sampleBuffer( new sampleBuffer( eng() ) )
m_sampleBuffer( new sampleBuffer )
{
#ifndef QT4
setBackgroundMode( Qt::NoBackground );
@@ -72,7 +72,7 @@ sampleTCO::sampleTCO( track * _track ) :
// we need to receive bpm-change-events, because then we have to
// change length of this TCO
connect( eng()->getSongEditor(), SIGNAL( tempoChanged( bpm_t ) ), this,
connect( engine::getSongEditor(), SIGNAL( tempoChanged( bpm_t ) ), this,
SLOT( updateLength( bpm_t ) ) );
}
@@ -150,7 +150,7 @@ void sampleTCO::dropEvent( QDropEvent * _de )
{
m_sampleBuffer->loadFromBase64(
stringPairDrag::decodeValue( _de ) );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
updateLength();
update();
_de->accept();
@@ -170,7 +170,7 @@ void sampleTCO::mouseDoubleClickEvent( QMouseEvent * )
if( af != "" && af != m_sampleBuffer->audioFile() )
{
setSampleFile( af );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
}
@@ -243,7 +243,7 @@ void sampleTCO::paintEvent( QPaintEvent * _pe )
midiTime sampleTCO::getSampleLength( void ) const
{
return( static_cast<Sint32>( m_sampleBuffer->frames() /
eng()->framesPerTact64th() ) );
engine::framesPerTact64th() ) );
}
@@ -351,7 +351,7 @@ void sampleTCOSettingsDialog::setSampleFile( const QString & _f )
{
m_fileLbl->setText( _f );
m_sampleTCO->setSampleFile( _f );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
*/
@@ -361,22 +361,22 @@ void sampleTCOSettingsDialog::setSampleFile( const QString & _f )
sampleTrack::sampleTrack( trackContainer * _tc ) :
track( _tc ),
m_audioPort( new audioPort( tr( "Sample track" ), eng() ) )
m_audioPort( new audioPort( tr( "Sample track" ) ) )
{
getTrackWidget()->setFixedHeight( 32 );
m_trackLabel = new effectLabel( tr( "Sample track" ),
getTrackSettingsWidget(), eng(), this );
getTrackSettingsWidget(), this );
#if 0
m_trackLabel = new nameLabel( tr( "Sample track" ),
getTrackSettingsWidget(), eng() );
getTrackSettingsWidget() );
m_trackLabel->setPixmap( embed::getIconPixmap( "sample_track" ) );
#endif
m_trackLabel->setGeometry( 26, 1, DEFAULT_SETTINGS_WIDGET_WIDTH-2, 29 );
m_trackLabel->show();
m_volumeKnob = new volumeKnob( knobSmall_17, getTrackSettingsWidget(),
tr( "Channel volume" ), eng(), this );
tr( "Channel volume" ), this );
m_volumeKnob->setRange( MIN_VOLUME, MAX_VOLUME, 1.0f );
m_volumeKnob->setInitValue( DEFAULT_VOLUME );
m_volumeKnob->setHintText( tr( "Channel volume:" ) + " ", "%" );
@@ -451,7 +451,7 @@ bool FASTCALL sampleTrack::play( const midiTime & _start,
else
{
// send it to the mixer
eng()->getMixer()->addPlayHandle( handle );
engine::getMixer()->addPlayHandle( handle );
}
played_a_note = TRUE;
}

View File

@@ -4,7 +4,7 @@
* automatable_button.cpp - implementation of class automatableButton and
* automatableButtonGroup
*
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -50,13 +50,13 @@
automatableButton::automatableButton( QWidget * _parent, const QString & _name,
engine * _engine, track * _track ) :
track * _track ) :
QWidget( _parent
#ifndef QT4
, _name.ascii()
#endif
),
autoObj( _engine, _track, FALSE, FALSE, TRUE ),
autoObj( _track, FALSE, FALSE, TRUE ),
m_group( NULL ),
m_checkable( FALSE )
{
@@ -205,14 +205,14 @@ void automatableButton::setValue( const bool _on )
automatableButtonGroup::automatableButtonGroup( QWidget * _parent,
const QString & _name,
engine * _engine, track * _track ) :
const QString & _name,
track * _track ) :
QWidget( _parent
#ifndef QT4
, _name.ascii()
#endif
),
automatableObject<int>( _engine, _track )
automatableObject<int>( _track )
{
hide();
if( _track != NULL )

View File

@@ -3,7 +3,7 @@
/*
* automatable_slider.cpp - implementation of class automatableSlider
*
* Copyright (c) 2006 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -48,7 +48,7 @@
automatableSlider::automatableSlider( QWidget * _parent, const QString & _name,
engine * _engine, class track * _track ) :
class track * _track ) :
QSlider( _parent
#ifndef QT4
, _name.ascii()
@@ -56,7 +56,7 @@ automatableSlider::automatableSlider( QWidget * _parent, const QString & _name,
),
m_show_status( FALSE )
{
m_knob = new knob( knobDark_28, NULL, _name, _engine, _track );
m_knob = new knob( knobDark_28, NULL, _name, _track );
#ifdef QT4
setAccessibleName( _name );

View File

@@ -3,7 +3,7 @@
/*
* combobox.cpp - implementation of LMMS-combobox
*
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -58,14 +58,13 @@ QPixmap * comboBox::s_arrow = NULL;
const int CB_ARROW_BTN_WIDTH = 20;
comboBox::comboBox( QWidget * _parent, const QString & _name, engine * _engine,
track * _track ) :
comboBox::comboBox( QWidget * _parent, const QString & _name, track * _track ) :
QWidget( _parent
#ifndef QT4
, _name.ascii()
#endif
),
automatableObject<int>( _engine, _track ),
automatableObject<int>( _track ),
m_menu( this ),
m_pressed( FALSE )
{

View File

@@ -4,7 +4,7 @@
* cpuload_widget.cpp - widget for displaying CPU-load (partly based on
* Hydrogen's CPU-load-widget)
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -41,12 +41,12 @@
#include "cpuload_widget.h"
#include "embed.h"
#include "engine.h"
#include "mixer.h"
cpuloadWidget::cpuloadWidget( QWidget * _parent, engine * _engine ) :
cpuloadWidget::cpuloadWidget( QWidget * _parent ) :
QWidget( _parent ),
engineObject( _engine ),
m_currentLoad( 0 ),
m_temp(),
m_background( embed::getIconPixmap( "cpuload_bg" ) ),
@@ -106,7 +106,7 @@ void cpuloadWidget::paintEvent( QPaintEvent * )
void cpuloadWidget::updateCpuLoad()
{
// smooth load-values a bit
Uint8 new_load = ( m_currentLoad + eng()->getMixer()->cpuLoad() ) / 2;
Uint8 new_load = ( m_currentLoad + engine::getMixer()->cpuLoad() ) / 2;
if( new_load != m_currentLoad )
{
m_currentLoad = new_load;

View File

@@ -4,7 +4,7 @@
* effect_label.cpp - a label which is renamable by double-clicking it and
* offers access to an effect rack
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -38,12 +38,9 @@
#endif
effectLabel::effectLabel( const QString & _initial_name,
QWidget * _parent,
engine * _engine,
sampleTrack * _track ) :
effectLabel::effectLabel( const QString & _initial_name, QWidget * _parent,
sampleTrack * _track ) :
QWidget( _parent ),
journallingObject( _engine ),
m_track( _track ),
m_show( TRUE )
{
@@ -59,7 +56,7 @@ effectLabel::effectLabel( const QString & _initial_name,
m_label->setFont( pointSize<8>( f ) );
m_label->setGeometry( 38, 1, 200, 28 );
m_effWidget = new effectTabWidget( eng()->getMainWindow()->workspace(),
m_effWidget = new effectTabWidget( engine::getMainWindow()->workspace(),
m_track,
m_track->getAudioPort() );
m_effWidget->setFixedSize( 240, 242 );

View File

@@ -3,7 +3,7 @@
/*
* group_box.cpp - groupbox for LMMS
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -58,9 +58,8 @@ QPixmap * groupBox::s_ledBg = NULL;
groupBox::groupBox( const QString & _caption, QWidget * _parent,
engine * _engine, track * _track ) :
track * _track ) :
QWidget( _parent ),
engineObject( _engine ),
m_caption( _caption ),
m_origHeight( height() ),
m_animating( FALSE )
@@ -77,7 +76,7 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent,
updatePixmap();
m_led = new pixmapButton( this, _caption, eng(), _track );
m_led = new pixmapButton( this, _caption, _track );
m_led->setCheckable( TRUE );
m_led->move( 2, 3 );
m_led->setActiveGraphic( embed::getIconPixmap( "led_green" ) );

View File

@@ -86,13 +86,13 @@ textFloat * knob::s_textFloat = NULL;
knob::knob( int _knob_num, QWidget * _parent, const QString & _name,
engine * _engine, track * _track ) :
track * _track ) :
QWidget( _parent
#ifndef QT4
, _name.ascii()
#endif
),
autoObj( _engine, _track ),
autoObj( _track ),
m_mouseOffset( 0.0f ),
m_buttonPressed( FALSE ),
m_hintTextBeforeValue( "" ),
@@ -138,9 +138,9 @@ knob::~knob()
{
/* // make sure pointer to this knob isn't used anymore in active
// midi-device-class
if( eng()->getMixer()->getMIDIClient()->pitchBendKnob() == this )
if( engine::getMixer()->getMIDIClient()->pitchBendKnob() == this )
{
eng()->getMixer()->getMIDIClient()->setPitchBendKnob( NULL );
engine::getMixer()->getMIDIClient()->setPitchBendKnob( NULL );
}*/
}
@@ -289,7 +289,7 @@ float knob::getValue( const QPoint & _p )
}
return( new_value );
}
if( eng()->getMainWindow()->isShiftPressed() )
if( engine::getMainWindow()->isShiftPressed() )
{
return( ( _p.y() - m_origMousePos.y() ) * step() );
}
@@ -429,8 +429,8 @@ void knob::dropEvent( QDropEvent * _de )
void knob::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() == Qt::LeftButton &&
eng()->getMainWindow()->isCtrlPressed() == FALSE &&
eng()->getMainWindow()->isShiftPressed() == FALSE )
engine::getMainWindow()->isCtrlPressed() == FALSE &&
engine::getMainWindow()->isShiftPressed() == FALSE )
{
prepareJournalEntryFromOldVal();
@@ -459,21 +459,21 @@ void knob::mousePressEvent( QMouseEvent * _me )
m_buttonPressed = TRUE;
}
else if( _me->button() == Qt::LeftButton &&
eng()->getMainWindow()->isCtrlPressed() == TRUE/* &&
eng()->getMainWindow()->isShiftPressed() == FALSE*/ )
engine::getMainWindow()->isCtrlPressed() == TRUE/* &&
engine::getMainWindow()->isShiftPressed() == FALSE*/ )
{
new stringPairDrag( "float_value", QString::number( value() ),
QPixmap(), this, eng() );
QPixmap(), this );
}
else if( _me->button() == Qt::LeftButton &&
/* eng()->getMainWindow()->isCtrlPressed() == TRUE &&*/
eng()->getMainWindow()->isShiftPressed() == TRUE )
/* engine::getMainWindow()->isCtrlPressed() == TRUE &&*/
engine::getMainWindow()->isShiftPressed() == TRUE )
{
/* this pointer was casted to uint,
* compile time error on 64 bit systems */
new stringPairDrag( "link_object",
QString::number( (ulong) this ),
QPixmap(), this, eng() );
QPixmap(), this );
}
else if( _me->button() == Qt::MidButton )
{
@@ -734,7 +734,7 @@ void knob::enterValue( void )
void knob::connectToMidiDevice( void )
{
//eng()->getMixer()->getMIDIDevice()->setPitchBendKnob( this );
//engine::getMixer()->getMIDIDevice()->setPitchBendKnob( this );
}

View File

@@ -3,7 +3,7 @@
/*
* lcd_spinbox.cpp - class lcdSpinBox, an improved QLCDNumber
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -52,14 +52,14 @@
lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent,
const QString & _name,
engine * _engine, track * _track ) :
const QString & _name,
track * _track ) :
QWidget( _parent
#ifndef QT4
, _name.ascii()
#endif
),
autoObj( _engine, _track, 0, _min, _max ),
autoObj( _track, 0, _min, _max ),
m_label( NULL ),
m_origMousePos()
{

View File

@@ -3,7 +3,7 @@
/*
* led_checkbox.cpp - class ledCheckBox, an improved QCheckBox
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -55,10 +55,9 @@ static const QString names[ledCheckBox::TOTAL_COLORS] =
ledCheckBox::ledCheckBox( const QString & _text, QWidget * _parent,
const QString & _name,
engine * _engine, track * _track,
const QString & _name, track * _track,
ledColors _color ) :
automatableButton( _parent, _name, _engine, _track ),
automatableButton( _parent, _name, _track ),
m_text( _text )
{
setCheckable( TRUE );

View File

@@ -4,7 +4,7 @@
* pixmap_button.cpp - implementation of pixmap-button (often used as "themed"
* checkboxes/radiobuttons etc)
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -46,8 +46,8 @@
pixmapButton::pixmapButton( QWidget * _parent, const QString & _name,
engine * _engine, track * _track ) :
automatableButton( _parent, _name, _engine, _track ),
track * _track ) :
automatableButton( _parent, _name, _track ),
m_activePixmap(),
m_inactivePixmap(),
m_bgPixmap()

View File

@@ -3,7 +3,7 @@
/*
* project_notes.cpp - implementation of project-notes-editor
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -68,21 +68,21 @@
#include "project_notes.h"
#include "embed.h"
#include "engine.h"
#include "main_window.h"
#include "song_editor.h"
projectNotes::projectNotes( engine * _engine ) :
QMainWindow( _engine->getMainWindow()->workspace()
projectNotes::projectNotes( void ) :
QMainWindow( engine::getMainWindow()->workspace()
#ifndef QT4
, 0, Qt::WStyle_Title
#endif
),
journallingObject( _engine )
)
{
#ifdef QT4
eng()->getMainWindow()->workspace()->addWindow( this );
engine::getMainWindow()->workspace()->addWindow( this );
#endif
m_edit = new QTextEdit( this );
@@ -104,7 +104,7 @@ projectNotes::projectNotes( engine * _engine ) :
connect( m_edit, SIGNAL( currentAlignmentChanged( int ) ),
this, SLOT( alignmentChanged( int ) ) );
connect( m_edit, SIGNAL( textChanged() ),
eng()->getSongEditor(), SLOT( setModified() ) );
engine::getSongEditor(), SLOT( setModified() ) );
setupActions();
@@ -115,7 +115,7 @@ projectNotes::projectNotes( engine * _engine ) :
resize( 300, 200 );
QWidget * w = ( parentWidget() != NULL ) ? parentWidget() : this;
if( eng()->getMainWindow()->workspace() != NULL )
if( engine::getMainWindow()->workspace() != NULL )
{
w->move( 700, 10 );
}
@@ -438,7 +438,7 @@ void projectNotes::setupActions()
void projectNotes::textBold()
{
m_edit->setFontWeight( m_actionTextBold->isChecked() );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -447,7 +447,7 @@ void projectNotes::textBold()
void projectNotes::textUnderline()
{
m_edit->setFontUnderline( m_actionTextUnderline->isChecked() );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -456,7 +456,7 @@ void projectNotes::textUnderline()
void projectNotes::textItalic()
{
m_edit->setFontItalic( m_actionTextItalic->isChecked() );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -466,7 +466,7 @@ void projectNotes::textFamily( const QString & _f )
{
m_edit->setFontFamily( _f );
m_edit->viewport()->setFocus();
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -476,7 +476,7 @@ void projectNotes::textSize( const QString & _p )
{
m_edit->setFontPointSize( _p.toInt() );
m_edit->viewport()->setFocus();
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -532,7 +532,7 @@ void projectNotes::fontChanged( const QFont & _f )
m_actionTextBold->setChecked( _f.bold() );
m_actionTextItalic->setChecked( _f.italic() );
m_actionTextUnderline->setChecked( _f.underline() );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -547,7 +547,7 @@ void projectNotes::colorChanged( const QColor & _c )
#else
m_actionTextColor->setIconSet( pix );
#endif
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -575,7 +575,7 @@ void projectNotes::alignmentChanged( int _a )
{
m_actionAlignJustify->setChecked( TRUE );
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}

View File

@@ -4,7 +4,7 @@
* effect_tab_widget.cpp - tab-widget in channel-track-window for setting up
* effects
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -68,7 +68,6 @@ rackPlugin::rackPlugin( QWidget * _parent,
track * _track,
audioPort * _port ) :
QWidget( _parent ),
journallingObject( _track->eng() ),
m_effect( _eff ),
m_track( _track ),
m_port( _port ),
@@ -90,7 +89,7 @@ rackPlugin::rackPlugin( QWidget * _parent,
#endif
m_bypass = new ledCheckBox( "", this, tr( "Turn the effect off" ),
eng(), m_track );
m_track );
connect( m_bypass, SIGNAL( toggled( bool ) ),
this, SLOT( bypassed( bool ) ) );
toolTip::add( m_bypass, tr( "On/Off" ) );
@@ -104,8 +103,8 @@ rackPlugin::rackPlugin( QWidget * _parent,
tr(
"Toggles the effect on or off." ) );
m_wetDry = new knob( knobBright_26, this,
tr( "Wet/Dry mix" ), eng(), m_track );
m_wetDry = new knob( knobBright_26, this, tr( "Wet/Dry mix" ),
m_track );
connect( m_wetDry, SIGNAL( valueChanged( float ) ),
this, SLOT( setWetDry( float ) ) );
m_wetDry->setLabel( tr( "W/D" ) );
@@ -123,7 +122,7 @@ rackPlugin::rackPlugin( QWidget * _parent,
"shows up in the output." ) );
m_autoQuit = new tempoSyncKnob( knobBright_26, this, tr( "Decay" ),
eng(), m_track );
m_track );
connect( m_autoQuit, SIGNAL( valueChanged( float ) ),
this, SLOT( setAutoQuit( float ) ) );
m_autoQuit->setLabel( tr( "Decay" ) );
@@ -141,7 +140,7 @@ rackPlugin::rackPlugin( QWidget * _parent,
"plugin stops processing. Smaller values will reduce the CPU overhead but "
"run the risk of clipping the tail on delay effects." ) );
m_gate = new knob( knobBright_26, this, tr( "Gate" ), eng(), m_track );
m_gate = new knob( knobBright_26, this, tr( "Gate" ), m_track );
connect( m_wetDry, SIGNAL( valueChanged( float ) ),
this, SLOT( setGate( float ) ) );
m_gate->setLabel( tr( "Gate" ) );
@@ -183,10 +182,10 @@ rackPlugin::rackPlugin( QWidget * _parent,
#endif
m_controlView = m_effect->createControlDialog( m_track );
/* eng()->getMainWindow()->workspace(),
/* engine::getMainWindow()->workspace(),
new ControlDialog(
eng()->getMainWindow()->workspace(),
m_effect, eng(), m_track );*/
engine::getMainWindow()->workspace(),
m_effect, m_track );*/
connect( m_controlView, SIGNAL( closed() ),
this, SLOT( closeEffects() ) );
m_controlView->hide();
@@ -276,9 +275,9 @@ void rackPlugin::setWetDry( float _value )
void rackPlugin::setAutoQuit( float _value )
{
float samples = eng()->getMixer()->sampleRate() * _value / 1000.0f;
float samples = engine::getMixer()->sampleRate() * _value / 1000.0f;
Uint32 buffers = 1 + ( static_cast<Uint32>( samples ) /
eng()->getMixer()->framesPerAudioBuffer() );
engine::getMixer()->framesPerAudioBuffer() );
m_effect->setTimeout( buffers );
}

View File

@@ -3,7 +3,7 @@
/*
* rack_view.cpp - provides the display for the rackInsert instances
*
* Copyright (c) 2006 Danny McRae <khjklujn@netscape.net>
* Copyright (c) 2006-2007 Danny McRae <khjklujn@netscape.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -39,12 +39,8 @@
#include "rack_view.h"
rackView::rackView( QWidget * _parent,
engine * _engine,
track * _track,
audioPort * _port ):
rackView::rackView( QWidget * _parent, track * _track, audioPort * _port ) :
QWidget( _parent ),
journallingObject( _engine ),
m_track( _track ),
m_port( _port )
{
@@ -250,15 +246,11 @@ void FASTCALL rackView::loadSettings( const QDomElement & _this )
{
QDomElement cn = node.toElement();
const QString name = cn.attribute( "name" );
effect::constructionData cd =
{
eng(),
// we have this really convenient key-ctor
// which takes a QString and decodes the
// base64-data inside :-)
effectKey( cn.attribute( "key" ) )
} ;
addEffect(effect::instantiate( name, cd ) );
// we have this really convenient key-ctor
// which takes a QString and decodes the
// base64-data inside :-)
effectKey key( cn.attribute( "key" ) );
addEffect( effect::instantiate( name, &key ) );
// TODO: somehow detect if effect is sub-plugin-capable
// but couldn't load sub-plugin with requsted key
if( node.isElement() )

View File

@@ -3,8 +3,8 @@
/*
* tempo_sync_knob.cpp - adds bpm to ms conversion for knob class
*
* Copyright (c) 2005 Danny McRae <khjklujn/at/yahoo.com>
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Danny McRae <khjklujn/at/yahoo.com>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -53,19 +53,19 @@
tempoSyncKnob::tempoSyncKnob( int _knob_num, QWidget * _parent,
const QString & _name,
engine * _engine, track * _track,
float _scale ) :
knob( _knob_num, _parent, _name, _engine, _track ),
const QString & _name,
track * _track,
float _scale ) :
knob( _knob_num, _parent, _name, _track ),
m_tempoSyncMode( NO_SYNC ),
m_scale( _scale ),
m_tempoSyncIcon( embed::getIconPixmap( "tempo_sync" ) ),
m_tempoSyncDescription( tr( "Tempo Sync" ) ),
m_tempoLastSyncMode( NO_SYNC )
{
connect( eng()->getSongEditor(), SIGNAL( tempoChanged( bpm_t ) ),
connect( engine::getSongEditor(), SIGNAL( tempoChanged( bpm_t ) ),
this, SLOT( calculateTempoSyncTime( bpm_t ) ) );
m_custom = new meterDialog( eng()->getMainWindow()->workspace(),
m_custom = new meterDialog( engine::getMainWindow()->workspace(),
_track );
m_custom->hide();
m_custom->setWindowTitle( "Meter" );
@@ -110,7 +110,7 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
this, SLOT( pasteValue() ) );
contextMenu.addSeparator();
float limit = 60000.0f / ( eng()->getSongEditor()->getTempo() *
float limit = 60000.0f / ( engine::getSongEditor()->getTempo() *
m_scale );
#ifdef QT4
@@ -261,7 +261,7 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
void tempoSyncKnob::mouseMoveEvent( QMouseEvent * _me )
{
m_tempoSyncMode = NO_SYNC;
calculateTempoSyncTime( eng()->getSongEditor()->getTempo() );
calculateTempoSyncTime( engine::getSongEditor()->getTempo() );
knob::mouseMoveEvent( _me );
}
@@ -272,7 +272,7 @@ void tempoSyncKnob::wheelEvent( QWheelEvent * _we )
{
knob::wheelEvent( _we );
m_tempoSyncMode = NO_SYNC;
calculateTempoSyncTime( eng()->getSongEditor()->getTempo() );
calculateTempoSyncTime( engine::getSongEditor()->getTempo() );
}
@@ -295,7 +295,7 @@ void tempoSyncKnob::setTempoSync( QAction * ) { }
void tempoSyncKnob::setTempoSync( int _note_type )
{
setSyncMode( ( tempoSyncMode ) _note_type );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -473,7 +473,7 @@ void tempoSyncKnob::setSyncMode( tempoSyncMode _new_mode )
this, SLOT( updateCustom( int ) ) );
}
}
calculateTempoSyncTime( eng()->getSongEditor()->getTempo() );
calculateTempoSyncTime( engine::getSongEditor()->getTempo() );
}
@@ -490,7 +490,7 @@ float tempoSyncKnob::getScale( void )
void tempoSyncKnob::setScale( float _new_scale )
{
m_scale = _new_scale;
calculateTempoSyncTime( eng()->getSongEditor()->getTempo() );
calculateTempoSyncTime( engine::getSongEditor()->getTempo() );
emit scaleChanged( _new_scale );
}

View File

@@ -3,7 +3,7 @@
/*
* visualization_widget.cpp - widget for visualization of sound-data
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -45,6 +45,7 @@
#include "visualization_widget.h"
#include "embed.h"
#include "engine.h"
#include "buffer_allocator.h"
#include "templates.h"
#include "tooltip.h"
@@ -55,10 +56,8 @@ const int UPDATE_TIME = 1000 / 20; // 20 fps
visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p,
engine * _engine,
visualizationTypes _vtype ) :
QWidget( _p ),
engineObject( _engine ),
s_background( _bg ),
m_enabled( TRUE )
{
@@ -68,10 +67,10 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p,
setFixedSize( s_background.width(), s_background.height() );
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
m_buffer = bufferAllocator::alloc<surroundSampleFrame>( frames );
eng()->getMixer()->clearAudioBuffer( m_buffer, frames );
engine::getMixer()->clearAudioBuffer( m_buffer, frames );
m_updateTimer = new QTimer( this );
@@ -81,7 +80,7 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p,
m_updateTimer->start( UPDATE_TIME );
}
connect( eng()->getMixer(), SIGNAL( nextAudioBuffer(
connect( engine::getMixer(), SIGNAL( nextAudioBuffer(
const surroundSampleFrame *, int ) ),
this, SLOT( setAudioBuffer(
const surroundSampleFrame *, int ) ) );
@@ -125,7 +124,7 @@ void visualizationWidget::paintEvent( QPaintEvent * )
if( m_enabled == TRUE )
{
float master_output = eng()->getMixer()->masterGain();
float master_output = engine::getMixer()->masterGain();
Uint16 w = width()-4;
float half_h = -( height() - 6 ) / 3.0 * master_output - 1;
Uint16 x_base = 2;
@@ -140,7 +139,8 @@ void visualizationWidget::paintEvent( QPaintEvent * )
float max_level = 0.0;
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
const fpab_t frames =
engine::getMixer()->framesPerAudioBuffer();
// analyse wave-stream for max-level
for( fpab_t frame = 0; frame < frames; ++frame )

View File

@@ -4,7 +4,7 @@
* volume_knob.cpp - defines a knob that display it's value as either a
* percentage or in dbV.
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -49,8 +49,8 @@
volumeKnob::volumeKnob( int _knob_num, QWidget * _parent, const QString & _name,
engine * _engine, track * _track ) :
knob( _knob_num, _parent, _name, _engine, _track )
track * _track ) :
knob( _knob_num, _parent, _name, _track )
{
}
@@ -68,7 +68,7 @@ volumeKnob::~volumeKnob()
void volumeKnob::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() == Qt::LeftButton &&
eng()->getMainWindow()->isCtrlPressed() == FALSE )
engine::getMainWindow()->isCtrlPressed() == FALSE )
{
prepareJournalEntryFromOldVal();
@@ -108,10 +108,10 @@ void volumeKnob::mousePressEvent( QMouseEvent * _me )
m_buttonPressed = TRUE;
}
else if( _me->button() == Qt::LeftButton &&
eng()->getMainWindow()->isCtrlPressed() == TRUE )
engine::getMainWindow()->isCtrlPressed() == TRUE )
{
new stringPairDrag( "float_value", QString::number( value() ),
QPixmap(), this, eng() );
QPixmap(), this );
}
else if( _me->button() == Qt::MidButton )
{