fixed potential segfault and small GUI-improvement
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@567 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
14
ChangeLog
14
ChangeLog
@@ -1,3 +1,17 @@
|
||||
2007-09-25 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* include/mixer.h:
|
||||
* include/visualization_widget.h:
|
||||
* src/core/mixer.cpp:
|
||||
* src/widget/visualization_widget.cpp:
|
||||
reworked code for retrieving current mixer-buffer for visualizing it -
|
||||
do not use signal/slot-mechanism for passing pointer and use
|
||||
currentReadBuffer() + mixer-mutex instead which probably fixes some
|
||||
mixer-related crashes
|
||||
|
||||
* src/widget/effect_label.cpp:
|
||||
set window-title for effect-chain-windows of a sample-track etc.
|
||||
|
||||
2007-09-16 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/ladspa_effect/ladspa_subplugin_features.cpp:
|
||||
|
||||
@@ -188,9 +188,9 @@ public:
|
||||
return( m_framesPerPeriod );
|
||||
}
|
||||
|
||||
inline const surroundSampleFrame * currentAudioBuffer( void ) const
|
||||
inline const surroundSampleFrame * currentReadBuffer( void ) const
|
||||
{
|
||||
return( m_writeBuf );
|
||||
return( m_readBuf );
|
||||
}
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ public slots:
|
||||
|
||||
signals:
|
||||
void sampleRateChanged( void );
|
||||
void nextAudioBuffer( const surroundSampleFrame *, int _frames );
|
||||
void nextAudioBuffer( void );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -54,7 +54,7 @@ protected:
|
||||
|
||||
|
||||
protected slots:
|
||||
void setAudioBuffer( const surroundSampleFrame * _ab, int _frames );
|
||||
void updateAudioBuffer( void );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -376,11 +376,10 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
emit nextAudioBuffer( m_readBuf, m_framesPerPeriod );
|
||||
|
||||
unlock();
|
||||
|
||||
emit nextAudioBuffer();
|
||||
|
||||
// and trigger LFOs
|
||||
envelopeAndLFOWidget::triggerLFO();
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ effectLabel::effectLabel( const QString & _initial_name, QWidget * _parent,
|
||||
|
||||
engine::getMainWindow()->workspace()->addWindow( m_effWidget );
|
||||
|
||||
m_effWidget->setWindowTitle( _initial_name );
|
||||
m_effWidget->setFixedSize( 240, 242 );
|
||||
m_effWidget->hide();
|
||||
connect( m_effWidget, SIGNAL( closed() ),
|
||||
@@ -92,6 +93,7 @@ QString effectLabel::text( void ) const
|
||||
void FASTCALL effectLabel::setText( const QString & _text )
|
||||
{
|
||||
m_label->setText( _text );
|
||||
m_effWidget->setWindowTitle( _text );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -63,10 +63,8 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p,
|
||||
m_updateTimer->start( UPDATE_TIME );
|
||||
}
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( nextAudioBuffer(
|
||||
const surroundSampleFrame *, int ) ),
|
||||
this, SLOT( setAudioBuffer(
|
||||
const surroundSampleFrame *, int ) ) );
|
||||
connect( engine::getMixer(), SIGNAL( nextAudioBuffer() ),
|
||||
this, SLOT( updateAudioBuffer() ) );
|
||||
|
||||
toolTip::add( this, tr( "click to enable/disable visualization of "
|
||||
"master-output" ) );
|
||||
@@ -83,12 +81,15 @@ visualizationWidget::~visualizationWidget()
|
||||
|
||||
|
||||
|
||||
void visualizationWidget::setAudioBuffer( const surroundSampleFrame * _ab,
|
||||
int _frames )
|
||||
void visualizationWidget::updateAudioBuffer( void )
|
||||
{
|
||||
if( m_enabled == TRUE )
|
||||
{
|
||||
memcpy( m_buffer, *_ab, _frames * BYTES_PER_SURROUND_FRAME);
|
||||
engine::getMixer()->lock();
|
||||
memcpy( m_buffer, engine::getMixer()->currentReadBuffer(),
|
||||
engine::getMixer()->framesPerPeriod() *
|
||||
BYTES_PER_SURROUND_FRAME );
|
||||
engine::getMixer()->unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user