Conflicts:
	plugins/opl2/logo.png
This commit is contained in:
Raine M. Ekman
2014-01-22 20:55:39 +02:00
144 changed files with 1264 additions and 1109 deletions

View File

@@ -186,21 +186,18 @@ void audioFileProcessor::loadFile( const QString & _file )
QString audioFileProcessor::nodeName( void ) const
{
return( audiofileprocessor_plugin_descriptor.name );
return audiofileprocessor_plugin_descriptor.name;
}
Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
int audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
{
const float freq_factor = BaseFreq / _n->frequency() *
engine::mixer()->processingSampleRate() /
engine::mixer()->baseSampleRate();
engine::mixer()->processingSampleRate() / engine::mixer()->baseSampleRate();
return( static_cast<Uint32>( floorf( ( m_sampleBuffer.endFrame() -
m_sampleBuffer.startFrame() ) *
freq_factor ) ) );
return static_cast<int>( floorf( ( m_sampleBuffer.endFrame() - m_sampleBuffer.startFrame() ) * freq_factor ) );
}
@@ -208,7 +205,7 @@ Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
PluginView * audioFileProcessor::instantiateView( QWidget * _parent )
{
return( new AudioFileProcessorView( this, _parent ) );
return new AudioFileProcessorView( this, _parent );
}

View File

@@ -56,11 +56,11 @@ public:
virtual QString nodeName() const;
virtual Uint32 getBeatLen( notePlayHandle * _n ) const;
virtual int getBeatLen( notePlayHandle * _n ) const;
virtual f_cnt_t desiredReleaseFrames() const
{
return( 128 );
return 128;
}
virtual PluginView * instantiateView( QWidget * _parent );

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -287,7 +287,7 @@ void bitInvader::playNote( notePlayHandle * _n,
for( fpp_t frame = 0; frame < frames; ++frame )
{
const sample_t cur = ps->nextStringSample();
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
{
_working_buffer[frame][chnl] = cur;
}

View File

@@ -721,7 +721,7 @@ bool FlpImport::tryImport( TrackContainer* tc )
// search for FLdt chunk
while( 1 )
{
Sint32 id = readID();
int32_t id = readID();
const int len = read32LE();
if( file().atEnd() )
{
@@ -769,7 +769,7 @@ bool FlpImport::tryImport( TrackContainer* tc )
while( file().atEnd() == false )
{
FLP_Events ev = static_cast<FLP_Events>( readByte() );
Uint32 data = readByte();
uint32_t data = readByte();
if( ev >= FLP_Word && ev < FLP_Text )
{
@@ -786,7 +786,7 @@ bool FlpImport::tryImport( TrackContainer* tc )
if( ev >= FLP_Text )
{
text_len = data & 0x7F;
Uint8 shift = 0;
uint8_t shift = 0;
while( data & 0x80 )
{
data = readByte();
@@ -1814,7 +1814,7 @@ void FlpImport::processPluginParams( FL_Channel * _ch )
int ws = Oscillator::UserDefinedWave;
for( int i = 0; i < 3; ++i )
{
const Sint32 * d = (const Sint32 *)
const int32_t * d = (const int32_t *)
( _ch->pluginSettings + i * 28 );
QString is = QString::number( i );
de.setAttribute( "vol" + is,

View File

@@ -69,7 +69,7 @@ private:
return( value );
}
inline Sint32 read32LE()
inline int32_t read32LE()
{
int value = readByte();
value |= readByte() << 8;
@@ -77,14 +77,14 @@ private:
value |= readByte() << 24;
return( value );
}
inline Sint32 read16LE()
inline int32_t read16LE()
{
int value = readByte();
value |= readByte() << 8;
return( value );
}
inline Sint32 readID()
inline int32_t readID()
{
return( read32LE() );
}

View File

@@ -46,7 +46,7 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
vlayout->setSpacing( 0 );
vlayout->setMargin( 0 );
Uint16 pc = manager->getPortCount( _key );
int pc = manager->getPortCount( _key );
QTableWidget * settings = new QTableWidget( pc, 7, this );
@@ -60,31 +60,23 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
ports.append( tr( "SR Dependent" ) );
settings->setHorizontalHeaderLabels( ports );
for( Uint16 row = 0; row < pc; row++ )
for( int row = 0; row < pc; row++ )
{
for( Uint8 col = 0; col < 7; ++col )
for( int col = 0; col < 7; ++col )
{
QTableWidgetItem * item = new QTableWidgetItem;
item->setFlags( 0 );
settings->setItem( row, col, item );
}
Uint8 col = 0;
settings->item( row, col++ )->setText( manager->getPortName(
_key, row ) );
int col = 0;
settings->item( row, col++ )->setText( manager->getPortName( _key, row ) );
settings->item( row, col++ )->setText(
manager->isPortAudio( _key, row ) ?
tr( "Audio" ) : tr( "Control" ) );
settings->item( row, col++ )->setText( manager->isPortAudio( _key, row ) ? tr( "Audio" ) : tr( "Control" ) );
settings->item( row, col++ )->setText(
manager->isPortInput( _key, row ) ?
tr( "Input" ) : tr( "Output" ) );
settings->item( row, col++ )->setText( manager->isPortInput( _key, row ) ? tr( "Input" ) : tr( "Output" ) );
settings->item( row, col++ )->setText(
manager->isPortToggled( _key, row ) ? tr( "Toggled" ) :
manager->isInteger( _key, row ) ? tr( "Integer" ) :
tr( "Float" ) );
settings->item( row, col++ )->setText( manager->isPortToggled( _key, row ) ? tr( "Toggled" ) : manager->isInteger( _key, row ) ? tr( "Integer" ) : tr( "Float" ) );
float min = manager->getLowerBound( _key, row );
float max = manager->getUpperBound( _key, row );

View File

@@ -1,7 +1,7 @@
/*
* LadspaControls.cpp - model for LADSPA plugin controls
*
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -46,26 +46,20 @@ LadspaControls::LadspaControls( LadspaEffect * _eff ) :
control_list_t p;
const bool linked_control = ( m_processors > 1 && proc == 0 );
buffer_data_t last_port = NONE;
for( multi_proc_t::Iterator it = controls.begin();
it != controls.end(); it++ )
for( multi_proc_t::Iterator it = controls.begin(); it != controls.end(); it++ )
{
if( (*it)->proc == proc )
{
(*it)->control = new LadspaControl( this, *it,
linked_control );
last_port = (*it)->data_type;
p.append( (*it)->control );
if( linked_control )
{
connect( (*it)->control,
SIGNAL( linkChanged( Uint16, bool ) ),
this,
SLOT( linkPort( Uint16, bool ) ) );
connect( (*it)->control, SIGNAL( linkChanged( int, bool ) ),
this, SLOT( linkPort( int, bool ) ) );
}
}
}
@@ -143,7 +137,7 @@ void LadspaControls::loadSettings( const QDomElement & _this )
void LadspaControls::linkPort( Uint16 _port, bool _state )
void LadspaControls::linkPort( int _port, bool _state )
{
LadspaControl * first = m_controls[0][_port];
if( _state )
@@ -170,18 +164,14 @@ void LadspaControls::updateLinkStatesFromGlobal()
{
if( m_stereoLinkModel.value() )
{
for( Uint16 port = 0;
port < m_controlCount / m_processors;
port++ )
for( int port = 0; port < m_controlCount / m_processors; port++ )
{
m_controls[0][port]->setLink( true );
}
}
else if( !m_noLink )
{
for( Uint16 port = 0;
port < m_controlCount / m_processors;
port++ )
for( int port = 0; port < m_controlCount / m_processors; port++ )
{
m_controls[0][port]->setLink( false );
}

View File

@@ -1,7 +1,7 @@
/*
* LadspaControls.h - model for LADSPA plugin controls
*
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -62,7 +62,7 @@ public:
protected slots:
void updateLinkStatesFromGlobal();
void linkPort( Uint16 _port, bool _state );
void linkPort( int _port, bool _state );
private:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View File

@@ -466,9 +466,8 @@ inline float GET_INC(float freq) {
return freq/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
}
int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
int lb302Synth::process(sampleFrame *outbuf, const int size)
{
unsigned int i;
float w;
float samp;
@@ -500,7 +499,7 @@ int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
// TODO: NORMAL RELEASE
// vca_mode = 1;
for(i=0;i<size;i++) {
for(int i=0;i<size;i++) {
// update vcf
if(vcf_envpos >= ENVINC) {
@@ -804,34 +803,34 @@ lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
m_vcfCutKnob = new knob( knobBright_26, this );
m_vcfCutKnob->move( 75, 130 );
m_vcfCutKnob->setHintText( tr( "Cutoff Freq:" ) + " ", "" );
m_vcfCutKnob->setLabel( tr("CUT") );
m_vcfCutKnob->setLabel( "" );
m_vcfResKnob = new knob( knobBright_26, this );
m_vcfResKnob->move( 120, 130 );
m_vcfResKnob->setHintText( tr( "Resonance:" ) + " ", "" );
m_vcfResKnob->setLabel( tr("RES") );
m_vcfResKnob->setLabel( "" );
m_vcfModKnob = new knob( knobBright_26, this );
m_vcfModKnob->move( 165, 130 );
m_vcfModKnob->setHintText( tr( "Env Mod:" ) + " ", "" );
m_vcfModKnob->setLabel( tr("ENV MOD") );
m_vcfModKnob->setLabel( "" );
m_vcfDecKnob = new knob( knobBright_26, this );
m_vcfDecKnob->move( 210, 130 );
m_vcfDecKnob->setHintText( tr( "Decay:" ) + " ", "" );
m_vcfDecKnob->setLabel( tr("DEC") );
m_vcfDecKnob->setLabel( "" );
m_slideToggle = new ledCheckBox( "Slide", this );
m_slideToggle = new ledCheckBox( "", this );
m_slideToggle->move( 10, 180 );
m_accentToggle = new ledCheckBox( "Accent", this );
m_accentToggle = new ledCheckBox( "", this );
m_accentToggle->move( 10, 200 );
m_accentToggle->setDisabled(true);
m_deadToggle = new ledCheckBox( "Dead", this );
m_deadToggle = new ledCheckBox( "", this );
m_deadToggle->move( 10, 220 );
m_db24Toggle = new ledCheckBox( "24dB/oct", this );
m_db24Toggle = new ledCheckBox( "", this );
m_db24Toggle->setWhatsThis(
tr( "303-es-que, 24dB/octave, 3 pole filter" ) );
m_db24Toggle->move( 10, 150);
@@ -840,12 +839,12 @@ lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
m_slideDecKnob = new knob( knobBright_26, this );
m_slideDecKnob->move( 210, 75 );
m_slideDecKnob->setHintText( tr( "Slide Decay:" ) + " ", "" );
m_slideDecKnob->setLabel( tr( "SLIDE"));
m_slideDecKnob->setLabel( "");
m_distKnob = new knob( knobBright_26, this );
m_distKnob->move( 210, 190 );
m_distKnob->setHintText( tr( "DIST:" ) + " ", "" );
m_distKnob->setLabel( tr( "DIST"));
m_distKnob->setLabel( tr( ""));
// Shapes

View File

@@ -231,7 +231,7 @@ private:
void recalcFilter();
int process(sampleFrame *outbuf, const Uint32 size);
int process(sampleFrame *outbuf, const int size);
friend class lb302SynthView;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View File

@@ -69,15 +69,15 @@ private:
} while( --_bytes );
return( value );
}
inline Sint32 read32LE( void )
inline int read32LE()
{
int value = readByte();
value |= readByte() << 8;
value |= readByte() << 16;
value |= readByte() << 24;
return( value );
return value;
}
inline int readVar( void )
inline int readVar()
{
int c = readByte();
int value = c & 0x7f;
@@ -103,9 +103,9 @@ private:
return( !file().atEnd() ? value : -1 );
}
inline Sint32 readID( void )
inline int readID()
{
return( read32LE() );
return read32LE();
}
inline void skip( int _bytes )
{

View File

@@ -190,7 +190,7 @@ void organicInstrument::playNote( notePlayHandle * _n,
Oscillator * oscs_l[m_numOscillators];
Oscillator * oscs_r[m_numOscillators];
for( Sint8 i = m_numOscillators - 1; i >= 0; --i )
for( int i = m_numOscillators - 1; i >= 0; --i )
{
m_osc[i]->m_phaseOffsetLeft = rand()

View File

@@ -2,7 +2,7 @@
* patman.cpp - a GUS-compatible patch instrument plugin
*
* Copyright (c) 2007-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
* Copyright (c) 2009-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2009-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -564,7 +564,7 @@ void PatmanView::openFile( void )
void PatmanView::updateFilename( void )
{
m_displayFilename = "";
Uint16 idx = m_pi->m_patchFile.length();
int idx = m_pi->m_patchFile.length();
QFontMetrics fm( pointSize<8>( font() ) );

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -64,6 +64,7 @@ PeakControllerEffect::PeakControllerEffect(
m_peakControls( this ),
m_lastSample( 0 ),
m_lastRMS( -1 ),
m_lastRMSavail(false),
m_autoController( NULL )
{
m_autoController = new PeakController( engine::getSong(), this );
@@ -83,13 +84,19 @@ PeakControllerEffect::~PeakControllerEffect()
}
}
//! returns 1.0f if val > 0.0f, -1.0 else
inline float my_sign(float val) { return -1.0f + 2.0f * (val > 0.0f); }
//! if val >= 0.0f, returns sqrtf(val), else: -sqrtf(-val)
inline float sqrt_neg(float val) {
return sqrtf(fabs(val)) * my_sign(val);
}
bool PeakControllerEffect::processAudioBuffer( sampleFrame * _buf,
const fpp_t _frames )
{
PeakControllerEffectControls & c = m_peakControls;
// This appears to be used for determining whether or not to continue processing
// audio with this effect
if( !isEnabled() || !isRunning() )
@@ -101,7 +108,12 @@ bool PeakControllerEffect::processAudioBuffer( sampleFrame * _buf,
double sum = 0;
for( int i = 0; i < _frames; ++i )
{
sum += _buf[i][0]*_buf[i][0] + _buf[i][1]*_buf[i][1];
float sign_0 = (c.m_absModel.value())
? 1.0f : my_sign(_buf[i][0]);
float sign_1 = (c.m_absModel.value())
? 1.0f : my_sign(_buf[i][1]);
sum += _buf[i][0]*_buf[i][0]*sign_0
+ _buf[i][1]*_buf[i][1]*sign_1;
}
if( c.m_muteModel.value() )
@@ -112,19 +124,22 @@ bool PeakControllerEffect::processAudioBuffer( sampleFrame * _buf,
}
}
float curRMS = sqrtf( sum / _frames );
float curRMS = sqrt_neg( sum / _frames );
const float origRMS = curRMS;
if( m_lastRMS < 0 )
if( !m_lastRMSavail )
{
m_lastRMSavail = true;
m_lastRMS = curRMS;
}
const float v = ( curRMS >= m_lastRMS ) ?
c.m_attackModel.value() :
c.m_decayModel.value();
const float a = sqrtf( sqrtf( v ) );
const float a = sqrt_neg( sqrt_neg( v ) );
curRMS = (1-a)*curRMS + a*m_lastRMS;
m_lastSample = c.m_baseModel.value() + c.m_amountModel.value()*curRMS;
const float amount = c.m_amountModel.value() * c.m_amountMultModel.value();
m_lastSample = c.m_baseModel.value() + amount*curRMS;
m_lastRMS = curRMS;
// on greater buffer sizes our LP is updated less frequently, therfore
@@ -138,6 +153,16 @@ bool PeakControllerEffect::processAudioBuffer( sampleFrame * _buf,
//checkGate( out_sum / _frames );
// finally, mute the output if wanted
// TODO: avoid clips?
if( c.m_muteOutputModel.value() )
{
for( int i = 0; i < _frames; ++i )
{
_buf[i][0] = _buf[i][1] = 0.0f;
}
}
return isRunning();
}

View File

@@ -55,6 +55,7 @@ private:
float m_lastSample;
float m_lastRMS;
bool m_lastRMSavail;
Controller * m_autoController;

View File

@@ -44,13 +44,12 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog(
pal.setBrush( backgroundRole(),
PLUGIN_NAME::getIconPixmap( "artwork" ) );
setPalette( pal );
setFixedSize( 144, 110 );
QVBoxLayout * tl = new QVBoxLayout( this );
tl->addSpacing( 25 );
tl->setContentsMargins( 5, 30, 8, 8 );
QHBoxLayout * l = new QHBoxLayout;
l->setSpacing( 4 );
m_baseKnob = new knob( knobBright_26, this );
m_baseKnob->setLabel( tr( "BASE" ) );
m_baseKnob->setModel( &_controls->m_baseModel );
@@ -61,8 +60,13 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog(
m_amountKnob->setModel( &_controls->m_amountModel );
m_amountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" );
m_amountMultKnob = new knob( knobBright_26, this );
m_amountMultKnob->setLabel( tr( "MULT" ) );
m_amountMultKnob->setModel( &_controls->m_amountMultModel );
m_amountMultKnob->setHintText( tr( "Amount Multiplicator:" ) + " ", "" );
m_attackKnob = new knob( knobBright_26, this );
m_attackKnob->setLabel( tr( "ATTACK" ) );
m_attackKnob->setLabel( tr( "ATTCK" ) );
m_attackKnob->setModel( &_controls->m_attackModel );
m_attackKnob->setHintText( tr( "Attack:" ) + " ", "" );
@@ -73,15 +77,28 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog(
l->addWidget( m_baseKnob );
l->addWidget( m_amountKnob );
l->addWidget( m_amountMultKnob );
l->addWidget( m_attackKnob );
l->addWidget( m_decayKnob );
l->addStretch(); // expand, so other widgets have minimum width
tl->addLayout( l );
m_muteLed = new ledCheckBox( "Mute", this );
QVBoxLayout * l2 = new QVBoxLayout; // = 2nd vbox
m_muteLed = new ledCheckBox( "Mute Effect", this );
m_muteLed->setModel( &_controls->m_muteModel );
tl->addSpacing( 5 );
tl->addWidget( m_muteLed );
m_absLed = new ledCheckBox( "Abs Value", this );
m_absLed->setModel( &_controls->m_absModel );
m_muteOutputLed = new ledCheckBox( "Mute Output", this );
m_muteOutputLed->setModel( &_controls->m_muteOutputModel );
l2->addWidget( m_muteLed );
l2->addWidget( m_absLed );
l2->addWidget( m_muteOutputLed );
l2->addStretch(); // expand, so other widgets have minimum height
tl->addLayout( l2 );
setLayout( tl );
}

View File

@@ -50,6 +50,10 @@ protected:
knob * m_decayKnob;
ledCheckBox * m_muteLed;
ledCheckBox * m_absLed;
knob * m_amountMultKnob;
ledCheckBox * m_muteOutputLed;
} ;

View File

@@ -39,7 +39,10 @@ PeakControllerEffectControls( PeakControllerEffect * _eff ) :
m_amountModel( 1.0, -1.0, 1.0, 0.005, this, tr( "Modulation amount" ) ),
m_attackModel( 0, 0, 0.999, 0.001, this, tr( "Attack" ) ),
m_decayModel( 0, 0, 0.999, 0.001, this, tr( "Release" ) ),
m_muteModel( false, this, tr( "Mute output" ) )
m_muteModel( false, this, tr( "Mute output" ) ),
m_absModel( true, this, tr("Abs Value") ),
m_amountMultModel( 1.0, 0, 32, 0.2, this, tr("Amount Multiplicator") ),
m_muteOutputModel( false, this, tr("Mute Output") )
{
}
@@ -54,6 +57,10 @@ void PeakControllerEffectControls::loadSettings( const QDomElement & _this )
m_attackModel.loadSettings( _this, "attack" );
m_decayModel.loadSettings( _this, "decay" );
m_absModel.loadSettings( _this, "abs" );
m_amountMultModel.loadSettings( _this, "amountmult" );
m_muteOutputModel.loadSettings( _this, "muteout" );
int effectId = _this.attribute( "effectId" ).toInt();
if( effectId > PeakController::s_lastEffectId )
{
@@ -82,6 +89,10 @@ void PeakControllerEffectControls::saveSettings( QDomDocument & _doc,
m_attackModel.saveSettings( _doc, _this, "attack" );
m_decayModel.saveSettings( _doc, _this, "decay" );
m_absModel.saveSettings( _doc, _this, "abs" );
m_amountMultModel.saveSettings( _doc, _this, "amountmult" );
m_muteOutputModel.saveSettings( _doc, _this, "muteout" );
}

View File

@@ -66,6 +66,9 @@ private:
FloatModel m_attackModel;
FloatModel m_decayModel;
BoolModel m_muteModel;
BoolModel m_absModel;
FloatModel m_amountMultModel;
BoolModel m_muteOutputModel;
friend class PeakControllerEffectControlDialog;
friend class PeakControllerEffect;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

@@ -232,7 +232,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
m_stickModel.value(),
m_vibratoFreqModel.value(),
p,
(Uint8) m_spreadModel.value(),
(uint8_t) m_spreadModel.value(),
engine::mixer()->processingSampleRate() );
}
else if( p == 9 )
@@ -245,7 +245,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
m_crossfadeModel.value(),
m_lfoSpeedModel.value(),
m_adsrModel.value(),
(Uint8) m_spreadModel.value(),
(uint8_t) m_spreadModel.value(),
engine::mixer()->processingSampleRate() );
}
else
@@ -258,7 +258,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
p - 10,
m_strikeModel.value() * 128.0,
m_velocityModel.value(),
(Uint8) m_spreadModel.value(),
(uint8_t) m_spreadModel.value(),
engine::mixer()->processingSampleRate() );
}
m.unlock();
@@ -522,7 +522,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
const StkFloat _control8,
const StkFloat _control11,
const int _control16,
const Uint8 _delay,
const uint8_t _delay,
const sample_rate_t _sample_rate )
{
try
@@ -551,7 +551,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
m_delay = new StkFloat[256];
m_delayRead = 0;
m_delayWrite = _delay;
for( Uint16 i = 0; i < 256; i++ )
for( int i = 0; i < 256; i++ )
{
m_delay[i] = 0.0;
}
@@ -569,7 +569,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
const StkFloat _control4,
const StkFloat _control11,
const StkFloat _control128,
const Uint8 _delay,
const uint8_t _delay,
const sample_rate_t _sample_rate )
{
try
@@ -596,7 +596,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
m_delay = new StkFloat[256];
m_delayRead = 0;
m_delayWrite = _delay;
for( Uint16 i = 0; i < 256; i++ )
for( int i = 0; i < 256; i++ )
{
m_delay[i] = 0.0;
}
@@ -614,7 +614,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
const int _control16,
const StkFloat _control64,
const StkFloat _control128,
const Uint8 _delay,
const uint8_t _delay,
const sample_rate_t _sample_rate )
{
try
@@ -643,7 +643,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
m_delay = new StkFloat[256];
m_delayRead = 0;
m_delayWrite = _delay;
for( Uint16 i = 0; i < 256; i++ )
for( int i = 0; i < 256; i++ )
{
m_delay[i] = 0.0;
}

View File

@@ -55,7 +55,7 @@ public:
const StkFloat _control8,
const StkFloat _control11,
const int _control16,
const Uint8 _delay,
const uint8_t _delay,
const sample_rate_t _sample_rate );
// TubeBell
@@ -67,7 +67,7 @@ public:
const StkFloat _control4,
const StkFloat _control11,
const StkFloat _control128,
const Uint8 _delay,
const uint8_t _delay,
const sample_rate_t _sample_rate );
// BandedWG
@@ -79,7 +79,7 @@ public:
const int _control16,
const StkFloat _control64,
const StkFloat _control128,
const Uint8 _delay,
const uint8_t _delay,
const sample_rate_t _sample_rate );
inline ~malletsSynth()
@@ -124,8 +124,8 @@ protected:
Instrmnt * m_voice;
StkFloat * m_delay;
Uint8 m_delayRead;
Uint8 m_delayWrite;
uint8_t m_delayRead;
uint8_t m_delayWrite;
};

View File

@@ -304,7 +304,7 @@ void TripleOscillator::playNote( notePlayHandle * _n,
Oscillator * oscs_l[NUM_OF_OSCILLATORS];
Oscillator * oscs_r[NUM_OF_OSCILLATORS];
for( Sint8 i = NUM_OF_OSCILLATORS - 1; i >= 0; --i )
for( int i = NUM_OF_OSCILLATORS - 1; i >= 0; --i )
{
// the last oscs needs no sub-oscs...

View File

@@ -6,7 +6,6 @@ LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../vst_base)
LINK_LIBRARIES(vstbase)
BUILD_PLUGIN(vestige vestige.cpp vestige.h MOCFILES vestige.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png)
SET_TARGET_PROPERTIES(vestige PROPERTIES COMPILE_FLAGS "-D_FORTIFY_SOURCE=0")
ENDIF(LMMS_SUPPORT_VST)

View File

@@ -1,7 +1,7 @@
/*
* vestige.cpp - instrument-plugin for hosting VST-instruments
*
* Copyright (c) 2005-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -135,8 +135,7 @@ void vestigeInstrument::loadSettings( const QDomElement & _this )
knobFModel[i] = new FloatModel( 0.0f, 0.0f, 1.0f, 0.01f, this, QString::number(i) );
knobFModel[i]->loadSettings( _this, paramStr );
if( !( knobFModel[ i ]->isAutomated() ||
knobFModel[ i ]->getControllerConnection() ) )
if( !( knobFModel[ i ]->isAutomated() || knobFModel[ i ]->controllerConnection() ) )
{
knobFModel[ i ]->setValue( ( s_dumpValues.at( 2 )).toFloat() );
knobFModel[ i ]->setInitValue( ( s_dumpValues.at( 2 )).toFloat() );
@@ -190,7 +189,7 @@ void vestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
char paramStr[35];
for( int i = 0; i < paramCount; i++ )
{
if (knobFModel[i]->isAutomated() || knobFModel[i]->getControllerConnection()) {
if (knobFModel[i]->isAutomated() || knobFModel[i]->controllerConnection()) {
sprintf( paramStr, "param%d", i);
knobFModel[i]->saveSettings( _doc, _this, paramStr );
}
@@ -200,7 +199,7 @@ void vestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
me.setAttribute( "value", knobFModel[i]->value() );
_this.appendChild( me );
ControllerConnection * m_controllerConnection = knobFModel[i]->getControllerConnection();
ControllerConnection * m_controllerConnection = knobFModel[i]->controllerConnection();
if (m_controllerConnection) {
QDomElement controller_element;
QDomNode node = _this.namedItem( "connection" );
@@ -1016,8 +1015,7 @@ void manageVestigeInstrumentView::syncPlugin( void )
{
// only not automated knobs are synced from VST
// those auto-setted values are not jurnaled, tracked for undo / redo
if( !( m_vi->knobFModel[ i ]->isAutomated() ||
m_vi->knobFModel[ i ]->getControllerConnection() ) )
if( !( m_vi->knobFModel[ i ]->isAutomated() || m_vi->knobFModel[ i ]->controllerConnection() ) )
{
sprintf( paramStr, "param%d", i );
s_dumpValues = dump[ paramStr ].split( ":" );
@@ -1038,8 +1036,7 @@ void manageVestigeInstrumentView::displayAutomatedOnly( void )
for( int i = 0; i< m_vi->paramCount; i++ )
{
if( !( m_vi->knobFModel[ i ]->isAutomated() ||
m_vi->knobFModel[ i ]->getControllerConnection() ) )
if( !( m_vi->knobFModel[ i ]->isAutomated() || m_vi->knobFModel[ i ]->controllerConnection() ) )
{
if( m_vi->vstKnobs[ i ]->isVisible() == true && isAuto )
{

View File

@@ -50,8 +50,8 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
QPixmap _button7_off,
QPixmap _button8_on,
QPixmap _button8_off,
Uint8 _default,
Uint32 _x, Uint32 _y,
int _default,
int _x, int _y,
QWidget * _parent ):
QWidget( _parent ),
IntModelView( new nineButtonSelectorModel(0, 8, _default, NULL,
@@ -148,7 +148,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
nineButtonSelector::~ nineButtonSelector()
{
for( Uint8 i = 0; i < 9; i++ )
for( int i = 0; i < 9; i++ )
{
delete m_buttons[i];
}
@@ -231,13 +231,13 @@ void nineButtonSelector::modelChanged()
updateButton( model()->value() );
}
void nineButtonSelector::setSelected( Uint8 _new_button )
void nineButtonSelector::setSelected( int _new_button )
{
model()->setValue(_new_button);
updateButton( _new_button );
}
void nineButtonSelector::updateButton( Uint8 _new_button )
void nineButtonSelector::updateButton( int _new_button )
{
m_lastBtn->setChecked( false );
m_lastBtn->update();

View File

@@ -51,17 +51,17 @@ public:
QPixmap _button7_off,
QPixmap _button8_on,
QPixmap _button8_off,
Uint8 _default,
Uint32 _x, Uint32 _y,
int _default,
int _x, int _y,
QWidget * _parent);
virtual ~nineButtonSelector();
// inline Uint8 getSelected() {
// inline int getSelected() {
// return( castModel<nineButtonSelectorModel>()->value() );
// };
protected:
void setSelected( Uint8 _new_button );
void setSelected( int _new_button );
public slots:
void button0Clicked();
@@ -77,11 +77,11 @@ public slots:
void displayHelp();
signals:
void nineButtonSelection( Uint8 );
void nineButtonSelection( int );
private:
virtual void modelChanged();
void updateButton( Uint8 );
void updateButton( int );
QList<pixmapButton *> m_buttons;
pixmapButton * m_button;

View File

@@ -27,13 +27,13 @@
stringContainer::stringContainer(const float _pitch,
const sample_rate_t _sample_rate,
const Uint32 _buffer_length,
const Uint8 _strings ) :
const int _buffer_length,
const int _strings ) :
m_pitch( _pitch ),
m_sampleRate( _sample_rate ),
m_bufferLength( _buffer_length )
{
for( Uint8 i = 0; i < _strings; i++ )
for( int i = 0; i < _strings; i++ )
{
m_exists.append( false );
}
@@ -42,16 +42,16 @@ stringContainer::stringContainer(const float _pitch,
void stringContainer::addString(Uint8 _harm,
void stringContainer::addString(int _harm,
const float _pick,
const float _pickup,
const float * _impulse,
const float _randomize,
const float _string_loss,
const float _detune,
const Uint8 _oversample,
const int _oversample,
const bool _state,
const Uint8 _id )
const int _id )
{
float harm;
switch( _harm )

View File

@@ -35,44 +35,44 @@ class stringContainer
public:
stringContainer(const float _pitch,
const sample_rate_t _sample_rate,
const Uint32 _buffer_length,
const Uint8 _strings = 9 );
const int _buffer_length,
const int _strings = 9 );
void addString( Uint8 _harm,
void addString( int _harm,
const float _pick,
const float _pickup,
const float * _impluse,
const float _randomize,
const float _string_loss,
const float _detune,
const Uint8 _oversample,
const int _oversample,
const bool _state,
const Uint8 _id );
const int _id );
inline bool exists( Uint8 _id )
bool exists( int _id ) const
{
return( m_exists[_id] );
return m_exists[_id];
}
inline ~stringContainer()
~stringContainer()
{
Uint32 strings = m_strings.count();
for( Uint32 i = 0; i < strings; i++ )
int strings = m_strings.count();
for( int i = 0; i < strings; i++ )
{
delete m_strings[i];
}
}
inline float getStringSample( Uint8 _string )
float getStringSample( int _string )
{
return( m_strings[_string]->nextSample() );
return m_strings[_string]->nextSample();
}
private:
QVector<vibratingString *> m_strings;
const float m_pitch;
const sample_rate_t m_sampleRate;
const Uint32 m_bufferLength;
const int m_bufferLength;
QVector<bool> m_exists;
} ;

View File

@@ -71,7 +71,7 @@ vibed::vibed( InstrumentTrack * _instrumentTrack ) :
nineButtonSelectorModel * harmonic;
graphModel * graphTmp;
for( Uint8 harm = 0; harm < 9; harm++ )
for( int harm = 0; harm < 9; harm++ )
{
knob = new FloatModel( DefaultVolume, MinVolume, MaxVolume,
1.0f, this, tr( "String %1 volume" ).arg( harm+1 ) );
@@ -142,7 +142,7 @@ void vibed::saveSettings( QDomDocument & _doc, QDomElement & _this )
// Save plugin version
_this.setAttribute( "version", "0.1" );
for( Uint8 i = 0; i < 9; i++ )
for( int i = 0; i < 9; i++ )
{
name = "active" + QString::number( i );
_this.setAttribute( name, QString::number(
@@ -199,7 +199,7 @@ void vibed::loadSettings( const QDomElement & _this )
QString name;
for( Uint8 i = 0; i < 9; i++ )
for( int i = 0; i < 9; i++ )
{
name = "active" + QString::number( i );
m_powerButtons[i]->setValue( _this.attribute( name ).toInt() );
@@ -280,7 +280,7 @@ void vibed::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
engine::mixer()->processingSampleRate(),
__sampleLength );
for( Uint8 i = 0; i < 9; ++i )
for( int i = 0; i < 9; ++i )
{
if( m_powerButtons[i]->value() )
{
@@ -309,18 +309,14 @@ void vibed::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
{
_working_buffer[i][0] = 0.0f;
_working_buffer[i][1] = 0.0f;
Uint8 s = 0;
for( Uint8 string = 0; string < 9; ++string )
int s = 0;
for( int string = 0; string < 9; ++string )
{
if( ps->exists( string ) )
{
// pan: 0 -> left, 1 -> right
const float pan = (
m_panKnobs[string]->value() + 1 ) /
2.0f;
const sample_t sample =
ps->getStringSample( s ) *
m_volumeKnobs[string]->value() / 100.0f;
const float pan = ( m_panKnobs[string]->value() + 1 ) / 2.0f;
const sample_t sample = ps->getStringSample( s ) * m_volumeKnobs[string]->value() / 100.0f;
_working_buffer[i][0] += ( 1.0f - pan ) * sample;
_working_buffer[i][1] += pan * sample;
s++;
@@ -547,8 +543,8 @@ vibedView::vibedView( Instrument * _instrument,
"vibrating strings. The LED in the lower right corner of the "
"waveform editor indicates whether the selected string is active." ) );
connect( m_stringSelector, SIGNAL( nineButtonSelection( Uint8 ) ),
this, SLOT( showString( Uint8 ) ) );
connect( m_stringSelector, SIGNAL( nineButtonSelection( int ) ),
this, SLOT( showString( int ) ) );
showString( 0 );
@@ -668,7 +664,7 @@ void vibedView::modelChanged()
void vibedView::showString( Uint8 _string )
void vibedView::showString( int _string )
{
vibed * v = castModel<vibed>();

View File

@@ -90,7 +90,7 @@ public:
virtual ~vibedView() {};
public slots:
void showString( Uint8 _string );
void showString( int _string );
void contextMenuEvent( QContextMenuEvent * );
void displayHelp();

View File

@@ -34,9 +34,9 @@ vibratingString::vibratingString( float _pitch,
float _pick,
float _pickup,
float * _impulse,
Uint32 _len,
int _len,
sample_rate_t _sample_rate,
Uint8 _oversample,
int _oversample,
float _randomize,
float _string_loss,
float _detune,
@@ -64,7 +64,7 @@ vibratingString::vibratingString( float _pitch,
else
{
m_impulse = new float[_len];
for( Uint32 i = 0; i < _len; i++ )
for( int i = 0; i < _len; i++ )
{
m_impulse[i] = _impulse[i];
}

View File

@@ -37,9 +37,9 @@ public:
float _pick,
float _pickup,
float * impluse,
Uint32 _len,
int _len,
sample_rate_t _sample_rate,
Uint8 _oversample,
int _oversample,
float _randomize,
float _string_loss,
float _detune,
@@ -57,7 +57,7 @@ public:
{
sample_t ym0;
sample_t ypM;
for( Uint8 i = 0; i < m_oversample; i++)
for( int i = 0; i < m_oversample; i++)
{
// Output at pickup position
m_outsamp[i] = fromBridgeAccess( m_fromBridge,
@@ -94,7 +94,7 @@ private:
delayLine * m_fromBridge;
delayLine * m_toBridge;
int m_pickupLoc;
Uint8 m_oversample;
int m_oversample;
float m_randomize;
float m_stringLoss;

View File

@@ -24,7 +24,14 @@ IF(LMMS_BUILD_LINUX AND NOT WANT_VST_NOWINE)
IF(LMMS_HOST_X86_64)
SET(EXTRA_FLAGS -m32)
# workaround for broken wineg++ in WINE 1.4 (shipped e.g. with Ubuntu Precise)
EXEC_PROGRAM( wineg++ ARGS "-v -m32 /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT)
if("${WINEBUILD_OUTPUT}" MATCHES ".*x86_64-linux-gnu/wine/libwinecrt0.a.*")
SET(EXTRA_FLAGS ${EXTRA_FLAGS} -nodefaultlibs /usr/lib/i386-linux-gnu/wine/libwinecrt0.a -luser32 -lkernel32 -lgdi32)
ENDIF()
ENDIF(LMMS_HOST_X86_64)
ADD_CUSTOM_COMMAND(
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp
COMMAND wineg++

View File

@@ -1,7 +1,7 @@
/*
* RemoteVstPlugin.cpp - LMMS VST Support Layer (RemotePlugin client)
*
* Copyright (c) 2005-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -297,7 +297,7 @@ private:
AEffect * m_plugin;
HWND m_window;
Sint32 m_windowID;
intptr_t m_windowID;
int m_windowWidth;
int m_windowHeight;
@@ -689,7 +689,7 @@ void RemoteVstPlugin::initEditor()
UpdateWindow( m_window );
#ifdef LMMS_BUILD_LINUX
m_windowID = (Sint32) GetProp( m_window, "__wine_x11_whole_window" );
m_windowID = (intptr_t) GetProp( m_window, "__wine_x11_whole_window" );
#endif
}

View File

@@ -1,7 +1,7 @@
/*
* VstPlugin.h - declaration of VstPlugin class
*
* Copyright (c) 2005-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -61,7 +61,7 @@ public:
return m_name;
}
inline Sint32 version() const
inline int version() const
{
return m_version;
}
@@ -137,7 +137,7 @@ private:
bool m_badDllFormat;
QString m_name;
Sint32 m_version;
int m_version;
QString m_vendorString;
QString m_productString;
QString m_currentProgramName;

View File

@@ -1,7 +1,7 @@
/*
* VstEffectControls.cpp - controls for VST effect plugins
*
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -88,7 +88,7 @@ void VstEffectControls::loadSettings( const QDomElement & _this )
knobFModel[i]->loadSettings( _this, paramStr );
if( !( knobFModel[ i ]->isAutomated() ||
knobFModel[ i ]->getControllerConnection() ) )
knobFModel[ i ]->controllerConnection() ) )
{
knobFModel[ i ]->setValue( (s_dumpValues.at( 2 ) ).toFloat() );
knobFModel[ i ]->setInitValue( (s_dumpValues.at( 2 ) ).toFloat() );
@@ -133,7 +133,7 @@ void VstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this )
char paramStr[35];
for( int i = 0; i < paramCount; i++ )
{
if (knobFModel[i]->isAutomated() || knobFModel[i]->getControllerConnection()) {
if (knobFModel[i]->isAutomated() || knobFModel[i]->controllerConnection()) {
sprintf( paramStr, "param%d", i);
knobFModel[i]->saveSettings( _doc, _this, paramStr );
}
@@ -443,7 +443,7 @@ void manageVSTEffectView::syncPlugin( void )
// only not automated knobs are synced from VST
// those auto-setted values are not jurnaled, tracked for undo / redo
if( !( m_vi2->knobFModel[ i ]->isAutomated() ||
m_vi2->knobFModel[ i ]->getControllerConnection() ) )
m_vi2->knobFModel[ i ]->controllerConnection() ) )
{
sprintf( paramStr, "param%d", i );
s_dumpValues = dump[ paramStr ].split( ":" );
@@ -464,7 +464,7 @@ void manageVSTEffectView::displayAutomatedOnly( void )
{
if( !( m_vi2->knobFModel[ i ]->isAutomated() ||
m_vi2->knobFModel[ i ]->getControllerConnection() ) )
m_vi2->knobFModel[ i ]->controllerConnection() ) )
{
if( m_vi2->vstKnobs[ i ]->isVisible() == true && isAuto )
{

View File

@@ -108,7 +108,8 @@ ENDIF(LMMS_BUILD_WIN32)
# FLTK needs X
IF(LMMS_BUILD_LINUX)
FIND_PACKAGE(X11)
FIND_PACKAGE(X11 REQUIRED)
SET(FREETYPE_INCLUDE_DIRS foo) # fix broken FindFreetype.cmake in older versions of FreeType2
FIND_PACKAGE(Freetype REQUIRED)
TARGET_LINK_LIBRARIES(RemoteZynAddSubFx -ldl ${X11_LIBRARIES} ${X11_Xft_LIB} ${X11_Xinerama_LIB} ${FREETYPE_LIBRARY} -lfontconfig)
ENDIF(LMMS_BUILD_LINUX)
@@ -126,6 +127,10 @@ ELSEIF(LMMS_BUILD_WIN32)
SET(FLTK_EXTRA_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/modules/Win32Toolchain.cmake")
ENDIF(LMMS_BUILD_WIN64)
IF(NOT FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR_ft2build}/freetype2)
ENDIF()
ADD_CUSTOM_TARGET(libfltk COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/fltk && cd ${CMAKE_CURRENT_BINARY_DIR}/fltk && ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/fltk ${FLTK_EXTRA_FLAGS} -DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/cmake/modules/ -DFLTK_USE_SYSTEM_ZLIB:BOOL=ON -DFLTK_USE_SYSTEM_JPEG:BOOL=ON -DFLTK_USE_SYSTEM_PNG:BOOL=ON -DOPTION_BUILD_EXAMPLES:BOOL=OFF -DCMAKE_BUILD_TYPE=release -DFREETYPE_PATH="${FREETYPE_INCLUDE_DIR_freetype2}\;${FREETYPE_INCLUDE_DIR_ft2build}" && ${CMAKE_BUILD_TOOL})
ADD_DEPENDENCIES(RemoteZynAddSubFx libfltk)