removed buffer allocator, automatable object dependencies, deadlocks

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@477 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Javier Serrano Polo
2007-04-24 05:36:58 +00:00
parent 40137f4453
commit 416d208cc3
77 changed files with 1010 additions and 1105 deletions

View File

@@ -50,7 +50,6 @@
#include "instrument_track.h"
#include "note_play_handle.h"
#include "interpolation.h"
#include "buffer_allocator.h"
#include "file_browser.h"
#include "pixmap_button.h"
#include "knob.h"
@@ -393,7 +392,7 @@ void audioFileProcessor::setAudioFile( const QString & _audio_file, bool _rename
void audioFileProcessor::playNote( notePlayHandle * _n, bool )
{
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
// calculate frequency of note
const float note_freq = getInstrumentTrack()->frequency( _n );
@@ -409,7 +408,7 @@ void audioFileProcessor::playNote( notePlayHandle * _n, bool )
{
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
}
bufferAllocator::free( buf );
delete[] buf;
}

View File

@@ -56,7 +56,6 @@ using namespace std;
#include "instrument_track.h"
#include "note_play_handle.h"
#include "templates.h"
#include "buffer_allocator.h"
#include "knob.h"
#include "pixmap_button.h"
#include "tooltip.h"
@@ -701,7 +700,7 @@ void bitInvader::playNote( notePlayHandle * _n, bool )
}
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
bSynth * ps = static_cast<bSynth *>( _n->m_pluginData );
for( fpab_t frame = 0; frame < frames; ++frame )
@@ -715,7 +714,7 @@ void bitInvader::playNote( notePlayHandle * _n, bool )
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
delete[] buf;
}

View File

@@ -42,7 +42,6 @@
#include "instrument_track.h"
#include "note_play_handle.h"
#include "sweep_oscillator.h"
#include "buffer_allocator.h"
#include "knob.h"
#undef SINGLE_SOURCE_COMPILE
@@ -201,7 +200,7 @@ void kickerInstrument::playNote( notePlayHandle * _n, bool )
const float f1 = m_startFreqKnob->value() + tfp * fdiff / decfr;
const float f2 = m_startFreqKnob->value() + (frames+tfp-1)*fdiff/decfr;
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
sweepOsc * so = static_cast<sweepOsc *>( _n->m_pluginData );
@@ -223,7 +222,7 @@ void kickerInstrument::playNote( notePlayHandle * _n, bool )
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
delete[] buf;
}

View File

@@ -37,6 +37,7 @@
#include "ladspa_control.h"
#include "automatable_object_templates.h"
#include "ladspa_base.h"
#include "tooltip.h"
#include "tempo_sync_knob.h"

View File

@@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = foreign 1.4
AM_CXXFLAGS := $(AM_CXXFLAGS) -O6 -ffast-math -funroll-loops -ftracer -I../../../include
DEST = $(libdir)/$(PACKAGE)/ladspa
DEST = $(DESTDIR)$(libdir)/$(PACKAGE)/ladspa
SOURCES = $(wildcard *.cc)
HDRS = $(wildcard *.h) $(wildcard dsp/*.h)
OBJECTS = $(SOURCES:.cc=.o)

View File

@@ -40,7 +40,6 @@
#include "ladspa_effect.h"
#include "mixer.h"
#include "config_mgr.h"
#include "buffer_allocator.h"
#include "audio_device.h"
#include "ladspa_control.h"
#include "ladspa_subplugin_features.h"

View File

@@ -32,6 +32,7 @@
#include "qt3support.h"
#include "effect.h"
#include "engine.h"
#include "ladspa_2_lmms.h"
#include "mixer.h"
#include "ladspa_control.h"

View File

@@ -36,7 +36,8 @@
#else
#include <qlayout.h>
#include <qhbox.h>
//#include <qlayout.h>
#include <qlabel.h>
#include <qstring.h>
@@ -67,10 +68,14 @@ void ladspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
QLabel * label = new QLabel( _parent );
label->setText( QWidget::tr( "Name: " ) + lm->getName( lkey ) );
#ifndef QT3
QWidget * maker = new QWidget( _parent );
QHBoxLayout * l = new QHBoxLayout( maker );
l->setMargin( 0 );
l->setSpacing( 0 );
#else
QHBox * maker = new QHBox( _parent );
#endif
QLabel * maker_label = new QLabel( maker );
maker_label->setText( QWidget::tr( "Maker: " ) );
@@ -79,16 +84,21 @@ void ladspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
maker_content->setText( lm->getMaker( lkey ) );
#ifndef QT3
maker_content->setWordWrap( TRUE );
l->setStretchFactor( maker_content, 100 );
#else
maker_content->setAlignment( Qt::WordBreak );
maker->setStretchFactor( maker_content, 100 );
#endif
l->setStretchFactor( maker_content, 100 );
#ifndef QT3
QWidget * copyright = new QWidget( _parent );
l = new QHBoxLayout( copyright );
l->setMargin( 0 );
l->setSpacing( 0 );
#else
QHBox * copyright = new QHBox( _parent );
#endif
copyright->setMinimumWidth( _parent->minimumWidth() );
QLabel * copyright_label = new QLabel( copyright );
@@ -98,10 +108,11 @@ void ladspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
copyright_content->setText( lm->getCopyright( lkey ) );
#ifndef QT3
copyright_content->setWordWrap( TRUE );
l->setStretchFactor( copyright_content, 100 );
#else
copyright_content->setAlignment( Qt::WordBreak );
copyright->setStretchFactor( copyright_content, 100 );
#endif
l->setStretchFactor( copyright_content, 100 );
QLabel * requiresRealTime = new QLabel( _parent );
requiresRealTime->setText( QWidget::tr( "Requires Real Time: " ) +

View File

@@ -46,7 +46,6 @@
#include "instrument_play_handle.h"
#include "note_play_handle.h"
#include "templates.h"
#include "buffer_allocator.h"
#include "knob.h"
#undef SINGLE_SOURCE_COMPILE
@@ -731,14 +730,12 @@ void lb302Synth::playNote( notePlayHandle * _n, bool )
}
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame *buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame *buf = new sampleFrame[frames];
if (buf) {
process(buf, frames);
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
}
delete[] buf;
lastFramesPlayed = _n->totalFramesPlayed();
}

View File

@@ -54,7 +54,6 @@ using namespace std;
#include "instrument_track.h"
#include "note_play_handle.h"
#include "templates.h"
#include "buffer_allocator.h"
#include "knob.h"
#include "pixmap_button.h"
#include "tooltip.h"
@@ -371,7 +370,7 @@ void organicInstrument::playNote( notePlayHandle * _n, bool )
)->oscRight;
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
osc_l->update( buf, frames, 0 );
osc_r->update( buf, frames, 1 );
@@ -394,7 +393,7 @@ void organicInstrument::playNote( notePlayHandle * _n, bool )
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
delete[] buf;
}

View File

@@ -29,17 +29,18 @@
#include <QtGui/QFileDialog>
#include <QtGui/QDragEnterEvent>
#include <QtXml/QDomElement>
#else
#include <qcursor.h>
#include <qdom.h>
#include <qfiledialog.h>
#include <qwhatsthis.h>
#endif
#include "patman.h"
#include "buffer_allocator.h"
#include "endian_handling.h"
#include "file_browser.h"
#include "note_play_handle.h"
@@ -211,7 +212,7 @@ QString patmanSynth::nodeName( void ) const
void patmanSynth::playNote( notePlayHandle * _n, bool )
{
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
float freq = getInstrumentTrack()->frequency( _n );
@@ -228,7 +229,7 @@ void patmanSynth::playNote( notePlayHandle * _n, bool )
{
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
}
bufferAllocator::free( buf );
delete[] buf;
}

View File

@@ -40,7 +40,6 @@
#include "instrument_track.h"
#include "note_play_handle.h"
#include "templates.h"
#include "buffer_allocator.h"
#include "knob.h"
#undef SINGLE_SOURCE_COMPILE
@@ -144,7 +143,7 @@ void pluckedStringSynth::playNote( notePlayHandle * _n, bool )
}
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
pluckSynth * ps = static_cast<pluckSynth *>( _n->m_pluginData );
for( Uint32 frame = 0; frame < frames; ++frame )
@@ -158,7 +157,7 @@ void pluckedStringSynth::playNote( notePlayHandle * _n, bool )
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
delete[] buf;
}

View File

@@ -30,7 +30,6 @@
#include "polyb302.h"
#include "buffer_allocator.h"
#include "knob.h"
#include "led_checkbox.h"
#include "note_play_handle.h"
@@ -558,15 +557,12 @@ void polyb302Synth::playNote( notePlayHandle * _n, bool )
}
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
if( buf )
{
hstate->process( buf, frames, freq );
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
hstate->process( buf, frames, freq );
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
}
delete[] buf;
hstate->m_lastFramesPlayed = _n->totalFramesPlayed();
}

View File

@@ -30,17 +30,18 @@
#include <QtCore/QDir>
#include <QtGui/QLayout>
#include <QtGui/QTextEdit>
#include <QtXml/QDomElement>
#else
#include <qdir.h>
#include <qdom.h>
#include <qlayout.h>
#include <qtextedit.h>
#endif
#include "singerbot.h"
#include "buffer_allocator.h"
#include "instrument_track.h"
#include "note_play_handle.h"
#include "pattern.h"
@@ -145,7 +146,7 @@ singerBot::~singerBot()
void singerBot::playNote( notePlayHandle * _n, bool )
{
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
if( !_n->m_pluginData )
{
@@ -163,7 +164,7 @@ void singerBot::playNote( notePlayHandle * _n, bool )
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
}
sharedObject::unref( sample_buffer );
bufferAllocator::free( buf );
delete[] buf;
}

View File

@@ -92,8 +92,7 @@ mallets::mallets( instrumentTrack * _channel_track ) :
m_spread->move( 178, 173 );
m_spread->setHintText( tr( "Spread:" ) + " ", "" );
m_buffer = bufferAllocator::alloc<sampleFrame>(
engine::getMixer()->framesPerAudioBuffer() );
m_buffer = new sampleFrame[engine::getMixer()->framesPerAudioBuffer()];
}
@@ -101,7 +100,7 @@ mallets::mallets( instrumentTrack * _channel_track ) :
mallets::~mallets()
{
bufferAllocator::free( m_buffer );
delete[] m_buffer;
}
@@ -539,7 +538,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
m_voice = NULL;
}
m_delay = bufferAllocator::alloc<StkFloat>( 256 );
m_delay = new StkFloat[256];
m_delayRead = 0;
m_delayWrite = _delay;
for( Uint16 i = 0; i < 256; i++ )
@@ -587,7 +586,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
m_voice = NULL;
}
m_delay = bufferAllocator::alloc<StkFloat>( 256 );
m_delay = new StkFloat[256];
m_delayRead = 0;
m_delayWrite = _delay;
for( Uint16 i = 0; i < 256; i++ )
@@ -637,7 +636,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
m_voice = NULL;
}
m_delay = bufferAllocator::alloc<StkFloat>( 256 );
m_delay = new StkFloat[256];
m_delayRead = 0;
m_delayWrite = _delay;
for( Uint16 i = 0; i < 256; i++ )

View File

@@ -1,7 +1,7 @@
/*
* mallets.h - tuned instruments that one would bang upon
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
*
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
@@ -33,7 +33,6 @@
#include "combobox.h"
#include "led_checkbox.h"
#include "track.h"
#include "buffer_allocator.h"
class knob;
class notePlayHandle;
@@ -81,7 +80,7 @@ public:
inline ~malletsSynth( void )
{
m_voice->noteOff( 0.0 );
bufferAllocator::free( m_delay );
delete[] m_delay;
delete m_voice;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -48,7 +48,6 @@
#include "instrument_track.h"
#include "note_play_handle.h"
#include "knob.h"
#include "buffer_allocator.h"
#include "debug.h"
#include "tooltip.h"
#include "sample_buffer.h"
@@ -103,7 +102,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
#endif
pixmapButton * pm_osc1_btn = new pixmapButton( this, NULL, NULL );
pm_osc1_btn->move( 80, 50 );
pm_osc1_btn->move( 46, 50 );
pm_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"pm_active" ) );
pm_osc1_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -115,7 +114,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"oscillator 1" ) );
pixmapButton * am_osc1_btn = new pixmapButton( this, NULL, NULL );
am_osc1_btn->move( 120, 50 );
am_osc1_btn->move( 86, 50 );
am_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"am_active" ) );
am_osc1_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -127,7 +126,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"oscillator 1" ) );
pixmapButton * mix_osc1_btn = new pixmapButton( this, NULL, NULL );
mix_osc1_btn->move( 160, 50 );
mix_osc1_btn->move( 126, 50 );
mix_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"mix_active" ) );
mix_osc1_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -137,7 +136,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
toolTip::add( mix_osc1_btn, tr( "mix output of oscillator 1 & 2" ) );
pixmapButton * sync_osc1_btn = new pixmapButton( this, NULL, NULL );
sync_osc1_btn->move( 200, 50 );
sync_osc1_btn->move( 166, 50 );
sync_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"sync_active" ) );
sync_osc1_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -148,7 +147,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"oscillator 2" ) );
pixmapButton * fm_osc1_btn = new pixmapButton( this, NULL, NULL );
fm_osc1_btn->move( 330, 50 );
fm_osc1_btn->move( 206, 50 );
fm_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"fm_active" ) );
fm_osc1_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -174,7 +173,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
pixmapButton * pm_osc2_btn = new pixmapButton( this, NULL, NULL );
pm_osc2_btn->move( 80, 70 );
pm_osc2_btn->move( 46, 68 );
pm_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"pm_active" ) );
pm_osc2_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -186,7 +185,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"oscillator 2" ) );
pixmapButton * am_osc2_btn = new pixmapButton( this, NULL, NULL );
am_osc2_btn->move( 120, 70 );
am_osc2_btn->move( 86, 68 );
am_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"am_active" ) );
am_osc2_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -198,7 +197,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"oscillator 2" ) );
pixmapButton * mix_osc2_btn = new pixmapButton( this, NULL, NULL );
mix_osc2_btn->move( 160, 70 );
mix_osc2_btn->move( 126, 68 );
mix_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"mix_active" ) );
mix_osc2_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -208,7 +207,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
toolTip::add( mix_osc2_btn, tr("mix output of oscillator 2 & 3" ) );
pixmapButton * sync_osc2_btn = new pixmapButton( this, NULL, NULL );
sync_osc2_btn->move( 200, 70 );
sync_osc2_btn->move( 166, 68 );
sync_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"sync_active" ) );
sync_osc2_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -219,7 +218,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
"oscillator 3" ) );
pixmapButton * fm_osc2_btn = new pixmapButton( this, NULL, NULL );
fm_osc2_btn->move( 330, 70 );
fm_osc2_btn->move( 206, 68 );
fm_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"fm_active" ) );
fm_osc2_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
@@ -740,14 +739,14 @@ void tripleOscillator::playNote( notePlayHandle * _n, bool )
)->oscRight;
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
osc_l->update( buf, frames, 0 );
osc_r->update( buf, frames, 1 );
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
delete[] buf;
}

View File

@@ -51,7 +51,6 @@
#include "instrument_track.h"
#include "note_play_handle.h"
#include "buffer_allocator.h"
#include "mixer.h"
#include "instrument_play_handle.h"
#include "pixmap_button.h"
@@ -298,7 +297,7 @@ void vestigeInstrument::waitForWorkerThread( void )
}
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
if( m_plugin->waitForProcessingFinished( buf ) )
{
@@ -307,7 +306,7 @@ void vestigeInstrument::waitForWorkerThread( void )
m_pluginMutex.unlock();
bufferAllocator::free( buf );
delete[] buf;
}

View File

@@ -48,7 +48,6 @@
#include "note_play_handle.h"
#include "instrument_track.h"
#include "templates.h"
#include "buffer_allocator.h"
#include "knob.h"
#include "tooltip.h"
#include "oscillator.h"
@@ -582,7 +581,7 @@ void vibed::playNote( notePlayHandle * _n, bool )
stringContainer * ps = static_cast<stringContainer *>(
_n->m_pluginData );
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
sampleFrame * buf = new sampleFrame[frames];
for( fpab_t i = 0; i < frames; ++i )
{
@@ -609,7 +608,7 @@ void vibed::playNote( notePlayHandle * _n, bool )
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
delete[] buf;
}

View File

@@ -1,6 +1,6 @@
/* vibed_strings.h -
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/yahoo/com>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/yahoo/com>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -29,7 +29,6 @@
#include "sample_buffer.h"
#include "graph.h"
#include "pixmap_button.h"
#include "buffer_allocator.h"
#include "led_checkbox.h"
#include "impulse_editor.h"
#include "lcd_spinbox.h"

View File

@@ -1,7 +1,7 @@
/*
* vibrating_sring.h - model of a vibrating string lifted from pluckedSynth
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/yahoo/com>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/yahoo/com>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -44,7 +44,7 @@ vibratingString::vibratingString( float _pitch,
m_stringLoss( 1.0f - _string_loss ),
m_state( 0.1f )
{
m_outsamp = bufferAllocator::alloc<sample_t>( m_oversample );
m_outsamp = new sample_t[m_oversample];
int string_length;
string_length = static_cast<int>( m_oversample * _sample_rate /
@@ -55,12 +55,12 @@ vibratingString::vibratingString( float _pitch,
if( not _state )
{
m_impulse = bufferAllocator::alloc<float>( string_length );
m_impulse = new float[string_length];
resample( _impulse, _len, string_length );
}
else
{
m_impulse = bufferAllocator::alloc<float>( _len );
m_impulse = new float[_len];
for( Uint32 i = 0; i < _len; i++ )
{
m_impulse[i] = _impulse[i];

View File

@@ -1,7 +1,7 @@
/*
* vibrating_string.h - model of a vibrating string lifted from pluckedSynth
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/yahoo/com>
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/yahoo/com>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -29,7 +29,6 @@
#include "config.h"
#include "types.h"
#include "buffer_allocator.h"
class vibratingString
{
@@ -49,8 +48,8 @@ public:
inline ~vibratingString( void )
{
bufferAllocator::free( m_outsamp );
bufferAllocator::free( m_impulse );
delete[] m_outsamp;
delete[] m_impulse;
vibratingString::freeDelayLine( m_fromBridge );
vibratingString::freeDelayLine( m_toBridge );
}

View File

@@ -38,7 +38,6 @@
#include "vst_subplugin_features.h"
#include "song_editor.h"
#include "text_float.h"
#include "buffer_allocator.h"
#undef SINGLE_SOURCE_COMPILE
@@ -98,8 +97,7 @@ bool FASTCALL vstEffect::processAudioBuffer( surroundSampleFrame * _buf,
if( m_plugin )
{
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>(
_frames );
sampleFrame * buf = new sampleFrame[_frames];
for( fpab_t f = 0; f < _frames; ++f )
{
for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
@@ -121,7 +119,7 @@ bool FASTCALL vstEffect::processAudioBuffer( surroundSampleFrame * _buf,
out_sum += _buf[f][ch]*_buf[f][ch];
}
}
bufferAllocator::free( buf );
delete[] buf;
if( out_sum <= getGate() )
{
incrementBufferCount();