bugfixes and improvements

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@440 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2006-12-18 16:05:08 +00:00
parent 64aa78c4f6
commit f7009c3afd
12 changed files with 190 additions and 65 deletions

View File

@@ -46,6 +46,7 @@ instrument::instrument( instrumentTrack * _instrument_track,
instrument::~instrument()
{
invalidate();
}

View File

@@ -295,23 +295,18 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
idx = 0;
while( idx < m_playHandles.size() )
{
playHandle * n =m_playHandles[idx];
if( n->supportsParallelizing() )
{
++idx;
continue;
}
else if( n->done() )
playHandle * n = m_playHandles[idx];
if( n->done() )
{
delete n;
m_playHandles.erase(
m_playHandles.begin() + idx );
}
else
else if( !n->supportsParallelizing() )
{
n->play();
++idx;
}
++idx;
}
for( playHandleVector::iterator it = par_hndls.begin();
it != par_hndls.end(); ++it )

View File

@@ -115,7 +115,7 @@ void oscillator::updatePM( sampleFrame * _ab, const fpab_t _frames,
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
float osc_coeff = *m_freq * *m_detuning;
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
@@ -132,7 +132,7 @@ void oscillator::updateAM( sampleFrame * _ab, const fpab_t _frames,
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
float osc_coeff = *m_freq * *m_detuning;
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
@@ -148,7 +148,7 @@ void oscillator::updateMix( sampleFrame * _ab, const fpab_t _frames,
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
float osc_coeff = *m_freq * *m_detuning;
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{
@@ -163,9 +163,9 @@ void oscillator::updateMix( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateSync( sampleFrame * _ab, const fpab_t _frames,
const ch_cnt_t _chnl )
{
float sub_osc_coeff = m_subOsc->syncInit( _ab, _frames, _chnl );
const float sub_osc_coeff = m_subOsc->syncInit( _ab, _frames, _chnl );
recalcPhase();
float osc_coeff = *m_freq * *m_detuning;
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames ; ++frame )
{
@@ -187,7 +187,7 @@ void oscillator::updateFM( sampleFrame * _ab, const fpab_t _frames,
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
float osc_coeff = *m_freq * *m_detuning;
const float osc_coeff = *m_freq * *m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
{

View File

@@ -134,7 +134,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
#endif
{
m_notesMutex.lock();
for( int i = 0; i < NOTES_PER_OCTAVE * OCTAVES; ++i )
for( int i = 0; i < NOTES; ++i )
{
m_notes[i] = NULL;
}
@@ -899,7 +899,8 @@ int instrumentTrack::masterKey( notePlayHandle * _n ) const
{
int key = baseTone() + baseOctave() * NOTES_PER_OCTAVE +
eng()->getSongEditor()->masterPitch();
return( _n->key() - ( key - A - DEFAULT_OCTAVE * NOTES_PER_OCTAVE ) );
return( tLimit<int>( _n->key() -
( key - A - DEFAULT_OCTAVE * NOTES_PER_OCTAVE ), 0, NOTES ) );
}
@@ -1288,7 +1289,7 @@ void instrumentTrack::invalidateAllMyNPH( void )
m_trackType = NULL_TRACK;
m_notesMutex.lock();
for( int i = 0; i < NOTES_PER_OCTAVE * OCTAVES; ++i )
for( int i = 0; i < NOTES; ++i )
{
m_notes[i] = NULL;
}