removed obsolete instrument-parallelization support as this is handled much better by worker threads and adds unneccessary complexity

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1718 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-09-30 11:14:32 +00:00
parent 396dbbc1b3
commit adf8aed93c
51 changed files with 219 additions and 277 deletions

View File

@@ -56,12 +56,10 @@ public:
// if the plugin doesn't play each note, it can create an instrument-
// play-handle and re-implement this method, so that it mixes its
// output buffer only once per mixer-period
virtual void play( bool _try_parallelizing,
sampleFrame * _working_buffer );
virtual void play( sampleFrame * _working_buffer );
// to be implemented by actual plugin
virtual void playNote( notePlayHandle * _note_to_play,
bool _try_parallelizing,
sampleFrame * _working_buf )
{
}

View File

@@ -1,7 +1,7 @@
/*
* instrument_play_handle.h - play-handle for playing an instrument
*
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -33,41 +33,30 @@
class instrumentPlayHandle : public playHandle
{
public:
inline instrumentPlayHandle( instrument * _instrument ) :
instrumentPlayHandle( instrument * _instrument ) :
playHandle( InstrumentPlayHandle ),
m_instrument( _instrument )
{
}
inline virtual ~instrumentPlayHandle()
virtual ~instrumentPlayHandle()
{
}
inline virtual void play( bool _try_parallelizing,
sampleFrame * _working_buffer )
virtual void play( sampleFrame * _working_buffer )
{
m_instrument->play( _try_parallelizing, _working_buffer );
m_instrument->play( _working_buffer );
}
inline virtual bool done( void ) const
virtual bool done( void ) const
{
return( FALSE );
return false;
}
virtual bool isFromTrack( const track * _track ) const
{
return( m_instrument->isFromTrack( _track ) );
}
inline virtual bool supportsParallelizing( void ) const
{
return( m_instrument->supportsParallelizing() );
}
inline virtual void waitForWorkerThread( void )
{
m_instrument->waitForWorkerThread();
return m_instrument->isFromTrack( _track );
}

View File

@@ -83,8 +83,7 @@ public:
// for capturing note-play-events -> need that for arpeggio,
// filter and so on
void playNote( notePlayHandle * _n, bool _try_parallelizing,
sampleFrame * _working_buffer );
void playNote( notePlayHandle * _n, sampleFrame * _working_buffer );
QString instrumentName( void ) const;
inline const instrument * getInstrument( void ) const

View File

@@ -72,8 +72,7 @@ public:
return( m_unpitchedFrequency );
}
virtual void play( bool _try_parallelizing,
sampleFrame * _working_buffer );
virtual void play( sampleFrame * _working_buffer );
virtual inline bool done( void ) const
{
@@ -237,27 +236,6 @@ public:
m_bbTrack = _bb_track;
}
virtual bool supportsParallelizing( void ) const
{
return( m_instrumentTrack->getInstrument()->
supportsParallelizing()
&&
// we must not parallelize note-play-handles, which
// belong to instruments that are instrument-play-
// handle-driven (i.e. react to MIDI events),
// because then waitForWorkerThread()
// would be additionally called for each
// note-play-handle which results in hangups
m_instrumentTrack->getInstrument()->
isMidiBased() );
}
virtual void waitForWorkerThread( void )
{
m_instrumentTrack->m_instrument->waitForWorkerThread();
}
void processMidiTime( const midiTime & _time );
void resize( const bpm_t _new_tempo );

View File

@@ -1,6 +1,5 @@
/*
* play_handle.h - base-class playHandle which is needed by
* LMMS-Player-Engine
* play_handle.h - base-class playHandle - core of rendering engine
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -64,23 +63,22 @@ public:
const QThread * affinity( void ) const
{
return( m_affinity );
return m_affinity;
}
inline types type( void ) const
{
return( m_type );
return m_type;
}
virtual void play( bool _try_parallelizing,
sampleFrame * _working_buffer ) = 0;
virtual void play( sampleFrame * _working_buffer ) = 0;
virtual bool done( void ) const = 0;
// returns how many frames this play-handle is aligned ahead, i.e.
// at which position it is inserted in the according buffer
inline f_cnt_t offset( void ) const
{
return ( m_offset );
return m_offset;
}
inline void setOffset( f_cnt_t _offset )
@@ -91,15 +89,6 @@ public:
virtual bool isFromTrack( const track * _track ) const = 0;
virtual bool supportsParallelizing( void ) const
{
return( FALSE );
}
virtual void waitForWorkerThread( void )
{
}
private:
types m_type;

View File

@@ -182,19 +182,6 @@ public:
model * _parent,
void * _data );
// some plugins run external programs for doing their actual work
// (e.g. LVSL-server) or can run in separate worker-threads, so the
// mixer can schedule processing for parallelizing work which is very
// important for at least trying to use the full power of SMP-systems,
// otherwise the mixer will create according threads on it's own which
// of course isn't that efficient
virtual bool supportsParallelizing( void ) const;
// plugins supporting parallelization, should re-implement that as the
// mixer will call this at the end of processing according chain
// of plugins
virtual void waitForWorkerThread( void );
// fills given vector with descriptors of all available plugins
static void getDescriptorsOfAvailPlugins(
QVector<descriptor> & _plugin_descs );

View File

@@ -41,8 +41,7 @@ public:
bool _load_by_plugin = false );
virtual ~presetPreviewPlayHandle();
virtual void play( bool _try_parallelizing,
sampleFrame * _working_buffer );
virtual void play( sampleFrame * _working_buffer );
virtual bool done( void ) const;
virtual bool isFromTrack( const track * _track ) const;

View File

@@ -610,9 +610,7 @@ public:
virtual bool processMessage( const message & _m );
bool process( const sampleFrame * _in_buf,
sampleFrame * _out_buf, bool _wait );
bool waitForProcessingFinished( sampleFrame * _out_buf );
bool process( const sampleFrame * _in_buf, sampleFrame * _out_buf );
void processMidiEvent( const midiEvent &, const f_cnt_t _offset );

View File

@@ -52,8 +52,7 @@ public:
}
virtual void play( bool _try_parallelizing,
sampleFrame * _working_buffer );
virtual void play( sampleFrame * _working_buffer );
virtual bool done( void ) const;
virtual bool isFromTrack( const track * _track ) const;

View File

@@ -45,8 +45,7 @@ public:
sampleRecordHandle( sampleTCO * _tco );
virtual ~sampleRecordHandle();
virtual void play( bool _try_parallelizing,
sampleFrame * _working_buffer );
virtual void play( sampleFrame * _working_buffer );
virtual bool done( void ) const;
virtual bool isFromTrack( const track * _track ) const;