support for more special instrument-properties (monophonic, own number of release-frames)

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@436 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2006-12-09 23:34:57 +00:00
parent 26393dab8d
commit b91c607651
9 changed files with 83 additions and 11 deletions

View File

@@ -84,7 +84,8 @@ static const QString targetNames[envelopeTabWidget::TARGET_COUNT][2] =
envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
QWidget( _instrument_track->tabWidgetParent() ),
journallingObject( _instrument_track->eng() )
journallingObject( _instrument_track->eng() ),
m_instrumentTrack( _instrument_track )
{
m_targetsTabWidget = new tabWidget( tr( "TARGET" ), this );
@@ -525,6 +526,13 @@ f_cnt_t envelopeTabWidget::releaseFrames( const bool _only_vol )
{
f_cnt_t ret_val = m_envLFOWidgets[VOLUME]->used() ?
m_envLFOWidgets[VOLUME]->m_rFrames : 0;
if( m_instrumentTrack->getInstrument()->desiredReleaseFrames() >
ret_val )
{
ret_val = m_instrumentTrack->getInstrument()->
desiredReleaseFrames();
}
if( m_envLFOWidgets[VOLUME]->used() == FALSE )
{
for( int i = VOLUME+1; i < TARGET_COUNT; ++i )

View File

@@ -235,8 +235,9 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
{
if( *it == m_playHandlesToRemove.front() )
{
delete *it;
m_playHandles.erase( it );
delete m_playHandlesToRemove.front();
//delete m_playHandlesToRemove.front();
break;
}
++it;

View File

@@ -60,6 +60,20 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
m_muted( FALSE ),
m_bbTrack( NULL )
{
// if the instrument is monophonic we do not allow other note-play-
// handles to exist for this track and therefore remove them
if( m_instrumentTrack->getInstrument()->isMonophonic() )
{
constNotePlayHandleVector cphv = nphsOfInstrumentTrack(
m_instrumentTrack );
for( constNotePlayHandleVector::iterator it = cphv.begin();
it != cphv.end(); ++it )
{
m_instrumentTrack->eng()->getMixer()->
removePlayHandle( *it );
}
}
setDetuning( _n.detuning() );
if( detuning() )
{
@@ -318,7 +332,9 @@ void notePlayHandle::setFrames( const f_cnt_t _frames )
float notePlayHandle::volumeLevel( const f_cnt_t _frame )
{
return( ( m_instrumentTrack != NULL ) ?
m_instrumentTrack->m_envWidget->volumeLevel( this, _frame ) : 0 );
m_instrumentTrack->m_envWidget->volumeLevel( this, _frame )
:
0 );
}
@@ -388,6 +404,7 @@ constNotePlayHandleVector notePlayHandle::nphsOfInstrumentTrack(
bool notePlayHandle::operator==( const notePlayHandle & _nph ) const
{
return( length() == _nph.length() &&