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:
117
ChangeLog
117
ChangeLog
@@ -1,3 +1,120 @@
|
||||
2007-04-24 Javier Serrano Polo <jasp00/at/terra/dot/es>
|
||||
|
||||
* include/buffer_allocator.h:
|
||||
* src/lib/buffer_allocator.cpp:
|
||||
removed, obsoleted by small audio buffers
|
||||
|
||||
* Makefile.am:
|
||||
* include/audio_device.h:
|
||||
* plugins/audio_file_processor/audio_file_processor.cpp:
|
||||
* plugins/bit_invader/bit_invader.cpp:
|
||||
* plugins/kicker/kicker.cpp:
|
||||
* plugins/ladspa_effect/ladspa_effect.cpp:
|
||||
* plugins/lb302/lb302.cpp:
|
||||
* plugins/organic/organic.cpp:
|
||||
* plugins/patman/patman.cpp:
|
||||
* plugins/plucked_string_synth/plucked_string_synth.cpp:
|
||||
* plugins/polyb302/polyb302.cpp:
|
||||
* plugins/singerbot/singerbot.cpp:
|
||||
* plugins/stk/mallets/mallets.cpp:
|
||||
* plugins/stk/mallets/mallets.h:
|
||||
* plugins/triple_oscillator/triple_oscillator.cpp:
|
||||
* plugins/vestige/vestige.cpp:
|
||||
* plugins/vibed/vibed.cpp:
|
||||
* plugins/vibed/vibed.h:
|
||||
* plugins/vibed/vibrating_string.cpp:
|
||||
* plugins/vibed/vibrating_string.h:
|
||||
* plugins/vst_effect/vst_effect.cpp:
|
||||
* src/lmms_single_source.cpp:
|
||||
* src/audio/audio_alsa.cpp:
|
||||
* src/audio/audio_device.cpp:
|
||||
* src/audio/audio_file_device.cpp:
|
||||
* src/audio/audio_file_wave.cpp:
|
||||
* src/audio/audio_jack.cpp:
|
||||
* src/audio/audio_oss.cpp:
|
||||
* src/audio/audio_port.cpp:
|
||||
* src/audio/audio_sample_recorder.cpp:
|
||||
* src/audio/audio_sdl.cpp:
|
||||
* src/core/main_window.cpp:
|
||||
* src/core/mixer.cpp:
|
||||
* src/core/sample_play_handle.cpp:
|
||||
* src/tracks/pattern.cpp:
|
||||
* src/widgets/visualization_widget.cpp:
|
||||
removed buffer allocator
|
||||
|
||||
* include/automatable_object_templates.h:
|
||||
initial release, templates extracted from automatable_object.h
|
||||
|
||||
* Makefile.am:
|
||||
* include/automatable_object.h:
|
||||
* plugins/ladspa_base/ladspa_control.cpp:
|
||||
* plugins/ladspa_effect/ladspa_effect.h:
|
||||
* plugins/patman/patman.cpp:
|
||||
* plugins/singerbot/singerbot.cpp:
|
||||
* src/core/automation_editor.cpp:
|
||||
* src/core/bb_editor.cpp:
|
||||
* src/core/envelope_and_lfo_widget.cpp:
|
||||
* src/core/export_project_dialog.cpp:
|
||||
* src/core/note.cpp:
|
||||
* src/core/note_play_handle.cpp:
|
||||
* src/core/piano_roll.cpp:
|
||||
* src/core/piano_widget.cpp:
|
||||
* src/core/setup_dialog.cpp:
|
||||
* src/core/song_editor.cpp:
|
||||
* src/core/surround_area.cpp:
|
||||
* src/core/track.cpp:
|
||||
* src/tracks/instrument_track.cpp:
|
||||
* src/tracks/sample_track.cpp:
|
||||
* src/widgets/automatable_button.cpp:
|
||||
* src/widgets/automatable_slider.cpp:
|
||||
* src/widgets/combobox.cpp:
|
||||
* src/widgets/effect_label.cpp:
|
||||
* src/widgets/knob.cpp:
|
||||
* src/widgets/lcd_spinbox.cpp:
|
||||
* src/widgets/led_checkbox.cpp:
|
||||
* src/widgets/pixmap_button.cpp:
|
||||
* src/widgets/rack_plugin.cpp:
|
||||
* src/widgets/tempo_sync_knob.cpp:
|
||||
* src/widgets/volume_knob.cpp:
|
||||
reduced dependencies on automatable object
|
||||
|
||||
* src/audio/audio_device.cpp:
|
||||
* src/core/export_project_dialog.cpp:
|
||||
* src/core/mixer.cpp:
|
||||
fixed deadlocks
|
||||
|
||||
* include/audio_dummy.h:
|
||||
don't process buffers
|
||||
|
||||
* src/audio/audio_sample_recorder.cpp:
|
||||
fixed high quality
|
||||
|
||||
* include/basic_filters.h:
|
||||
* include/envelope_and_lfo_widget.h:
|
||||
* src/core/envelope_tab_widget.cpp:
|
||||
simplified envelope processing
|
||||
|
||||
* include/basic_filters.h:
|
||||
- use samplerate member as sample rate
|
||||
- reformatted
|
||||
|
||||
* plugins/ladspa_effect/ladspa_subplugin_features.cpp:
|
||||
reverted layout changes in QT3, fixes descriptions
|
||||
|
||||
* plugins/triple_oscillator/artwork.png:
|
||||
* plugins/triple_oscillator/triple_oscillator.cpp:
|
||||
updated GUI
|
||||
|
||||
* include/tempo_sync_knob.h:
|
||||
* src/widgets/tempo_sync_knob.cpp:
|
||||
graceful shutdown
|
||||
|
||||
* src/widgets/automatable_button.cpp:
|
||||
fixed undef
|
||||
|
||||
* plugins/ladspa_effect/caps/Makefile.am:
|
||||
use DESTDIR
|
||||
|
||||
2007-04-21 Javier Serrano Polo <jasp00/at/terra/dot/es>
|
||||
|
||||
* plugins/singerbot/singerbot.cpp:
|
||||
|
||||
@@ -172,7 +172,6 @@ lmms_SOURCES = \
|
||||
$(srcdir)/src/core/surround_area.cpp \
|
||||
$(srcdir)/src/core/timeline.cpp \
|
||||
$(srcdir)/src/lib/base64.cpp \
|
||||
$(srcdir)/src/lib/buffer_allocator.cpp \
|
||||
$(srcdir)/src/lib/clipboard.cpp \
|
||||
$(srcdir)/src/lib/journalling_object.cpp \
|
||||
$(srcdir)/src/lib/project_journal.cpp \
|
||||
@@ -309,7 +308,6 @@ lmms_SOURCES = \
|
||||
$(srcdir)/include/nstate_button.h \
|
||||
$(srcdir)/include/midi_dummy.h \
|
||||
$(srcdir)/include/midi_mapper.h \
|
||||
$(srcdir)/include/buffer_allocator.h \
|
||||
$(srcdir)/include/lcd_spinbox.h \
|
||||
$(srcdir)/include/tooltip.h \
|
||||
$(srcdir)/include/automatable_button.h \
|
||||
@@ -336,6 +334,7 @@ lmms_SOURCES = \
|
||||
$(srcdir)/include/rubberband.h \
|
||||
$(srcdir)/include/base64.h \
|
||||
$(srcdir)/include/automatable_object.h \
|
||||
$(srcdir)/include/automatable_object_templates.h \
|
||||
$(srcdir)/include/journalling_object.h \
|
||||
$(srcdir)/include/level_object.h \
|
||||
$(srcdir)/include/project_journal.h \
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(lmms, 0.2.1-svn20070421, lmms-devel/at/lists/dot/sf/dot/net)
|
||||
AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20070421)
|
||||
AC_INIT(lmms, 0.2.1-svn20070424, lmms-devel/at/lists/dot/sf/dot/net)
|
||||
AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20070424)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
|
||||
@@ -97,10 +97,11 @@ public:
|
||||
return( m_channels );
|
||||
}
|
||||
|
||||
bool processNextBuffer( void );
|
||||
void processNextBuffer( void );
|
||||
|
||||
virtual void startProcessing( void )
|
||||
{
|
||||
m_in_process = TRUE;
|
||||
}
|
||||
|
||||
virtual void stopProcessing( void );
|
||||
@@ -175,6 +176,7 @@ private:
|
||||
sample_rate_t m_sampleRate;
|
||||
ch_cnt_t m_channels;
|
||||
mixer * m_mixer;
|
||||
bool m_in_process;
|
||||
|
||||
QMutex m_devMutex;
|
||||
|
||||
|
||||
@@ -92,10 +92,14 @@ private:
|
||||
while( TRUE )
|
||||
{
|
||||
timer.reset();
|
||||
if ( !processNextBuffer() )
|
||||
const surroundSampleFrame * b =
|
||||
getMixer()->nextBuffer();
|
||||
if( !b )
|
||||
{
|
||||
break;
|
||||
}
|
||||
delete[] b;
|
||||
|
||||
const Sint32 microseconds = static_cast<Sint32>(
|
||||
getMixer()->framesPerAudioBuffer() *
|
||||
1000000.0f / getMixer()->sampleRate() -
|
||||
|
||||
@@ -29,29 +29,24 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "qt3support.h"
|
||||
#include "automation_editor.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "engine.h"
|
||||
#include "journalling_object.h"
|
||||
#include "templates.h"
|
||||
#include "midi_time.h"
|
||||
#include "level_object.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtCore/QPointer>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qvariant.h>
|
||||
#include <qguardedptr.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class automationPattern;
|
||||
class track;
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE = T>
|
||||
class automatableObject : public journallingObject, public levelObject
|
||||
{
|
||||
@@ -60,32 +55,9 @@ public:
|
||||
|
||||
automatableObject( track * _track = NULL, const T _val = 0,
|
||||
const T _min = 0, const T _max = 0,
|
||||
const T _step = defaultRelStep() ) :
|
||||
m_value( _val ),
|
||||
m_minValue( _min ),
|
||||
m_maxValue( _max ),
|
||||
m_step( _step ),
|
||||
m_automation_pattern( NULL ),
|
||||
m_track( _track ),
|
||||
m_journalEntryReady( FALSE )
|
||||
{
|
||||
m_curLevel = level( _val );
|
||||
m_minLevel = level( _min );
|
||||
m_maxLevel = level( _max );
|
||||
}
|
||||
const T _step = defaultRelStep() );
|
||||
|
||||
virtual ~automatableObject()
|
||||
{
|
||||
if( m_automation_pattern )
|
||||
{
|
||||
delete m_automation_pattern;
|
||||
}
|
||||
while( m_linkedObjects.empty() == FALSE )
|
||||
{
|
||||
m_linkedObjects.last()->unlinkObject( this );
|
||||
m_linkedObjects.erase( m_linkedObjects.end() - 1 );
|
||||
}
|
||||
}
|
||||
virtual ~automatableObject();
|
||||
|
||||
static inline T minRelStep( void )
|
||||
{
|
||||
@@ -128,217 +100,32 @@ public:
|
||||
return( m_curLevel );
|
||||
}
|
||||
|
||||
inline T fittedValue( T _value )
|
||||
{
|
||||
_value = tLimit<T>( _value, minValue(), maxValue() );
|
||||
inline T fittedValue( T _value );
|
||||
|
||||
if( m_step != 0 )
|
||||
{
|
||||
_value = static_cast<T>( roundf( _value
|
||||
/ (float)step() ) * step() );
|
||||
}
|
||||
else
|
||||
{
|
||||
_value = minValue();
|
||||
}
|
||||
virtual void setInitValue( const T _value );
|
||||
|
||||
// correct rounding error at the border
|
||||
if( tAbs<T>( _value - maxValue() ) < minEps() *
|
||||
tAbs<T>( step() ) )
|
||||
{
|
||||
_value = maxValue();
|
||||
}
|
||||
|
||||
// correct rounding error if value = 0
|
||||
if( tAbs<T>( _value ) < minEps() * tAbs<T>( step() ) )
|
||||
{
|
||||
_value = 0;
|
||||
}
|
||||
|
||||
return( _value );
|
||||
}
|
||||
|
||||
inline virtual void setInitValue( const T _value )
|
||||
{
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
setValue( _value );
|
||||
if( m_automation_pattern )
|
||||
{
|
||||
setFirstValue();
|
||||
}
|
||||
setJournalling( journalling );
|
||||
}
|
||||
|
||||
inline virtual void setValue( const T _value )
|
||||
{
|
||||
const T old_val = m_value;
|
||||
|
||||
m_value = fittedValue( _value );
|
||||
if( old_val != m_value )
|
||||
{
|
||||
m_curLevel = level( m_value );
|
||||
|
||||
// add changes to history so user can undo it
|
||||
addJournalEntry( journalEntry( 0,
|
||||
static_cast<EDIT_STEP_TYPE>( m_value ) -
|
||||
static_cast<EDIT_STEP_TYPE>( old_val ) ) );
|
||||
|
||||
// notify linked objects
|
||||
|
||||
// doesn't work because of implicit typename T
|
||||
// for( autoObjVector::iterator it =
|
||||
// m_linkedObjects.begin();
|
||||
// it != m_linkedObjects.end(); ++it )
|
||||
for( csize i = 0; i < m_linkedObjects.size(); ++i )
|
||||
{
|
||||
autoObj * it = m_linkedObjects[i];
|
||||
if( value() != it->value() &&
|
||||
it->fittedValue( value() ) !=
|
||||
it->value() )
|
||||
{
|
||||
bool journalling =
|
||||
it->testAndSetJournalling(
|
||||
isJournalling() );
|
||||
it->setValue( value() );
|
||||
it->setJournalling( journalling );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
inline virtual void setValue( const T _value );
|
||||
|
||||
inline virtual void incValue( int _steps )
|
||||
{
|
||||
setValue( m_value + _steps * m_step );
|
||||
}
|
||||
|
||||
inline virtual void setRange( const T _min, const T _max,
|
||||
const T _step = defaultRelStep() )
|
||||
{
|
||||
m_minValue = _min;
|
||||
m_maxValue = _max;
|
||||
if( m_minValue > m_maxValue )
|
||||
{
|
||||
qSwap<T>( m_minValue, m_maxValue );
|
||||
}
|
||||
setStep( _step );
|
||||
// re-adjust value
|
||||
autoObj::setInitValue( value() );
|
||||
}
|
||||
virtual void setRange( const T _min, const T _max,
|
||||
const T _step = defaultRelStep() );
|
||||
|
||||
inline virtual void setStep( const T _step )
|
||||
{
|
||||
/*
|
||||
const T intv = maxValue() - minValue();
|
||||
inline virtual void setStep( const T _step );
|
||||
|
||||
if( _step == 0 )
|
||||
{
|
||||
m_step = intv * defaultRelStep();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ( intv > 0 ) && ( _step < 0 ) || ( intv < 0 ) &&
|
||||
( _step > 0 ) )
|
||||
{
|
||||
m_step = -_step;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_step = _step;
|
||||
}
|
||||
if( tAbs<T>( m_step ) <
|
||||
tAbs<T>( minRelStep() * intv ) )
|
||||
{
|
||||
m_step = minRelStep() * intv;
|
||||
}
|
||||
}*/
|
||||
m_step = _step;
|
||||
m_curLevel = level( m_value );
|
||||
m_minLevel = level( m_minValue );
|
||||
m_maxLevel = level( m_maxValue );
|
||||
}
|
||||
static void linkObjects( autoObj * _object1, autoObj * _object2 );
|
||||
|
||||
static inline void linkObjects( autoObj * _object1,
|
||||
autoObj * _object2 )
|
||||
{
|
||||
_object1->linkObject( _object2 );
|
||||
_object2->linkObject( _object1 );
|
||||
|
||||
if( _object1->m_automation_pattern
|
||||
!= _object2->m_automation_pattern )
|
||||
{
|
||||
if( _object2->m_automation_pattern )
|
||||
{
|
||||
delete _object2->m_automation_pattern;
|
||||
}
|
||||
_object2->m_automation_pattern
|
||||
= _object1->m_automation_pattern;
|
||||
}
|
||||
}
|
||||
|
||||
static void unlinkObjects( autoObj * _object1,
|
||||
autoObj * _object2 )
|
||||
{
|
||||
_object1->unlinkObject( _object2 );
|
||||
_object2->unlinkObject( _object1 );
|
||||
|
||||
if( _object1->m_automation_pattern
|
||||
&& _object1->m_automation_pattern
|
||||
== _object2->m_automation_pattern )
|
||||
{
|
||||
_object2->m_automation_pattern = new automationPattern(
|
||||
*_object1->m_automation_pattern, _object2 );
|
||||
}
|
||||
}
|
||||
static void unlinkObjects( autoObj * _object1, autoObj * _object2 );
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this,
|
||||
const QString & _name = "value" )
|
||||
{
|
||||
if( m_automation_pattern )
|
||||
{
|
||||
QDomElement pattern_element;
|
||||
QDomNode node = _this.namedItem(
|
||||
automationPattern::classNodeName() );
|
||||
if( node.isElement() )
|
||||
{
|
||||
pattern_element = node.toElement();
|
||||
}
|
||||
else
|
||||
{
|
||||
pattern_element = _doc.createElement(
|
||||
automationPattern::classNodeName() );
|
||||
_this.appendChild( pattern_element );
|
||||
}
|
||||
QDomElement element = _doc.createElement( _name );
|
||||
m_automation_pattern->saveSettings( _doc, element );
|
||||
pattern_element.appendChild( element );
|
||||
}
|
||||
else
|
||||
{
|
||||
_this.setAttribute( _name, value() );
|
||||
}
|
||||
}
|
||||
const QString & _name = "value" );
|
||||
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this,
|
||||
const QString & _name = "value" )
|
||||
{
|
||||
QDomNode node = _this.namedItem(
|
||||
automationPattern::classNodeName() );
|
||||
if( node.isElement() )
|
||||
{
|
||||
node = node.namedItem( _name );
|
||||
if( node.isElement() )
|
||||
{
|
||||
m_automation_pattern->loadSettings(
|
||||
node.toElement() );
|
||||
setLevel( m_automation_pattern->valueAt(
|
||||
midiTime( 0 ) ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
setInitValue( attributeValue( _this.attribute( _name ) ) );
|
||||
}
|
||||
const QString & _name = "value" );
|
||||
|
||||
virtual QString nodeName( void ) const
|
||||
{
|
||||
@@ -355,16 +142,7 @@ public:
|
||||
m_data = _data;
|
||||
}
|
||||
|
||||
inline automationPattern * getAutomationPattern( void )
|
||||
{
|
||||
if( !m_automation_pattern )
|
||||
{
|
||||
m_automation_pattern = new automationPattern( m_track,
|
||||
this );
|
||||
syncAutomationPattern();
|
||||
}
|
||||
return( m_automation_pattern );
|
||||
}
|
||||
inline automationPattern * getAutomationPattern( void );
|
||||
|
||||
inline bool nullTrack( void )
|
||||
{
|
||||
@@ -378,67 +156,15 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void redoStep( journalEntry & _je )
|
||||
{
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
/*#ifndef QT3
|
||||
setValue( static_cast<T>( value() +
|
||||
_je.data().value<EDIT_STEP_TYPE>() ) );
|
||||
#else*/
|
||||
setValue( static_cast<T>( value() + static_cast<EDIT_STEP_TYPE>(
|
||||
_je.data().toDouble() ) ) );
|
||||
//#endif
|
||||
setJournalling( journalling );
|
||||
}
|
||||
virtual void redoStep( journalEntry & _je );
|
||||
|
||||
virtual void undoStep( journalEntry & _je )
|
||||
{
|
||||
journalEntry je( _je.actionID(),
|
||||
/*#ifndef QT3
|
||||
-_je.data().value<EDIT_STEP_TYPE>()
|
||||
#else*/
|
||||
static_cast<EDIT_STEP_TYPE>( -_je.data().toDouble() )
|
||||
//#endif
|
||||
);
|
||||
redoStep( je );
|
||||
}
|
||||
virtual void undoStep( journalEntry & _je );
|
||||
|
||||
inline void prepareJournalEntryFromOldVal( void )
|
||||
{
|
||||
m_oldValue = value();
|
||||
saveJournallingState( FALSE );
|
||||
m_journalEntryReady = TRUE;
|
||||
}
|
||||
void prepareJournalEntryFromOldVal( void );
|
||||
|
||||
inline void addJournalEntryFromOldToCurVal( void )
|
||||
{
|
||||
if( m_journalEntryReady )
|
||||
{
|
||||
restoreJournallingState();
|
||||
if( value() != m_oldValue )
|
||||
{
|
||||
addJournalEntry( journalEntry( 0, value() -
|
||||
m_oldValue ) );
|
||||
}
|
||||
m_journalEntryReady = FALSE;
|
||||
}
|
||||
}
|
||||
void addJournalEntryFromOldToCurVal( void );
|
||||
|
||||
inline void setFirstValue( void )
|
||||
{
|
||||
if( m_automation_pattern
|
||||
&& m_automation_pattern->updateFirst() )
|
||||
{
|
||||
m_automation_pattern->putValue( midiTime( 0 ),
|
||||
m_curLevel, FALSE );
|
||||
if( engine::getAutomationEditor() &&
|
||||
engine::getAutomationEditor()->currentPattern()
|
||||
== m_automation_pattern )
|
||||
{
|
||||
engine::getAutomationEditor()->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
inline void setFirstValue( void );
|
||||
|
||||
|
||||
private:
|
||||
@@ -459,52 +185,15 @@ private:
|
||||
typedef vvector<autoObj *> autoObjVector;
|
||||
autoObjVector m_linkedObjects;
|
||||
|
||||
inline void linkObject( autoObj * _object )
|
||||
{
|
||||
if( qFind( m_linkedObjects.begin(), m_linkedObjects.end(),
|
||||
_object ) == m_linkedObjects.end() )
|
||||
{
|
||||
m_linkedObjects.push_back( _object );
|
||||
}
|
||||
}
|
||||
inline void linkObject( autoObj * _object );
|
||||
|
||||
inline void unlinkObject( autoObj * _object )
|
||||
{
|
||||
if( qFind( m_linkedObjects.begin(), m_linkedObjects.end(),
|
||||
_object ) != m_linkedObjects.end() )
|
||||
{
|
||||
m_linkedObjects.erase( qFind( m_linkedObjects.begin(),
|
||||
m_linkedObjects.end(),
|
||||
_object ) );
|
||||
}
|
||||
}
|
||||
inline void unlinkObject( autoObj * _object );
|
||||
|
||||
static T attributeValue( QString _value );
|
||||
static inline T attributeValue( QString _value );
|
||||
|
||||
inline void syncAutomationPattern( void )
|
||||
{
|
||||
for( csize i = 0; i < m_linkedObjects.size(); ++i )
|
||||
{
|
||||
autoObj * it = m_linkedObjects[i];
|
||||
if( m_automation_pattern != it->m_automation_pattern )
|
||||
{
|
||||
it->m_automation_pattern = m_automation_pattern;
|
||||
}
|
||||
}
|
||||
}
|
||||
inline void syncAutomationPattern( void );
|
||||
|
||||
void setLevel( int _level )
|
||||
{
|
||||
if( m_curLevel == _level )
|
||||
{
|
||||
return;
|
||||
}
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
m_automation_pattern->setUpdateFirst( FALSE );
|
||||
setValue( _level * m_step );
|
||||
m_automation_pattern->setUpdateFirst( TRUE );
|
||||
setJournalling( journalling );
|
||||
}
|
||||
inline void setLevel( int _level );
|
||||
|
||||
inline int level( T _value ) const
|
||||
{
|
||||
@@ -525,54 +214,6 @@ private:
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline float automatableObject<float>::minRelStep( void )
|
||||
{
|
||||
return( 1.0e-10 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline float automatableObject<float>::defaultRelStep( void )
|
||||
{
|
||||
return( 1.0e-2 );
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
inline float automatableObject<float>::minEps( void )
|
||||
{
|
||||
return( 1.0e-10 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline float automatableObject<float>::attributeValue( QString _value )
|
||||
{
|
||||
return( _value.toFloat() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline int automatableObject<int>::attributeValue( QString _value )
|
||||
{
|
||||
return( _value.toInt() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline bool automatableObject<bool, signed char>::attributeValue(
|
||||
QString _value )
|
||||
{
|
||||
return( static_cast<bool>( _value.toInt() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
533
include/automatable_object_templates.h
Normal file
533
include/automatable_object_templates.h
Normal file
@@ -0,0 +1,533 @@
|
||||
/*
|
||||
* automatable_object_templates.h - definition of automatableObject templates
|
||||
*
|
||||
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUTOMATABLE_OBJECT_TEMPLATES_H
|
||||
#define _AUTOMATABLE_OBJECT_TEMPLATES_H
|
||||
|
||||
|
||||
#include "automatable_object.h"
|
||||
#include "automation_editor.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "engine.h"
|
||||
#include "templates.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
automatableObject<T, EDIT_STEP_TYPE>::automatableObject( track * _track,
|
||||
const T _val, const T _min,
|
||||
const T _max, const T _step ) :
|
||||
m_value( _val ),
|
||||
m_minValue( _min ),
|
||||
m_maxValue( _max ),
|
||||
m_step( _step ),
|
||||
m_automation_pattern( NULL ),
|
||||
m_track( _track ),
|
||||
m_journalEntryReady( FALSE )
|
||||
{
|
||||
m_curLevel = level( _val );
|
||||
m_minLevel = level( _min );
|
||||
m_maxLevel = level( _max );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
automatableObject<T, EDIT_STEP_TYPE>::~automatableObject()
|
||||
{
|
||||
if( m_automation_pattern )
|
||||
{
|
||||
delete m_automation_pattern;
|
||||
}
|
||||
while( m_linkedObjects.empty() == FALSE )
|
||||
{
|
||||
m_linkedObjects.last()->unlinkObject( this );
|
||||
m_linkedObjects.erase( m_linkedObjects.end() - 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
T automatableObject<T, EDIT_STEP_TYPE>::fittedValue( T _value )
|
||||
{
|
||||
_value = tLimit<T>( _value, minValue(), maxValue() );
|
||||
|
||||
if( m_step != 0 )
|
||||
{
|
||||
_value = static_cast<T>( roundf( _value / (float)step() )
|
||||
* step() );
|
||||
}
|
||||
else
|
||||
{
|
||||
_value = minValue();
|
||||
}
|
||||
|
||||
// correct rounding error at the border
|
||||
if( tAbs<T>( _value - maxValue() ) < minEps() * tAbs<T>( step() ) )
|
||||
{
|
||||
_value = maxValue();
|
||||
}
|
||||
|
||||
// correct rounding error if value = 0
|
||||
if( tAbs<T>( _value ) < minEps() * tAbs<T>( step() ) )
|
||||
{
|
||||
_value = 0;
|
||||
}
|
||||
|
||||
return( _value );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::setInitValue( const T _value )
|
||||
{
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
setValue( _value );
|
||||
if( m_automation_pattern )
|
||||
{
|
||||
setFirstValue();
|
||||
}
|
||||
setJournalling( journalling );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::setValue( const T _value )
|
||||
{
|
||||
const T old_val = m_value;
|
||||
|
||||
m_value = fittedValue( _value );
|
||||
if( old_val != m_value )
|
||||
{
|
||||
m_curLevel = level( m_value );
|
||||
|
||||
// add changes to history so user can undo it
|
||||
addJournalEntry( journalEntry( 0,
|
||||
static_cast<EDIT_STEP_TYPE>( m_value ) -
|
||||
static_cast<EDIT_STEP_TYPE>( old_val ) ) );
|
||||
|
||||
// notify linked objects
|
||||
|
||||
// doesn't work because of implicit typename T
|
||||
// for( autoObjVector::iterator it =
|
||||
// m_linkedObjects.begin();
|
||||
// it != m_linkedObjects.end(); ++it )
|
||||
for( csize i = 0; i < m_linkedObjects.size(); ++i )
|
||||
{
|
||||
autoObj * it = m_linkedObjects[i];
|
||||
if( value() != it->value() && it->fittedValue( value() )
|
||||
!= it->value() )
|
||||
{
|
||||
bool journalling = it->testAndSetJournalling(
|
||||
isJournalling() );
|
||||
it->setValue( value() );
|
||||
it->setJournalling( journalling );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::setRange( const T _min, const T _max,
|
||||
const T _step )
|
||||
{
|
||||
m_minValue = _min;
|
||||
m_maxValue = _max;
|
||||
if( m_minValue > m_maxValue )
|
||||
{
|
||||
qSwap<T>( m_minValue, m_maxValue );
|
||||
}
|
||||
setStep( _step );
|
||||
// re-adjust value
|
||||
autoObj::setInitValue( value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::setStep( const T _step )
|
||||
{
|
||||
/*
|
||||
const T intv = maxValue() - minValue();
|
||||
|
||||
if( _step == 0 )
|
||||
{
|
||||
m_step = intv * defaultRelStep();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ( intv > 0 ) && ( _step < 0 ) || ( intv < 0 ) &&
|
||||
( _step > 0 ) )
|
||||
{
|
||||
m_step = -_step;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_step = _step;
|
||||
}
|
||||
if( tAbs<T>( m_step ) < tAbs<T>( minRelStep() * intv ) )
|
||||
{
|
||||
m_step = minRelStep() * intv;
|
||||
}
|
||||
}*/
|
||||
m_step = _step;
|
||||
m_curLevel = level( m_value );
|
||||
m_minLevel = level( m_minValue );
|
||||
m_maxLevel = level( m_maxValue );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::linkObjects( autoObj * _object1,
|
||||
autoObj * _object2 )
|
||||
{
|
||||
_object1->linkObject( _object2 );
|
||||
_object2->linkObject( _object1 );
|
||||
|
||||
if( _object1->m_automation_pattern != _object2->m_automation_pattern )
|
||||
{
|
||||
if( _object2->m_automation_pattern )
|
||||
{
|
||||
delete _object2->m_automation_pattern;
|
||||
}
|
||||
_object2->m_automation_pattern = _object1->m_automation_pattern;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::unlinkObjects( autoObj * _object1,
|
||||
autoObj * _object2 )
|
||||
{
|
||||
_object1->unlinkObject( _object2 );
|
||||
_object2->unlinkObject( _object1 );
|
||||
|
||||
if( _object1->m_automation_pattern && _object1->m_automation_pattern
|
||||
== _object2->m_automation_pattern )
|
||||
{
|
||||
_object2->m_automation_pattern = new automationPattern(
|
||||
*_object1->m_automation_pattern, _object2 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
if( m_automation_pattern )
|
||||
{
|
||||
QDomElement pattern_element;
|
||||
QDomNode node = _this.namedItem(
|
||||
automationPattern::classNodeName() );
|
||||
if( node.isElement() )
|
||||
{
|
||||
pattern_element = node.toElement();
|
||||
}
|
||||
else
|
||||
{
|
||||
pattern_element = _doc.createElement(
|
||||
automationPattern::classNodeName() );
|
||||
_this.appendChild( pattern_element );
|
||||
}
|
||||
QDomElement element = _doc.createElement( _name );
|
||||
m_automation_pattern->saveSettings( _doc, element );
|
||||
pattern_element.appendChild( element );
|
||||
}
|
||||
else
|
||||
{
|
||||
_this.setAttribute( _name, value() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::loadSettings(
|
||||
const QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
QDomNode node = _this.namedItem( automationPattern::classNodeName() );
|
||||
if( node.isElement() )
|
||||
{
|
||||
node = node.namedItem( _name );
|
||||
if( node.isElement() )
|
||||
{
|
||||
m_automation_pattern->loadSettings( node.toElement() );
|
||||
setLevel( m_automation_pattern->valueAt(
|
||||
midiTime( 0 ) ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
setInitValue( attributeValue( _this.attribute( _name ) ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
automationPattern * automatableObject<T, EDIT_STEP_TYPE>::getAutomationPattern(
|
||||
void )
|
||||
{
|
||||
if( !m_automation_pattern )
|
||||
{
|
||||
m_automation_pattern = new automationPattern( m_track, this );
|
||||
syncAutomationPattern();
|
||||
}
|
||||
return( m_automation_pattern );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::redoStep( journalEntry & _je )
|
||||
{
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
/*#ifndef QT3
|
||||
setValue( static_cast<T>( value() +
|
||||
_je.data().value<EDIT_STEP_TYPE>() ) );
|
||||
#else*/
|
||||
setValue( static_cast<T>( value() + static_cast<EDIT_STEP_TYPE>(
|
||||
_je.data().toDouble() ) ) );
|
||||
//#endif
|
||||
setJournalling( journalling );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::undoStep( journalEntry & _je )
|
||||
{
|
||||
journalEntry je( _je.actionID(),
|
||||
/*#ifndef QT3
|
||||
-_je.data().value<EDIT_STEP_TYPE>()
|
||||
#else*/
|
||||
static_cast<EDIT_STEP_TYPE>( -_je.data().toDouble() )
|
||||
//#endif
|
||||
);
|
||||
redoStep( je );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::prepareJournalEntryFromOldVal( void )
|
||||
{
|
||||
m_oldValue = value();
|
||||
saveJournallingState( FALSE );
|
||||
m_journalEntryReady = TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::addJournalEntryFromOldToCurVal(
|
||||
void )
|
||||
{
|
||||
if( m_journalEntryReady )
|
||||
{
|
||||
restoreJournallingState();
|
||||
if( value() != m_oldValue )
|
||||
{
|
||||
addJournalEntry( journalEntry( 0, value() -
|
||||
m_oldValue ) );
|
||||
}
|
||||
m_journalEntryReady = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::setFirstValue( void )
|
||||
{
|
||||
if( m_automation_pattern && m_automation_pattern->updateFirst() )
|
||||
{
|
||||
m_automation_pattern->putValue( midiTime( 0 ), m_curLevel,
|
||||
FALSE );
|
||||
if( engine::getAutomationEditor() &&
|
||||
engine::getAutomationEditor()->currentPattern()
|
||||
== m_automation_pattern )
|
||||
{
|
||||
engine::getAutomationEditor()->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::linkObject( autoObj * _object )
|
||||
{
|
||||
if( qFind( m_linkedObjects.begin(), m_linkedObjects.end(), _object )
|
||||
== m_linkedObjects.end() )
|
||||
{
|
||||
m_linkedObjects.push_back( _object );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::unlinkObject( autoObj * _object )
|
||||
{
|
||||
if( qFind( m_linkedObjects.begin(), m_linkedObjects.end(), _object )
|
||||
!= m_linkedObjects.end() )
|
||||
{
|
||||
m_linkedObjects.erase( qFind( m_linkedObjects.begin(),
|
||||
m_linkedObjects.end(),
|
||||
_object ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::syncAutomationPattern( void )
|
||||
{
|
||||
for( csize i = 0; i < m_linkedObjects.size(); ++i )
|
||||
{
|
||||
autoObj * it = m_linkedObjects[i];
|
||||
if( m_automation_pattern != it->m_automation_pattern )
|
||||
{
|
||||
it->m_automation_pattern = m_automation_pattern;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T, typename EDIT_STEP_TYPE>
|
||||
void automatableObject<T, EDIT_STEP_TYPE>::setLevel( int _level )
|
||||
{
|
||||
if( m_curLevel == _level )
|
||||
{
|
||||
return;
|
||||
}
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
m_automation_pattern->setUpdateFirst( FALSE );
|
||||
setValue( _level * m_step );
|
||||
m_automation_pattern->setUpdateFirst( TRUE );
|
||||
setJournalling( journalling );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline float automatableObject<float>::minRelStep( void )
|
||||
{
|
||||
return( 1.0e-10 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline float automatableObject<float>::defaultRelStep( void )
|
||||
{
|
||||
return( 1.0e-2 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline float automatableObject<float>::minEps( void )
|
||||
{
|
||||
return( 1.0e-10 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline float automatableObject<float>::attributeValue( QString _value )
|
||||
{
|
||||
return( _value.toFloat() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline int automatableObject<int>::attributeValue( QString _value )
|
||||
{
|
||||
return( _value.toInt() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline bool automatableObject<bool, signed char>::attributeValue(
|
||||
QString _value )
|
||||
{
|
||||
return( static_cast<bool>( _value.toInt() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
m_b2a0( 0.0f ),
|
||||
m_a1a0( 0.0f ),
|
||||
m_a2a0( 0.0f ),
|
||||
m_sampleRate( 1.0f / _sample_rate ),
|
||||
m_sampleRate( _sample_rate ),
|
||||
m_subFilter( NULL )
|
||||
{
|
||||
// reset in/out history
|
||||
@@ -231,13 +231,17 @@ public:
|
||||
return( out );
|
||||
}
|
||||
|
||||
|
||||
inline void calcFilterCoeffs( const filterTypes _type, float _freq,
|
||||
float _q
|
||||
|
||||
void setType( const filterTypes _type )
|
||||
{
|
||||
m_type = _type;
|
||||
}
|
||||
|
||||
|
||||
inline void calcFilterCoeffs( float _freq, float _q
|
||||
/*, const bool _q_is_bandwidth = FALSE*/ )
|
||||
{
|
||||
// temp coef vars
|
||||
m_type = _type;
|
||||
_freq = tMax( _freq, 0.01f );// limit freq and q for not getting
|
||||
// bad noise out of the filter...
|
||||
_q = tMax( _q, minQ() );
|
||||
@@ -250,21 +254,21 @@ public:
|
||||
{
|
||||
m_subFilter =
|
||||
new basicFilters<CHANNELS>(
|
||||
static_cast<sample_rate_t>( 1.0f / m_sampleRate ) );
|
||||
static_cast<sample_rate_t>( m_sampleRate ) );
|
||||
m_subFilter->setType( MOOG );
|
||||
}
|
||||
m_subFilter->calcFilterCoeffs( MOOG, _freq,
|
||||
_q );
|
||||
m_subFilter->calcFilterCoeffs( _freq, _q );
|
||||
}
|
||||
|
||||
case MOOG:
|
||||
{
|
||||
// [ 0 - 1 ]
|
||||
const float f = 2 * _freq * m_sampleRate;
|
||||
const float f = 2 * _freq / m_sampleRate;
|
||||
// (Empirical tunning)
|
||||
m_k = 3.6f*f - 1.6f*f*f - 1;
|
||||
m_p = (m_k+1)*0.5f;
|
||||
m_r = _q*powf( M_E, ( ( 1-m_p ) * 1.386249f ) );
|
||||
break;
|
||||
m_k = 3.6f * f - 1.6f * f * f - 1;
|
||||
m_p = ( m_k + 1 ) * 0.5f;
|
||||
m_r = _q * powf( M_E, ( 1 - m_p ) * 1.386249f );
|
||||
return;
|
||||
}
|
||||
|
||||
/* case DOUBLE_MOOG2:
|
||||
@@ -273,7 +277,7 @@ public:
|
||||
{
|
||||
m_subFilter =
|
||||
new basicFilters<CHANNELS>(
|
||||
1.0f / m_sampleRate );
|
||||
m_sampleRate );
|
||||
}
|
||||
m_subFilter->calcFilterCoeffs( MOOG2, _freq,
|
||||
_q );
|
||||
@@ -281,8 +285,8 @@ public:
|
||||
|
||||
case MOOG2:
|
||||
{
|
||||
const float kfc = 2 * _freq * m_sampleRate;
|
||||
const float kf = _freq * m_sampleRate;
|
||||
const float kfc = 2 * _freq / m_sampleRate;
|
||||
const float kf = _freq / m_sampleRate;
|
||||
const float kfcr = 1.8730 * ( kfc*kfc*kfc ) +
|
||||
0.4955 * ( kfc*kfc ) +
|
||||
0.6490 * kfc + 0.9988;
|
||||
@@ -295,81 +299,79 @@ public:
|
||||
}*/
|
||||
|
||||
default:
|
||||
{
|
||||
// other filters
|
||||
const float omega = F_2PI * _freq *
|
||||
m_sampleRate;
|
||||
const float tsin = sinf( omega );
|
||||
const float tcos = cosf( omega );
|
||||
//float alpha;
|
||||
|
||||
//if (q_is_bandwidth)
|
||||
//alpha = tsin*sinhf(logf(2.0f)/2.0f*q*omega/
|
||||
// tsin);
|
||||
//else
|
||||
const float alpha = 0.5f * tsin / _q;
|
||||
|
||||
const float a0 = 1.0f / ( 1.0f + alpha );
|
||||
|
||||
if( m_type == LOWPASS ||
|
||||
m_type == DOUBLE_LOWPASS )
|
||||
{
|
||||
m_b0a0 = ((1.0f-tcos)*0.5f)*a0;
|
||||
m_b1a0 = (1.0f-tcos)*a0;
|
||||
m_b2a0 = m_b0a0;//((1.0f-tcos)/2.0f)*a0;
|
||||
m_a1a0 = (-2.0f*tcos)*a0;
|
||||
if( m_type == DOUBLE_LOWPASS )
|
||||
{
|
||||
if( m_subFilter == NULL )
|
||||
{
|
||||
m_subFilter =
|
||||
new basicFilters<CHANNELS>( static_cast<sample_rate_t>(
|
||||
1.0f / m_sampleRate ) );
|
||||
}
|
||||
m_subFilter->calcFilterCoeffs(
|
||||
LOWPASS, _freq, _q );
|
||||
}
|
||||
}
|
||||
else if( m_type == HIPASS )
|
||||
{
|
||||
m_b0a0 = ((1.0f+tcos)*0.5f)*a0;
|
||||
m_b1a0 = (-1.0f-tcos)*a0;
|
||||
m_b2a0 = m_b0a0;//((1.0f+tcos)/2.0f)*a0;
|
||||
m_a1a0 = (-2.0f*tcos)*a0;
|
||||
}
|
||||
else if( m_type == BANDPASS_CSG )
|
||||
{
|
||||
m_b0a0 = tsin*0.5f*a0;
|
||||
m_b1a0 = 0.0f;
|
||||
m_b2a0 = -tsin*0.5f*a0;
|
||||
m_a1a0 = (-2.0f*tcos)*a0;
|
||||
}
|
||||
else if( m_type == BANDPASS_CZPG )
|
||||
{
|
||||
m_b0a0 = alpha*a0;
|
||||
m_b1a0 = 0.0f;
|
||||
m_b2a0 = (-alpha)*a0;
|
||||
m_a1a0 = (-2.0f*tcos)*a0;
|
||||
}
|
||||
else if( m_type == NOTCH )
|
||||
{
|
||||
m_b0a0 = a0;
|
||||
m_b1a0 = (-2.0f*tcos)*a0;
|
||||
m_b2a0 = a0;
|
||||
m_a1a0 = m_b1a0;//(-2.0f*tcos)*a0;
|
||||
}
|
||||
else if( m_type == ALLPASS )
|
||||
{
|
||||
m_b0a0 = (1.0f-alpha)*a0;
|
||||
m_b1a0 = (-2.0f*tcos)*a0;
|
||||
m_b2a0 = 1.0;//(1.0f+alpha)*a0;
|
||||
m_a1a0 = m_b1a0;//(-2.0f*tcos)*a0;
|
||||
//m_a2a0 = m_b0a0;//(1.0f-alpha)*a0;
|
||||
}
|
||||
m_a2a0 = (1.0f-alpha)*a0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// other filters
|
||||
const float omega = F_2PI * _freq / m_sampleRate;
|
||||
const float tsin = sinf( omega );
|
||||
const float tcos = cosf( omega );
|
||||
//float alpha;
|
||||
|
||||
//if (q_is_bandwidth)
|
||||
//alpha = tsin*sinhf(logf(2.0f)/2.0f*q*omega/
|
||||
// tsin);
|
||||
//else
|
||||
const float alpha = 0.5f * tsin / _q;
|
||||
|
||||
const float a0 = 1.0f / ( 1.0f + alpha );
|
||||
|
||||
switch( m_type )
|
||||
{
|
||||
case LOWPASS:
|
||||
case DOUBLE_LOWPASS:
|
||||
m_b0a0 = ( 1.0f - tcos ) * 0.5f * a0;
|
||||
m_b1a0 = ( 1.0f - tcos ) * a0;
|
||||
m_b2a0 = m_b0a0;//((1.0f-tcos)/2.0f)*a0;
|
||||
m_a1a0 = -2.0f * tcos * a0;
|
||||
if( m_type == DOUBLE_LOWPASS )
|
||||
{
|
||||
if( m_subFilter == NULL )
|
||||
{
|
||||
m_subFilter =
|
||||
new basicFilters<CHANNELS>( static_cast<sample_rate_t>(
|
||||
m_sampleRate ) );
|
||||
m_subFilter->setType( LOWPASS );
|
||||
}
|
||||
m_subFilter->calcFilterCoeffs( _freq,
|
||||
_q );
|
||||
}
|
||||
break;
|
||||
case HIPASS:
|
||||
m_b0a0 = ( 1.0f + tcos ) * 0.5f * a0;
|
||||
m_b1a0 = ( -1.0f - tcos ) * a0;
|
||||
m_b2a0 = m_b0a0;//((1.0f+tcos)/2.0f)*a0;
|
||||
m_a1a0 = -2.0f * tcos * a0;
|
||||
break;
|
||||
case BANDPASS_CSG:
|
||||
m_b0a0 = tsin * 0.5f * a0;
|
||||
m_b1a0 = 0.0f;
|
||||
m_b2a0 = -tsin * 0.5f * a0;
|
||||
m_a1a0 = -2.0f * tcos * a0;
|
||||
break;
|
||||
case BANDPASS_CZPG:
|
||||
m_b0a0 = alpha * a0;
|
||||
m_b1a0 = 0.0f;
|
||||
m_b2a0 = -alpha * a0;
|
||||
m_a1a0 = -2.0f * tcos * a0;
|
||||
break;
|
||||
case NOTCH:
|
||||
m_b0a0 = a0;
|
||||
m_b1a0 = -2.0f * tcos * a0;
|
||||
m_b2a0 = a0;
|
||||
m_a1a0 = m_b1a0;//(-2.0f*tcos)*a0;
|
||||
break;
|
||||
case ALLPASS:
|
||||
m_b0a0 = ( 1.0f - alpha ) * a0;
|
||||
m_b1a0 = -2.0f * tcos * a0;
|
||||
m_b2a0 = 1.0f;//(1.0f+alpha)*a0;
|
||||
m_a1a0 = m_b1a0;//(-2.0f*tcos)*a0;
|
||||
//m_a2a0 = m_b0a0;//(1.0f-alpha)*a0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
m_a2a0 = ( 1.0f - alpha ) * a0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* buffer_allocator.h - namespace bufferAllocator providing routines for own
|
||||
* optimized memory-management for audio-buffers
|
||||
*
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BUFFER_ALLOCATOR_H
|
||||
#define _BUFFER_ALLOCATOR_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
|
||||
|
||||
namespace bufferAllocator
|
||||
{
|
||||
void * FASTCALL allocBytes( const Uint32 _bytes );
|
||||
|
||||
template<class T>
|
||||
inline T * FASTCALL alloc( const Uint32 _n )
|
||||
{
|
||||
return( (T *) allocBytes( sizeof( T ) * _n ) );
|
||||
}
|
||||
|
||||
// free given buffer
|
||||
void FASTCALL free( void * _buf );
|
||||
|
||||
// try to cleanup _level unused buffers
|
||||
void FASTCALL cleanUp( const Uint16 _level );
|
||||
|
||||
// disable autocleanup-mechanisms
|
||||
void FASTCALL disableAutoCleanup( const bool _disabled );
|
||||
|
||||
|
||||
// simple class for automatically freeing buffer in complex functions
|
||||
template<class T = void>
|
||||
class autoCleaner
|
||||
{
|
||||
public:
|
||||
autoCleaner( T * _ptr ) :
|
||||
m_ptr( _ptr )
|
||||
{
|
||||
}
|
||||
~autoCleaner()
|
||||
{
|
||||
bufferAllocator::free( m_ptr );
|
||||
}
|
||||
inline const T * ptr( void ) const
|
||||
{
|
||||
return( m_ptr );
|
||||
}
|
||||
|
||||
private:
|
||||
T * m_ptr;
|
||||
} ;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
@@ -77,9 +77,9 @@ public:
|
||||
track * _track );
|
||||
virtual ~envelopeAndLFOWidget();
|
||||
|
||||
static inline float expKnobVal( float val )
|
||||
static inline float expKnobVal( float _val )
|
||||
{
|
||||
return( ( ( val < 0 ) ? -1 : 1 ) * val*val );
|
||||
return( ( ( _val < 0 ) ? -_val : _val ) * _val );
|
||||
}
|
||||
|
||||
static void triggerLFO( void );
|
||||
|
||||
@@ -114,7 +114,8 @@ private:
|
||||
QString m_tempoSyncDescription;
|
||||
|
||||
tempoSyncMode m_tempoLastSyncMode;
|
||||
meterDialog * m_custom;
|
||||
QPointer<meterDialog> m_custom;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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: " ) +
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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++ )
|
||||
|
||||
@@ -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 |
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#ifdef ALSA_SUPPORT
|
||||
|
||||
#include "endian_handling.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "config_mgr.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "gui_templates.h"
|
||||
@@ -214,13 +213,11 @@ void audioALSA::stopProcessing( void )
|
||||
void audioALSA::run( void )
|
||||
{
|
||||
surroundSampleFrame * temp =
|
||||
bufferAllocator::alloc<surroundSampleFrame>(
|
||||
getMixer()->framesPerAudioBuffer() );
|
||||
int_sample_t * outbuf = bufferAllocator::alloc<int_sample_t>(
|
||||
getMixer()->framesPerAudioBuffer() *
|
||||
channels() );
|
||||
int_sample_t * pcmbuf = bufferAllocator::alloc<int_sample_t>(
|
||||
m_periodSize * channels() );
|
||||
new surroundSampleFrame[getMixer()->framesPerAudioBuffer()];
|
||||
int_sample_t * outbuf =
|
||||
new int_sample_t[getMixer()->framesPerAudioBuffer() *
|
||||
channels()];
|
||||
int_sample_t * pcmbuf = new int_sample_t[m_periodSize * channels()];
|
||||
|
||||
int outbuf_size = getMixer()->framesPerAudioBuffer() * channels();
|
||||
int outbuf_pos = 0;
|
||||
@@ -286,9 +283,9 @@ void audioALSA::run( void )
|
||||
}
|
||||
}
|
||||
|
||||
bufferAllocator::free( temp );
|
||||
bufferAllocator::free( outbuf );
|
||||
bufferAllocator::free( pcmbuf );
|
||||
delete[] temp;
|
||||
delete[] outbuf;
|
||||
delete[] pcmbuf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
|
||||
#include "audio_device.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
@@ -43,8 +42,7 @@ audioDevice::audioDevice( const sample_rate_t _sample_rate,
|
||||
m_sampleRate( _sample_rate ),
|
||||
m_channels( _channels ),
|
||||
m_mixer( _mixer ),
|
||||
m_buffer( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
getMixer()->framesPerAudioBuffer() ) )
|
||||
m_buffer( new surroundSampleFrame[getMixer()->framesPerAudioBuffer()] )
|
||||
{
|
||||
#ifdef HAVE_SAMPLERATE_H
|
||||
int error;
|
||||
@@ -70,7 +68,7 @@ audioDevice::~audioDevice()
|
||||
#ifdef HAVE_SAMPLERATE_H
|
||||
src_delete( m_srcState );
|
||||
#endif
|
||||
bufferAllocator::free( m_buffer );
|
||||
delete[] m_buffer;
|
||||
#ifdef QT3
|
||||
if( m_devMutex.locked() )
|
||||
{
|
||||
@@ -85,15 +83,17 @@ audioDevice::~audioDevice()
|
||||
|
||||
|
||||
|
||||
bool audioDevice::processNextBuffer( void )
|
||||
void audioDevice::processNextBuffer( void )
|
||||
{
|
||||
const fpab_t frames = getNextBuffer( m_buffer );
|
||||
if( !frames )
|
||||
if( frames )
|
||||
{
|
||||
return( FALSE );
|
||||
writeBuffer( m_buffer, frames, getMixer()->masterGain() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_in_process = FALSE;
|
||||
}
|
||||
writeBuffer( m_buffer, frames, getMixer()->masterGain() );
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,10 @@ fpab_t audioDevice::getNextBuffer( surroundSampleFrame * _ab )
|
||||
|
||||
void audioDevice::stopProcessing( void )
|
||||
{
|
||||
while( processNextBuffer() );
|
||||
while( m_in_process )
|
||||
{
|
||||
processNextBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
#include "audio_file_device.h"
|
||||
#include "export_project_dialog.h"
|
||||
#include "buffer_allocator.h"
|
||||
|
||||
|
||||
audioFileDevice::audioFileDevice( const sample_rate_t _sample_rate,
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "audio_file_wave.h"
|
||||
#include "endian_handling.h"
|
||||
#include "buffer_allocator.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
@@ -96,13 +95,12 @@ void FASTCALL audioFileWave::writeBuffer( const surroundSampleFrame * _ab,
|
||||
const fpab_t _frames,
|
||||
const float _master_gain )
|
||||
{
|
||||
int_sample_t * outbuf = bufferAllocator::alloc<int_sample_t>(
|
||||
_frames * channels() );
|
||||
int_sample_t * outbuf = new int_sample_t[_frames * channels()];
|
||||
Uint32 bytes = convertToS16( _ab, _frames, _master_gain, outbuf,
|
||||
!isLittleEndian() );
|
||||
writeData( outbuf, bytes );
|
||||
|
||||
bufferAllocator::free( outbuf );
|
||||
delete[] outbuf;
|
||||
|
||||
m_bytesWritten += bytes;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
#include "debug.h"
|
||||
#include "templates.h"
|
||||
#include "gui_templates.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "config_mgr.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "audio_port.h"
|
||||
@@ -69,8 +68,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
m_active( FALSE ),
|
||||
// m_processCallbackMutex(),
|
||||
m_stop_semaphore( 1 ),
|
||||
m_outBuf( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
getMixer()->framesPerAudioBuffer() ) ),
|
||||
m_outBuf( new surroundSampleFrame[getMixer()->framesPerAudioBuffer()] ),
|
||||
m_framesDoneInCurBuf( 0 ),
|
||||
m_framesToDoInCurBuf( 0 )
|
||||
{
|
||||
@@ -202,7 +200,7 @@ audioJACK::~audioJACK()
|
||||
jack_client_close( m_client );
|
||||
}
|
||||
|
||||
bufferAllocator::free( m_outBuf );
|
||||
delete[] m_outBuf;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "buffer_allocator.h"
|
||||
#include "endian_handling.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "gui_templates.h"
|
||||
@@ -317,11 +316,10 @@ void audioOSS::stopProcessing( void )
|
||||
void audioOSS::run( void )
|
||||
{
|
||||
surroundSampleFrame * temp =
|
||||
bufferAllocator::alloc<surroundSampleFrame>(
|
||||
getMixer()->framesPerAudioBuffer() );
|
||||
int_sample_t * outbuf = bufferAllocator::alloc<int_sample_t>(
|
||||
getMixer()->framesPerAudioBuffer() *
|
||||
channels() );
|
||||
new surroundSampleFrame[getMixer()->framesPerAudioBuffer()];
|
||||
int_sample_t * outbuf =
|
||||
new int_sample_t[getMixer()->framesPerAudioBuffer() *
|
||||
channels()];
|
||||
|
||||
while( TRUE )
|
||||
{
|
||||
@@ -337,8 +335,8 @@ void audioOSS::run( void )
|
||||
write( m_audioFD, outbuf, bytes );
|
||||
}
|
||||
|
||||
bufferAllocator::free( temp );
|
||||
bufferAllocator::free( outbuf );
|
||||
delete[] temp;
|
||||
delete[] outbuf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,15 +30,14 @@
|
||||
|
||||
#include "audio_port.h"
|
||||
#include "audio_device.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "engine.h"
|
||||
|
||||
audioPort::audioPort( const QString & _name ) :
|
||||
m_bufferUsage( NONE ),
|
||||
m_firstBuffer( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
engine::getMixer()->framesPerAudioBuffer() ) ),
|
||||
m_secondBuffer( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
engine::getMixer()->framesPerAudioBuffer() ) ),
|
||||
m_firstBuffer( new surroundSampleFrame[
|
||||
engine::getMixer()->framesPerAudioBuffer()] ),
|
||||
m_secondBuffer( new surroundSampleFrame[
|
||||
engine::getMixer()->framesPerAudioBuffer()] ),
|
||||
m_extOutputEnabled( FALSE ),
|
||||
m_nextFxChannel( -1 ),
|
||||
m_name( "unnamed port" )
|
||||
@@ -63,8 +62,8 @@ audioPort::~audioPort()
|
||||
{
|
||||
engine::getMixer()->audioDev()->unregisterPort( this );
|
||||
}
|
||||
bufferAllocator::free( m_firstBuffer );
|
||||
bufferAllocator::free( m_secondBuffer );
|
||||
delete[] m_firstBuffer;
|
||||
delete[] m_secondBuffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
#include "audio_sample_recorder.h"
|
||||
#include "sample_buffer.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
@@ -52,7 +51,7 @@ audioSampleRecorder::~audioSampleRecorder()
|
||||
{
|
||||
while( !m_buffers.empty() )
|
||||
{
|
||||
bufferAllocator::free( m_buffers.front().first );
|
||||
delete[] m_buffers.front().first;
|
||||
m_buffers.erase( m_buffers.begin() );
|
||||
}
|
||||
}
|
||||
@@ -78,9 +77,9 @@ void audioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf )
|
||||
{
|
||||
const f_cnt_t frames = framesRecorded();
|
||||
// create buffer to store all recorded buffers in
|
||||
sampleFrame * data = bufferAllocator::alloc<sampleFrame>( frames );
|
||||
sampleFrame * data = new sampleFrame[frames];
|
||||
// make sure buffer is cleaned up properly at the end...
|
||||
bufferAllocator::autoCleaner<sampleFrame> ac( data );
|
||||
sampleFrame * data_ptr = data;
|
||||
|
||||
#ifdef LMMS_DEBUG
|
||||
assert( data != NULL );
|
||||
@@ -89,12 +88,14 @@ void audioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf )
|
||||
for( bufferList::const_iterator it = m_buffers.begin();
|
||||
it != m_buffers.end(); ++it )
|
||||
{
|
||||
memcpy( data, ( *it ).first, ( *it ).second *
|
||||
memcpy( data_ptr, ( *it ).first, ( *it ).second *
|
||||
sizeof( sampleFrame ) );
|
||||
data += ( *it ).second;
|
||||
data_ptr += ( *it ).second;
|
||||
}
|
||||
// create according sample-buffer out of big buffer
|
||||
*_sample_buf = new sampleBuffer( ac.ptr(), frames );
|
||||
*_sample_buf = new sampleBuffer( data, frames );
|
||||
( *_sample_buf )->setSampleRate( sampleRate() );
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +104,7 @@ void audioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf )
|
||||
void audioSampleRecorder::writeBuffer( const surroundSampleFrame * _ab,
|
||||
const fpab_t _frames, const float )
|
||||
{
|
||||
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( _frames );
|
||||
sampleFrame * buf = new sampleFrame[_frames];
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "buffer_allocator.h"
|
||||
#include "debug.h"
|
||||
#include "config_mgr.h"
|
||||
#include "gui_templates.h"
|
||||
@@ -55,8 +54,7 @@
|
||||
audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
mixer * _mixer ) :
|
||||
audioDevice( _sample_rate, DEFAULT_CHANNELS, _mixer ),
|
||||
m_outBuf( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
getMixer()->framesPerAudioBuffer() ) ),
|
||||
m_outBuf( new surroundSampleFrame[getMixer()->framesPerAudioBuffer()] ),
|
||||
m_convertedBuf_pos( 0 ),
|
||||
m_convertEndian( FALSE ),
|
||||
m_stop_semaphore( 1 )
|
||||
@@ -65,8 +63,7 @@ audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
|
||||
m_convertedBuf_size = getMixer()->framesPerAudioBuffer() * channels()
|
||||
* sizeof( int_sample_t );
|
||||
m_convertedBuf = (Uint8 *)bufferAllocator::allocBytes(
|
||||
m_convertedBuf_size );
|
||||
m_convertedBuf = new Uint8[m_convertedBuf_size];
|
||||
|
||||
/* // if device is set, we set AUDIODEV-environment-variable, so that
|
||||
// SDL can evaluate and use it
|
||||
@@ -130,8 +127,8 @@ audioSDL::~audioSDL()
|
||||
#endif
|
||||
SDL_CloseAudio();
|
||||
SDL_Quit();
|
||||
bufferAllocator::free( m_convertedBuf );
|
||||
bufferAllocator::free( m_outBuf );
|
||||
delete[] m_convertedBuf;
|
||||
delete[] m_outBuf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
#include "song_editor.h"
|
||||
#include "main_window.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "templates.h"
|
||||
#include "gui_templates.h"
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "bb_editor.h"
|
||||
#include "song_editor.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "tool_button.h"
|
||||
#include "track_container.h"
|
||||
#include "bb_track.h"
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "envelope_and_lfo_widget.h"
|
||||
#include "song_editor.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "knob.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "oscillator.h"
|
||||
|
||||
@@ -253,7 +253,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
|
||||
const fpab_t _frames,
|
||||
notePlayHandle * _n )
|
||||
{
|
||||
f_cnt_t total_frames = _n->totalFramesPlayed();
|
||||
const f_cnt_t total_frames = _n->totalFramesPlayed();
|
||||
f_cnt_t release_begin = total_frames - _n->releaseFramesDone() +
|
||||
_n->framesBeforeRelease();
|
||||
|
||||
@@ -263,67 +263,49 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
|
||||
}
|
||||
|
||||
// because of optimizations, there's special code for several cases:
|
||||
// - volume-, cut- and res-lfo/envelope active
|
||||
// - volume- and cut-lfo/envelope active
|
||||
// - volume- and res-lfo/envelope active
|
||||
// - cut- and res-lfo/envelope active
|
||||
// - cut-lfo/envelope active
|
||||
// - res-lfo/envelope active
|
||||
// - volume-lfo/envelope active
|
||||
// - no lfo/envelope active but filter is used
|
||||
// now there's a lot of similar code but I didn't found a way to
|
||||
// generalize it yet... may be later we could do that
|
||||
// by using preprocessor and macro-expansion... (like in oscillator.cpp)
|
||||
|
||||
// only use filter, if it is really needed
|
||||
|
||||
if( _n->m_filter == NULL )
|
||||
{
|
||||
_n->m_filter = new basicFilters<>(
|
||||
engine::getMixer()->sampleRate() );
|
||||
}
|
||||
|
||||
m_envLFOWidgets[VOLUME]->lock();
|
||||
m_envLFOWidgets[CUT]->lock();
|
||||
m_envLFOWidgets[RES]->lock();
|
||||
|
||||
float * vol_buf = NULL;
|
||||
float * cut_buf = NULL;
|
||||
float * res_buf = NULL;
|
||||
|
||||
if( m_envLFOWidgets[VOLUME]->used() )
|
||||
{
|
||||
vol_buf = new float[_frames];
|
||||
m_envLFOWidgets[VOLUME]->fillLevel( vol_buf, total_frames,
|
||||
release_begin, _frames );
|
||||
}
|
||||
if( m_envLFOWidgets[CUT]->used() )
|
||||
{
|
||||
cut_buf = new float[_frames];
|
||||
m_envLFOWidgets[CUT]->fillLevel( cut_buf, total_frames,
|
||||
release_begin, _frames );
|
||||
}
|
||||
if( m_envLFOWidgets[RES]->used() )
|
||||
{
|
||||
res_buf = new float[_frames];
|
||||
m_envLFOWidgets[RES]->fillLevel( res_buf, total_frames,
|
||||
release_begin, _frames );
|
||||
}
|
||||
|
||||
if( m_filterGroupBox->isActive() )
|
||||
{
|
||||
int old_filter_cut = 0;
|
||||
int old_filter_res = 0;
|
||||
|
||||
basicFilters<>::filterTypes filter =
|
||||
basicFilters<>::getFilterType(
|
||||
m_filterComboBox->value() );
|
||||
if( _n->m_filter == NULL )
|
||||
{
|
||||
_n->m_filter = new basicFilters<>(
|
||||
engine::getMixer()->sampleRate() );
|
||||
}
|
||||
_n->m_filter->setType( basicFilters<>::getFilterType(
|
||||
m_filterComboBox->value() ) );
|
||||
|
||||
if( m_envLFOWidgets[VOLUME]->used() &&
|
||||
m_envLFOWidgets[CUT]->used() &&
|
||||
float * cut_buf = NULL;
|
||||
float * res_buf = NULL;
|
||||
|
||||
m_envLFOWidgets[CUT]->lock();
|
||||
m_envLFOWidgets[RES]->lock();
|
||||
|
||||
if( m_envLFOWidgets[CUT]->used() )
|
||||
{
|
||||
cut_buf = new float[_frames];
|
||||
m_envLFOWidgets[CUT]->fillLevel( cut_buf, total_frames,
|
||||
release_begin, _frames );
|
||||
}
|
||||
if( m_envLFOWidgets[RES]->used() )
|
||||
{
|
||||
res_buf = new float[_frames];
|
||||
m_envLFOWidgets[RES]->fillLevel( res_buf, total_frames,
|
||||
release_begin, _frames );
|
||||
}
|
||||
|
||||
if( m_envLFOWidgets[CUT]->used() &&
|
||||
m_envLFOWidgets[RES]->used() )
|
||||
{
|
||||
for( fpab_t frame = 0; frame < _frames;
|
||||
++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
float new_cut_val = envelopeAndLFOWidget::expKnobVal( cut_buf[frame] ) * CUT_FREQ_MULTIPLIER +
|
||||
m_filterCutKnob->value();
|
||||
@@ -334,76 +316,27 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
|
||||
if( static_cast<int>( new_cut_val ) != old_filter_cut ||
|
||||
static_cast<int>( new_res_val*RES_PRECISION ) != old_filter_res )
|
||||
{
|
||||
_n->m_filter->calcFilterCoeffs( filter, new_cut_val, new_res_val );
|
||||
_n->m_filter->calcFilterCoeffs( new_cut_val, new_res_val );
|
||||
old_filter_cut = static_cast<int>( new_cut_val );
|
||||
old_filter_res = static_cast<int>( new_res_val*RES_PRECISION );
|
||||
}
|
||||
|
||||
float vol_level = vol_buf[frame];
|
||||
vol_level = vol_level*vol_level;
|
||||
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
_ab[frame][chnl] = _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( m_envLFOWidgets[VOLUME]->used() && m_envLFOWidgets[CUT]->used() )
|
||||
{
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
float new_cut_val = envelopeAndLFOWidget::expKnobVal( cut_buf[frame] ) * CUT_FREQ_MULTIPLIER +
|
||||
m_filterCutKnob->value();
|
||||
|
||||
if( static_cast<int>( new_cut_val ) != old_filter_cut )
|
||||
{
|
||||
_n->m_filter->calcFilterCoeffs( filter, new_cut_val, m_filterResKnob->value() );
|
||||
old_filter_cut = static_cast<int>( new_cut_val );
|
||||
}
|
||||
|
||||
float vol_level = vol_buf[frame];
|
||||
vol_level = vol_level*vol_level;
|
||||
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( m_envLFOWidgets[VOLUME]->used() && m_envLFOWidgets[RES]->used() )
|
||||
{
|
||||
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
float new_res_val = m_filterResKnob->value() + RES_MULTIPLIER *
|
||||
res_buf[frame];
|
||||
|
||||
if( static_cast<int>( new_res_val*RES_PRECISION ) != old_filter_res )
|
||||
{
|
||||
_n->m_filter->calcFilterCoeffs( filter, m_filterCutKnob->value(), new_res_val );
|
||||
old_filter_res = static_cast<int>( new_res_val*RES_PRECISION );
|
||||
}
|
||||
|
||||
float vol_level = vol_buf[frame];
|
||||
vol_level = vol_level*vol_level;
|
||||
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if( m_envLFOWidgets[CUT]->used() )
|
||||
{
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
float new_cut_val = envelopeAndLFOWidget::expKnobVal( cut_buf[frame] ) * CUT_FREQ_MULTIPLIER +
|
||||
m_filterCutKnob->value();
|
||||
|
||||
if( static_cast<int>( new_cut_val ) != old_filter_cut )
|
||||
{
|
||||
_n->m_filter->calcFilterCoeffs( filter, new_cut_val, m_filterResKnob->value() );
|
||||
_n->m_filter->calcFilterCoeffs( new_cut_val, m_filterResKnob->value() );
|
||||
old_filter_cut = static_cast<int>( new_cut_val );
|
||||
}
|
||||
|
||||
@@ -415,14 +348,14 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
|
||||
}
|
||||
else if( m_envLFOWidgets[RES]->used() )
|
||||
{
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
float new_res_val = m_filterResKnob->value() + RES_MULTIPLIER *
|
||||
res_buf[frame];
|
||||
|
||||
if( static_cast<int>( new_res_val*RES_PRECISION ) != old_filter_res )
|
||||
{
|
||||
_n->m_filter->calcFilterCoeffs( filter, m_filterCutKnob->value(), new_res_val );
|
||||
_n->m_filter->calcFilterCoeffs( m_filterCutKnob->value(), new_res_val );
|
||||
old_filter_res = static_cast<int>( new_res_val*RES_PRECISION );
|
||||
}
|
||||
|
||||
@@ -432,26 +365,11 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( m_envLFOWidgets[VOLUME]->used() )
|
||||
{
|
||||
_n->m_filter->calcFilterCoeffs( filter, m_filterCutKnob->value(), m_filterResKnob->value() );
|
||||
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
float vol_level = vol_buf[frame];
|
||||
vol_level = vol_level*vol_level;
|
||||
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_n->m_filter->calcFilterCoeffs( filter, m_filterCutKnob->value(), m_filterResKnob->value() );
|
||||
_n->m_filter->calcFilterCoeffs( m_filterCutKnob->value(), m_filterResKnob->value() );
|
||||
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
@@ -459,24 +377,39 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_envLFOWidgets[RES]->unlock();
|
||||
m_envLFOWidgets[CUT]->unlock();
|
||||
|
||||
delete[] cut_buf;
|
||||
delete[] res_buf;
|
||||
}
|
||||
else if( m_envLFOWidgets[VOLUME]->used() /*&& m_envLFOWidgets[PANNING]->used() == FALSE*/ )
|
||||
|
||||
m_envLFOWidgets[VOLUME]->lock();
|
||||
if( m_envLFOWidgets[VOLUME]->used() )
|
||||
{
|
||||
// only use volume-envelope...
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
float * vol_buf = new float[_frames];
|
||||
m_envLFOWidgets[VOLUME]->fillLevel( vol_buf, total_frames,
|
||||
release_begin, _frames );
|
||||
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
float vol_level = vol_buf[frame];
|
||||
vol_level = vol_level*vol_level;
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
vol_level = vol_level * vol_level;
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS;
|
||||
++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _ab[frame][chnl];
|
||||
}
|
||||
}
|
||||
delete[] vol_buf;
|
||||
}
|
||||
m_envLFOWidgets[VOLUME]->unlock();
|
||||
|
||||
/* else if( m_envLFOWidgets[VOLUME]->used() == FALSE && m_envLFOWidgets[PANNING]->used() )
|
||||
{
|
||||
// only use panning-envelope...
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
float vol_level = pan_buf[frame];
|
||||
vol_level = vol_level*vol_level;
|
||||
@@ -486,14 +419,6 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
delete[] vol_buf;
|
||||
delete[] cut_buf;
|
||||
delete[] res_buf;
|
||||
|
||||
m_envLFOWidgets[RES]->unlock();
|
||||
m_envLFOWidgets[CUT]->unlock();
|
||||
m_envLFOWidgets[VOLUME]->unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "combobox.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
|
||||
#include "audio_file_wave.h"
|
||||
#include "audio_file_ogg.h"
|
||||
@@ -383,7 +384,8 @@ void exportProjectDialog::exportBtnClicked( void )
|
||||
songEditor::PLAY_SONG );
|
||||
|
||||
while( engine::getSongEditor()->exportDone() == FALSE &&
|
||||
engine::getSongEditor()->exporting() == TRUE )
|
||||
engine::getSongEditor()->exporting() == TRUE
|
||||
&& !m_deleteFile )
|
||||
{
|
||||
dev->processNextBuffer();
|
||||
int pval = pp * 100 /
|
||||
@@ -401,13 +403,7 @@ void exportProjectDialog::exportBtnClicked( void )
|
||||
qApp->processEvents();
|
||||
}
|
||||
|
||||
// if m_deleteFile == TRUE, user aborted export and finalization-
|
||||
// routines were already called, so we only need to call them if
|
||||
// export went through without any problems
|
||||
if( m_deleteFile == FALSE )
|
||||
{
|
||||
finishProjectExport();
|
||||
}
|
||||
finishProjectExport();
|
||||
}
|
||||
|
||||
|
||||
@@ -432,8 +428,6 @@ void exportProjectDialog::cancelBtnClicked( void )
|
||||
void exportProjectDialog::abortProjectExport( void )
|
||||
{
|
||||
m_deleteFile = TRUE;
|
||||
|
||||
finishProjectExport();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@
|
||||
#include "config_mgr.h"
|
||||
#include "mixer.h"
|
||||
#include "project_notes.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "setup_dialog.h"
|
||||
#include "audio_dummy.h"
|
||||
#include "tool.h"
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "song_editor.h"
|
||||
#include "templates.h"
|
||||
#include "envelope_and_lfo_widget.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "debug.h"
|
||||
#include "engine.h"
|
||||
#include "config_mgr.h"
|
||||
@@ -109,8 +108,7 @@ mixer::mixer( void ) :
|
||||
|
||||
for( Uint8 i = 0; i < 3; i++ )
|
||||
{
|
||||
m_readBuf = bufferAllocator::alloc<surroundSampleFrame>(
|
||||
m_framesPerAudioBuffer );
|
||||
m_readBuf = new surroundSampleFrame[m_framesPerAudioBuffer];
|
||||
|
||||
clearAudioBuffer( m_readBuf, m_framesPerAudioBuffer );
|
||||
m_bufferPool.push_back( m_readBuf );
|
||||
@@ -135,7 +133,7 @@ mixer::~mixer()
|
||||
|
||||
for( Uint8 i = 0; i < 3; i++ )
|
||||
{
|
||||
bufferAllocator::free( m_bufferPool[i] );
|
||||
delete[] m_bufferPool[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,11 +163,12 @@ void mixer::startProcessing( void )
|
||||
void mixer::stopProcessing( void )
|
||||
{
|
||||
m_fifo_writer->finish();
|
||||
|
||||
m_audioDev->stopProcessing();
|
||||
|
||||
m_fifo_writer->wait( 1000 );
|
||||
m_fifo_writer->terminate();
|
||||
delete m_fifo_writer;
|
||||
|
||||
m_audioDev->stopProcessing();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "note.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "knob.h"
|
||||
#include "templates.h"
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
|
||||
#include "note_play_handle.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "instrument_track.h"
|
||||
#include "envelope_tab_widget.h"
|
||||
#include "midi.h"
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
|
||||
|
||||
#include "piano_roll.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "song_editor.h"
|
||||
#include "main_window.h"
|
||||
#include "pattern.h"
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
|
||||
#include "piano_widget.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "instrument_track.h"
|
||||
#include "midi.h"
|
||||
#include "templates.h"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "pattern.h"
|
||||
#include "sample_buffer.h"
|
||||
#include "sample_track.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "audio_port.h"
|
||||
|
||||
|
||||
@@ -132,8 +131,7 @@ void samplePlayHandle::play( const fpab_t _frame_base, bool )
|
||||
if( !( m_track && m_track->muted() )
|
||||
&& !( m_bbTrack && m_bbTrack->muted() ) )
|
||||
{
|
||||
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>(
|
||||
frames );
|
||||
sampleFrame * buf = new sampleFrame[frames];
|
||||
volumeVector v = { { m_volume, m_volume
|
||||
#ifndef DISABLE_SURROUND
|
||||
, m_volume, m_volume
|
||||
@@ -143,7 +141,7 @@ void samplePlayHandle::play( const fpab_t _frame_base, bool )
|
||||
engine::getMixer()->bufferToPort( buf, frames, _frame_base, v,
|
||||
m_audioPort );
|
||||
|
||||
bufferAllocator::free( buf );
|
||||
delete[] buf;
|
||||
}
|
||||
|
||||
m_frame += frames;
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include "project_journal.h"
|
||||
#include "config_mgr.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "debug.h"
|
||||
#include "tooltip.h"
|
||||
#include "led_checkbox.h"
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
|
||||
|
||||
#include "song_editor.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "automatable_slider.h"
|
||||
#include "bb_editor.h"
|
||||
#include "rename_dialog.h"
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "surround_area.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
#include "templates.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
|
||||
|
||||
#include "track.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "track_container.h"
|
||||
#include "automation_track.h"
|
||||
#include "instrument_track.h"
|
||||
|
||||
@@ -1,230 +0,0 @@
|
||||
#ifndef SINGLE_SOURCE_COMPILE
|
||||
|
||||
/*
|
||||
* buffer_allocator.cpp - namespace bufferAllocator providing routines for own
|
||||
* optimized memory-management for audio-buffers
|
||||
*
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMutex>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpair.h>
|
||||
#include <qvaluelist.h>
|
||||
#include <qmutex.h>
|
||||
|
||||
#define qSort qHeapSort
|
||||
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "buffer_allocator.h"
|
||||
#include "templates.h"
|
||||
#include "mixer.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
struct bufDesc
|
||||
{
|
||||
bool free;
|
||||
char * origPtr;
|
||||
void * buf;
|
||||
Uint32 bytes;
|
||||
Uint32 timesUsed;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
inline bool operator<( const bufDesc & _bd1, const bufDesc & _bd2 )
|
||||
{
|
||||
return( _bd1.timesUsed < _bd2.timesUsed );
|
||||
}
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
inline bool operator==( const bufDesc & _bd1, const bufDesc & _bd2 )
|
||||
{
|
||||
return( memcmp( &_bd1, &_bd2, sizeof( bufDesc ) ) == 0 );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
inline bool operator!=( const bufDesc & _bd1, const bufDesc & _bd2 )
|
||||
{
|
||||
return( memcmp( &_bd1, &_bd2, sizeof( bufDesc ) ) != 0 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
static vlist<bufDesc> s_buffers;
|
||||
typedef vlist<bufDesc>::iterator bufIt;
|
||||
|
||||
static int s_freeBufs = 0;
|
||||
static bool s_autoCleanupDisabled = FALSE;
|
||||
static QMutex s_buffersMutex;
|
||||
|
||||
|
||||
const int BUFFER_ALIGN = 16;
|
||||
const int BUFFER_ALIGN_MASK = BUFFER_ALIGN - 1;
|
||||
|
||||
|
||||
|
||||
void bufferAllocator::cleanUp( Uint16 _level )
|
||||
{
|
||||
// first insert all unused bufs into an array
|
||||
vlist<bufDesc> bufsToRemove;
|
||||
for( bufIt it = s_buffers.begin(); it != s_buffers.end(); ++it )
|
||||
{
|
||||
if( ( *it ).free )
|
||||
{
|
||||
bufsToRemove.push_back( *it );
|
||||
}
|
||||
}
|
||||
|
||||
// sort array by usage of each buffer
|
||||
// ( operator<(...) compares bufDesc::timesUsed )
|
||||
qSort( bufsToRemove );
|
||||
|
||||
const Sint16 todo = tMin<Sint16>( s_buffers.size() - _level,
|
||||
bufsToRemove.size() );
|
||||
|
||||
// now cleanup the first n elements of sorted array
|
||||
for( Sint16 i = 0; i < todo; ++i )
|
||||
{
|
||||
delete[] bufsToRemove[i].origPtr;
|
||||
s_buffers.erase( qFind( s_buffers.begin(), s_buffers.end(),
|
||||
bufsToRemove[i] ) );
|
||||
--s_freeBufs;
|
||||
}
|
||||
|
||||
#ifdef LMMS_DEBUG
|
||||
//printf( "cleaned up %d buffers\n", todo );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bufferAllocator::free( void * _buf )
|
||||
{
|
||||
s_buffersMutex.lock();
|
||||
|
||||
// look for buffer
|
||||
for( bufIt it = s_buffers.begin(); it != s_buffers.end(); ++it )
|
||||
{
|
||||
if( !( *it ).free && ( *it ).buf == _buf )
|
||||
{
|
||||
++( *it ).timesUsed;
|
||||
( *it ).free = TRUE;
|
||||
++s_freeBufs;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// do clean-up if neccessary
|
||||
static const csize CLEANUP_LEVEL = static_cast<csize>( 768 / ( logf(
|
||||
/*mixer::inst()->framesPerAudioBuffer()*/
|
||||
128 ) /
|
||||
logf( 2 ) ) );
|
||||
static int count = 0;
|
||||
// only cleanup every 10th time, because otherwise there's a lot of
|
||||
// overhead e.g. when freeing a lot of single buffers
|
||||
if( s_autoCleanupDisabled == FALSE &&
|
||||
s_buffers.size() > CLEANUP_LEVEL && ++count > 10 )
|
||||
{
|
||||
cleanUp( CLEANUP_LEVEL );
|
||||
count = 0;
|
||||
}
|
||||
|
||||
s_buffersMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void * bufferAllocator::allocBytes( Uint32 _bytes )
|
||||
{
|
||||
QMutexLocker ml( &s_buffersMutex );
|
||||
|
||||
// there's a low probability that we find a matching buffer, if there're
|
||||
// less than 2 bufs available, so do not search - this speeds up
|
||||
// processes like pattern-freezing because this way we do not have to
|
||||
// search for a free buffer in an array, containing several
|
||||
// 10.000 buffers
|
||||
if( (csize) s_freeBufs > s_buffers.size() / 10 )
|
||||
{
|
||||
bufIt free_buf = s_buffers.end();
|
||||
|
||||
// look whether there's a buffer matching to the one wanted and
|
||||
// find out the most used one (higher chances for being in CPU-
|
||||
// cache)
|
||||
for( bufIt it = s_buffers.begin(); it != s_buffers.end(); ++it )
|
||||
{
|
||||
if( ( *it ).free && ( *it ).bytes == _bytes )
|
||||
{
|
||||
if( free_buf == s_buffers.end() ||
|
||||
( *it ).timesUsed >
|
||||
( *free_buf ).timesUsed )
|
||||
{
|
||||
free_buf = it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( free_buf != s_buffers.end() )
|
||||
{
|
||||
--s_freeBufs;
|
||||
( *free_buf ).free = FALSE;
|
||||
return( ( *free_buf ).buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// got nothing so far, so we'll alloc a new (aligned) buf
|
||||
bufDesc d = { FALSE, new char[_bytes + BUFFER_ALIGN], NULL, _bytes, 0 };
|
||||
d.buf = (void *)( (size_t) d.origPtr + ( BUFFER_ALIGN -
|
||||
( (size_t) d.origPtr &
|
||||
BUFFER_ALIGN_MASK ) ) );
|
||||
s_buffers.push_back( d );
|
||||
return( d.buf );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bufferAllocator::disableAutoCleanup( bool _disabled )
|
||||
{
|
||||
s_autoCleanupDisabled = _disabled;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "src/core/effect_tab_widget.cpp"
|
||||
#include "src/core/midi_tab_widget.cpp"
|
||||
#include "src/lib/string_pair_drag.cpp"
|
||||
#include "src/lib/buffer_allocator.cpp"
|
||||
#include "src/lib/journalling_object.cpp"
|
||||
#include "src/lib/project_journal.cpp"
|
||||
#include "src/lib/embed.cpp"
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
#include "arp_and_chords_tab_widget.h"
|
||||
#include "instrument.h"
|
||||
#include "audio_port.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "midi_client.h"
|
||||
#include "midi_port.h"
|
||||
#include "midi_tab_widget.h"
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
#include "tooltip.h"
|
||||
#include "bb_editor.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "main_window.h"
|
||||
|
||||
|
||||
@@ -1317,8 +1316,6 @@ patternFreezeThread::~patternFreezeThread()
|
||||
|
||||
void patternFreezeThread::run( void )
|
||||
{
|
||||
bufferAllocator::disableAutoCleanup( TRUE );
|
||||
|
||||
// create and install audio-sample-recorder
|
||||
bool b;
|
||||
// we cannot create local copy, because at a later stage
|
||||
@@ -1368,8 +1365,6 @@ void patternFreezeThread::run( void )
|
||||
m_pattern->m_frozenPatternMutex.unlock();
|
||||
}
|
||||
|
||||
bufferAllocator::disableAutoCleanup( FALSE );
|
||||
|
||||
// restore original audio-device
|
||||
engine::getMixer()->restoreAudioDevice();
|
||||
|
||||
|
||||
@@ -49,9 +49,11 @@
|
||||
#include "sample_track.h"
|
||||
#include "song_editor.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "templates.h"
|
||||
#include "tooltip.h"
|
||||
#include "audio_port.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "sample_play_handle.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "knob.h"
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
@@ -296,7 +297,7 @@ void automatableButtonGroup::setValue( const int _value )
|
||||
|
||||
|
||||
#ifdef QT3
|
||||
#undef findIndex
|
||||
#undef indexOf
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
|
||||
#include "combobox.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "templates.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "effect_label.h"
|
||||
#include "sample_track.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "rename_dialog.h"
|
||||
#include "main_window.h"
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "knob.h"
|
||||
#include "automatable_object_templates.h"
|
||||
/*#include "midi_client.h"*/
|
||||
#include "embed.h"
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
|
||||
|
||||
#include "lcd_spinbox.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
#include "templates.h"
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
|
||||
#include "led_checkbox.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
|
||||
#include "pixmap_button.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
#include "tooltip.h"
|
||||
#include "effect_control_dialog.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "main_window.h"
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
|
||||
|
||||
#include "tempo_sync_knob.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "song_editor.h"
|
||||
#include "embed.h"
|
||||
#include "main_window.h"
|
||||
@@ -76,7 +77,10 @@ tempoSyncKnob::tempoSyncKnob( int _knob_num, QWidget * _parent,
|
||||
|
||||
tempoSyncKnob::~tempoSyncKnob()
|
||||
{
|
||||
m_custom->deleteLater();
|
||||
if( m_custom )
|
||||
{
|
||||
m_custom->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#include "visualization_widget.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "templates.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
@@ -68,7 +67,7 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p,
|
||||
|
||||
|
||||
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
|
||||
m_buffer = bufferAllocator::alloc<surroundSampleFrame>( frames );
|
||||
m_buffer = new surroundSampleFrame[frames];
|
||||
|
||||
engine::getMixer()->clearAudioBuffer( m_buffer, frames );
|
||||
|
||||
@@ -94,6 +93,7 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p,
|
||||
|
||||
visualizationWidget::~visualizationWidget()
|
||||
{
|
||||
delete[] m_buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,8 +28,10 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "volume_knob.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "main_window.h"
|
||||
#include "config_mgr.h"
|
||||
#include "engine.h"
|
||||
#include "text_float.h"
|
||||
#include "string_pair_drag.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user