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

@@ -92,7 +92,6 @@ QPixmap * audioFileProcessor::s_artwork = NULL;
audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
instrument( _channel_track, &audiofileprocessor_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
m_sampleBuffer( eng(), "" ),
m_drawMethod( sampleBuffer::LINE_CONNECT )
{
connect( &m_sampleBuffer, SIGNAL( sampleUpdated() ), this,
@@ -105,7 +104,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
}
m_openAudioFileButton = new pixmapButton( this, NULL, eng(), NULL );
m_openAudioFileButton = new pixmapButton( this, NULL, NULL );
m_openAudioFileButton->setCursor( QCursor( Qt::PointingHandCursor ) );
m_openAudioFileButton->move( 200, 90 );
m_openAudioFileButton->setActiveGraphic( embed::getIconPixmap(
@@ -130,7 +129,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"are not reset, so please don't wonder if your sample "
"doesn't sound like the original one..." ) );
m_reverseButton = new pixmapButton( this, NULL, eng(), NULL );
m_reverseButton = new pixmapButton( this, NULL, NULL );
m_reverseButton->setCheckable( TRUE );
m_reverseButton->move( 160, 124 );
m_reverseButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -150,7 +149,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"This is useful for cool effects, e.g. a reversed "
"crash." ) );
m_loopButton = new pixmapButton( this, NULL, eng(), NULL );
m_loopButton = new pixmapButton( this, tr( "Loop" ), _channel_track );
m_loopButton->setCheckable( TRUE );
m_loopButton->move( 180, 124 );
m_loopButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -171,8 +170,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"This is useful for things like string- and choir-"
"samples." ) );
m_ampKnob = new volumeKnob( knobDark_28, this, tr( "Amplify" ), eng(),
NULL );
m_ampKnob = new volumeKnob( knobDark_28, this, tr( "Amplify" ), NULL );
m_ampKnob->setRange( 0, 500, 1.0f );
m_ampKnob->move( 6, 114 );
m_ampKnob->setInitValue( 100.0f );
@@ -191,7 +189,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"actual sample-file isn't touched!)" ) );
m_startKnob = new knob( knobDark_28, this, tr( "Start of sample" ),
eng(), _channel_track );
_channel_track );
m_startKnob->setRange( 0.0f, 1.0f, 0.00001f );
m_startKnob->move( 46, 114 );
m_startKnob->setInitValue( 0.0f );
@@ -210,7 +208,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"which AudioFileProcessor returns if a note is longer "
"than the sample between start- and end-point." ) );
m_endKnob = new knob( knobDark_28, this, tr( "End of sample" ), eng(),
m_endKnob = new knob( knobDark_28, this, tr( "End of sample" ),
_channel_track );
m_endKnob->setRange( 0.0f, 1.0f, 0.00001f );
m_endKnob->move( 84, 114 );
@@ -230,7 +228,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"AudioFileProcessor returns if a note is longer than "
"the sample between start- and end-point." ) );
m_viewLinesPB = new pixmapButton( this, NULL, eng(), NULL );
m_viewLinesPB = new pixmapButton( this, NULL, NULL );
m_viewLinesPB->move( 154, 158 );
m_viewLinesPB->setBgGraphic( getBackground( m_viewLinesPB ) );
if( m_drawMethod == sampleBuffer::LINE_CONNECT )
@@ -249,7 +247,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"sound itself. It just gives you another view to your "
"sample." ) );
m_viewDotsPB = new pixmapButton( this, NULL, eng(), NULL );
m_viewDotsPB = new pixmapButton( this, NULL, NULL );
m_viewDotsPB->move( 204, 158 );
m_viewDotsPB->setBgGraphic( getBackground( m_viewDotsPB ) );
if( m_drawMethod == sampleBuffer::DOTS )
@@ -268,7 +266,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
"It just gives you another view to your sample." ) );
automatableButtonGroup * view_group = new automatableButtonGroup( this,
NULL, eng(), NULL );
NULL, NULL );
view_group->addButton( m_viewLinesPB );
view_group->addButton( m_viewDotsPB );
@@ -360,7 +358,7 @@ Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
const float freq_factor = BASE_FREQ /
( getInstrumentTrack()->frequency( _n ) *
DEFAULT_SAMPLE_RATE /
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
return( static_cast<Uint32>( floorf( ( m_sampleBuffer.endFrame() -
m_sampleBuffer.startFrame() ) *
@@ -394,13 +392,11 @@ void audioFileProcessor::setAudioFile( const QString & _audio_file, bool _rename
void audioFileProcessor::playNote( notePlayHandle * _n, bool )
{
const Uint32 frames = eng()->getMixer()->framesPerAudioBuffer();
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
// calculate frequency of note
const float note_freq = getInstrumentTrack()->frequency( _n ) /
( eng()->getMixer()->sampleRate() /
DEFAULT_SAMPLE_RATE );
const float note_freq = getInstrumentTrack()->frequency( _n );
if( !_n->m_pluginData )
{
@@ -430,9 +426,10 @@ void audioFileProcessor::deleteNotePluginData( notePlayHandle * _n )
void audioFileProcessor::dragEnterEvent( QDragEnterEvent * _dee )
{
#ifdef QT4
if( _dee->mimeData()->hasFormat( "lmms/stringpair" ) )
if( _dee->mimeData()->hasFormat( stringPairDrag::mimeType() ) )
{
QString txt = _dee->mimeData()->data( "lmms/stringpair" );
QString txt = _dee->mimeData()->data(
stringPairDrag::mimeType() );
if( txt.section( ':', 0, 0 ) == QString( "tco_%1" ).arg(
track::SAMPLE_TRACK ) )
{
@@ -452,7 +449,7 @@ void audioFileProcessor::dragEnterEvent( QDragEnterEvent * _dee )
_dee->ignore();
}
#else
QString txt = _dee->encodedData( "lmms/stringpair" );
QString txt = _dee->encodedData( stringPairDrag::mimeType() );
if( txt != "" )
{
if( txt.section( ':', 0, 0 ) == QString( "tco_%1" ).arg(
@@ -620,7 +617,7 @@ void audioFileProcessor::sampleUpdated( void )
void audioFileProcessor::reverseBtnToggled( bool _on )
{
m_sampleBuffer.setReversed( _on );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -727,7 +724,7 @@ void audioFileProcessor::openAudioFile( void )
if( af != "" )
{
setAudioFile( af );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
}

View File

@@ -1,7 +1,7 @@
/*
* bass_booster.cpp - bass-booster-effect-plugin
*
* 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
*
@@ -51,8 +51,9 @@ plugin::descriptor bassbooster_plugin_descriptor =
bassBoosterEffect::bassBoosterEffect( effect::constructionData * _cdata ) :
effect( &bassbooster_plugin_descriptor, _cdata ),
bassBoosterEffect::bassBoosterEffect(
const descriptor::subPluginFeatures::key * _key ) :
effect( &bassbooster_plugin_descriptor, _key ),
m_bbFX( effectLib::fastBassBoost<>( 70.0f, 1.0f, 2.8f ) )
{
}
@@ -116,7 +117,8 @@ extern "C"
plugin * lmms_plugin_main( void * _data )
{
return( new bassBoosterEffect(
static_cast<effect::constructionData *>( _data ) ) );
static_cast<const plugin::descriptor::subPluginFeatures::key *>(
_data ) ) );
}
}

View File

@@ -1,7 +1,7 @@
/*
* bass_booster.h - bass-booster-effect-plugin
*
* 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
*
@@ -29,6 +29,7 @@
#include "effect.h"
#include "effect_lib.h"
#include "engine.h"
#include "main_window.h"
#include "bassbooster_control_dialog.h"
@@ -37,7 +38,7 @@
class bassBoosterEffect : public effect
{
public:
bassBoosterEffect( effect::constructionData * _cdata );
bassBoosterEffect( const descriptor::subPluginFeatures::key * _key );
virtual ~bassBoosterEffect();
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
const fpab_t _frames );
@@ -49,7 +50,7 @@ public:
virtual inline effectControlDialog * createControlDialog( track * )
{
return( new bassBoosterControlDialog(
eng()->getMainWindow()->workspace(),
engine::getMainWindow()->workspace(),
this ) );
}

View File

@@ -1,7 +1,7 @@
/*
* bassbooster_control_dialog.cpp - control-dialog for bassbooster-effect
*
* 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
*
@@ -45,8 +45,7 @@ bassBoosterControlDialog::bassBoosterControlDialog( QWidget * _parent,
{
QHBoxLayout * l = new QHBoxLayout( this );
m_freqKnob = new knob( knobBright_26, this, tr( "Frequency" ),
eng(), NULL );
m_freqKnob = new knob( knobBright_26, this, tr( "Frequency" ), NULL );
m_freqKnob->setRange( 50.0f, 200.0f, 1.0f );
m_freqKnob->setInitValue( 100.0f );
m_freqKnob->setLabel( tr( "FREQ" ) );
@@ -54,7 +53,7 @@ bassBoosterControlDialog::bassBoosterControlDialog( QWidget * _parent,
connect( m_freqKnob, SIGNAL( valueChanged( float ) ),
this, SLOT( changeFrequency( void ) ) );
m_gainKnob = new knob( knobBright_26, this, tr( "Gain" ), eng(), NULL );
m_gainKnob = new knob( knobBright_26, this, tr( "Gain" ), NULL );
m_gainKnob->setRange( 0.1f, 5.0f, 0.1f );
m_gainKnob->setInitValue( 1.0f );
m_gainKnob->setLabel( tr( "GAIN" ) );
@@ -62,8 +61,7 @@ bassBoosterControlDialog::bassBoosterControlDialog( QWidget * _parent,
connect( m_gainKnob, SIGNAL( valueChanged( float ) ),
this, SLOT( changeGain( void ) ) );
m_ratioKnob = new knob( knobBright_26, this, tr( "Ratio" ), eng(),
NULL );
m_ratioKnob = new knob( knobBright_26, this, tr( "Ratio" ), NULL );
m_ratioKnob->setRange( 0.1f, 10.0f, 0.1f );
m_ratioKnob->setInitValue( 2.0f );
m_ratioKnob->setLabel( tr( "RATIO" ) );

View File

@@ -1,7 +1,7 @@
/*
* bit_invader.cpp - instrument which uses a usereditable wavetable
*
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -189,7 +189,7 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
m_sampleLengthKnob = new knob( knobDark_28, this, tr( "Samplelength" ),
eng(), _channel_track );
_channel_track );
m_sampleLengthKnob->setRange( 8, 128, 1 );
m_sampleLengthKnob->setInitValue( 128 );
m_sampleLengthKnob->move( 10, 120 );
@@ -201,7 +201,7 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
m_interpolationToggle = new ledCheckBox( "Interpolation", this,
tr( "Interpolation" ),
eng(), _channel_track );
_channel_track );
m_interpolationToggle->move( 55,80 );
connect( m_interpolationToggle, SIGNAL( toggled( bool ) ),
@@ -209,14 +209,14 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
m_normalizeToggle = new ledCheckBox( "Normalize", this,
tr( "Normalize" ),
eng(), _channel_track );
_channel_track );
m_normalizeToggle->move( 55, 100 );
connect( m_normalizeToggle, SIGNAL( toggled( bool ) ),
this, SLOT ( normalizeToggle( bool ) ) );
m_graph = new graph( this, eng() );
m_graph = new graph( this );
m_graph->move(53,118); // 55,120 - 2px border
m_graph->setCursor( QCursor( Qt::CrossCursor ) );
@@ -234,7 +234,7 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
connect( m_graph, SIGNAL ( sampleChanged( void ) ),
this, SLOT ( sampleChanged( void ) ) );
sinWaveBtn = new pixmapButton( this, tr( "Sine wave" ), eng(),
sinWaveBtn = new pixmapButton( this, tr( "Sine wave" ),
_channel_track );
sinWaveBtn->move( 188, 120 );
sinWaveBtn->setActiveGraphic( embed::getIconPixmap(
@@ -246,7 +246,7 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
"current oscillator." ) );
triangleWaveBtn = new pixmapButton( this, tr( "Triangle wave" ),
eng(), _channel_track );
_channel_track );
triangleWaveBtn->move( 188, 136 );
triangleWaveBtn->setActiveGraphic(
embed::getIconPixmap( "triangle_wave_active" ) );
@@ -256,7 +256,7 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
tr( "Click here if you want a triangle-wave "
"for current oscillator." ) );
sawWaveBtn = new pixmapButton( this, tr( "Saw wave" ), eng(),
sawWaveBtn = new pixmapButton( this, tr( "Saw wave" ),
_channel_track );
sawWaveBtn->move( 188, 152 );
sawWaveBtn->setActiveGraphic( embed::getIconPixmap(
@@ -267,7 +267,7 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
tr( "Click here if you want a saw-wave for "
"current oscillator." ) );
sqrWaveBtn = new pixmapButton( this, tr( "Square wave" ), eng(),
sqrWaveBtn = new pixmapButton( this, tr( "Square wave" ),
_channel_track );
sqrWaveBtn->move( 188, 168 );
sqrWaveBtn->setActiveGraphic( embed::getIconPixmap(
@@ -280,7 +280,7 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
whiteNoiseWaveBtn = new pixmapButton( this,
tr( "White noise wave" ),
eng(), _channel_track );
_channel_track );
whiteNoiseWaveBtn->move( 188, 184 );
whiteNoiseWaveBtn->setActiveGraphic(
embed::getIconPixmap( "white_noise_wave_active" ) );
@@ -291,7 +291,7 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
"current oscillator." ) );
usrWaveBtn = new pixmapButton( this, tr( "User defined wave" ),
eng(), _channel_track );
_channel_track );
usrWaveBtn->move( 188, 200 );
usrWaveBtn->setActiveGraphic( embed::getIconPixmap(
"usr_wave_active" ) );
@@ -317,7 +317,7 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
smoothBtn = new pixmapButton( this, tr( "Smooth" ), eng(),
smoothBtn = new pixmapButton( this, tr( "Smooth" ),
_channel_track );
smoothBtn->move( 55, 225 );
smoothBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -447,7 +447,7 @@ void bitInvader::usrWaveClicked( void )
}
// load user shape
sampleBuffer buffer( eng() );
sampleBuffer buffer;
QString af = buffer.openAudioFile();
if ( af != "" )
{
@@ -635,14 +635,14 @@ void bitInvader::interpolationToggle( bool value )
{
interpolation = value;
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
void bitInvader::normalizeToggle( bool value )
{
normalize = value;
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -674,7 +674,7 @@ void bitInvader::smoothClicked( void )
update();
m_graph->update();
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -697,10 +697,10 @@ void bitInvader::playNote( notePlayHandle * _n, bool )
_n->m_pluginData = new bSynth( sample_shape, sample_length,freq
, interpolation, factor,
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
}
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
bSynth * ps = static_cast<bSynth *>( _n->m_pluginData );
@@ -772,7 +772,7 @@ void bitInvader::sampleSizeChanged( float _new_sample_length )
m_graph->setSamplePointer( sample_shape, sample_length );
// set Song modified
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
@@ -793,7 +793,7 @@ void bitInvader::sampleChanged()
m_graph->update();
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}

View File

@@ -1,7 +1,7 @@
/*
* graph.cpp - a QT widget for displaying and manipulating waveforms
*
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -50,9 +50,8 @@ using namespace std;
graph::graph( QWidget * _parent, engine * _engine ) :
QWidget( _parent ),
engineObject( _engine )
graph::graph( QWidget * _parent ) :
QWidget( _parent )
{
// m_background = 0; TODO
@@ -96,7 +95,7 @@ void graph::loadSampleFromFile( const QString & _filename )
}
// load user shape
sampleBuffer buffer( eng(), _filename );
sampleBuffer buffer( _filename );
// copy buffer data
sampleLength = min( sampleLength, static_cast<int>(buffer.frames()) );

View File

@@ -1,7 +1,7 @@
/*
* graph.h - a QT widget for displaying and manipulating waveforms
*
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -43,14 +43,11 @@
#endif
#include "engine.h"
class graph : public QWidget, public engineObject
class graph : public QWidget
{
Q_OBJECT
public:
graph( QWidget * _parent, engine * _engine );
graph( QWidget * _parent );
virtual ~graph();
void setSamplePointer( float * pointer, int length );

View File

@@ -127,7 +127,7 @@ static void dump_mem( const void * buffer, uint n_bytes )
flpImport::flpImport( const QString & _file ) :
importFilter( _file, &flpimport_plugin_descriptor, NULL )
importFilter( _file, &flpimport_plugin_descriptor )
{
}
@@ -246,9 +246,9 @@ bool flpImport::tryImport( trackContainer * _tc )
int ev_cnt = 0;
_tc->eng()->getSongEditor()->clearProject();
const bool is_journ = _tc->eng()->getProjectJournal()->isJournalling();
_tc->eng()->getProjectJournal()->setJournalling( FALSE );
engine::getSongEditor()->clearProject();
const bool is_journ = engine::getProjectJournal()->isJournalling();
engine::getProjectJournal()->setJournalling( FALSE );
while( file().atEnd() == FALSE )
@@ -333,7 +333,7 @@ bool flpImport::tryImport( trackContainer * _tc )
case FLP_MainVol:
printf( "main-volume: %d\n", data );
_tc->eng()->getSongEditor()->setMasterVolume(
engine::getSongEditor()->setMasterVolume(
static_cast<volume>( data * 100 /
128 ) );
break;
@@ -364,7 +364,7 @@ bool flpImport::tryImport( trackContainer * _tc )
printf( "new channel\n" );
it = dynamic_cast<instrumentTrack *>(
track::create( track::INSTRUMENT_TRACK, _tc->eng()->getBBEditor() ) );
track::create( track::INSTRUMENT_TRACK, engine::getBBEditor() ) );
assert( it != NULL );
i_tracks.push_back( it );
it_inst = it->loadInstrument(
@@ -384,7 +384,7 @@ bool flpImport::tryImport( trackContainer * _tc )
case FLP_Tempo:
printf( "tempo: %d\n", data );
_tc->eng()->getSongEditor()->setTempo( data );
engine::getSongEditor()->setTempo( data );
break;
case FLP_CurrentPatNum:
@@ -417,8 +417,7 @@ bool flpImport::tryImport( trackContainer * _tc )
break;
case FLP_MainPitch:
_tc->eng()->getSongEditor()->setMasterPitch(
data );
engine::getSongEditor()->setMasterPitch( data );
break;
case FLP_Resonance:
@@ -533,7 +532,7 @@ bool flpImport::tryImport( trackContainer * _tc )
ba.resetRawData( text, text_len );
#endif
_tc->eng()->getProjectNotes()->setText( out );
engine::getProjectNotes()->setText( out );
outstring = "";
break;
}
@@ -749,7 +748,7 @@ bool flpImport::tryImport( trackContainer * _tc )
8 ) );
pos /= 6;
len /= 6;
note n( NULL, len, pos );
note n( len, pos );
n.setKey( key );
m_notes.push_back( qMakePair(
num_channels * current_pattern + ch, n ) );
@@ -816,10 +815,10 @@ bool flpImport::tryImport( trackContainer * _tc )
const int ch = ( *it ) >> 16;
const csize pat = ( ( *it ) & 0xffff ) / 16;
const csize pos = ( ( ( *it ) & 0xffff ) % 16 ) * 4;
while( _tc->eng()->getBBEditor()->numOfBBs() <= pat )
while( engine::getBBEditor()->numOfBBs() <= pat )
{
track::create( track::BB_TRACK,
_tc->eng()->getSongEditor() );
engine::getSongEditor() );
}
pattern * p = dynamic_cast<pattern *>(
i_tracks[ch]->getTCO( pat ) );
@@ -827,7 +826,7 @@ bool flpImport::tryImport( trackContainer * _tc )
{
continue;
}
p->setNoteAt( pos / 4, note( NULL, -64, pos ) );
p->setNoteAt( pos / 4, note( -64, pos ) );
}
// now process all notes
@@ -841,10 +840,10 @@ bool flpImport::tryImport( trackContainer * _tc )
{
continue;
}
while( _tc->eng()->getBBEditor()->numOfBBs() <= pat )
while( engine::getBBEditor()->numOfBBs() <= pat )
{
track::create( track::BB_TRACK,
_tc->eng()->getSongEditor() );
engine::getSongEditor() );
#ifdef QT4
qApp->processEvents( QEventLoop::AllEvents, 100 );
#else
@@ -868,10 +867,10 @@ bool flpImport::tryImport( trackContainer * _tc )
{
continue;
}
while( _tc->eng()->getBBEditor()->numOfBBs() <= pat_num )
while( engine::getBBEditor()->numOfBBs() <= pat_num )
{
track::create( track::BB_TRACK,
_tc->eng()->getSongEditor() );
engine::getSongEditor() );
#ifdef QT4
qApp->processEvents( QEventLoop::AllEvents, 100 );
#else
@@ -879,17 +878,17 @@ bool flpImport::tryImport( trackContainer * _tc )
#endif
}
bbTrack * bbt = bbTrack::findBBTrack( pat_num, _tc->eng() );
bbTrack * bbt = bbTrack::findBBTrack( pat_num );
trackContentObject * tco = bbt->addTCO( bbt->createTCO( 0 ) );
tco->movePosition( midiTime( ( ( *it ) & 0xffff ) * 64 ) );
}
if( (csize) project_cur_pat < _tc->eng()->getBBEditor()->numOfBBs() )
if( (csize) project_cur_pat < engine::getBBEditor()->numOfBBs() )
{
_tc->eng()->getBBEditor()->setCurrentBB( project_cur_pat );
engine::getBBEditor()->setCurrentBB( project_cur_pat );
}
_tc->eng()->getProjectJournal()->setJournalling( is_journ );
engine::getProjectJournal()->setJournalling( is_journ );
return( TRUE );
}

View File

@@ -1,7 +1,7 @@
/*
* kicker.cpp - bassdrum-synthesizer
*
* 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
*
@@ -74,35 +74,35 @@ kickerInstrument::kickerInstrument( instrumentTrack * _instrument_track ) :
QVBoxLayout * vl = new QVBoxLayout( this );
QHBoxLayout * hl = new QHBoxLayout;
m_startFreqKnob = new knob( knobDark_28, this, tr( "Start frequency" ),
eng(), _instrument_track );
_instrument_track );
m_startFreqKnob->setRange( 5.0f, 1000.0f, 1.0f );
m_startFreqKnob->setInitValue( 150.0f );
m_startFreqKnob->setLabel( tr( "START" ) );
m_startFreqKnob->setHintText( tr( "Start frequency:" ) + " ", "Hz" );
m_endFreqKnob = new knob( knobDark_28, this, tr( "End frequency" ),
eng(), _instrument_track );
_instrument_track );
m_endFreqKnob->setRange( 5.0f, 1000.0f, 1.0f );
m_endFreqKnob->setInitValue( 40.0f );
m_endFreqKnob->setLabel( tr( "END" ) );
m_endFreqKnob->setHintText( tr( "End frequency:" ) + " ", "Hz" );
m_decayKnob = new knob( knobDark_28, this, tr( "Decay" ),
eng(), _instrument_track );
_instrument_track );
m_decayKnob->setRange( 5.0f, 1000.0f, 1.0f );
m_decayKnob->setInitValue( 120.0f );
m_decayKnob->setLabel( tr( "DECAY" ) );
m_decayKnob->setHintText( tr( "Decay:" ) + " ", "ms" );
m_distKnob = new knob( knobDark_28, this, tr( "Distortion" ),
eng(), _instrument_track );
_instrument_track );
m_distKnob->setRange( 0.0f, 100.0f, 0.1f );
m_distKnob->setInitValue( 0.8f );
m_distKnob->setLabel( tr( "DIST" ) );
m_distKnob->setHintText( tr( "Distortion:" ) + " ", "" );
m_gainKnob = new knob( knobDark_28, this, tr( "Gain" ),
eng(), _instrument_track );
_instrument_track );
m_gainKnob->setRange( 0.1f, 5.0f, 0.05f );
m_gainKnob->setInitValue( 1.0f );
m_gainKnob->setLabel( tr( "GAIN" ) );
@@ -176,7 +176,7 @@ typedef sweepOscillator<effectLib::monoToStereoAdaptor<distFX> > sweepOsc;
void kickerInstrument::playNote( notePlayHandle * _n, bool )
{
const float decfr = m_decayKnob->value() *
eng()->getMixer()->sampleRate() / 1000.0f;
engine::getMixer()->sampleRate() / 1000.0f;
const f_cnt_t tfp = _n->totalFramesPlayed();
if ( tfp == 0 )
@@ -195,9 +195,9 @@ void kickerInstrument::playNote( notePlayHandle * _n, bool )
const fpab_t frames = _n->released() ?
tMax( tMin<f_cnt_t>( desiredReleaseFrames() -
_n->releaseFramesDone(),
eng()->getMixer()->framesPerAudioBuffer() ), 0 )
engine::getMixer()->framesPerAudioBuffer() ), 0 )
:
eng()->getMixer()->framesPerAudioBuffer();
engine::getMixer()->framesPerAudioBuffer();
const float f1 = m_startFreqKnob->value() + tfp * fdiff / decfr;
const float f2 = m_startFreqKnob->value() + (frames+tfp-1)*fdiff/decfr;
@@ -205,7 +205,7 @@ void kickerInstrument::playNote( notePlayHandle * _n, bool )
sweepOsc * so = static_cast<sweepOsc *>( _n->m_pluginData );
so->update( buf, frames, f1, f2, eng()->getMixer()->sampleRate() );
so->update( buf, frames, f1, f2, engine::getMixer()->sampleRate() );
if( _n->released() )
{

View File

@@ -2,7 +2,7 @@
* ladspa_2_lmms.cpp - class that identifies and instantiates LADSPA effects
* for use with LMMS
*
* Copyright (c) 2005 Danny McRae <khjklujn@netscape.net>
* Copyright (c) 2005-2007 Danny McRae <khjklujn@netscape.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -30,8 +30,7 @@
#define indexOf find
#endif
ladspa2LMMS::ladspa2LMMS( engine * _engine ):
ladspaManager( _engine )
ladspa2LMMS::ladspa2LMMS( void )
{
l_sortable_plugin_t plugins = getSortedPlugins();

View File

@@ -2,7 +2,7 @@
* ladspa_2_lmms.h - class that identifies and instantiates LADSPA effects
* for use with LMMS
*
* Copyright (c) 2005 Danny McRae <khjklujn@netscape.net>
* Copyright (c) 2005-2007 Danny McRae <khjklujn@netscape.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -28,7 +28,6 @@
#include "ladspa_manager.h"
#include "engine.h"
class ladspa2LMMS: public ladspaManager
@@ -64,10 +63,9 @@ public:
QString getShortName( const ladspa_key_t & _key );
private:
ladspa2LMMS( engine * _engine );
ladspa2LMMS( void );
~ladspa2LMMS();
// engine * m_engine;
// ladspaManager * m_ladspa;
l_sortable_plugin_t m_instruments;

View File

@@ -1,8 +1,8 @@
/*
* ladspa_base.h - basic declarations concerning LADSPA
*
* 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
*
@@ -70,10 +70,10 @@ typedef struct portDescription
inline ladspa_key_t subPluginKeyToLadspaKey(
const plugin::descriptor::subPluginFeatures::key & _key )
const plugin::descriptor::subPluginFeatures::key * _key )
{
return( ladspa_key_t( _key.user.toStringList().first(),
_key.user.toStringList().last() ) );
return( ladspa_key_t( _key->user.toStringList().first(),
_key->user.toStringList().last() ) );
}
inline plugin::descriptor::subPluginFeatures::key ladspaKeyToSubPluginKey(

View File

@@ -44,7 +44,6 @@
ladspaControl::ladspaControl( QWidget * _parent,
port_desc_t * _port,
engine * _engine,
track * _track,
bool _link) :
QWidget( _parent
@@ -52,7 +51,6 @@ ladspaControl::ladspaControl( QWidget * _parent,
, "ladspaControl"
#endif
),
journallingObject( _engine ),
m_port( _port ),
m_track( _track ),
m_link( NULL ),
@@ -67,7 +65,7 @@ ladspaControl::ladspaControl( QWidget * _parent,
if( _link )
{
m_link = new ledCheckBox( "", this, "", eng(), m_track );
m_link = new ledCheckBox( "", this, "", m_track );
m_link->setChecked( FALSE );
connect( m_link, SIGNAL( toggled( bool ) ),
this, SLOT( portLink( bool ) ) );
@@ -78,9 +76,8 @@ ladspaControl::ladspaControl( QWidget * _parent,
switch( m_port->data_type )
{
case TOGGLED:
m_toggle = new ledCheckBox( m_port->name, this, "",
eng(), m_track,
ledCheckBox::GREEN );
m_toggle = new ledCheckBox( m_port->name, this, "",
m_track, ledCheckBox::GREEN );
connect( m_toggle, SIGNAL( toggled( bool ) ),
this, SLOT( ledChange( bool ) ) );
setFixedSize( m_toggle->width(), m_toggle->height() );
@@ -97,8 +94,8 @@ ladspaControl::ladspaControl( QWidget * _parent,
}
break;
case INTEGER:
m_knob = new knob( knobBright_26, this,
m_port->name, eng(), m_track);
m_knob = new knob( knobBright_26, this, m_port->name,
m_track );
connect( m_knob, SIGNAL( valueChanged( float ) ),
this, SLOT( knobChange( float ) ) );
m_knob->setLabel( m_port->name );
@@ -125,8 +122,8 @@ ladspaControl::ladspaControl( QWidget * _parent,
}
break;
case FLOAT:
m_knob = new knob( knobBright_26, this,
m_port->name, eng(), m_track);
m_knob = new knob( knobBright_26, this, m_port->name,
m_track );
connect( m_knob, SIGNAL( valueChanged( float ) ),
this, SLOT( knobChange( float ) ) );
m_knob->setLabel( m_port->name );
@@ -153,8 +150,8 @@ ladspaControl::ladspaControl( QWidget * _parent,
}
break;
case TIME:
m_knob = new tempoSyncKnob( knobBright_26, this,
m_port->name, eng(), m_track);
m_knob = new tempoSyncKnob( knobBright_26, this,
m_port->name, m_track );
connect( m_knob, SIGNAL( valueChanged( float ) ),
this, SLOT( knobChange( float ) ) );
m_knob->setLabel( m_port->name );

View File

@@ -1,7 +1,7 @@
/*
* ladspa_control.h - widget for controlling a LADSPA port
*
* 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
*
@@ -56,9 +56,8 @@ class ladspaControl : public QWidget, public journallingObject
{
Q_OBJECT
public:
ladspaControl( QWidget * _parent, port_desc_t * _port,
engine * _engine, track * _track,
bool _link = FALSE );
ladspaControl( QWidget * _parent, port_desc_t * _port, track * _track,
bool _link = FALSE );
~ladspaControl();
LADSPA_Data getValue( void );

View File

@@ -2,7 +2,7 @@
* ladspa_manager.cpp - a class to manage loading and instantiation
* of ladspa plugins
*
* Copyright (c) 2005 Danny McRae <khjklujn@netscape.net>
* Copyright (c) 2005-2007 Danny McRae <khjklujn@netscape.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -50,7 +50,7 @@
ladspaManager::ladspaManager( engine * _engine )
ladspaManager::ladspaManager( void )
{
#ifdef QT4
QStringList ladspaDirectories = QString( getenv( "LADSPA_PATH" ) ).

View File

@@ -3,7 +3,7 @@
* a class to manage loading and instantiation
* of ladspa plugins
*
* Copyright (c) 2005 Danny McRae <khjklujn@netscape.net>
* Copyright (c) 2005-2007 Danny McRae <khjklujn@netscape.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -61,7 +61,6 @@
#include "types.h"
//#include "qt3support.h"
class engine;
const float NOHINT = -99342.2243f;
@@ -107,7 +106,7 @@ class ladspaManager
{
public:
ladspaManager( engine * _engine );
ladspaManager( void );
~ladspaManager();
l_sortable_plugin_t getSortedPlugins();

View File

@@ -1,7 +1,7 @@
/*
* ladspa_port_dialog.cpp - dialog to test a LADSPA plugin
*
* 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
*
@@ -41,15 +41,13 @@
#include "ladspa_port_dialog.h"
#include "embed.h"
#include "engine.h"
#include "mixer.h"
ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key,
engine * _engine ) :
QDialog(),
engineObject( _engine ),
ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key ) :
m_key( _key ),
m_ladspa( _engine->getLADSPAManager() )
m_ladspa( engine::getLADSPAManager() )
{
setWindowIcon( embed::getIconPixmap( "ports" ) );
setWindowTitle( "Ports" );
@@ -158,11 +156,11 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key,
{
if( min != NOHINT )
{
min *= eng()->getMixer()->sampleRate();
min *= engine::getMixer()->sampleRate();
}
if( max != NOHINT )
{
max *= eng()->getMixer()->sampleRate();
max *= engine::getMixer()->sampleRate();
}
}

View File

@@ -1,7 +1,7 @@
/*
* ladspa_port_dialog.h - dialog to test a LADSPA plugin
*
* 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
*
@@ -42,12 +42,11 @@
#include "ladspa_2_lmms.h"
class ladspaPortDialog : public QDialog, public engineObject
class ladspaPortDialog : public QDialog
{
Q_OBJECT
public:
ladspaPortDialog( const ladspa_key_t & _key,
engine * _engine );
ladspaPortDialog( const ladspa_key_t & _key );
virtual ~ladspaPortDialog();
private:

View File

@@ -2,7 +2,7 @@
* ladspa_control_dialog.cpp - dialog for displaying and editing control port
* values for LADSPA plugins
*
* 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
*
@@ -110,9 +110,8 @@ ladspaControlDialog::ladspaControlDialog( QWidget * _parent,
last_port == TOGGLED ) )
{
(*it)->control =
new ladspaControl(
grouper, (*it),
eng(), m_track,
new ladspaControl( grouper, *it,
m_track,
linked_control );
}
else
@@ -123,9 +122,8 @@ ladspaControlDialog::ladspaControlDialog( QWidget * _parent,
new QWidget( grouper ) );
row_cnt++;
}
(*it)->control = new ladspaControl(
(*it)->control = new ladspaControl(
grouper, (*it),
eng(),
m_track,
linked_control );
row_cnt = 0;
@@ -163,8 +161,8 @@ ladspaControlDialog::ladspaControlDialog( QWidget * _parent,
QHBoxLayout * center = new QHBoxLayout();
m_mainLay->addLayout( center );
#endif
m_stereoLink = new ledCheckBox( tr( "Link Channels" ),
this, "", eng(), m_track );
m_stereoLink = new ledCheckBox( tr( "Link Channels" ), this, "",
m_track );
connect( m_stereoLink, SIGNAL( toggled( bool ) ),
this, SLOT( link( bool ) ) );
m_stereoLink->setChecked( TRUE );

View File

@@ -70,13 +70,13 @@ plugin::descriptor ladspaeffect_plugin_descriptor =
}
ladspaEffect::ladspaEffect( effect::constructionData * _cdata ) :
effect( &ladspaeffect_plugin_descriptor, _cdata ),
ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) :
effect( &ladspaeffect_plugin_descriptor, _key ),
m_effName( "none" ),
m_key( subPluginKeyToLadspaKey( _cdata->key )
m_key( subPluginKeyToLadspaKey( _key )
/* ladspa_key_t( _cdata->settings.attribute( "label" ),
_cdata->settings.attribute( "lib" ) )*/ ),
m_ladspa( eng()->getLADSPAManager() )
m_ladspa( engine::getLADSPAManager() )
{
if( m_ladspa->getDescription( m_key ) == NULL )
{
@@ -90,7 +90,7 @@ ladspaEffect::ladspaEffect( effect::constructionData * _cdata ) :
setPublicName( m_ladspa->getShortName( m_key ) );
// Calculate how many processing units are needed.
const ch_cnt_t lmms_chnls = eng()->getMixer()->audioDev()->channels();
const ch_cnt_t lmms_chnls = engine::getMixer()->audioDev()->channels();
m_effectChannels = m_ladspa->getDescription( m_key )->inputChannels;
setProcessorCount( lmms_chnls / m_effectChannels );
@@ -117,7 +117,7 @@ ladspaEffect::ladspaEffect( effect::constructionData * _cdata ) :
// during cleanup. It was easier to troubleshoot with the
// memory management all taking place in one file.
p->buffer =
new LADSPA_Data[eng()->getMixer()->framesPerAudioBuffer()];
new LADSPA_Data[engine::getMixer()->framesPerAudioBuffer()];
if( p->name.toUpper().contains( "IN" ) &&
m_ladspa->isPortInput( m_key, port ) )
@@ -198,7 +198,7 @@ ladspaEffect::ladspaEffect( effect::constructionData * _cdata ) :
if( m_ladspa->areHintsSampleRateDependent(
m_key, port ) )
{
p->max *= eng()->getMixer()->sampleRate();
p->max *= engine::getMixer()->sampleRate();
}
p->min = m_ladspa->getLowerBound( m_key, port );
@@ -210,7 +210,7 @@ ladspaEffect::ladspaEffect( effect::constructionData * _cdata ) :
if( m_ladspa->areHintsSampleRateDependent(
m_key, port ) )
{
p->min *= eng()->getMixer()->sampleRate();
p->min *= engine::getMixer()->sampleRate();
}
p->def = m_ladspa->getDefaultSetting( m_key, port );
@@ -267,7 +267,7 @@ ladspaEffect::ladspaEffect( effect::constructionData * _cdata ) :
for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ )
{
LADSPA_Handle effect = m_ladspa->instantiate( m_key,
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
if( effect == NULL )
{
QMessageBox::warning( 0, "Effect",
@@ -492,7 +492,8 @@ extern "C"
plugin * lmms_plugin_main( void * _data )
{
return( new ladspaEffect(
static_cast<effect::constructionData *>( _data ) ) );
static_cast<const plugin::descriptor::subPluginFeatures::key *>(
_data ) ) );
}
}

View File

@@ -1,7 +1,7 @@
/*
* ladspa_effect.h - class for handling LADSPA effect plugins
*
* 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
*
@@ -45,7 +45,7 @@ typedef vvector<port_desc_t *> multi_proc_t;
class ladspaEffect : public effect
{
public:
ladspaEffect( effect::constructionData * _cdata );
ladspaEffect( const descriptor::subPluginFeatures::key * _key );
virtual ~ladspaEffect();
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
@@ -72,7 +72,7 @@ public:
track * _track )
{
return( new ladspaControlDialog(
eng()->getMainWindow()->workspace(),
engine::getMainWindow()->workspace(),
this, _track ) );
}

View File

@@ -45,6 +45,7 @@
#include "ladspa_2_lmms.h"
#include "mixer.h"
#include "audio_device.h"
#include "engine.h"
ladspaSubPluginFeatures::ladspaSubPluginFeatures( plugin::pluginTypes _type ) :
@@ -55,11 +56,11 @@ ladspaSubPluginFeatures::ladspaSubPluginFeatures( plugin::pluginTypes _type ) :
void ladspaSubPluginFeatures::fillDescriptionWidget(
QWidget * _parent, engine * _eng, const key & _key )
void ladspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
const key * _key )
{
const ladspa_key_t & lkey = subPluginKeyToLadspaKey( _key );
ladspa2LMMS * lm = _eng->getLADSPAManager();
ladspa2LMMS * lm = engine::getLADSPAManager();
QLabel * label = new QLabel( _parent );
label->setText( QWidget::tr( "Name: " ) + lm->getName( lkey ) );
@@ -113,10 +114,10 @@ void ladspaSubPluginFeatures::fillDescriptionWidget(
void ladspaSubPluginFeatures::listSubPluginKeys( engine * _eng,
plugin::descriptor * _desc, keyList & _kl )
void ladspaSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc,
keyList & _kl )
{
ladspa2LMMS * lm = _eng->getLADSPAManager();
ladspa2LMMS * lm = engine::getLADSPAManager();
l_sortable_plugin_t plugins;
switch( m_type )
@@ -142,7 +143,7 @@ void ladspaSubPluginFeatures::listSubPluginKeys( engine * _eng,
it != plugins.end(); ++it )
{
if( lm->getDescription( ( *it ).second )->inputChannels <=
_eng->getMixer()->audioDev()->channels() )
engine::getMixer()->audioDev()->channels() )
{
_kl.push_back( ladspaKeyToSubPluginKey(
_desc,

View File

@@ -39,11 +39,10 @@ public:
ladspaSubPluginFeatures( plugin::pluginTypes _type );
virtual void fillDescriptionWidget( QWidget * _parent,
engine * _eng,
const key & _key );
const key * _key );
virtual void listSubPluginKeys( engine * _eng,
plugin::descriptor * _desc, keyList & _kl );
virtual void listSubPluginKeys( plugin::descriptor * _desc,
keyList & _kl );
} ;

View File

@@ -258,7 +258,7 @@ lb302Synth::lb302Synth( instrumentTrack * _channel_track ) :
// GUI
vcf_cut_knob = new knob( knobBright_26, this, tr( "VCF Cutoff Frequency" ),
eng(), _channel_track );
_channel_track );
vcf_cut_knob->setRange( 0.0f, 1.5f, 0.005f ); // Originally [0,1.0]
vcf_cut_knob->setInitValue( 0.75f );
vcf_cut_knob->move( 75, 130 );
@@ -266,7 +266,7 @@ lb302Synth::lb302Synth( instrumentTrack * _channel_track ) :
vcf_cut_knob->setLabel( tr("CUT") );
vcf_res_knob = new knob( knobBright_26, this, tr( "VCF Resonance" ),
eng(), _channel_track );
_channel_track );
vcf_res_knob->setRange( 0.0f, 1.25f, 0.005f ); // Originally [0,1.0]
vcf_res_knob->setInitValue( 0.75f );
vcf_res_knob->move( 120, 130 );
@@ -274,7 +274,7 @@ lb302Synth::lb302Synth( instrumentTrack * _channel_track ) :
vcf_res_knob->setLabel( tr("RES") );
vcf_mod_knob = new knob( knobBright_26, this, tr( "VCF Envelope Mod" ),
eng(), _channel_track );
_channel_track );
vcf_mod_knob->setRange( 0.0f, 1.0f, 0.005f ); // Originally [0,1.0]
vcf_mod_knob->setInitValue( 1.0f );
vcf_mod_knob->move( 165, 130 );
@@ -282,7 +282,7 @@ lb302Synth::lb302Synth( instrumentTrack * _channel_track ) :
vcf_mod_knob->setLabel( tr("ENV MOD") );
vcf_dec_knob = new knob( knobBright_26, this, tr( "VCF Envelope Decay" ),
eng(), _channel_track );
_channel_track );
vcf_dec_knob->setRange( 0.0f, 1.0f, 0.005f ); // Originally [0,1.0]
vcf_dec_knob->setInitValue( 0.1f );
vcf_dec_knob->move( 210, 130 );
@@ -291,30 +291,30 @@ lb302Synth::lb302Synth( instrumentTrack * _channel_track ) :
slideToggle = new ledCheckBox( "Slide", this,
tr( "Slide" ),
eng(), _channel_track );
_channel_track );
slideToggle->move( 10, 180 );
accentToggle = new ledCheckBox( "Accent", this,
tr( "Accent" ),
eng(), _channel_track );
_channel_track );
accentToggle->move( 10, 200 );
accentToggle->setDisabled(true);
deadToggle = new ledCheckBox( "Dead", this,
tr( "Dead" ),
eng(), _channel_track );
_channel_track );
deadToggle->move( 10, 220 );
db24Toggle = new ledCheckBox( "24dB/oct", this,
tr( "303-es-que, 24dB/octave, 3 pole filter" ),
eng(), _channel_track );
_channel_track );
db24Toggle->move( 10, 150);
slide_dec_knob = new knob( knobBright_26, this, tr( "Slide Decay" ),
eng(), _channel_track );
_channel_track );
slide_dec_knob->setRange( 0.0f, 1.0f, 0.005f ); // Originally [0,1.0]
slide_dec_knob->setInitValue( 0.6f );
slide_dec_knob->move( 210, 75 );
@@ -323,7 +323,7 @@ lb302Synth::lb302Synth( instrumentTrack * _channel_track ) :
vco_fine_detune_knob = new knob( knobBright_26, this,
tr("Fine detuning of the VCO. Ranged between -100 and 100 centes."),
eng(), _channel_track );
_channel_track );
vco_fine_detune_knob->setRange(-100.0f, 100.0f, 1.0f);
vco_fine_detune_knob->setInitValue(0.0f);
vco_fine_detune_knob->move(165,75);
@@ -332,7 +332,7 @@ lb302Synth::lb302Synth( instrumentTrack * _channel_track ) :
dist_knob = new knob( knobBright_26, this, tr( "Distortion" ),
eng(), _channel_track );
_channel_track );
dist_knob->setRange( 0.0f, 1.0f, 0.01f ); // Originally [0,1.0]
dist_knob->setInitValue( 0.0f );
dist_knob->move( 210, 190 );
@@ -341,7 +341,7 @@ lb302Synth::lb302Synth( instrumentTrack * _channel_track ) :
wave_knob = new knob( knobBright_26, this, tr( "Waveform" ),
eng(), _channel_track );
_channel_track );
wave_knob->setRange( 0.0f, 5.0f, 1.0f ); // Originally [0,1.0]
wave_knob->setInitValue( 0.0f );
wave_knob->move( 120, 75 );
@@ -730,7 +730,7 @@ void lb302Synth::playNote( notePlayHandle * _n, bool )
}
}
const Uint32 frames = eng()->getMixer()->framesPerAudioBuffer();
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame *buf = bufferAllocator::alloc<sampleFrame>( frames );
if (buf) {

View File

@@ -32,6 +32,7 @@
#include "live_tool.h"
#include "bb_editor.h"
#include "engine.h"
#include "song_editor.h"
#ifdef Q_WS_X11
@@ -113,19 +114,19 @@ void liveTool::keyPressEvent( QKeyEvent * _ke )
switch( _ke->key() )
{
case Qt::Key_Space:
if( eng()->getSongEditor()->playing() )
if( engine::getSongEditor()->playing() )
{
eng()->getSongEditor()->pause();
engine::getSongEditor()->pause();
}
else if( eng()->getSongEditor()->paused() &&
eng()->getSongEditor()->playMode() ==
else if( engine::getSongEditor()->paused() &&
engine::getSongEditor()->playMode() ==
songEditor::PLAY_SONG )
{
eng()->getSongEditor()->resumeFromPause();
engine::getSongEditor()->resumeFromPause();
}
else
{
eng()->getSongEditor()->play();
engine::getSongEditor()->play();
}
break;
@@ -161,7 +162,7 @@ bool liveTool::x11Event( XEvent * _xe )
void liveTool::toggleInstrument( int _n )
{
bool track_exists;
track * t = eng()->getBBEditor()->tracks().at( _n, &track_exists );
track * t = engine::getBBEditor()->tracks().at( _n, &track_exists );
if( track_exists )
{
t->setMuted( !t->muted() );

View File

@@ -1,7 +1,7 @@
/*
* midi_import.cpp - support for importing MIDI-files
*
* 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
*
@@ -71,7 +71,7 @@ plugin::descriptor midiimport_plugin_descriptor =
midiImport::midiImport( const QString & _file ) :
importFilter( _file, &midiimport_plugin_descriptor, NULL )
importFilter( _file, &midiimport_plugin_descriptor )
{
}
@@ -269,8 +269,7 @@ invalid_format:
NOTES_PER_OCTAVE * OCTAVES &&
keys[ev.key()][0] >= 0 )
{
note n( eng(),
midiTime( ( tick - keys[ev.key()][0] ) / 10 ),
note n( midiTime( ( tick - keys[ev.key()][0] ) / 10 ),
midiTime( keys[ev.key()][0] / 10 ),
(tones)( ev.key() % NOTES_PER_OCTAVE ),
(octaves)( ev.key() / NOTES_PER_OCTAVE ),

View File

@@ -122,7 +122,7 @@ organicInstrument::organicInstrument( instrumentTrack * _channel_track ) :
// setup volume-knob
m_osc[i].oscKnob = new knob( knobGreen_17, this, tr(
"Osc %1 waveform" ).arg( i+1 ), eng(),
"Osc %1 waveform" ).arg( i+1 ),
_channel_track );
m_osc[i].oscKnob->move( 25+i*20, 90 );
m_osc[i].oscKnob->setRange( 0.0f, 5.0f, 0.25f );
@@ -136,7 +136,7 @@ organicInstrument::organicInstrument( instrumentTrack * _channel_track ) :
// setup volume-knob
m_osc[i].volKnob = new volumeKnob( knobGreen_17, this, tr(
"Osc %1 volume" ).arg( i+1 ), eng(),
"Osc %1 volume" ).arg( i+1 ),
_channel_track );
m_osc[i].volKnob->setData( i );
m_osc[i].volKnob->move( 25+i*20, 110 );
@@ -147,7 +147,7 @@ organicInstrument::organicInstrument( instrumentTrack * _channel_track ) :
// setup panning-knob
m_osc[i].panKnob = new knob( knobGreen_17, this,
tr( "Osc %1 panning" ).arg( i + 1 ), eng(),
tr( "Osc %1 panning" ).arg( i + 1 ),
_channel_track );
m_osc[i].panKnob->setData( i );
m_osc[i].panKnob->move( 25+i*20, 130 );
@@ -159,7 +159,7 @@ organicInstrument::organicInstrument( instrumentTrack * _channel_track ) :
// setup knob for left fine-detuning
m_osc[i].detuneKnob = new knob( knobGreen_17, this,
tr( "Osc %1 fine detuning left" ).arg( i+1 ),
eng(), _channel_track );
_channel_track );
m_osc[i].detuneKnob->setData( i );
m_osc[i].detuneKnob->move( 25+i*20, 150 );
m_osc[i].detuneKnob->setRange( -100.0f, 100.0f, 1.0f );
@@ -184,19 +184,19 @@ organicInstrument::organicInstrument( instrumentTrack * _channel_track ) :
}
connect( eng()->getMixer(), SIGNAL( sampleRateChanged() ),
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateAllDetuning() ) );
// setup knob for FX1
fx1Knob = new knob( knobGreen_17, this,
tr( "FX1" ), eng(), _channel_track );
fx1Knob = new knob( knobGreen_17, this, tr( "FX1" ),
_channel_track );
fx1Knob->move( 20, 200 );
fx1Knob->setRange( 0.0f, 0.99f, 0.01f );
fx1Knob->setInitValue( 0.0f);
// setup volume-knob
volKnob = new knob( knobGreen_17, this, tr(
"Osc %1 volume" ).arg( 1 ), eng(),
"Osc %1 volume" ).arg( 1 ),
_channel_track );
volKnob->move( 50, 200 );
volKnob->setRange( 0, 200, 1.0f );
@@ -205,7 +205,7 @@ organicInstrument::organicInstrument( instrumentTrack * _channel_track ) :
1 ) + " ", "%" );
// randomise
m_randBtn = new pixmapButton( this, tr( "Randomise" ), eng(),
m_randBtn = new pixmapButton( this, tr( "Randomise" ),
_channel_track );
m_randBtn->move( 100, 200 );
m_randBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -370,7 +370,7 @@ void organicInstrument::playNote( notePlayHandle * _n, bool )
oscillator * osc_r = static_cast<oscPtr *>( _n->m_pluginData
)->oscRight;
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
osc_l->update( buf, frames, 0 );
@@ -511,10 +511,10 @@ void organicInstrument::updateDetuning( const QVariant & _data )
const int _i = _data.toInt();
m_osc[_i].detuningLeft = powf( 2.0f, m_osc[_i].harmonic
+ (float)m_osc[_i].detuneKnob->value() / 100.0f )
/ static_cast<float>( eng()->getMixer()->sampleRate() );
/ engine::getMixer()->sampleRate();
m_osc[_i].detuningRight = powf( 2.0f, m_osc[_i].harmonic
- (float)m_osc[_i].detuneKnob->value() / 100.0f )
/ static_cast<float>( eng()->getMixer()->sampleRate() );
/ engine::getMixer()->sampleRate();
}

View File

@@ -85,7 +85,7 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) :
{
setPaletteBackgroundPixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) );
m_openFileButton = new pixmapButton( this, NULL, eng(), NULL );
m_openFileButton = new pixmapButton( this, NULL, NULL );
m_openFileButton->setCursor( QCursor( Qt::PointingHandCursor ) );
m_openFileButton->move( 200, 90 );
m_openFileButton->setActiveGraphic( embed::getIconPixmap(
@@ -106,7 +106,7 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) :
tr( "Click here to open another patch-file. Loop and Tune "
"settings are not reset." ) );
m_loopButton = new pixmapButton( this, NULL, eng(), NULL );
m_loopButton = new pixmapButton( this, tr( "Loop" ), _track );
m_loopButton->setCheckable( TRUE );
m_loopButton->move( 160, 160 );
m_loopButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -124,7 +124,7 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) :
"will use the loop information available in the "
"file." ) );
m_tuneButton = new pixmapButton( this, NULL, eng(), NULL );
m_tuneButton = new pixmapButton( this, tr( "Tune" ), _track );
m_tuneButton->setCheckable( TRUE );
m_tuneButton->setValue( TRUE );
m_tuneButton->move( 180, 160 );
@@ -200,12 +200,10 @@ QString patmanSynth::nodeName( void ) const
void patmanSynth::playNote( notePlayHandle * _n, bool )
{
const Uint32 frames = eng()->getMixer()->framesPerAudioBuffer();
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
float freq = getInstrumentTrack()->frequency( _n ) /
( eng()->getMixer()->sampleRate() /
DEFAULT_SAMPLE_RATE );
float freq = getInstrumentTrack()->frequency( _n );
if( !_n->m_pluginData )
{
@@ -240,9 +238,10 @@ void patmanSynth::deleteNotePluginData( notePlayHandle * _n )
void patmanSynth::dragEnterEvent( QDragEnterEvent * _dee )
{
#ifdef QT4
if( _dee->mimeData()->hasFormat( "lmms/stringpair" ) )
if( _dee->mimeData()->hasFormat( stringPairDrag::mimeType() ) )
{
QString txt = _dee->mimeData()->data( "lmms/stringpair" );
QString txt = _dee->mimeData()->data(
stringPairDrag::mimeType() );
if( txt.section( ':', 0, 0 ) == "samplefile" )
{
_dee->acceptProposedAction();
@@ -257,7 +256,7 @@ void patmanSynth::dragEnterEvent( QDragEnterEvent * _dee )
_dee->ignore();
}
#else
QString txt = _dee->encodedData( "lmms/stringpair" );
QString txt = _dee->encodedData( stringPairDrag::mimeType() );
if( txt != "" )
{
if( txt.section( ':', 0, 0 ) == "samplefile"
@@ -386,7 +385,7 @@ void patmanSynth::openFile( void )
if( f != "" )
{
setFile( f );
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}
}
}
@@ -589,19 +588,14 @@ patmanSynth::load_error patmanSynth::load_patch( const QString & _filename )
}
}
sampleBuffer * psample = new sampleBuffer( data, frames,
eng() );
sampleBuffer * psample = new sampleBuffer( data, frames );
psample->setFrequency( root_freq / 1000.0f );
psample->normalize_sample_rate( sample_rate );
psample->setSampleRate( sample_rate );
if( modes & MODES_LOOPING )
{
psample->setLoopStartFrame( loop_start
* SAMPLE_RATES[DEFAULT_QUALITY_LEVEL]
/ sample_rate );
psample->setLoopEndFrame( loop_end
* SAMPLE_RATES[DEFAULT_QUALITY_LEVEL]
/ sample_rate );
psample->setLoopStartFrame( loop_start );
psample->setLoopEndFrame( loop_end );
}
m_patch_samples.push_back( psample );
@@ -630,9 +624,7 @@ void patmanSynth::unload_current_patch( void )
void patmanSynth::select_sample( notePlayHandle * _n )
{
float freq = getInstrumentTrack()->frequency( _n ) /
( eng()->getMixer()->sampleRate() /
DEFAULT_SAMPLE_RATE );
float freq = getInstrumentTrack()->frequency( _n );
float min_dist = HUGE_VALF;
sampleBuffer * sample = NULL;
@@ -659,7 +651,7 @@ void patmanSynth::select_sample( notePlayHandle * _n )
}
else
{
hdata->sample = new sampleBuffer( NULL, 0, eng() );
hdata->sample = new sampleBuffer( NULL, 0 );
}
hdata->state = new sampleBuffer::handleState( _n->hasDetuningInfo() );

View File

@@ -1,7 +1,7 @@
/*
* plucked_string_synth.cpp - instrument which uses the Karplus-Strong-algorithm
*
* 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
*
@@ -73,14 +73,14 @@ pluckedStringSynth::pluckedStringSynth( instrumentTrack * _instrument_track ) :
instrument( _instrument_track, &pluckedstringsynth_plugin_descriptor )
{
m_pickKnob = new knob( knobDark_28, this, tr( "Pick position" ),
eng(), _instrument_track );
_instrument_track );
m_pickKnob->setRange( 0.0f, 0.5f, 0.005f );
m_pickKnob->setInitValue( 0.0f );
m_pickKnob->move( 86, 134 );
m_pickKnob->setHintText( tr( "Pick position:" ) + " ", "" );
m_pickupKnob = new knob( knobDark_28, this, tr( "Pickup position" ),
eng(), _instrument_track );
_instrument_track );
m_pickupKnob->setRange( 0.0f, 0.5f, 0.005f );
m_pickupKnob->setInitValue( 0.05f );
m_pickupKnob->move( 138, 134 );
@@ -140,10 +140,10 @@ void pluckedStringSynth::playNote( notePlayHandle * _n, bool )
float freq = getInstrumentTrack()->frequency( _n );
_n->m_pluginData = new pluckSynth( freq, m_pickKnob->value(),
m_pickupKnob->value(),
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
}
const Uint32 frames = eng()->getMixer()->framesPerAudioBuffer();
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
pluckSynth * ps = static_cast<pluckSynth *>( _n->m_pluginData );

View File

@@ -88,8 +88,7 @@ plugin * lmms_plugin_main( void * _data )
// lb302Filter
//
lb302Filter::lb302Filter( lb302FilterState * _p_fs, engine * _engine ) :
engineObject( _engine ),
lb302Filter::lb302Filter( lb302FilterState * _p_fs ) :
m_fs( _p_fs ),
m_vcf_c0( 0 ),
m_vcf_e0( 0 ),
@@ -106,8 +105,8 @@ void lb302Filter::recalc( void )
+ 1.2 * m_fs->reso );
m_vcf_e0 = exp( 4.8434 - 0.8 * m_fs->envmod + 2.1553 * m_fs->cutoff
+ 0.7696 * m_fs->reso );
m_vcf_e0 *= M_PI / eng()->getMixer()->sampleRate();
m_vcf_e1 *= M_PI / eng()->getMixer()->sampleRate();
m_vcf_e0 *= M_PI / engine::getMixer()->sampleRate();
m_vcf_e1 *= M_PI / engine::getMixer()->sampleRate();
m_vcf_e1 -= m_vcf_e0;
}
@@ -135,8 +134,8 @@ void lb302Filter::playNote( void )
// lb302FilterIIR2
//
lb302FilterIIR2::lb302FilterIIR2( lb302FilterState * _p_fs, engine * _engine ) :
lb302Filter( _p_fs, _engine ),
lb302FilterIIR2::lb302FilterIIR2( lb302FilterState * _p_fs ) :
lb302Filter( _p_fs ),
m_vcf_d1( 0 ),
m_vcf_d2( 0 ),
m_vcf_a( 0 ),
@@ -204,9 +203,8 @@ float lb302FilterIIR2::process( const float & _samp )
// lb302Filter3Pole
//
lb302Filter3Pole::lb302Filter3Pole( lb302FilterState * _p_fs,
engine * _engine ) :
lb302Filter( _p_fs, _engine ),
lb302Filter3Pole::lb302Filter3Pole( lb302FilterState * _p_fs ) :
lb302Filter( _p_fs ),
m_ay1( 0 ),
m_ay2( 0 ),
m_aout( 0 ),
@@ -239,14 +237,14 @@ void lb302Filter3Pole::envRecalc( void )
//TODO: Fix high quality
float kfco = 50.0f + k * ( 2300.0f - 1600.0f * m_fs->envmod
+ w * ( 700.0f + 1500.0f * k + ( 1500.0f + k * (
eng()->getMixer()->sampleRate() / 2.0f - 6000.0f ) )
engine::getMixer()->sampleRate() / 2.0f - 6000.0f ) )
* m_fs->envmod ) );
//+iacc*(.3+.7*kfco*kenvmod)*kaccent*kaccurve*2000
#ifdef LB_24_IGNORE_ENVELOPE
// m_kfcn = m_fs->cutoff;
m_kfcn = 2.0 * kfco / eng()->getMixer()->sampleRate();
m_kfcn = 2.0 * kfco / engine::getMixer()->sampleRate();
#else
m_kfcn = w;
#endif
@@ -295,7 +293,7 @@ polyb302Synth::polyb302Synth( instrumentTrack * _track ) :
{
m_vcf_cut_knob = new knob( knobBright_26, this,
tr( "VCF Cutoff Frequency" ),
eng(), _track );
_track );
m_vcf_cut_knob->setRange( 0.0f, 1.5f, 0.005f ); // Originally [0,1.0]
m_vcf_cut_knob->setInitValue( 0.75f );
m_vcf_cut_knob->move( 75, 130 );
@@ -303,7 +301,7 @@ polyb302Synth::polyb302Synth( instrumentTrack * _track ) :
m_vcf_cut_knob->setLabel( tr( "CUT" ) );
m_vcf_res_knob = new knob( knobBright_26, this, tr( "VCF Resonance" ),
eng(), _track );
_track );
m_vcf_res_knob->setRange( 0.0f, 1.25f, 0.005f ); // Originally [0,1.0]
m_vcf_res_knob->setInitValue( 0.75f );
m_vcf_res_knob->move( 120, 130 );
@@ -312,7 +310,7 @@ polyb302Synth::polyb302Synth( instrumentTrack * _track ) :
m_vcf_mod_knob = new knob( knobBright_26, this,
tr( "VCF Envelope Mod" ),
eng(), _track );
_track );
m_vcf_mod_knob->setRange( 0.0f, 1.0f, 0.005f ); // Originally [0,1.0]
m_vcf_mod_knob->setInitValue( 1.0f );
m_vcf_mod_knob->move( 165, 130 );
@@ -321,38 +319,37 @@ polyb302Synth::polyb302Synth( instrumentTrack * _track ) :
m_vcf_dec_knob = new knob( knobBright_26, this,
tr( "VCF Envelope Decay" ),
eng(), _track );
_track );
m_vcf_dec_knob->setRange( 0.0f, 1.0f, 0.005f ); // Originally [0,1.0]
m_vcf_dec_knob->setInitValue( 0.1f );
m_vcf_dec_knob->move( 210, 130 );
m_vcf_dec_knob->setHintText( tr( "Decay:" ) + " ", "" );
m_vcf_dec_knob->setLabel( tr( "DEC" ) );
m_slideToggle = new ledCheckBox( "Slide", this, tr( "Slide" ),
eng(), _track );
m_slideToggle = new ledCheckBox( "Slide", this, tr( "Slide" ), _track );
m_slideToggle->move( 10, 200 );
// m_accentToggle = new ledCheckBox( "Accent", this,
// tr( "Accent" ),
// eng(), _track );
// _track );
// m_accentToggle->move( 10, 200 );
// m_accentToggle->setDisabled(true);
// m_deadToggle = new ledCheckBox( "Dead", this,
// tr( "Dead" ),
// eng(), _track );
// _track );
// m_deadToggle->move( 10, 220 );
m_db24Toggle = new ledCheckBox( "24dB/oct", this,
tr( "303-es-que, 24dB/octave, 3 pole filter" ),
eng(), _track );
_track );
m_db24Toggle->move( 10, 150 );
m_slide_dec_knob = new knob( knobBright_26, this, tr( "Slide Decay" ),
eng(), _track );
_track );
m_slide_dec_knob->setRange( 0.0f, 1.0f, 0.005f ); // Originally [0,1.0]
m_slide_dec_knob->setInitValue( 0.6f );
m_slide_dec_knob->move( 210, 75 );
@@ -361,7 +358,7 @@ polyb302Synth::polyb302Synth( instrumentTrack * _track ) :
m_vco_fine_detune_knob = new knob( knobBright_26, this,
tr( "VCO fine detuning" ),
eng(), _track );
_track );
m_vco_fine_detune_knob->setRange( -100.0f, 100.0f, 1.0f );
m_vco_fine_detune_knob->setInitValue( 0.0f );
m_vco_fine_detune_knob->move( 165, 75 );
@@ -371,7 +368,7 @@ polyb302Synth::polyb302Synth( instrumentTrack * _track ) :
m_dist_knob = new knob( knobBright_26, this, tr( "Distortion" ),
eng(), _track );
_track );
m_dist_knob->setRange( 0.0f, 1.0f, 0.01f ); // Originally [0,1.0]
m_dist_knob->setInitValue( 0.0f );
m_dist_knob->move( 210, 190 );
@@ -379,8 +376,7 @@ polyb302Synth::polyb302Synth( instrumentTrack * _track ) :
m_dist_knob->setLabel( tr( "DIST" ) );
m_wave_knob = new knob( knobBright_26, this, tr( "Waveform" ),
eng(), _track );
m_wave_knob = new knob( knobBright_26, this, tr( "Waveform" ), _track );
m_wave_knob->setRange( 0.0f, 5.0f, 1.0f ); // Originally [0,1.0]
m_wave_knob->setInitValue( 0.0f );
m_wave_knob->move( 120, 75 );
@@ -519,7 +515,7 @@ void polyb302Synth::playNote( notePlayHandle * _n, bool )
// Adjust inc on SampRate change or detuning change
hstate->m_vco_inc = hstate->m_vco_detune
/ eng()->getMixer()->sampleRate();
/ engine::getMixer()->sampleRate();
// Initiate Slide
// TODO: Break out into function,
@@ -561,7 +557,7 @@ void polyb302Synth::playNote( notePlayHandle * _n, bool )
}
}
const Uint32 frames = eng()->getMixer()->framesPerAudioBuffer();
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
if( buf )
@@ -660,8 +656,7 @@ void polyb302Synth::waveChanged( float )
polyb302Synth::handleState::handleState( polyb302Synth * _synth ) :
engineObject( _synth->eng() )
polyb302Synth::handleState::handleState( polyb302Synth * _synth )
{
m_vco_inc = 0.0;
m_vco_c = 0;
@@ -692,11 +687,11 @@ polyb302Synth::handleState::handleState( polyb302Synth * _synth ) :
if( _synth->m_db24Toggle->isChecked() )
{
m_vcf = new lb302Filter3Pole( &m_fs, eng() );
m_vcf = new lb302Filter3Pole( &m_fs );
}
else
{
m_vcf = new lb302FilterIIR2( &m_fs, eng() );
m_vcf = new lb302FilterIIR2( &m_fs );
}
recalcFilter();
@@ -724,11 +719,11 @@ void polyb302Synth::handleState::db24Toggled( void )
delete m_vcf;
if( m_synth->m_db24Toggle->isChecked() )
{
m_vcf = new lb302Filter3Pole( &m_fs, eng() );
m_vcf = new lb302Filter3Pole( &m_fs );
}
else
{
m_vcf = new lb302FilterIIR2( &m_fs, eng() );
m_vcf = new lb302FilterIIR2( &m_fs );
}
recalcFilter();
}
@@ -741,7 +736,7 @@ void polyb302Synth::handleState::detuneChanged( void )
m_vco_detune = powf( 2.0f,
(float)m_synth->m_vco_fine_detune_knob->value()
/ 1200.0f );
m_vco_inc = m_vco_detune / eng()->getMixer()->sampleRate();
m_vco_inc = m_vco_detune / engine::getMixer()->sampleRate();
// If a slide note is pending,
if( m_vco_slideinc )
@@ -754,7 +749,7 @@ void polyb302Synth::handleState::detuneChanged( void )
if( m_vco_slide )
{
m_vco_slidebase = m_vco_detune
/ eng()->getMixer()->sampleRate();
/ engine::getMixer()->sampleRate();
}
}
@@ -771,7 +766,7 @@ void polyb302Synth::handleState::filterChanged( void )
m_fs.dist = LB_DIST_RATIO * m_synth->m_dist_knob->value();
float d = 0.2 + 2.3 * m_synth->m_vcf_dec_knob->value();
d *= eng()->getMixer()->sampleRate();
d *= engine::getMixer()->sampleRate();
// decay is 0.1 to the 1/d * ENVINC
m_fs.envdecay = pow( 0.1, ENVINC / d );
// vcf_envdecay is now adjusted for both
@@ -922,7 +917,7 @@ void polyb302Synth::handleState::process( sampleFrame * _outbuf,
// Handle Envelope
// TODO: Add decay once I figure out how to extend past the end
// of a note.
if( m_sample_cnt >= 0.5 * eng()->getMixer()->sampleRate() )
if( m_sample_cnt >= 0.5 * engine::getMixer()->sampleRate() )
{
m_vca_mode = 2;
}

View File

@@ -53,10 +53,10 @@ typedef struct
class lb302Filter : public engineObject
class lb302Filter
{
public:
lb302Filter( lb302FilterState * _p_fs, engine * _engine );
lb302Filter( lb302FilterState * _p_fs );
virtual ~lb302Filter() {};
virtual void recalc( void );
@@ -82,7 +82,7 @@ protected:
class lb302FilterIIR2 : public lb302Filter
{
public:
lb302FilterIIR2( lb302FilterState * _p_fs, engine * _engine );
lb302FilterIIR2( lb302FilterState * _p_fs );
virtual ~lb302FilterIIR2();
virtual void recalc( void );
@@ -110,7 +110,7 @@ protected:
class lb302Filter3Pole : public lb302Filter
{
public:
lb302Filter3Pole( lb302FilterState * _p_fs, engine * _engine );
lb302Filter3Pole( lb302FilterState * _p_fs );
virtual void envRecalc( void );
virtual void recalc( void );
@@ -160,7 +160,7 @@ public slots:
private:
class handleState : public engineObject
class handleState
{
public:
handleState( polyb302Synth * _synth );

View File

@@ -135,7 +135,7 @@ singerBot::~singerBot()
void singerBot::playNote( notePlayHandle * _n, bool )
{
const Uint32 frames = eng()->getMixer()->framesPerAudioBuffer();
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
if( !_n->m_pluginData )
@@ -145,7 +145,7 @@ void singerBot::playNote( notePlayHandle * _n, bool )
handle_data * hdata = (handle_data *)_n->m_pluginData;
sampleBuffer * sample_buffer = hdata->remaining_frames ?
readWave( hdata ) : new sampleBuffer( NULL, 0, eng() );
readWave( hdata ) : new sampleBuffer( NULL, 0 );
sampleBuffer::handleState hstate;
@@ -252,7 +252,7 @@ void singerBot::createWave( notePlayHandle * _n )
hdata->frequency = getInstrumentTrack()->frequency( _n );
hdata->duration = _n->length() > 0 ?
_n->length() * 60.0f * BEATS_PER_TACT
/ 64.0f / eng()->getSongEditor()->getTempo() :
/ 64.0f / engine::getSongEditor()->getTempo() :
0;
int word_index = _n->patternIndex() % m_words.size();
hdata->text = m_words[word_index].ascii();
@@ -274,7 +274,7 @@ void singerBot::createWave( notePlayHandle * _n )
src_strerror( error ) );
}
hdata->resampling_data.src_ratio = eng()->getMixer()->sampleRate()
hdata->resampling_data.src_ratio = engine::getMixer()->sampleRate()
/ (double)hdata->wave->sample_rate();
hdata->resampling_data.end_of_input = 0;
hdata->remaining_frames = hdata->wave->num_samples();
@@ -285,7 +285,7 @@ void singerBot::createWave( notePlayHandle * _n )
sampleBuffer * singerBot::readWave( handle_data * _hdata )
{
f_cnt_t frames = eng()->getMixer()->framesPerAudioBuffer();
f_cnt_t frames = engine::getMixer()->framesPerAudioBuffer();
f_cnt_t offset = _hdata->wave->num_samples() - _hdata->remaining_frames;
const float fac = 1.0f / OUTPUT_SAMPLE_MULTIPLIER;
@@ -324,7 +324,7 @@ sampleBuffer * singerBot::readWave( handle_data * _hdata )
}
}
sampleBuffer * buffer = new sampleBuffer( data, frames, eng() );
sampleBuffer * buffer = new sampleBuffer( data, frames );
_hdata->remaining_frames -= _hdata->resampling_data.input_frames_used;
delete[] wave_samples;
delete[] mono_data;

View File

@@ -1,7 +1,7 @@
/*
* mallets.h - tuned instruments that one would bang upon
*
* 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
*
@@ -85,7 +85,7 @@ mallets::mallets( instrumentTrack * _channel_track ) :
m_presets = setupPresets( this, _channel_track );
m_spread = new knob( knobBright_26, this, tr( "Spread" ),
eng(), _channel_track );
_channel_track );
m_spread->setLabel( tr( "Spread" ) );
m_spread->setRange( 0, 255, 1 );
m_spread->setInitValue( 0 );
@@ -93,7 +93,7 @@ mallets::mallets( instrumentTrack * _channel_track ) :
m_spread->setHintText( tr( "Spread:" ) + " ", "" );
m_buffer = bufferAllocator::alloc<sampleFrame>(
eng()->getMixer()->framesPerAudioBuffer() );
engine::getMixer()->framesPerAudioBuffer() );
}
@@ -129,7 +129,7 @@ QWidget * mallets::setupModalBarControls( QWidget * _parent, track * _track )
widget->setFixedSize( 250, 250 );
m_hardness = new knob( knobBright_26, widget, tr( "Hardness" ),
eng(), _track );
_track );
m_hardness->setLabel( tr( "Hardness" ) );
m_hardness->setRange( 0.0, 128.0, 0.1 );
m_hardness->setInitValue( 64.0 );
@@ -137,7 +137,7 @@ QWidget * mallets::setupModalBarControls( QWidget * _parent, track * _track )
m_hardness->setHintText( tr( "Hardness:" ) + " ", "" );
m_position = new knob( knobBright_26, widget, tr( "Position" ),
eng(), _track );
_track );
m_position->setLabel( tr( "Position" ) );
m_position->setRange( 0.0, 128.0, 0.1 );
m_position->setInitValue( 64.0 );
@@ -145,7 +145,7 @@ QWidget * mallets::setupModalBarControls( QWidget * _parent, track * _track )
m_position->setHintText( tr( "Position:" ) + " ", "" );
m_vibratoGain = new knob( knobBright_26, widget, tr( "Vibrato Gain" ),
eng(), _track );
_track );
m_vibratoGain->setLabel( tr( "Vib Gain" ) );
m_vibratoGain->setRange( 0.0, 128.0, 0.1 );
m_vibratoGain->setInitValue( 64.0 );
@@ -153,7 +153,7 @@ QWidget * mallets::setupModalBarControls( QWidget * _parent, track * _track )
m_vibratoGain->setHintText( tr( "Vib Gain:" ) + " ", "" );
m_vibratoFreq = new knob( knobBright_26, widget, tr( "Vibrato Freq" ),
eng(), _track );
_track );
m_vibratoFreq->setLabel( tr( "Vib Freq" ) );
m_vibratoFreq->setRange( 0.0, 128.0, 0.1 );
m_vibratoFreq->setInitValue( 64.0 );
@@ -161,7 +161,7 @@ QWidget * mallets::setupModalBarControls( QWidget * _parent, track * _track )
m_vibratoFreq->setHintText( tr( "Vib Freq:" ) + " ", "" );
m_stick = new knob( knobBright_26, widget, tr( "Stick Mix" ),
eng(), _track );
_track );
m_stick->setLabel( tr( "Stick Mix" ) );
m_stick->setRange( 0.0, 128.0, 0.1 );
m_stick->setInitValue( 64.0 );
@@ -180,7 +180,7 @@ QWidget * mallets::setupTubeBellControls( QWidget * _parent, track * _track )
widget->setFixedSize( 250, 250 );
m_modulator = new knob( knobBright_26, widget, tr( "Modulator" ),
eng(), _track );
_track );
m_modulator->setLabel( tr( "Modulator" ) );
m_modulator->setRange( 0.0, 128.0, 0.1 );
m_modulator->setInitValue( 100.0 );
@@ -188,7 +188,7 @@ QWidget * mallets::setupTubeBellControls( QWidget * _parent, track * _track )
m_modulator->setHintText( tr( "Modulator:" ) + " ", "" );
m_crossfade = new knob( knobBright_26, widget, tr( "Crossfade" ),
eng(), _track );
_track );
m_crossfade->setLabel( tr( "Crossfade" ) );
m_crossfade->setRange( 0.0, 128.0, 0.1 );
m_crossfade->setInitValue( 0.0 );
@@ -196,7 +196,7 @@ QWidget * mallets::setupTubeBellControls( QWidget * _parent, track * _track )
m_crossfade->setHintText( tr( "Crossfade:" ) + " ", "" );
m_lfoSpeed = new knob( knobBright_26, widget, tr( "LFO Speed" ),
eng(), _track );
_track );
m_lfoSpeed->setLabel( tr( "LFO Speed" ) );
m_lfoSpeed->setRange( 0.0, 128.0, 0.1 );
m_lfoSpeed->setInitValue( 20.0 );
@@ -204,15 +204,14 @@ QWidget * mallets::setupTubeBellControls( QWidget * _parent, track * _track )
m_lfoSpeed->setHintText( tr( "LFO Speed:" ) + " ", "" );
m_lfoDepth = new knob( knobBright_26, widget, tr( "LFO Depth" ),
eng(), _track );
_track );
m_lfoDepth->setLabel( tr( "LFO Depth" ) );
m_lfoDepth->setRange( 0.0, 128.0, 0.1 );
m_lfoDepth->setInitValue( 10.0 );
m_lfoDepth->move( 117, 86 );
m_lfoDepth->setHintText( tr( "LFO Depth:" ) + " ", "" );
m_adsr = new knob( knobBright_26, widget, tr( "ADSR" ),
eng(), _track );
m_adsr = new knob( knobBright_26, widget, tr( "ADSR" ), _track );
m_adsr->setLabel( tr( "ADSR" ) );
m_adsr->setRange( 0.0, 128.0, 0.1 );
m_adsr->setInitValue( 0.0 );
@@ -232,35 +231,32 @@ QWidget * mallets::setupBandedWGControls( QWidget * _parent, track * _track )
widget->setFixedSize( 250, 250 );
m_strike = new ledCheckBox( tr( "Bowed" ), widget, tr( "Bowed" ),
eng(), _track );
_track );
m_strike->move( 165, 30 );
m_pressure = new knob( knobBright_26, widget, tr( "Pressure" ),
eng(), _track );
_track );
m_pressure->setLabel( tr( "Pressure" ) );
m_pressure->setRange( 0.0, 128.0, 0.1 );
m_pressure->setInitValue( 64.0 );
m_pressure->move( 56, 86 );
m_pressure->setHintText( tr( "Pressure:" ) + " ", "" );
m_motion = new knob( knobBright_26, widget, tr( "Motion" ),
eng(), _track );
m_motion = new knob( knobBright_26, widget, tr( "Motion" ), _track );
m_motion->setLabel( tr( "Motion" ) );
m_motion->setRange( 0.0, 128.0, 0.1 );
m_motion->setInitValue( 64.0 );
m_motion->move( 117, 86 );
m_motion->setHintText( tr( "Motion:" ) + " ", "" );
m_velocity = new knob( knobBright_26, widget, tr( "Speed" ),
eng(), _track );
m_velocity = new knob( knobBright_26, widget, tr( "Speed" ), _track );
m_velocity->setLabel( tr( "Speed" ) );
m_velocity->setRange( 0.0, 128.0, 0.1 );
m_velocity->setInitValue( 74.5 );
m_velocity->move( 178, 86 );
m_velocity->setHintText( tr( "Speed:" ) + " ", "" );
m_vibrato = new knob( knobBright_26, widget, tr( "Vibrato" ),
eng(), _track );
m_vibrato = new knob( knobBright_26, widget, tr( "Vibrato" ), _track );
m_vibrato->setLabel( tr( "Vibrato" ) );
m_vibrato->setRange( 0.0, 128.0, 0.1 );
m_vibrato->setInitValue( 64.0 );
@@ -276,7 +272,7 @@ QWidget * mallets::setupBandedWGControls( QWidget * _parent, track * _track )
comboBox * mallets::setupPresets( QWidget * _parent, track * _track )
{
comboBox * presets = new comboBox( _parent, tr( "Instrument" ),
eng(), _track );
_track );
presets->setGeometry( 64, 157, 99, 22 );
presets->setFont( pointSize<8>( presets->font() ) );
@@ -412,7 +408,7 @@ void mallets::playNote( notePlayHandle * _n, bool )
m_vibratoFreq->value(),
p,
(Uint8) m_spread->value(),
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
}
else if( p == 9 )
{
@@ -426,7 +422,7 @@ void mallets::playNote( notePlayHandle * _n, bool )
m_lfoSpeed->value(),
m_adsr->value(),
(Uint8) m_spread->value(),
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
}
else
{
@@ -440,11 +436,11 @@ void mallets::playNote( notePlayHandle * _n, bool )
m_strike->value() * 128.0,
m_velocity->value(),
(Uint8) m_spread->value(),
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
}
}
const Uint32 frames = eng()->getMixer()->framesPerAudioBuffer();
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
malletsSynth * ps = static_cast<malletsSynth *>( _n->m_pluginData );
sample_t add_scale = 0.0f;

View File

@@ -89,7 +89,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
{
for( int i = 0; i < NUM_OF_OSCILLATORS; ++i )
{
m_osc[i].m_sampleBuffer = new sampleBuffer( eng() );
m_osc[i].m_sampleBuffer = new sampleBuffer;
}
#ifdef QT4
@@ -102,8 +102,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) );
#endif
pixmapButton * pm_osc1_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * pm_osc1_btn = new pixmapButton( this, NULL, NULL );
pm_osc1_btn->move( 80, 50 );
pm_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"pm_active" ) );
@@ -115,8 +114,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"modulating oscillator 2 with "
"oscillator 1" ) );
pixmapButton * am_osc1_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * am_osc1_btn = new pixmapButton( this, NULL, NULL );
am_osc1_btn->move( 120, 50 );
am_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"am_active" ) );
@@ -128,8 +126,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"modulating oscillator 2 with "
"oscillator 1" ) );
pixmapButton * mix_osc1_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * mix_osc1_btn = new pixmapButton( this, NULL, NULL );
mix_osc1_btn->move( 160, 50 );
mix_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"mix_active" ) );
@@ -139,8 +136,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"btn_mask" ).createHeuristicMask() ) );
toolTip::add( mix_osc1_btn, tr( "mix output of oscillator 1 & 2" ) );
pixmapButton * sync_osc1_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * sync_osc1_btn = new pixmapButton( this, NULL, NULL );
sync_osc1_btn->move( 200, 50 );
sync_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"sync_active" ) );
@@ -151,8 +147,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
toolTip::add( sync_osc1_btn, tr( "synchronize oscillator 1 with "
"oscillator 2" ) );
pixmapButton * fm_osc1_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * fm_osc1_btn = new pixmapButton( this, NULL, NULL );
fm_osc1_btn->move( 330, 50 );
fm_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"fm_active" ) );
@@ -166,7 +161,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
m_mod1BtnGrp = new automatableButtonGroup( this,
tr( "Modulation type 1" ),
eng(), _channel_track );
_channel_track );
m_mod1BtnGrp->addButton( pm_osc1_btn );
m_mod1BtnGrp->addButton( am_osc1_btn );
m_mod1BtnGrp->addButton( mix_osc1_btn );
@@ -178,8 +173,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
this, SLOT( mod1Ch( int ) ) );
pixmapButton * pm_osc2_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * pm_osc2_btn = new pixmapButton( this, NULL, NULL );
pm_osc2_btn->move( 80, 70 );
pm_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"pm_active" ) );
@@ -191,8 +185,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"modulating oscillator 3 with "
"oscillator 2" ) );
pixmapButton * am_osc2_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * am_osc2_btn = new pixmapButton( this, NULL, NULL );
am_osc2_btn->move( 120, 70 );
am_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"am_active" ) );
@@ -204,8 +197,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"modulating oscillator 3 with "
"oscillator 2" ) );
pixmapButton * mix_osc2_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * mix_osc2_btn = new pixmapButton( this, NULL, NULL );
mix_osc2_btn->move( 160, 70 );
mix_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"mix_active" ) );
@@ -215,8 +207,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"btn_mask" ).createHeuristicMask() ) );
toolTip::add( mix_osc2_btn, tr("mix output of oscillator 2 & 3" ) );
pixmapButton * sync_osc2_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * sync_osc2_btn = new pixmapButton( this, NULL, NULL );
sync_osc2_btn->move( 200, 70 );
sync_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"sync_active" ) );
@@ -227,8 +218,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
toolTip::add( sync_osc2_btn, tr( "synchronize oscillator 2 with "
"oscillator 3" ) );
pixmapButton * fm_osc2_btn = new pixmapButton( this, NULL, eng(),
NULL );
pixmapButton * fm_osc2_btn = new pixmapButton( this, NULL, NULL );
fm_osc2_btn->move( 330, 70 );
fm_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"fm_active" ) );
@@ -242,7 +232,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
m_mod2BtnGrp = new automatableButtonGroup( this,
tr( "Modulation type 2" ),
eng(), _channel_track );
_channel_track );
m_mod2BtnGrp->addButton( pm_osc2_btn );
m_mod2BtnGrp->addButton( am_osc2_btn );
m_mod2BtnGrp->addButton( mix_osc2_btn );
@@ -261,8 +251,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
// setup volume-knob
m_osc[i].volKnob = new volumeKnob( knobSmall_17, this, tr(
"Osc %1 volume" ).arg( i+1 ), eng(),
_channel_track );
"Osc %1 volume" ).arg( i+1 ), _channel_track );
m_osc[i].volKnob->setData( i );
m_osc[i].volKnob->move( 6, 104+i*50 );
m_osc[i].volKnob->setRange( MIN_VOLUME, MAX_VOLUME, 1.0f );
@@ -283,7 +272,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
// setup panning-knob
m_osc[i].panKnob = new knob( knobSmall_17, this,
tr( "Osc %1 panning" ).arg( i + 1 ), eng(),
tr( "Osc %1 panning" ).arg( i + 1 ),
_channel_track );
m_osc[i].panKnob->setData( i );
m_osc[i].panKnob->move( 33, 104+i*50 );
@@ -304,7 +293,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
// setup coarse-knob
m_osc[i].coarseKnob = new knob( knobSmall_17, this,
tr( "Osc %1 coarse detuning" ).arg( i + 1 ),
eng(), _channel_track );
_channel_track );
m_osc[i].coarseKnob->setData( i );
m_osc[i].coarseKnob->move( 66, 104 + i * 50 );
m_osc[i].coarseKnob->setRange( -2 * NOTES_PER_OCTAVE,
@@ -327,7 +316,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
// setup knob for left fine-detuning
m_osc[i].fineLKnob = new knob( knobSmall_17, this,
tr( "Osc %1 fine detuning left" ).arg( i+1 ),
eng(), _channel_track );
_channel_track );
m_osc[i].fineLKnob->setData( i );
m_osc[i].fineLKnob->move( 90, 104 + i * 50 );
m_osc[i].fineLKnob->setRange( -100.0f, 100.0f, 1.0f );
@@ -351,7 +340,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
m_osc[i].fineRKnob = new knob( knobSmall_17, this,
tr( "Osc %1 fine detuning right"
).arg( i + 1 ),
eng(), _channel_track );
_channel_track );
m_osc[i].fineRKnob->setData( i );
m_osc[i].fineRKnob->move( 110, 104 + i * 50 );
m_osc[i].fineRKnob->setRange( -100.0f, 100.0f, 1.0f );
@@ -374,7 +363,6 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
m_osc[i].phaseOffsetKnob = new knob( knobSmall_17, this,
tr( "Osc %1 phase-"
"offset" ).arg( i+1 ),
eng(),
_channel_track );
m_osc[i].phaseOffsetKnob->setData( i );
m_osc[i].phaseOffsetKnob->move( 142, 104 + i * 50 );
@@ -402,7 +390,6 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
m_osc[i].stereoPhaseDetuningKnob = new knob( knobSmall_17, this,
tr( "Osc %1 stereo phase-"
"detuning" ).arg( i+1 ),
eng(),
_channel_track );
m_osc[i].stereoPhaseDetuningKnob->setData( i );
m_osc[i].stereoPhaseDetuningKnob->move( 166, 104 + i * 50 );
@@ -467,7 +454,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
updatePhaseOffsetRight( i );
pixmapButton * sin_wave_btn = new pixmapButton( this, NULL,
eng(), NULL );
NULL );
sin_wave_btn->move( 188, 105 + i * 50 );
sin_wave_btn->setActiveGraphic( embed::getIconPixmap(
"sin_wave_active" ) );
@@ -479,7 +466,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"current oscillator." ) );
pixmapButton * triangle_wave_btn = new pixmapButton( this, NULL,
eng(), NULL );
NULL );
triangle_wave_btn->move( 203, 105 + i * 50 );
triangle_wave_btn->setActiveGraphic(
embed::getIconPixmap( "triangle_wave_active" ) );
@@ -490,7 +477,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"for current oscillator." ) );
pixmapButton * saw_wave_btn = new pixmapButton( this, NULL,
eng(), NULL );
NULL );
saw_wave_btn->move( 218, 105 + i * 50 );
saw_wave_btn->setActiveGraphic( embed::getIconPixmap(
"saw_wave_active" ) );
@@ -501,7 +488,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"current oscillator." ) );
pixmapButton * sqr_wave_btn = new pixmapButton( this, NULL,
eng(), NULL );
NULL );
sqr_wave_btn->move( 233, 105 + i * 50 );
sqr_wave_btn->setActiveGraphic( embed::getIconPixmap(
"square_wave_active" ) );
@@ -512,7 +499,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"current oscillator." ) );
pixmapButton * moog_saw_wave_btn = new pixmapButton( this, NULL,
eng(), NULL );
NULL );
moog_saw_wave_btn->move( 188, 120+i*50 );
moog_saw_wave_btn->setActiveGraphic(
embed::getIconPixmap( "moog_saw_wave_active" ) );
@@ -523,7 +510,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"for current oscillator." ) );
pixmapButton * exp_wave_btn = new pixmapButton( this, NULL,
eng(), NULL );
NULL );
exp_wave_btn->move( 203, 120+i*50 );
exp_wave_btn->setActiveGraphic( embed::getIconPixmap(
"exp_wave_active" ) );
@@ -534,7 +521,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"wave for current oscillator." ) );
pixmapButton * white_noise_btn = new pixmapButton( this, NULL,
eng(), NULL );
NULL );
white_noise_btn->move( 218, 120+i*50 );
white_noise_btn->setActiveGraphic(
embed::getIconPixmap( "white_noise_wave_active" ) );
@@ -544,8 +531,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
tr( "Click here if you want a white-noise for "
"current oscillator." ) );
m_osc[i].usrWaveBtn = new pixmapButton( this, NULL, eng(),
NULL );
m_osc[i].usrWaveBtn = new pixmapButton( this, NULL, NULL );
m_osc[i].usrWaveBtn->move( 233, 120+i*50 );
m_osc[i].usrWaveBtn->setActiveGraphic( embed::getIconPixmap(
"usr_wave_active" ) );
@@ -557,7 +543,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
m_osc[i].waveBtnGrp = new automatableButtonGroup( this,
tr( "Osc %1 wave shape" ).arg( i + 1 ),
eng(), _channel_track );
_channel_track );
m_osc[i].waveBtnGrp->addButton( sin_wave_btn );
m_osc[i].waveBtnGrp->addButton( triangle_wave_btn );
m_osc[i].waveBtnGrp->addButton( saw_wave_btn );
@@ -596,7 +582,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
}
}
connect( eng()->getMixer(), SIGNAL( sampleRateChanged() ),
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateAllDetuning() ) );
}
@@ -753,7 +739,7 @@ void tripleOscillator::playNote( notePlayHandle * _n, bool )
oscillator * osc_r = static_cast<oscPtr *>( _n->m_pluginData
)->oscRight;
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
osc_l->update( buf, frames, 0 );
@@ -893,7 +879,7 @@ void tripleOscillator::updateDetuningLeft( const QVariant & _data )
m_osc[_i].detuningLeft = powf( 2.0f, (
(float)m_osc[_i].coarseKnob->value() * 100.0f +
(float)m_osc[_i].fineLKnob->value() ) / 1200.0f )
/ static_cast<float>( eng()->getMixer()->sampleRate() );
/ engine::getMixer()->sampleRate();
}
@@ -905,7 +891,7 @@ void tripleOscillator::updateDetuningRight( const QVariant & _data )
m_osc[_i].detuningRight = powf( 2.0f, (
(float)m_osc[_i].coarseKnob->value() * 100.0f +
(float)m_osc[_i].fineRKnob->value() ) / 1200.0f )
/ static_cast<float>( eng()->getMixer()->sampleRate() );
/ engine::getMixer()->sampleRate();
}

View File

@@ -108,7 +108,7 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) :
setErasePixmap( *s_artwork );
#endif
m_openPluginButton = new pixmapButton( this, NULL, eng(), NULL );
m_openPluginButton = new pixmapButton( this, NULL, NULL );
m_openPluginButton->setCheckable( FALSE );
m_openPluginButton->setCursor( Qt::PointingHandCursor );
m_openPluginButton->move( 200, 70 );
@@ -160,7 +160,7 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) :
// now we need a play-handle which cares for calling play()
instrumentPlayHandle * iph = new instrumentPlayHandle( this );
eng()->getMixer()->addPlayHandle( iph );
engine::getMixer()->addPlayHandle( iph );
}
@@ -231,7 +231,7 @@ void vestigeInstrument::setParameter( const QString & _param,
PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ),
0 );
m_pluginMutex.lock();
m_plugin = new remoteVSTPlugin( m_pluginDLL, eng() );
m_plugin = new remoteVSTPlugin( m_pluginDLL );
if( m_plugin->failed() )
{
m_pluginMutex.unlock();
@@ -261,10 +261,10 @@ void vestigeInstrument::setParameter( const QString & _param,
return;
}*/
m_plugin->showEditor();
connect( eng()->getSongEditor(),
connect( engine::getSongEditor(),
SIGNAL( tempoChanged( bpm_t ) ),
m_plugin, SLOT( setTempo( bpm_t ) ) );
m_plugin->setTempo( eng()->getSongEditor()->getTempo() );
m_plugin->setTempo( engine::getSongEditor()->getTempo() );
if( set_ch_name == TRUE )
{
getInstrumentTrack()->setName( m_plugin->name() );
@@ -297,7 +297,7 @@ void vestigeInstrument::waitForWorkerThread( void )
return;
}
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
if( m_plugin->waitForProcessingFinished( buf ) )

View File

@@ -1,7 +1,7 @@
/*
* graph.cpp - a QT widget for displaying and manipulating waveforms
*
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -50,9 +50,8 @@ using namespace std;
graph::graph( QWidget * _parent, engine * _engine ) :
QWidget( _parent ),
engineObject( _engine )
graph::graph( QWidget * _parent ) :
QWidget( _parent )
{
m_mouseDown = false;
@@ -94,7 +93,7 @@ void graph::loadSampleFromFile( const QString & _filename )
}
// load user shape
sampleBuffer buffer( eng(), _filename );
sampleBuffer buffer( _filename );
// copy buffer data
sampleLength = min( sampleLength, static_cast<int>(buffer.frames()) );

View File

@@ -1,7 +1,7 @@
/*
* graph.h - a QT widget for displaying and manipulating waveforms
*
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -43,14 +43,11 @@
#endif
#include "engine.h"
class graph : public QWidget, public engineObject
class graph : public QWidget
{
Q_OBJECT
public:
graph( QWidget * _parent, engine * _engine );
graph( QWidget * _parent );
virtual ~graph();
void setSamplePointer( float * pointer, int length );

View File

@@ -1,7 +1,7 @@
/*
* impulse_editor.cpp - graphic waveform editor
*
* 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
*
@@ -52,11 +52,9 @@
#include "song_editor.h"
impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
engine * _engine, track * _track,
Uint32 _len ) :
impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, track * _track,
Uint32 _len ) :
QWidget( _parent/*, "impulseEditor"*/ ),
engineObject( _engine ),
m_sampleLength( _len ),
m_normalizeFactor( 1.0f ),
m_forward( TRUE )
@@ -72,7 +70,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
setPaletteBackgroundPixmap( m_base );
#endif
m_graph = new graph( this, eng() );
m_graph = new graph( this );
m_graph->setForeground( PLUGIN_NAME::getIconPixmap( "wavegraph4" ) );
m_graph->move( 0, 0 );
m_graph->setCursor( QCursor( Qt::CrossCursor ) );
@@ -82,8 +80,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
connect( m_graph, SIGNAL ( sampleChanged( void ) ),
this, SLOT ( sampleChanged( void ) ) );
m_sinWaveBtn = new pixmapButton( this, tr( "Sine wave" ), eng(),
_track );
m_sinWaveBtn = new pixmapButton( this, tr( "Sine wave" ), _track );
m_sinWaveBtn->move( 136, 3 );
m_sinWaveBtn->setActiveGraphic( embed::getIconPixmap(
"sin_wave_active" ) );
@@ -98,7 +95,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
m_triangleWaveBtn = new pixmapButton( this, tr( "Triangle wave" ),
eng(), _track );
_track );
m_triangleWaveBtn->move( 136, 20 );
m_triangleWaveBtn->setActiveGraphic(
embed::getIconPixmap( "triangle_wave_active" ) );
@@ -111,8 +108,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
this, SLOT ( triangleWaveClicked( void ) ) );
m_sawWaveBtn = new pixmapButton( this, tr( "Saw wave" ), eng(),
_track );
m_sawWaveBtn = new pixmapButton( this, tr( "Saw wave" ), _track );
m_sawWaveBtn->move( 136, 37 );
m_sawWaveBtn->setActiveGraphic( embed::getIconPixmap(
"saw_wave_active" ) );
@@ -125,8 +121,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
this, SLOT ( sawWaveClicked( void ) ) );
m_sqrWaveBtn = new pixmapButton( this, tr( "Square wave" ), eng(),
_track );
m_sqrWaveBtn = new pixmapButton( this, tr( "Square wave" ), _track );
m_sqrWaveBtn->move( 136, 54 );
m_sqrWaveBtn->setActiveGraphic( embed::getIconPixmap(
"square_wave_active" ) );
@@ -140,7 +135,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
m_whiteNoiseWaveBtn = new pixmapButton( this, tr( "White noise wave" ),
eng(), _track );
_track );
m_whiteNoiseWaveBtn->move( 136, 71 );
m_whiteNoiseWaveBtn->setActiveGraphic(
embed::getIconPixmap( "white_noise_wave_active" ) );
@@ -153,7 +148,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
this, SLOT ( noiseWaveClicked( void ) ) );
m_usrWaveBtn = new pixmapButton( this, tr( "User defined wave" ), eng(),
m_usrWaveBtn = new pixmapButton( this, tr( "User defined wave" ),
_track );
m_usrWaveBtn->move( 136, 88 );
m_usrWaveBtn->setActiveGraphic( embed::getIconPixmap(
@@ -167,7 +162,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
this, SLOT ( usrWaveClicked( void ) ) );
m_smoothBtn = new pixmapButton( this, tr( "Smooth" ), eng(), _track );
m_smoothBtn = new pixmapButton( this, tr( "Smooth" ), _track );
m_smoothBtn->move( 3, 108 );
m_smoothBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"smooth_active" ) );
@@ -180,8 +175,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
this, SLOT ( smoothClicked( void ) ) );
m_normalizeBtn = new pixmapButton( this, tr( "Normalize" ), eng(),
_track );
m_normalizeBtn = new pixmapButton( this, tr( "Normalize" ), _track );
m_normalizeBtn->move( 20, 108 );
m_normalizeBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"normalize_active" ) );
@@ -194,8 +188,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
connect( m_normalizeBtn, SIGNAL ( clicked ( void ) ),
this, SLOT ( normalizeClicked( void ) ) );
m_state = new ledCheckBox( "", this, tr( "Enable waveform" ), eng(),
_track );
m_state = new ledCheckBox( "", this, tr( "Enable waveform" ), _track );
m_state->move( 136, 109 );
m_state->setChecked( TRUE );
toolTip::add( m_state,
@@ -325,7 +318,7 @@ void impulseEditor::usrWaveClicked( void )
}
// load user shape
sampleBuffer buffer( eng() );
sampleBuffer buffer;
QString af = buffer.openAudioFile();
if( af != "" )
{
@@ -379,7 +372,7 @@ void impulseEditor::smoothClicked( void )
update();
m_graph->update();
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
m_smoothBtn->setChecked( FALSE );
m_smoothBtn->update();
@@ -411,7 +404,7 @@ void impulseEditor::normalizeClicked( void )
update();
m_graph->update();
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
m_normalizeBtn->setChecked( FALSE );
m_normalizeBtn->update();
@@ -439,7 +432,7 @@ void impulseEditor::sampleChanged()
m_graph->update();
}
eng()->getSongEditor()->setModified();
engine::getSongEditor()->setModified();
}

View File

@@ -1,7 +1,7 @@
/*
* impulse_editor.cpp - graphic waveform editor
*
* 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
*
@@ -44,16 +44,14 @@
#include "types.h"
#include "graph.h"
#include "pixmap_button.h"
#include "engine.h"
#include "led_checkbox.h"
class impulseEditor: public QWidget, public engineObject
class impulseEditor: public QWidget
{
Q_OBJECT
public:
impulseEditor( QWidget *parent, int _x, int _y,
engine * _engine, track * _track,
Uint32 _len = 128 );
impulseEditor( QWidget *parent, int _x, int _y, track * _track,
Uint32 _len = 128 );
~impulseEditor();
inline float * getValues() { return( m_sampleShape ); };

View File

@@ -1,7 +1,7 @@
/*
* nine_button_selector.cpp
*
* 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
*
@@ -64,10 +64,8 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
Uint8 _default,
Uint32 _x, Uint32 _y,
QWidget * _parent,
engine * _engine,
track * _track ):
QWidget( _parent/*, "nineButtonSelector"*/ ),
engineObject( _engine ),
m_selected( _default )
{
setFixedSize( 50, 50 );
@@ -82,7 +80,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
setPaletteBackgroundPixmap( m_base );
#endif
m_button = new pixmapButton( this, NULL, eng(), _track );
m_button = new pixmapButton( this, NULL, _track );
m_button->move( 1, 1 );
m_button->setActiveGraphic( _button0_on );
m_button->setInactiveGraphic( _button0_off );
@@ -91,7 +89,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button0Clicked( void ) ) );
m_buttons.append( m_button );
m_button = new pixmapButton( this, NULL, eng(), _track );
m_button = new pixmapButton( this, NULL, _track );
m_button->move( 18, 1 );
m_button->setActiveGraphic( _button1_on );
m_button->setInactiveGraphic( _button1_off );
@@ -100,7 +98,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button1Clicked( void ) ) );
m_buttons.append( m_button );
m_button = new pixmapButton( this, NULL, eng(), _track );
m_button = new pixmapButton( this, NULL, _track );
m_button->move( 35, 1 );
m_button->setActiveGraphic( _button2_on );
m_button->setInactiveGraphic( _button2_off );
@@ -109,7 +107,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button2Clicked( void ) ) );
m_buttons.append( m_button );
m_button = new pixmapButton( this, NULL, eng(), _track );
m_button = new pixmapButton( this, NULL, _track );
m_button->move( 1, 18 );
m_button->setActiveGraphic( _button3_on );
m_button->setInactiveGraphic( _button3_off );
@@ -118,7 +116,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button3Clicked( void ) ) );
m_buttons.append( m_button );
m_button = new pixmapButton( this, NULL, eng(), _track );
m_button = new pixmapButton( this, NULL, _track );
m_button->move( 18, 18 );
m_button->setActiveGraphic( _button4_on );
m_button->setInactiveGraphic( _button4_off );
@@ -127,7 +125,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button4Clicked( void ) ) );
m_buttons.append( m_button );
m_button = new pixmapButton( this, NULL, eng(), _track );
m_button = new pixmapButton( this, NULL, _track );
m_button->move( 35, 18 );
m_button->setActiveGraphic( _button5_on );
m_button->setInactiveGraphic( _button5_off );
@@ -136,7 +134,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button5Clicked( void ) ) );
m_buttons.append( m_button );
m_button = new pixmapButton( this, NULL, eng(), _track );
m_button = new pixmapButton( this, NULL, _track );
m_button->move( 1, 35 );
m_button->setActiveGraphic( _button6_on );
m_button->setInactiveGraphic( _button6_off );
@@ -145,7 +143,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button6Clicked( void ) ) );
m_buttons.append( m_button );
m_button = new pixmapButton( this, NULL, eng(), _track );
m_button = new pixmapButton( this, NULL, _track );
m_button->move( 18, 35 );
m_button->setActiveGraphic( _button7_on );
m_button->setInactiveGraphic( _button7_off );
@@ -154,7 +152,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button7Clicked( void ) ) );
m_buttons.append( m_button );
m_button = new pixmapButton( this, NULL, eng(), _track );
m_button = new pixmapButton( this, NULL, _track );
m_button->move( 35, 35 );
m_button->setActiveGraphic( _button8_on );
m_button->setInactiveGraphic( _button8_off );

View File

@@ -1,7 +1,7 @@
/*
* nine_button_selector.h
*
* 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
*
@@ -30,7 +30,7 @@
#include "pixmap_button.h"
class nineButtonSelector: public QWidget, public engineObject
class nineButtonSelector: public QWidget
{
Q_OBJECT
@@ -56,7 +56,6 @@ public:
Uint8 _default,
Uint32 _x, Uint32 _y,
QWidget * _parent,
engine * _engine,
track * _track );
~nineButtonSelector();

View File

@@ -1,7 +1,7 @@
/*
* vibed.cpp - combination of PluckedStringSynth and BitInvader
*
* 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
*
@@ -96,8 +96,7 @@ vibed::vibed( instrumentTrack * _channel_track ) :
for( Uint8 harm = 0; harm < 9; harm++ )
{
m_editor = new impulseEditor( this, 76, 21, eng(),
_channel_track );
m_editor = new impulseEditor( this, 76, 21, _channel_track );
m_editor->setOn( FALSE );
m_editor->hide();
m_editors.append( m_editor );
@@ -119,8 +118,8 @@ vibed::vibed( instrumentTrack * _channel_track ) :
"The 'N' button will normalize the waveform.") );
m_volumeKnob = new volumeKnob( knobBright_26, this,
tr( "Volume" ), eng(), _channel_track );
m_volumeKnob = new volumeKnob( knobBright_26, this,
tr( "Volume" ), _channel_track );
m_volumeKnob->setRange( MIN_VOLUME, MAX_VOLUME, 1.0f );
m_volumeKnob->setInitValue( DEFAULT_VOLUME );
m_volumeKnob->move( 103, 142 );
@@ -137,7 +136,7 @@ vibed::vibed( instrumentTrack * _channel_track ) :
m_stiffnessKnob = new knob( knobBright_26, this,
tr( "String stiffness" ),
eng(), _channel_track );
_channel_track );
m_stiffnessKnob->setRange( 0.0f, 0.05f, 0.001f );
m_stiffnessKnob->setInitValue( 0.0f );
m_stiffnessKnob->move( 129, 142 );
@@ -158,7 +157,7 @@ vibed::vibed( instrumentTrack * _channel_track ) :
m_pickKnob = new knob( knobBright_26, this,
tr( "Pick position" ),
eng(), _channel_track );
_channel_track );
m_pickKnob->setRange( 0.0f, 0.5f, 0.005f );
m_pickKnob->setInitValue( 0.0f );
m_pickKnob->move( 153, 142 );
@@ -176,7 +175,7 @@ vibed::vibed( instrumentTrack * _channel_track ) :
m_pickupKnob = new knob( knobBright_26, this,
tr( "Pickup position" ),
eng(), _channel_track );
_channel_track );
m_pickupKnob->setRange( 0.0f, 0.5f, 0.005f );
m_pickupKnob->setInitValue( 0.05f );
m_pickupKnob->move( 177, 142 );
@@ -194,8 +193,8 @@ vibed::vibed( instrumentTrack * _channel_track ) :
"for the selected string. The lower the setting, the closer the "
"pickup is to the bridge." ) );
m_panKnob = new knob( knobBright_26, this,
tr( "Pan" ), eng(), _channel_track );
m_panKnob = new knob( knobBright_26, this, tr( "Pan" ),
_channel_track );
m_panKnob->setRange( -1.0f, 1.0f, 0.01f );
m_panKnob->setInitValue( 0.0f );
m_panKnob->move( 105, 187 );
@@ -211,9 +210,8 @@ vibed::vibed( instrumentTrack * _channel_track ) :
"The Pan knob determines the location of the selected string in the stereo "
"field." ) );
m_detuneKnob = new knob( knobBright_26, this,
tr( "Detune" ),
eng(), _channel_track );
m_detuneKnob = new knob( knobBright_26, this, tr( "Detune" ),
_channel_track );
m_detuneKnob->setRange( -0.1f, 0.1f, 0.001f );
m_detuneKnob->setInitValue( 0.0f );
m_detuneKnob->move( 150, 187 );
@@ -230,9 +228,8 @@ vibed::vibed( instrumentTrack * _channel_track ) :
"than zero will cause the string to sound flat. Settings greater than zero "
"will cause the string to sound sharp." ) );
m_randomKnob = new knob( knobBright_26, this,
tr( "Fuzziness" ),
eng(), _channel_track );
m_randomKnob = new knob( knobBright_26, this, tr( "Fuzziness" ),
_channel_track );
m_randomKnob->setRange( 0.0f, 0.75f, 0.01f );
m_randomKnob->setInitValue( 0.0f );
m_randomKnob->move( 194, 187 );
@@ -250,8 +247,8 @@ vibed::vibed( instrumentTrack * _channel_track ) :
"apparent during the attack, though it can also be used to make the string "
"sound more 'metallic'.") );
m_lengthKnob = new knob( knobBright_26, this,
tr( "Length" ), eng(), _channel_track );
m_lengthKnob = new knob( knobBright_26, this, tr( "Length" ),
_channel_track );
m_lengthKnob->setRange( 1, 16, 1 );
m_lengthKnob->setInitValue( 1 );
m_lengthKnob->move( 23, 193 );
@@ -269,7 +266,7 @@ vibed::vibed( instrumentTrack * _channel_track ) :
"will both ring longer and sound brighter, however, they will also eat up "
"more CPU cycles." ) );
m_impulse = new ledCheckBox( "", this, tr( "Impulse" ), eng(),
m_impulse = new ledCheckBox( "", this, tr( "Impulse" ),
_channel_track );
m_impulse->move( 23, 94 );
m_impulse->setChecked( FALSE );
@@ -309,7 +306,6 @@ vibed::vibed( instrumentTrack * _channel_track ) :
2,
21, 127,
this,
eng(),
NULL );
m_harmonic->hide();
m_harmonics.append( m_harmonic );
@@ -348,7 +344,6 @@ vibed::vibed( instrumentTrack * _channel_track ) :
0,
21, 39,
this,
eng(),
NULL );
connect( m_stringSelector, SIGNAL( nineButtonSelection( Uint8 ) ),
this, SLOT( showString( Uint8 ) ) );
@@ -559,7 +554,7 @@ void vibed::playNote( notePlayHandle * _n, bool )
_n->m_pluginData = new stringContainer(
freq,
eng()->getMixer()->sampleRate(),
engine::getMixer()->sampleRate(),
m_sampleLength );
for( Uint8 i = 0; i < 9; ++i )
@@ -583,7 +578,7 @@ void vibed::playNote( notePlayHandle * _n, bool )
}
}
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
stringContainer * ps = static_cast<stringContainer *>(
_n->m_pluginData );

View File

@@ -1,7 +1,7 @@
/*
* lvsl_client.cpp - client for LVSL Server
*
* 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
*
@@ -79,15 +79,15 @@
#include "templates.h"
#include "config_mgr.h"
#include "engine.h"
#include "main_window.h"
#include "lvsl_client.h"
remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin, engine * _engine ) :
remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin ) :
QObject(),
journallingObject( _engine ),
m_failed( TRUE ),
m_plugin( _plugin ),
m_pluginWidget( NULL ),
@@ -253,11 +253,11 @@ void remoteVSTPlugin::showEditor( void )
return;
}
m_pluginWidget = new QWidget( eng()->getMainWindow()->workspace() );
m_pluginWidget = new QWidget( engine::getMainWindow()->workspace() );
m_pluginWidget->setFixedSize( m_pluginGeometry );
m_pluginWidget->setWindowTitle( name() );
#ifndef QT3
eng()->getMainWindow()->workspace()->addWindow( m_pluginWidget );
engine::getMainWindow()->workspace()->addWindow( m_pluginWidget );
#endif
m_pluginWidget->show();
@@ -289,7 +289,7 @@ void remoteVSTPlugin::hideEditor( void )
bool remoteVSTPlugin::process( const sampleFrame * _in_buf,
sampleFrame * _out_buf, bool _wait )
{
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
if( m_shm == NULL )
{
@@ -303,7 +303,8 @@ bool remoteVSTPlugin::process( const sampleFrame * _in_buf,
}
if( _out_buf != NULL )
{
eng()->getMixer()->clearAudioBuffer( _out_buf, frames );
engine::getMixer()->clearAudioBuffer( _out_buf,
frames );
}
return( FALSE );
}
@@ -352,13 +353,13 @@ bool remoteVSTPlugin::waitForProcessingFinished( sampleFrame * _out_buf )
usleep( 10 );
}
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
const ch_cnt_t outputs = tMax<ch_cnt_t>( m_outputCount,
DEFAULT_CHANNELS );
if( outputs != DEFAULT_CHANNELS )
{
// clear buffer, if plugin didn't fill up both channels
eng()->getMixer()->clearAudioBuffer( _out_buf, frames );
engine::getMixer()->clearAudioBuffer( _out_buf, frames );
}
for( ch_cnt_t ch = 0; ch < outputs; ++ch )
@@ -553,14 +554,14 @@ Sint16 remoteVSTPlugin::processNextMessage( void )
writeValueS<Sint16>( VST_SAMPLE_RATE );
// handle is the same
writeValueS<sample_rate_t>(
eng()->getMixer()->sampleRate() );
engine::getMixer()->sampleRate() );
break;
case VST_GET_BUFFER_SIZE:
writeValueS<Sint16>( VST_BUFFER_SIZE );
// handle is the same
writeValueS<fpab_t>(
eng()->getMixer()->framesPerAudioBuffer() );
engine::getMixer()->framesPerAudioBuffer() );
break;
case VST_SHM_KEY_AND_SIZE:

View File

@@ -1,7 +1,7 @@
/*
* lvsl_client.h - client for LVSL Server
*
* 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
*
@@ -54,7 +54,7 @@ class remoteVSTPlugin : public QObject, public journallingObject
{
Q_OBJECT
public:
remoteVSTPlugin( const QString & _plugin, engine * _engine );
remoteVSTPlugin( const QString & _plugin );
virtual ~remoteVSTPlugin();
void showEditor( void );

View File

@@ -1,7 +1,7 @@
/*
* vst_effect.cpp - class for handling VST effect plugins
*
* 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
*
@@ -65,11 +65,11 @@ plugin::descriptor vsteffect_plugin_descriptor =
}
vstEffect::vstEffect( effect::constructionData * _cdata ) :
effect( &vsteffect_plugin_descriptor, _cdata ),
vstEffect::vstEffect( const descriptor::subPluginFeatures::key * _key ) :
effect( &vsteffect_plugin_descriptor, _key ),
m_plugin( NULL ),
m_pluginMutex(),
m_key( _cdata->key )
m_key( *_key )
{
if( !m_key.user.toString().isEmpty() )
{
@@ -150,7 +150,7 @@ void vstEffect::openPlugin( const QString & _plugin )
"Please wait while loading VST-plugin..." ),
PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ), 0 );
m_pluginMutex.lock();
m_plugin = new remoteVSTPlugin( _plugin, eng() );
m_plugin = new remoteVSTPlugin( _plugin );
if( m_plugin->failed() )
{
m_pluginMutex.unlock();
@@ -168,10 +168,10 @@ void vstEffect::openPlugin( const QString & _plugin )
return;
}
m_plugin->showEditor();
remoteVSTPlugin::connect( eng()->getSongEditor(),
remoteVSTPlugin::connect( engine::getSongEditor(),
SIGNAL( tempoChanged( bpm_t ) ),
m_plugin, SLOT( setTempo( bpm_t ) ) );
m_plugin->setTempo( eng()->getSongEditor()->getTempo() );
m_plugin->setTempo( engine::getSongEditor()->getTempo() );
if( m_plugin->pluginWidget() != NULL )
{
/*#ifdef QT4
@@ -206,7 +206,8 @@ extern "C"
plugin * lmms_plugin_main( void * _data )
{
return( new vstEffect(
static_cast<effect::constructionData *>( _data ) ) );
static_cast<const plugin::descriptor::subPluginFeatures::key *>(
_data ) ) );
}
}

View File

@@ -1,7 +1,7 @@
/*
* vst_effect.h - class for handling VST effect plugins
*
* 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
*
@@ -40,6 +40,7 @@
#include "effect.h"
#include "engine.h"
#include "main_window.h"
#include "lvsl_client.h"
#include "vst_control_dialog.h"
@@ -48,7 +49,7 @@
class vstEffect : public effect
{
public:
vstEffect( effect::constructionData * _cdata );
vstEffect( const descriptor::subPluginFeatures::key * _key );
virtual ~vstEffect();
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
@@ -62,7 +63,7 @@ public:
virtual inline effectControlDialog * createControlDialog( track * )
{
return( new vstControlDialog(
eng()->getMainWindow()->workspace(),
engine::getMainWindow()->workspace(),
this ) );
}

View File

@@ -50,18 +50,18 @@ vstSubPluginFeatures::vstSubPluginFeatures( plugin::pluginTypes _type ) :
void vstSubPluginFeatures::fillDescriptionWidget(
QWidget * _parent, engine * _eng, const key & _key )
void vstSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
const key * _key )
{
new QLabel( QWidget::tr( "Name: " ) + _key.name, _parent );
new QLabel( QWidget::tr( "File: " ) + _key.user.toString(), _parent );
new QLabel( QWidget::tr( "Name: " ) + _key->name, _parent );
new QLabel( QWidget::tr( "File: " ) + _key->user.toString(), _parent );
}
void vstSubPluginFeatures::listSubPluginKeys( engine * _eng,
plugin::descriptor * _desc, keyList & _kl )
void vstSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc,
keyList & _kl )
{
QStringList dlls = QDir( configManager::inst()->vstDir() ).
#ifndef QT3

View File

@@ -37,11 +37,10 @@ public:
vstSubPluginFeatures( plugin::pluginTypes _type );
virtual void fillDescriptionWidget( QWidget * _parent,
engine * _eng,
const key & _key );
const key * _key );
virtual void listSubPluginKeys( engine * _eng,
plugin::descriptor * _desc, keyList & _kl );
virtual void listSubPluginKeys( plugin::descriptor * _desc,
keyList & _kl );
} ;