added dummyTrackContainer with dummyInstrumentTrack in order to have a default-model for cached inactive instrument-track-windows - fixes regular crashes

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@863 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-04-01 22:31:10 +00:00
parent 108f3a9a68
commit c2dbbd7fe0
8 changed files with 90 additions and 11 deletions

View File

@@ -1,5 +1,39 @@
2008-04-01 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/ladspa_effect/Makefile.am:
* plugins/patman/Makefile.am:
* plugins/lb302/Makefile.am:
* plugins/organic/Makefile.am:
* plugins/bass_booster/Makefile.am:
* plugins/bit_invader/Makefile.am:
* plugins/vst_effect/Makefile.am:
* plugins/vibed/Makefile.am:
* plugins/triple_oscillator/Makefile.am:
* plugins/live_tool/Makefile.am:
* plugins/live_tool/live_tool.cpp:
* plugins/singerbot/Makefile.am:
* plugins/audio_file_processor/Makefile.am:
* plugins/stk/mallets/Makefile.am:
* plugins/stereo_enhancer/Makefile.am:
* plugins/vestige/Makefile.am:
* plugins/sf2_player/Makefile.am:
* plugins/ladspa_browser/Makefile.am:
* plugins/kicker/Makefile.am:
* plugins/polyb302/Makefile.am:
* plugins/flp_import/flp_import.cpp:
corrected paths / includes
* include/engine.h:
* include/instrument_track.h:
* include/preset_preview_play_handle.h:
* src/tracks/instrument_track.cpp:
* src/core/preset_preview_play_handle.cpp:
* src/core/track_container.cpp:
* src/core/engine.cpp:
added dummyTrackContainer with dummyInstrumentTrack in order to have a
default-model for cached inactive instrument-track-windows - fixes
regular crashes
* include/engine.h:
* include/bb_track_container.h:
* include/track_container_view.h:

View File

@@ -126,6 +126,11 @@ public:
return( s_ladspaManager );
}
static dummyTrackContainer * getDummyTrackContainer( void )
{
return( s_dummyTC );
}
static float framesPerTact64th( void )
{
return( s_framesPerTact64th );

View File

@@ -223,6 +223,9 @@ public:
void freeInstrumentTrackWindow( void );
static void cleanupWindowPool( void );
private slots:
void toggledInstrumentTrackButton( bool _on );
void activityIndicatorPressed( void );

View File

@@ -46,7 +46,7 @@ public:
virtual bool isFromTrack( const track * _track ) const;
static void init( void );
static void cleanUp( void );
static void cleanup( void );
static constNotePlayHandleVector nphsOfInstrumentTrack(
const instrumentTrack * _ct );

View File

@@ -58,6 +58,7 @@ pianoRoll * engine::s_pianoRoll = NULL;
projectNotes * engine::s_projectNotes = NULL;
projectJournal * engine::s_projectJournal = NULL;
ladspa2LMMS * engine::s_ladspaManager = NULL;
dummyTrackContainer * engine::s_dummyTC = NULL;
QMap<QString, QString> engine::s_sampleExtensions;
@@ -97,6 +98,7 @@ void engine::init( const bool _has_gui )
}
presetPreviewPlayHandle::init();
s_dummyTC = new dummyTrackContainer;
s_mixer->startProcessing();
}
@@ -121,15 +123,21 @@ void engine::destroy( void )
delete s_fxMixerView;
s_fxMixerView = NULL;
delete s_fxMixer;
s_fxMixer = NULL;
presetPreviewPlayHandle::cleanup();
instrumentTrackView::cleanupWindowPool();
delete s_song;
delete s_bbTrackContainer;
delete s_dummyTC;
delete s_ladspaManager;
presetPreviewPlayHandle::cleanUp();
delete s_mixer;
s_mixer = NULL;
delete s_fxMixer;
s_fxMixer = NULL;
//delete configManager::inst();
delete s_projectJournal;
s_projectJournal = NULL;

View File

@@ -196,7 +196,7 @@ void presetPreviewPlayHandle::init( void )
void presetPreviewPlayHandle::cleanUp( void )
void presetPreviewPlayHandle::cleanup( void )
{
delete s_previewTC;
s_previewTC = NULL;

View File

@@ -24,13 +24,11 @@
*/
#include "track_container.h"
#include <QtGui/QApplication>
#include <QtGui/QProgressDialog>
#include "track_container.h"
#include "instrument_track.h"
#include "engine.h"
#include "song.h"
@@ -203,5 +201,21 @@ void trackContainer::setMutedOfAllTracks( bool _muted )
dummyTrackContainer::dummyTrackContainer( void ) :
trackContainer(),
m_dummyInstrumentTrack( NULL )
{
setJournalling( FALSE );
m_dummyInstrumentTrack = dynamic_cast<instrumentTrack *>(
track::create( track::InstrumentTrack,
this ) );
m_dummyInstrumentTrack->setJournalling( FALSE );
}
#include "track_container.moc"

View File

@@ -921,6 +921,10 @@ void instrumentTrackView::freeInstrumentTrackWindow( void )
{
if( s_windows.count() < INSTRUMENT_WINDOW_CACHE_SIZE )
{
m_window->setModel(
engine::getDummyTrackContainer()->
dummyInstrumentTrack() );
m_window->parentWidget()->hide();
s_windows.enqueue( m_window );
}
else
@@ -935,6 +939,17 @@ void instrumentTrackView::freeInstrumentTrackWindow( void )
void instrumentTrackView::cleanupWindowPool( void )
{
while( s_windows.count() )
{
delete s_windows.dequeue();
}
}
instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void )
{
if( m_window != NULL )
@@ -1179,7 +1194,7 @@ instrumentTrackWindow::~instrumentTrackWindow()
void instrumentTrackWindow::modelChanged( void )
{
m_track = m_itv->model();
m_track = castModel<instrumentTrack>();
m_instrumentNameLE->setText( m_track->name() );