From adf8aed93c89f332487bdff880b9174f7f96a701 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 30 Sep 2008 11:14:32 +0000 Subject: [PATCH] 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 --- ChangeLog | 61 +++++++++++++++++ include/instrument.h | 4 +- include/instrument_play_handle.h | 27 +++----- include/instrument_track.h | 3 +- include/note_play_handle.h | 24 +------ include/play_handle.h | 21 ++---- include/plugin.h | 13 ---- include/preset_preview_play_handle.h | 3 +- include/remote_plugin.h | 4 +- include/sample_play_handle.h | 3 +- include/sample_record_handle.h | 3 +- .../audio_file_processor.cpp | 2 +- .../audio_file_processor.h | 2 +- plugins/bit_invader/bit_invader.cpp | 67 +++++++++++++++---- plugins/bit_invader/bit_invader.h | 2 +- plugins/kicker/kicker.cpp | 2 +- plugins/kicker/kicker.h | 2 +- plugins/ladspa_effect/caps/CMakeLists.txt | 2 +- plugins/ladspa_effect/tap/CMakeLists.txt | 4 +- plugins/lb302/lb302.cpp | 6 +- plugins/lb302/lb302.h | 5 +- plugins/lb303/lb303.cpp | 5 +- plugins/lb303/lb303.h | 5 +- plugins/organic/organic.cpp | 2 +- plugins/organic/organic.h | 2 +- plugins/papu/papu_instrument.cpp | 4 +- plugins/papu/papu_instrument.h | 4 +- plugins/patman/patman.cpp | 2 +- plugins/patman/patman.h | 2 +- plugins/sf2_player/sf2_player.cpp | 5 +- plugins/sf2_player/sf2_player.h | 6 +- plugins/sid/sid_instrument.cpp | 2 +- plugins/sid/sid_instrument.h | 2 +- plugins/stk/mallets/mallets.cpp | 2 +- plugins/stk/mallets/mallets.h | 2 +- .../triple_oscillator/triple_oscillator.cpp | 2 +- plugins/triple_oscillator/triple_oscillator.h | 2 +- plugins/vestige/vestige.cpp | 35 ++-------- plugins/vestige/vestige.h | 12 +--- plugins/vibed/vibed.cpp | 2 +- plugins/vibed/vibed.h | 2 +- plugins/vst_effect/vst_effect.cpp | 2 +- src/core/instrument.cpp | 2 +- src/core/mixer.cpp | 54 ++++++--------- src/core/note_play_handle.cpp | 14 ++-- src/core/plugin.cpp | 21 +----- src/core/preset_preview_play_handle.cpp | 5 +- src/core/remote_plugin.cpp | 27 ++------ src/core/sample_play_handle.cpp | 3 +- src/core/sample_record_handle.cpp | 3 +- src/tracks/instrument_track.cpp | 5 +- 51 files changed, 219 insertions(+), 277 deletions(-) diff --git a/ChangeLog b/ChangeLog index a5b0a0e7e..0fa18c756 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,64 @@ +2008-09-30 Tobias Doerffel + + * plugins/sid/sid_instrument.h: + * plugins/sid/sid_instrument.cpp: + * plugins/ladspa_effect/tap/CMakeLists.txt: + * plugins/ladspa_effect/caps/CMakeLists.txt: + * plugins/patman/patman.cpp: + * plugins/patman/patman.h: + * plugins/lb302/lb302.cpp: + * plugins/lb302/lb302.h: + * plugins/organic/organic.cpp: + * plugins/organic/organic.h: + * plugins/lb303/lb303.cpp: + * plugins/lb303/lb303.h: + * plugins/bit_invader/bit_invader.cpp: + * plugins/bit_invader/bit_invader.h: + * plugins/vst_effect/vst_effect.cpp: + * plugins/vibed/vibed.h: + * plugins/vibed/vibed.cpp: + * plugins/triple_oscillator/triple_oscillator.h: + * plugins/triple_oscillator/triple_oscillator.cpp: + * plugins/audio_file_processor/audio_file_processor.cpp: + * plugins/audio_file_processor/audio_file_processor.h: + * plugins/stk/mallets/mallets.cpp: + * plugins/stk/mallets/mallets.h: + * plugins/papu/papu_instrument.h: + * plugins/papu/papu_instrument.cpp: + * plugins/sf2_player/sf2_player.cpp: + * plugins/sf2_player/sf2_player.h: + * plugins/vestige/vestige.cpp: + * plugins/vestige/vestige.h: + * plugins/kicker/kicker.cpp: + * plugins/kicker/kicker.h: + * include/instrument_play_handle.h: + * include/instrument_track.h: + * include/instrument.h: + * include/sample_record_handle.h: + * include/plugin.h: + * include/note_play_handle.h: + * include/sample_play_handle.h: + * include/remote_plugin.h: + * include/preset_preview_play_handle.h: + * include/play_handle.h: + * src/core/plugin.cpp: + * src/core/preset_preview_play_handle.cpp: + * src/core/note_play_handle.cpp: + * src/core/remote_plugin.cpp: + * src/core/sample_play_handle.cpp: + * src/core/mixer.cpp: + * src/core/instrument.cpp: + * src/core/sample_record_handle.cpp: + * src/tracks/instrument_track.cpp: + removed obsolete instrument-parallelization support as this is handled + much better by worker threads and adds unneccessary complexity + + * cmake/modules/FindPCHSupport.cmake: + * INSTALL: + * CMakeLists.txt: + - removed (buggy) PCH support + - added support for CFLAGS and CXXFLAGS environment variables + 2008-09-29 Tobias Doerffel * plugins/sf2_player/sf2_player.cpp: diff --git a/include/instrument.h b/include/instrument.h index 4e401bc6d..342fca333 100644 --- a/include/instrument.h +++ b/include/instrument.h @@ -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 ) { } diff --git a/include/instrument_play_handle.h b/include/instrument_play_handle.h index 81d9a9083..eba03e6b1 100644 --- a/include/instrument_play_handle.h +++ b/include/instrument_play_handle.h @@ -1,7 +1,7 @@ /* * instrument_play_handle.h - play-handle for playing an instrument * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * 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 ); } diff --git a/include/instrument_track.h b/include/instrument_track.h index 2ec54bae7..ef1f96fc5 100644 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -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 diff --git a/include/note_play_handle.h b/include/note_play_handle.h index f180b605c..29abb9cd1 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -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 ); diff --git a/include/play_handle.h b/include/play_handle.h index c2f3a270c..536008cb5 100644 --- a/include/play_handle.h +++ b/include/play_handle.h @@ -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 * @@ -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; diff --git a/include/plugin.h b/include/plugin.h index e6a2f4717..88efdebd8 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -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 & _plugin_descs ); diff --git a/include/preset_preview_play_handle.h b/include/preset_preview_play_handle.h index 33f7f9c04..657940f69 100644 --- a/include/preset_preview_play_handle.h +++ b/include/preset_preview_play_handle.h @@ -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; diff --git a/include/remote_plugin.h b/include/remote_plugin.h index 398750039..6b270b5cc 100755 --- a/include/remote_plugin.h +++ b/include/remote_plugin.h @@ -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 ); diff --git a/include/sample_play_handle.h b/include/sample_play_handle.h index 8ecec2b46..035fd3ad3 100644 --- a/include/sample_play_handle.h +++ b/include/sample_play_handle.h @@ -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; diff --git a/include/sample_record_handle.h b/include/sample_record_handle.h index 27310f505..3cf07d09b 100644 --- a/include/sample_record_handle.h +++ b/include/sample_record_handle.h @@ -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; diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 462535be7..b58d8ee33 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -99,7 +99,7 @@ audioFileProcessor::~audioFileProcessor() -void audioFileProcessor::playNote( notePlayHandle * _n, bool, +void audioFileProcessor::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { const fpp_t frames = _n->framesLeftForCurrentPeriod(); diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index 94d362a8a..e2e00689b 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -44,7 +44,7 @@ public: audioFileProcessor( instrumentTrack * _instrument_track ); virtual ~audioFileProcessor(); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index 30f855b64..4ab7fa851 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -23,15 +23,9 @@ */ -#include "bit_invader.h" - - #include - -using namespace std; - - +#include "bit_invader.h" #include "engine.h" #include "graph.h" #include "instrument_track.h" @@ -56,7 +50,7 @@ plugin::descriptor PLUGIN_EXPORT bitinvader_plugin_descriptor = STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), "BitInvader", QT_TRANSLATE_NOOP( "pluginBrowser", - "Rough & Dirty Wavetable Synthesizer." ), + "Customizable wavetable synthesizer" ), "Andreas Brandmaier ", 0x0100, plugin::Instrument, @@ -90,6 +84,7 @@ bSynth::~bSynth() delete[] sample_shape; } + sample_t bSynth::nextStringSample( void ) { float sample_step = @@ -145,14 +140,13 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) : m_sampleLength( 128, 8, 128, 1, this, tr( "Samplelength" ) ), m_graph( -1.0f, 1.0f, 128, this ), m_interpolation( FALSE, this ), - m_normalize( FALSE, this) + m_normalize( FALSE, this ) { m_graph.setWaveToSine(); connect( &m_sampleLength, SIGNAL( dataChanged( ) ), - this, SLOT( lengthChanged( ) ) - ); + this, SLOT( lengthChanged( ) ) ); connect( &m_graph, SIGNAL( samplesChanged( int, int ) ), this, SLOT( samplesChanged( int, int ) ) ); @@ -160,6 +154,8 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) : } + + bitInvader::~bitInvader() { } @@ -214,11 +210,11 @@ void bitInvader::loadSettings( const QDomElement & _this ) // Load LED m_normalize.loadSettings( _this, "normalize" ); -// songEditor::inst()->setModified(); - } + + void bitInvader::lengthChanged( void ) { m_graph.setLength( (int) m_sampleLength.value() ); @@ -227,6 +223,8 @@ void bitInvader::lengthChanged( void ) } + + void bitInvader::samplesChanged( int _begin, int _end ) { normalize(); @@ -234,6 +232,8 @@ void bitInvader::samplesChanged( int _begin, int _end ) } + + void bitInvader::normalize( void ) { // analyze @@ -248,13 +248,16 @@ void bitInvader::normalize( void ) + QString bitInvader::nodeName( void ) const { return( bitinvader_plugin_descriptor.name ); } -void bitInvader::playNote( notePlayHandle * _n, bool, + + +void bitInvader::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) @@ -296,18 +299,27 @@ void bitInvader::playNote( notePlayHandle * _n, bool, } + + void bitInvader::deleteNotePluginData( notePlayHandle * _n ) { delete static_cast( _n->m_pluginData ); } + + pluginView * bitInvader::instantiateView( QWidget * _parent ) { return( new bitInvaderView( this, _parent ) ); } + + + + + bitInvaderView::bitInvaderView( instrument * _instrument, QWidget * _parent ) : instrumentView( _instrument, _parent ) @@ -438,6 +450,9 @@ bitInvaderView::bitInvaderView( instrument * _instrument, } + + + void bitInvaderView::modelChanged( void ) { bitInvader * b = castModel(); @@ -450,12 +465,17 @@ void bitInvaderView::modelChanged( void ) } + + void bitInvaderView::sinWaveClicked( void ) { m_graph->model()->setWaveToSine(); engine::getSong()->setModified(); } + + + void bitInvaderView::triangleWaveClicked( void ) { m_graph->model()->setWaveToTriangle(); @@ -463,24 +483,35 @@ void bitInvaderView::triangleWaveClicked( void ) } + + void bitInvaderView::sawWaveClicked( void ) { m_graph->model()->setWaveToSaw(); engine::getSong()->setModified(); } + + + void bitInvaderView::sqrWaveClicked( void ) { m_graph->model()->setWaveToSquare(); engine::getSong()->setModified(); } + + + void bitInvaderView::noiseWaveClicked( void ) { m_graph->model()->setWaveToNoise(); engine::getSong()->setModified(); } + + + void bitInvaderView::usrWaveClicked( void ) { /* @@ -513,6 +544,8 @@ void bitInvaderView::usrWaveClicked( void ) } + + void bitInvaderView::smoothClicked( void ) { m_graph->model()->smooth(); @@ -520,6 +553,8 @@ void bitInvaderView::smoothClicked( void ) } + + void bitInvaderView::interpolationToggled( bool value ) { m_graph->setGraphStyle( value ? graph::LinearStyle : graph::NearestStyle); @@ -527,12 +562,16 @@ void bitInvaderView::interpolationToggled( bool value ) } + + void bitInvaderView::normalizeToggled( bool value ) { engine::getSong()->setModified(); } + + extern "C" { diff --git a/plugins/bit_invader/bit_invader.h b/plugins/bit_invader/bit_invader.h index 72b63d42c..d0854499a 100644 --- a/plugins/bit_invader/bit_invader.h +++ b/plugins/bit_invader/bit_invader.h @@ -69,7 +69,7 @@ public: bitInvader(instrumentTrack * _channel_track ); virtual ~bitInvader(); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index f0870b596..9b5af9702 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -114,7 +114,7 @@ typedef effectLib::distortion<> distFX; typedef sweepOscillator > sweepOsc; -void kickerInstrument::playNote( notePlayHandle * _n, bool, +void kickerInstrument::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { const float decfr = m_decayModel.value() * diff --git a/plugins/kicker/kicker.h b/plugins/kicker/kicker.h index 9773e9fb7..6cf1de88d 100644 --- a/plugins/kicker/kicker.h +++ b/plugins/kicker/kicker.h @@ -42,7 +42,7 @@ public: kickerInstrument( instrumentTrack * _instrument_track ); virtual ~kickerInstrument(); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/ladspa_effect/caps/CMakeLists.txt b/plugins/ladspa_effect/caps/CMakeLists.txt index a6e613dee..87188890e 100644 --- a/plugins/ladspa_effect/caps/CMakeLists.txt +++ b/plugins/ladspa_effect/caps/CMakeLists.txt @@ -11,7 +11,7 @@ IF(NO_O3) MESSAGE("Found GCC 4.1.x - compiling CAPS-plugins with -O2 instead of -O3") SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-Wno-write-strings") ELSE(NO_O3) - SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-O3 -Wno-write-strings") + SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-O3 -Wno-write-strings -msse -msse2 -msse3") ENDIF(NO_O3) IF(LMMS_BUILD_WIN32) diff --git a/plugins/ladspa_effect/tap/CMakeLists.txt b/plugins/ladspa_effect/tap/CMakeLists.txt index 72578587f..588b251e6 100644 --- a/plugins/ladspa_effect/tap/CMakeLists.txt +++ b/plugins/ladspa_effect/tap/CMakeLists.txt @@ -1,15 +1,13 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include") FILE(GLOB PLUGIN_SOURCES *.c) +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-write-strings -Wall -fomit-frame-pointer -fno-strict-aliasing -fstrength-reduce -funroll-loops -ffast-math") FOREACH(_item ${PLUGIN_SOURCES}) GET_FILENAME_COMPONENT(_plugin "${_item}" NAME_WE) ADD_LIBRARY(${_plugin} MODULE ${_item}) INSTALL(TARGETS ${_plugin} LIBRARY DESTINATION ${PLUGIN_DIR}/ladspa) SET_TARGET_PROPERTIES(${_plugin} PROPERTIES PREFIX "") - SET_TARGET_PROPERTIES(${_plugin} PROPERTIES COMPILE_FLAGS "-O3 -Wno-write-strings -Wall -fomit-frame-pointer -fno-strict-aliasing -fstrength-reduce -funroll-loops -ffast-math -c") IF(LMMS_BUILD_WIN32) ADD_CUSTOM_COMMAND(TARGET ${_plugin} POST_BUILD COMMAND /opt/mingw/bin/i586-mingw32-strip ${CMAKE_CURRENT_BINARY_DIR}/${_plugin}.dll) - ELSE(LMMS_BUILD_WIN32) - SET_TARGET_PROPERTIES(${_plugin} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -fPIC -DPIC") ENDIF(LMMS_BUILD_WIN32) IF(LMMS_BUILD_APPLE) SET_TARGET_PROPERTIES(${_plugin} PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -no-undefined -Bsymbolic -lm") diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index c5dcf9c9a..cbe43cfb6 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -715,8 +715,7 @@ void lb302Synth::initNote( lb302Note *n) } -void lb302Synth::playNote( notePlayHandle * _n, bool, - sampleFrame * _working_buffer ) +void lb302Synth::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { //fpp_t framesPerPeriod = engine::getMixer()->framesPerPeriod(); @@ -775,8 +774,7 @@ void lb302Synth::playNote( notePlayHandle * _n, bool, -void lb302Synth::play( bool _try_parallelizing, - sampleFrame * _working_buffer ) +void lb302Synth::play( sampleFrame * _working_buffer ) { //printf("."); const fpp_t frames = engine::getMixer()->framesPerPeriod(); diff --git a/plugins/lb302/lb302.h b/plugins/lb302/lb302.h index 38429039f..30703915d 100644 --- a/plugins/lb302/lb302.h +++ b/plugins/lb302/lb302.h @@ -139,9 +139,8 @@ public: lb302Synth( instrumentTrack * _channel_track ); virtual ~lb302Synth(); - virtual void play( bool _try_parallelizing, - sampleFrame * _working_buffer ); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void play( sampleFrame * _working_buffer ); + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/lb303/lb303.cpp b/plugins/lb303/lb303.cpp index 578f0287b..df24dd742 100644 --- a/plugins/lb303/lb303.cpp +++ b/plugins/lb303/lb303.cpp @@ -666,7 +666,7 @@ void lb303Synth::initNote( lb303Note *n) } -void lb303Synth::playNote( notePlayHandle * _n, bool, +void lb303Synth::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { if( _n->arpBaseNote() ) @@ -708,8 +708,7 @@ void lb303Synth::playNote( notePlayHandle * _n, bool, -void lb303Synth::play( bool _try_parallelizing, - sampleFrame * _working_buffer ) +void lb303Synth::play( sampleFrame * _working_buffer ) { //printf("."); const fpp_t frames = engine::getMixer()->framesPerPeriod(); diff --git a/plugins/lb303/lb303.h b/plugins/lb303/lb303.h index 3d5b31573..70c408561 100644 --- a/plugins/lb303/lb303.h +++ b/plugins/lb303/lb303.h @@ -139,9 +139,8 @@ public: lb303Synth( instrumentTrack * _channel_track ); virtual ~lb303Synth(); - virtual void play( bool _try_parallelizing, - sampleFrame * _working_buffer ); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void play( sampleFrame * _working_buffer ); + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index 7f08d2d33..b287b98bf 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -183,7 +183,7 @@ QString organicInstrument::nodeName( void ) const -void organicInstrument::playNote( notePlayHandle * _n, bool, +void organicInstrument::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) diff --git a/plugins/organic/organic.h b/plugins/organic/organic.h index 2c55783c3..23e93a540 100644 --- a/plugins/organic/organic.h +++ b/plugins/organic/organic.h @@ -82,7 +82,7 @@ public: organicInstrument( instrumentTrack * _instrument_track ); virtual ~organicInstrument(); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/papu/papu_instrument.cpp b/plugins/papu/papu_instrument.cpp index 558609c54..f9119d8b9 100644 --- a/plugins/papu/papu_instrument.cpp +++ b/plugins/papu/papu_instrument.cpp @@ -230,7 +230,9 @@ f_cnt_t papuInstrument::desiredReleaseFrames( void ) const return f_cnt_t( 1000 ); } -void papuInstrument::playNote( notePlayHandle * _n, bool, + + +void papuInstrument::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { const f_cnt_t tfp = _n->totalFramesPlayed(); diff --git a/plugins/papu/papu_instrument.h b/plugins/papu/papu_instrument.h index 9df25b76f..6e34cfaf6 100644 --- a/plugins/papu/papu_instrument.h +++ b/plugins/papu/papu_instrument.h @@ -44,7 +44,7 @@ public: papuInstrument( instrumentTrack * _instrument_track ); virtual ~papuInstrument(); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); @@ -160,4 +160,4 @@ private: } ; -#endif \ No newline at end of file +#endif diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 0f3b8dde0..b44ff12f5 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -129,7 +129,7 @@ QString patmanInstrument::nodeName( void ) const -void patmanInstrument::playNote( notePlayHandle * _n, bool, +void patmanInstrument::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { if( m_patchFile == "" ) diff --git a/plugins/patman/patman.h b/plugins/patman/patman.h index 541038230..3d38b0d5c 100644 --- a/plugins/patman/patman.h +++ b/plugins/patman/patman.h @@ -53,7 +53,7 @@ public: patmanInstrument( instrumentTrack * _track ); virtual ~patmanInstrument(); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 1df9546e1..451b282d9 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -554,7 +554,7 @@ void sf2Instrument::updateSampleRate( void ) -void sf2Instrument::playNote( notePlayHandle * _n, bool, sampleFrame * ) +void sf2Instrument::playNote( notePlayHandle * _n, sampleFrame * ) { const double LOG440 = 2.643452676486187424842455584439449012279510498046875f; @@ -587,8 +587,7 @@ void sf2Instrument::playNote( notePlayHandle * _n, bool, sampleFrame * ) // Could we get iph-based instruments support sample-exact models by using a // frame-length of 1 while rendering? -void sf2Instrument::play( bool _try_parallelizing, - sampleFrame * _working_buffer ) +void sf2Instrument::play( sampleFrame * _working_buffer ) { const fpp_t frames = engine::getMixer()->framesPerPeriod(); diff --git a/plugins/sf2_player/sf2_player.h b/plugins/sf2_player/sf2_player.h index 626b89615..fa53cbbbb 100644 --- a/plugins/sf2_player/sf2_player.h +++ b/plugins/sf2_player/sf2_player.h @@ -54,10 +54,9 @@ public: sf2Instrument( instrumentTrack * _instrument_track ); virtual ~sf2Instrument(); - virtual void play( bool _try_parallelizing, - sampleFrame * _working_buffer ); + virtual void play( sampleFrame * _working_buffer ); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); @@ -88,6 +87,7 @@ public: void setParameter( const QString & _param, const QString & _value ); + public slots: void openFile( const QString & _sf2File ); void updatePatch( void ); diff --git a/plugins/sid/sid_instrument.cpp b/plugins/sid/sid_instrument.cpp index 49845fe3a..39764dc7d 100644 --- a/plugins/sid/sid_instrument.cpp +++ b/plugins/sid/sid_instrument.cpp @@ -295,7 +295,7 @@ static int sid_fillbuffer(unsigned char* sidreg, cSID *sid, int tdelta, short *p -void sidInstrument::playNote( notePlayHandle * _n, bool, +void sidInstrument::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { const f_cnt_t tfp = _n->totalFramesPlayed(); diff --git a/plugins/sid/sid_instrument.h b/plugins/sid/sid_instrument.h index 7e0145ca1..c1c401247 100644 --- a/plugins/sid/sid_instrument.h +++ b/plugins/sid/sid_instrument.h @@ -91,7 +91,7 @@ public: sidInstrument( instrumentTrack * _instrument_track ); virtual ~sidInstrument(); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index b155355c6..71bf6132c 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -204,7 +204,7 @@ QString malletsInstrument::nodeName( void ) const -void malletsInstrument::playNote( notePlayHandle * _n, bool, +void malletsInstrument::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { if( m_filesMissing ) diff --git a/plugins/stk/mallets/mallets.h b/plugins/stk/mallets/mallets.h index 5e46ec3e9..a969dfb3b 100644 --- a/plugins/stk/mallets/mallets.h +++ b/plugins/stk/mallets/mallets.h @@ -131,7 +131,7 @@ public: malletsInstrument( instrumentTrack * _channel_track ); virtual ~malletsInstrument( void ); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/triple_oscillator.cpp index eb227c4d5..4ccbaf9f0 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/triple_oscillator.cpp @@ -297,7 +297,7 @@ QString tripleOscillator::nodeName( void ) const -void tripleOscillator::playNote( notePlayHandle * _n, bool, +void tripleOscillator::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) diff --git a/plugins/triple_oscillator/triple_oscillator.h b/plugins/triple_oscillator/triple_oscillator.h index 0061458f4..bc92fb4b3 100644 --- a/plugins/triple_oscillator/triple_oscillator.h +++ b/plugins/triple_oscillator/triple_oscillator.h @@ -97,7 +97,7 @@ public: tripleOscillator( instrumentTrack * _track ); virtual ~tripleOscillator(); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 48e10094e..7f47935cc 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -183,7 +183,7 @@ void vestigeInstrument::loadFile( const QString & _file ) -void vestigeInstrument::waitForWorkerThread( void ) +void vestigeInstrument::play( sampleFrame * _buf ) { m_pluginMutex.lock(); if( m_plugin == NULL ) @@ -192,38 +192,13 @@ void vestigeInstrument::waitForWorkerThread( void ) return; } + m_plugin->process( NULL, _buf ); + const fpp_t frames = engine::getMixer()->framesPerPeriod(); - sampleFrame * buf = new sampleFrame[frames]; - if( m_plugin->waitForProcessingFinished( buf ) ) - { - getInstrumentTrack()->processAudioBuffer( buf, frames, NULL ); - } + getInstrumentTrack()->processAudioBuffer( _buf, frames, NULL ); m_pluginMutex.unlock(); - - delete[] buf; -} - - - - -void vestigeInstrument::play( bool _try_parallelizing, sampleFrame * ) -{ - m_pluginMutex.lock(); - if( m_plugin == NULL ) - { - m_pluginMutex.unlock(); - return; - } - - m_plugin->process( NULL, NULL, FALSE ); - m_pluginMutex.unlock(); - - if( !_try_parallelizing ) - { - waitForWorkerThread(); - } } @@ -238,7 +213,7 @@ bool vestigeInstrument::handleMidiEvent( const midiEvent & _me, m_plugin->processMidiEvent( _me, _time ); } m_pluginMutex.unlock(); - return( TRUE ); + return true; } diff --git a/plugins/vestige/vestige.h b/plugins/vestige/vestige.h index 5cb905b12..05d034d44 100644 --- a/plugins/vestige/vestige.h +++ b/plugins/vestige/vestige.h @@ -50,8 +50,7 @@ public: vestigeInstrument( instrumentTrack * _channel_track ); virtual ~vestigeInstrument(); - virtual void play( bool _try_parallelizing, - sampleFrame * _working_buffer ); + virtual void play( sampleFrame * _working_buffer ); virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); @@ -60,16 +59,9 @@ public: virtual void loadFile( const QString & _file ); - virtual bool supportsParallelizing( void ) const - { - return( TRUE ); - } - - virtual void waitForWorkerThread( void ); - virtual bool isMidiBased( void ) const { - return( true ); + return true; } virtual bool handleMidiEvent( const midiEvent & _me, diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 1a712dcb6..827fa4b63 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -274,7 +274,7 @@ QString vibed::nodeName( void ) const -void vibed::playNote( notePlayHandle * _n, bool, sampleFrame * _working_buffer ) +void vibed::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) { diff --git a/plugins/vibed/vibed.h b/plugins/vibed/vibed.h index 4084daebd..de2e7033a 100644 --- a/plugins/vibed/vibed.h +++ b/plugins/vibed/vibed.h @@ -43,7 +43,7 @@ public: vibed( instrumentTrack * _instrument_track ); virtual ~vibed(); - virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); diff --git a/plugins/vst_effect/vst_effect.cpp b/plugins/vst_effect/vst_effect.cpp index 8c6330fc3..ddda538c8 100644 --- a/plugins/vst_effect/vst_effect.cpp +++ b/plugins/vst_effect/vst_effect.cpp @@ -100,7 +100,7 @@ bool vstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) } } m_pluginMutex.lock(); - m_plugin->process( buf, buf, TRUE ); + m_plugin->process( buf, buf ); m_pluginMutex.unlock(); double out_sum = 0.0; diff --git a/src/core/instrument.cpp b/src/core/instrument.cpp index fd9b4baf2..e992bad51 100644 --- a/src/core/instrument.cpp +++ b/src/core/instrument.cpp @@ -50,7 +50,7 @@ instrument::~instrument() -void instrument::play( bool, sampleFrame * ) +void instrument::play( sampleFrame * ) { } diff --git a/src/core/mixer.cpp b/src/core/mixer.cpp index 170363f56..dfaf39f5e 100644 --- a/src/core/mixer.cpp +++ b/src/core/mixer.cpp @@ -118,13 +118,13 @@ public: jobQueueItem() : type( InvalidJob ), job( NULL ), - done( FALSE ) + done( false ) { } jobQueueItem( JobTypes _type, void * _job ) : type( _type ), job( _job ), - done( FALSE ) + done( false ) { } @@ -156,7 +156,7 @@ public: mixerWorkerThread( mixer * _mixer ) : QThread( _mixer ), - m_quit( FALSE ), + m_quit( false ), m_mixer( _mixer ), m_queueReadySem( &m_mixer->m_queueReadySem ), m_workersDoneSem( &m_mixer->m_workersDoneSem ), @@ -176,7 +176,7 @@ public: virtual void quit( void ) { - m_quit = TRUE; + m_quit = true; } private: @@ -185,7 +185,7 @@ private: sampleFrame * working_buf = (sampleFrame *) aligned_malloc( m_mixer->framesPerPeriod() * sizeof( sampleFrame ) ); - while( m_quit == FALSE ) + while( m_quit == false ) { m_queueReadySem->acquire(); for( jobQueueItems::iterator it = @@ -199,13 +199,13 @@ private: m_jobQueue->lock.lock(); if( !it->done ) { - it->done = TRUE; + it->done = true; m_jobQueue->lock.unlock(); #endif switch( it->type ) { case PlayHandle: - it->playHandleJob->play( FALSE, working_buf ); + it->playHandleJob->play( working_buf ); break; case AudioPortEffects: { @@ -490,7 +490,7 @@ sample_rate_t mixer::processingSampleRate( void ) const bool mixer::criticalXRuns( void ) const { return( ( m_cpuLoad >= 99 && - engine::getSong()->realTimeTask() == TRUE ) ); + engine::getSong()->realTimeTask() == true ) ); } @@ -534,7 +534,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void ) song::playPos p = engine::getSong()->getPlayPos( song::Mode_PlayPattern ); if( engine::getSong()->playMode() == song::Mode_PlayPattern && - engine::getPianoRoll()->isRecording() == TRUE && + engine::getPianoRoll()->isRecording() == true && p != last_metro_pos && p.getTicks() % (DefaultTicksPerTact / 4 ) == 0 ) { @@ -596,37 +596,19 @@ const surroundSampleFrame * mixer::renderNextBuffer( void ) // clear last audio-buffer clearAudioBuffer( m_writeBuf, m_framesPerPeriod ); //printf("---------------------------next period\n"); -// if( criticalXRuns() == FALSE ) +// if( criticalXRuns() == false ) { engine::getFxMixer()->prepareMasterMix(); engine::getSong()->processNextBuffer(); lockPlayHandles(); - int idx = 0; if( m_multiThreaded ) { - playHandleVector par_hndls; - while( idx < m_playHandles.size() ) - { - playHandle * n = m_playHandles[idx]; - if( !n->done() && n->supportsParallelizing() ) - { - n->play( TRUE, m_workingBuf ); - par_hndls.push_back( n ); - } - ++idx; - } mixerWorkerThread::jobQueue jq; FILL_JOB_QUEUE(jq,playHandleVector,m_playHandles, mixerWorkerThread::PlayHandle, - !( *it )->done() && - !( *it )->supportsParallelizing() ); + !( *it )->done()); DISTRIBUTE_JOB_QUEUE(jq); - for( playHandleVector::iterator it = par_hndls.begin(); - it != par_hndls.end(); ++it ) - { - ( *it )->waitForWorkerThread(); - } WAIT_FOR_JOBS(); } else @@ -637,8 +619,10 @@ const surroundSampleFrame * mixer::renderNextBuffer( void ) { if( !( *it )->done() ) { - - ( *it )->play( FALSE, m_workingBuf ); + // play now and don't try to + // parallelize as we're on single-core + // system + ( *it )->play( m_workingBuf ); } } } @@ -684,7 +668,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void ) } else { - bool more_effects = FALSE; + bool more_effects = false; for( QVector::iterator it = m_audioPorts.begin(); it != m_audioPorts.end(); ++it ) @@ -1007,7 +991,7 @@ void mixer::removePlayHandles( track * _track ) audioDevice * mixer::tryAudioDevices( void ) { - bool success_ful = FALSE; + bool success_ful = false; audioDevice * dev = NULL; QString dev_name = configManager::inst()->value( "mixer", "audiodev" ); @@ -1193,7 +1177,7 @@ midiClient * mixer::tryMidiClients( void ) mixer::fifoWriter::fifoWriter( mixer * _mixer, fifo * _fifo ) : m_mixer( _mixer ), m_fifo( _fifo ), - m_writing( TRUE ) + m_writing( true ) { } @@ -1202,7 +1186,7 @@ mixer::fifoWriter::fifoWriter( mixer * _mixer, fifo * _fifo ) : void mixer::fifoWriter::finish( void ) { - m_writing = FALSE; + m_writing = false; } diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index d76974ea1..f3791ac6a 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -2,7 +2,7 @@ /* * note_play_handle.cpp - implementation of class notePlayHandle, part of - * play-engine + * rendering engine * * Copyright (c) 2004-2008 Tobias Doerffel * @@ -174,10 +174,9 @@ int notePlayHandle::getMidiVelocity( void ) const -void notePlayHandle::play( bool _try_parallelizing, - sampleFrame * _working_buffer ) +void notePlayHandle::play( sampleFrame * _working_buffer ) { - if( m_muted == TRUE ) + if( m_muted ) { return; } @@ -195,11 +194,10 @@ void notePlayHandle::play( bool _try_parallelizing, if( framesLeft() > 0 ) { // play note! - m_instrumentTrack->playNote( this, _try_parallelizing, - _working_buffer ); + m_instrumentTrack->playNote( this, _working_buffer ); } - if( m_released == TRUE ) + if( m_released ) { f_cnt_t todo = engine::getMixer()->framesPerPeriod(); // if this note is base-note for arpeggio, always set @@ -257,7 +255,7 @@ void notePlayHandle::play( bool _try_parallelizing, for( notePlayHandleVector::iterator it = m_subNotes.begin(); it != m_subNotes.end(); ) { - ( *it )->play( _try_parallelizing, _working_buffer ); + ( *it )->play( _working_buffer ); if( ( *it )->done() ) { delete *it; diff --git a/src/core/plugin.cpp b/src/core/plugin.cpp index 67d5e59a2..631a06b22 100644 --- a/src/core/plugin.cpp +++ b/src/core/plugin.cpp @@ -129,22 +129,7 @@ plugin * plugin::instantiate( const QString & _plugin_name, model * _parent, return( new dummyPlugin() ); } plugin * inst = inst_hook( _parent, _data ); - return( inst ); -} - - - - -bool plugin::supportsParallelizing( void ) const -{ - return( FALSE ); -} - - - - -void plugin::waitForWorkerThread( void ) -{ + return inst; } @@ -202,7 +187,7 @@ pluginView * plugin::createView( QWidget * _parent ) { pv->setModel( this ); } - return( pv ); + return pv; } @@ -237,7 +222,7 @@ QDomElement plugin::descriptor::subPluginFeatures::key::saveXML( a.setAttribute( "value", it.value() ); e.appendChild( a ); } - return( e ); + return e; } diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index 237a27f2a..b5ac574ca 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -186,10 +186,9 @@ presetPreviewPlayHandle::~presetPreviewPlayHandle() -void presetPreviewPlayHandle::play( bool _try_parallelizing, - sampleFrame * _working_buffer ) +void presetPreviewPlayHandle::play( sampleFrame * _working_buffer ) { - m_previewNote->play( _try_parallelizing, _working_buffer ); + m_previewNote->play( _working_buffer ); } diff --git a/src/core/remote_plugin.cpp b/src/core/remote_plugin.cpp index 376697a86..88e42f365 100644 --- a/src/core/remote_plugin.cpp +++ b/src/core/remote_plugin.cpp @@ -42,7 +42,6 @@ remotePlugin::remotePlugin( const QString & _plugin_executable, bool _wait_for_init_done ) : remotePluginBase( new shmFifo(), new shmFifo() ), - m_initialized( false ), m_failed( true ), m_commMutex( QMutex::Recursive ), m_splitChannels( false ), @@ -108,7 +107,7 @@ remotePlugin::~remotePlugin() bool remotePlugin::process( const sampleFrame * _in_buf, - sampleFrame * _out_buf, bool _wait ) + sampleFrame * _out_buf ) { if( m_failed ) { @@ -133,7 +132,7 @@ bool remotePlugin::process( const sampleFrame * _in_buf, engine::getMixer()->clearAudioBuffer( _out_buf, frames ); } - return( false ); + return false; } memset( m_shm, 0, m_shmSize ); @@ -174,31 +173,15 @@ bool remotePlugin::process( const sampleFrame * _in_buf, sendMessage( IdStartProcessing ); unlock(); - m_initialized = TRUE; - if( _wait ) + if( m_failed || _out_buf == NULL || m_outputCount == 0 ) { - waitForProcessingFinished( _out_buf ); - } - - return( TRUE ); -} - - - - -bool remotePlugin::waitForProcessingFinished( sampleFrame * _out_buf ) -{ - if( m_failed || !m_initialized || _out_buf == NULL || - m_outputCount == 0 ) - { - return( false ); + return false; } lock(); waitForMessage( IdProcessingDone ); unlock(); - const fpp_t frames = engine::getMixer()->framesPerPeriod(); const ch_cnt_t outputs = tMin( m_outputCount, DEFAULT_CHANNELS ); if( m_splitChannels ) @@ -234,7 +217,7 @@ bool remotePlugin::waitForProcessingFinished( sampleFrame * _out_buf ) } } - return( TRUE ); + return true; } diff --git a/src/core/sample_play_handle.cpp b/src/core/sample_play_handle.cpp index d615ec0d2..45ff07fa1 100644 --- a/src/core/sample_play_handle.cpp +++ b/src/core/sample_play_handle.cpp @@ -116,8 +116,7 @@ samplePlayHandle::~samplePlayHandle() -void samplePlayHandle::play( bool /* _try_parallelizing */, - sampleFrame * _working_buffer ) +void samplePlayHandle::play( sampleFrame * _working_buffer ) { //play( 0, _try_parallelizing ); if( framesDone() >= totalFrames() ) diff --git a/src/core/sample_record_handle.cpp b/src/core/sample_record_handle.cpp index 5d1d10981..5610ebec3 100644 --- a/src/core/sample_record_handle.cpp +++ b/src/core/sample_record_handle.cpp @@ -68,8 +68,7 @@ sampleRecordHandle::~sampleRecordHandle() -void sampleRecordHandle::play( bool /* _try_parallelizing */, - sampleFrame * _working_buffer ) +void sampleRecordHandle::play( sampleFrame * _working_buffer ) { const sampleFrame * recbuf = engine::getMixer()->inputBuffer(); const fpp_t frames = engine::getMixer()->inputBufferFrames(); diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 6cc90b872..80d2e4c1f 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -394,7 +394,7 @@ f_cnt_t instrumentTrack::beatLen( notePlayHandle * _n ) const -void instrumentTrack::playNote( notePlayHandle * _n, bool _try_parallelizing, +void instrumentTrack::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { // arpeggio- and chord-widget has to do its work -> adding sub-notes @@ -405,8 +405,7 @@ void instrumentTrack::playNote( notePlayHandle * _n, bool _try_parallelizing, if( !_n->isArpeggioBaseNote() && m_instrument != NULL ) { // all is done, so now lets play the note! - m_instrument->playNote( _n, _try_parallelizing, - _working_buffer ); + m_instrument->playNote( _n, _working_buffer ); } }