Replaced [S/U]int[8/16/32] with types from stdint.h or plain integers
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -231,7 +231,7 @@ private:
|
||||
|
||||
void recalcFilter();
|
||||
|
||||
int process(sampleFrame *outbuf, const Uint32 size);
|
||||
int process(sampleFrame *outbuf, const int size);
|
||||
|
||||
friend class lb302SynthView;
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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() ) );
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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...
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -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>();
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
virtual ~vibedView() {};
|
||||
|
||||
public slots:
|
||||
void showString( Uint8 _string );
|
||||
void showString( int _string );
|
||||
void contextMenuEvent( QContextMenuEvent * );
|
||||
void displayHelp();
|
||||
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user