Fixed problem with adding strings to vibed plugin while playing
Modified Files: plugins/vibed/impulse_editor.cpp plugins/vibed/impulse_editor.h plugins/vibed/string_container.cpp plugins/vibed/string_container.h plugins/vibed/vibed.cpp plugins/vibed/vibed.h git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@120 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
11
ChangeLog
11
ChangeLog
@@ -1,3 +1,14 @@
|
||||
2006-04-05 Danny McRae <khjklujn/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/vibed/impulse_editor.cpp:
|
||||
- corrected mismatch sin/saw mismatch in initialization
|
||||
|
||||
* plugins/vibed/string_container.h:
|
||||
* plugins/vibed/string_container.cpp:
|
||||
* plugins/vibed/vibed.h:
|
||||
* plugins/vibed/vibed.cpp:
|
||||
- added string id tracking to allow adding strings while playing
|
||||
|
||||
2006-04-05 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* include/plugin_browser.h:
|
||||
|
||||
@@ -188,7 +188,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y,
|
||||
m_graph->setSamplePointer( m_sampleShape, m_sampleLength );
|
||||
|
||||
m_lastBtn = m_sinWaveBtn;
|
||||
emit( sawWaveClicked() );
|
||||
emit( sinWaveClicked() );
|
||||
|
||||
move( _x, _y );
|
||||
|
||||
@@ -298,7 +298,7 @@ void impulseEditor::noiseWaveClicked( void )
|
||||
|
||||
void impulseEditor::usrWaveClicked( void )
|
||||
{
|
||||
m_lastBtn->setChecked( FALSE);
|
||||
m_lastBtn->setChecked( FALSE );
|
||||
m_lastBtn = m_usrWaveBtn;
|
||||
m_lastBtn->setChecked( TRUE );
|
||||
// zero sample_shape
|
||||
|
||||
@@ -57,6 +57,7 @@ public:
|
||||
|
||||
inline float * getValues() { return( m_sampleShape ); };
|
||||
inline bool isOn() { return( m_state->isChecked() ); };
|
||||
|
||||
void FASTCALL setValues( float * _shape );
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -27,11 +27,16 @@
|
||||
|
||||
stringContainer::stringContainer(const float _pitch,
|
||||
const sample_rate_t _sample_rate,
|
||||
const Uint32 _buffer_length ) :
|
||||
const Uint32 _buffer_length,
|
||||
const Uint8 _strings ) :
|
||||
m_pitch( _pitch ),
|
||||
m_sampleRate( _sample_rate ),
|
||||
m_bufferLength( _buffer_length )
|
||||
{
|
||||
for( Uint8 i = 0; i < _strings; i++ )
|
||||
{
|
||||
m_exists.append( FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +50,8 @@ void stringContainer::addString(Uint8 _harm,
|
||||
const float _string_loss,
|
||||
const float _detune,
|
||||
const Uint8 _oversample,
|
||||
const bool _state )
|
||||
const bool _state,
|
||||
const Uint8 _id )
|
||||
{
|
||||
float harm;
|
||||
switch( _harm )
|
||||
@@ -92,4 +98,5 @@ void stringContainer::addString(Uint8 _harm,
|
||||
_string_loss,
|
||||
_detune,
|
||||
_state ) );
|
||||
m_exists[_id] = TRUE;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,8 @@ class stringContainer
|
||||
public:
|
||||
stringContainer(const float _pitch,
|
||||
const sample_rate_t _sample_rate,
|
||||
const Uint32 _buffer_length );
|
||||
const Uint32 _buffer_length,
|
||||
const Uint8 _strings = 9 );
|
||||
|
||||
void addString( Uint8 _harm,
|
||||
const float _pick,
|
||||
@@ -49,7 +50,13 @@ public:
|
||||
const float _string_loss,
|
||||
const float _detune,
|
||||
const Uint8 _oversample,
|
||||
const bool _state );
|
||||
const bool _state,
|
||||
const Uint8 _id );
|
||||
|
||||
inline bool exists( Uint8 _id )
|
||||
{
|
||||
return( m_exists[_id] );
|
||||
}
|
||||
|
||||
inline ~stringContainer()
|
||||
{
|
||||
@@ -70,6 +77,7 @@ private:
|
||||
const float m_pitch;
|
||||
const sample_rate_t m_sampleRate;
|
||||
const Uint32 m_bufferLength;
|
||||
vvector<bool> m_exists;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -589,7 +589,8 @@ void vibed::playNote( notePlayHandle * _n )
|
||||
m_detuneKnobs[i]->value(),
|
||||
static_cast<int>(
|
||||
m_lengthKnobs[i]->value() ),
|
||||
m_impulses[i]->isChecked() );
|
||||
m_impulses[i]->isChecked(),
|
||||
i );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -612,7 +613,7 @@ void vibed::playNote( notePlayHandle * _n )
|
||||
s = 0;
|
||||
for( Uint8 string = 0; string < 9; string ++ )
|
||||
{
|
||||
if( m_editors[string]->isOn() )
|
||||
if( ps->exists( string ) )
|
||||
{
|
||||
vol = m_volumeKnobs[string]->value();
|
||||
pan = (
|
||||
|
||||
@@ -93,7 +93,6 @@ private:
|
||||
sampleBuffer * m_sampleBuffer;
|
||||
|
||||
int m_sampleLength;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user