removed buggy and obsolete support for monophonic instruments
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1290 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -85,12 +85,6 @@ public:
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
// TO BE REMOVED
|
||||
virtual bool isMonophonic( void ) const
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
// instrument-play-handle-based instruments should return FALSE
|
||||
inline virtual bool notePlayHandleBased( void ) const
|
||||
{
|
||||
|
||||
@@ -70,8 +70,7 @@ public:
|
||||
notePlayHandle * _n );
|
||||
|
||||
virtual void processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time,
|
||||
bool _lock = TRUE );
|
||||
const midiTime & _time );
|
||||
virtual void processOutEvent( const midiEvent & _me,
|
||||
const midiTime & _time );
|
||||
|
||||
|
||||
@@ -51,8 +51,7 @@ public:
|
||||
|
||||
|
||||
virtual void processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time,
|
||||
bool _lock = TRUE );
|
||||
const midiTime & _time );
|
||||
|
||||
virtual void processOutEvent( const midiEvent& _me,
|
||||
const midiTime & _time)
|
||||
|
||||
@@ -44,8 +44,7 @@ public:
|
||||
|
||||
// to be implemented by inheriting classes
|
||||
virtual void processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time,
|
||||
bool _lock = TRUE ) = 0;
|
||||
const midiTime & _time ) = 0;
|
||||
virtual void processOutEvent( const midiEvent & _me,
|
||||
const midiTime & _time ) = 0;
|
||||
|
||||
|
||||
@@ -111,9 +111,9 @@ public:
|
||||
}
|
||||
|
||||
void subscribeReadablePort( const QString & _port,
|
||||
bool _subscribe = TRUE );
|
||||
bool _subscribe = TRUE );
|
||||
void subscribeWriteablePort( const QString & _port,
|
||||
bool _subscribe = TRUE );
|
||||
bool _subscribe = TRUE );
|
||||
|
||||
const map & readablePorts( void ) const
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ void midiController::updateName( void )
|
||||
|
||||
|
||||
void midiController::processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time, bool _lock )
|
||||
const midiTime & _time )
|
||||
{
|
||||
Uint8 controllerNum;
|
||||
const Uint8 * bytes;
|
||||
|
||||
@@ -260,10 +260,6 @@ void notePlayHandle::play( bool _try_parallelizing,
|
||||
|
||||
f_cnt_t notePlayHandle::framesLeft( void ) const
|
||||
{
|
||||
/* const instrument * i = ( m_instrumentTrack != NULL ) ?
|
||||
m_instrumentTrack->getInstrument() : NULL;
|
||||
f_cnt_t rftd = ( i != NULL && i->isMonophonic() ) ?
|
||||
0 : actualReleaseFramesToDo();*/
|
||||
if( m_released && actualReleaseFramesToDo() == 0 )
|
||||
{
|
||||
return( m_framesBeforeRelease );
|
||||
|
||||
@@ -207,7 +207,7 @@ void instrumentTrack::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
|
||||
void instrumentTrack::processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time, bool _lock )
|
||||
const midiTime & _time )
|
||||
{
|
||||
switch( _me.m_type )
|
||||
{
|
||||
@@ -246,10 +246,6 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
|
||||
|
||||
case MidiNoteOff:
|
||||
{
|
||||
if( _lock ) // TO BE REMOVED
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
}
|
||||
notePlayHandle * n = m_notes[_me.key()];
|
||||
if( n != NULL )
|
||||
{
|
||||
@@ -270,10 +266,6 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
|
||||
|
||||
emit noteDone( done_note );
|
||||
}
|
||||
if( _lock ) // TO BE REMOVED
|
||||
{
|
||||
engine::getMixer()->unlock();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -360,60 +352,6 @@ void instrumentTrack::playNote( notePlayHandle * _n, bool _try_parallelizing,
|
||||
|
||||
if( _n->arpBaseNote() == FALSE && m_instrument != NULL )
|
||||
{
|
||||
// TO BE REMOVED
|
||||
if( m_instrument->isMonophonic() )
|
||||
{
|
||||
constNotePlayHandleVector v =
|
||||
notePlayHandle::nphsOfInstrumentTrack( this,
|
||||
TRUE );
|
||||
if( v.size() > 1 )
|
||||
{
|
||||
constNotePlayHandleVector::iterator
|
||||
youngest_note = v.begin();
|
||||
for( constNotePlayHandleVector::iterator it =
|
||||
v.begin(); it != v.end(); ++it )
|
||||
{
|
||||
if( !( *it )->arpBaseNote() &&
|
||||
( *it )->totalFramesPlayed() <=
|
||||
( *youngest_note )->
|
||||
totalFramesPlayed() )
|
||||
{
|
||||
youngest_note = it;
|
||||
}
|
||||
}
|
||||
if( *youngest_note != _n &&
|
||||
!( *youngest_note )->arpBaseNote() &&
|
||||
!_n->released() )
|
||||
{
|
||||
processInEvent(midiEvent(
|
||||
MidiNoteOff, 0,
|
||||
_n->key(), 0 ), midiTime(),
|
||||
FALSE );
|
||||
if( ( *youngest_note )->offset() >
|
||||
_n->offset() )
|
||||
{
|
||||
_n->noteOff( ( *youngest_note )->
|
||||
offset() -
|
||||
_n->offset() );
|
||||
}
|
||||
else
|
||||
{
|
||||
// for the case the youngest
|
||||
// note has an offset smaller
|
||||
// then the current note we
|
||||
// already played everything
|
||||
// in last period and have
|
||||
// to clear parts of it
|
||||
_n->noteOff();
|
||||
engine::getMixer()->clearAudioBuffer( m_audioPort.firstBuffer(),
|
||||
engine::getMixer()->framesPerPeriod() -
|
||||
( *youngest_note )->offset(),
|
||||
( *youngest_note )->offset() );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// all is done, so now lets play the note!
|
||||
m_instrument->playNote( _n, _try_parallelizing,
|
||||
_working_buffer );
|
||||
|
||||
Reference in New Issue
Block a user