M/V-split for instrument-tracks

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@638 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-01-03 00:57:51 +00:00
parent e07c7fccee
commit ea467f92b7
8 changed files with 254 additions and 94 deletions

View File

@@ -3,7 +3,7 @@
/*
* instrument.cpp - base-class for all instrument-plugins (synths, samplers etc)
*
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -34,12 +34,10 @@
instrument::instrument( instrumentTrack * _instrument_track,
const descriptor * _descriptor ) :
QWidget( _instrument_track->tabWidgetParent() ),
plugin( _descriptor ),
model( /* _instrument_track */ NULL ),
m_instrumentTrack( _instrument_track )
{
setFixedSize( 250, 250 );
m_instrumentTrack->setWindowIcon( *getDescriptor()->logo );
}
@@ -107,6 +105,16 @@ bool instrument::isFromTrack( const track * _track ) const
instrumentView * instrument::createEditor( QWidget * _parent )
{
instrumentView * i = createView( _parent );
i->setModel( this );
return( i );
}
void instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n )
{
const fpp_t frames = _n->framesLeftForCurrentPeriod();
@@ -128,4 +136,43 @@ void instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n )
}
}
instrumentView::instrumentView( instrument * _instrument, QWidget * _parent ) :
QWidget( _parent ),
modelView()
{
setModel( _instrument );
setFixedSize( 250, 250 );
}
instrumentView::~instrumentView()
{
}
void instrumentView::setModel( ::model * _model, bool )
{
if( dynamic_cast<instrument *>( _model ) != NULL )
{
modelView::setModel( _model );
if( dynamic_cast<instrumentTrack *>( parentWidget() ) != NULL )
{
dynamic_cast<instrumentTrack *>( parentWidget() )->
setWindowIcon( *( model()->
getDescriptor()->logo ) );
}
}
}
#endif

View File

@@ -4,7 +4,7 @@
* instrument_track.cpp - implementation of instrument-track-class
* (window + data-structures)
*
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -1040,7 +1040,8 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this )
m_instrument->restoreState(
node.toElement() );
}
m_tabWidget->addTab( m_instrument,
m_tabWidget->addTab( m_instrument->
createEditor( m_tabWidget ),
tr( "PLUGIN" ), 0 );
}
}
@@ -1075,7 +1076,8 @@ instrument * instrumentTrack::loadInstrument( const QString & _plugin_name )
m_instrument = instrument::instantiate( _plugin_name, this );
engine::getMixer()->unlock();
m_tabWidget->addTab( m_instrument, tr( "PLUGIN" ), 0 );
m_tabWidget->addTab( m_instrument->createEditor( m_tabWidget ),
tr( "PLUGIN" ), 0 );
m_tabWidget->setActiveTab( 0 );
m_tswInstrumentTrackButton->update();