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

@@ -1,3 +1,24 @@
2006-12-09 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* configure.in:
check for ${prefix} before extending CFLAGS etc. - should fix issue
with make-problems when using older automake-versions
* include/instrument.h:
* include/envelope_tab_widget.h:
* src/core/envelope_tab_widget.cpp:
support for instruments which want to define their own number of
release-frames
* include/instrument_track.h:
* include/instrument.h:
* src/core/note_play_handle.cpp:
support for monophonic instruments
* include/mixer.h:
* src/core/mixer.cpp:
made mixer::removePlayHandle() to accept const-pointers
2006-12-06 Javier Serrano Polo <jasp00/at/terra/dot/es>
* include/note.h:

View File

@@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(lmms, 0.2.1-svn20061206, lmms-devel/at/lists/dot/sf/dot/net)
AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20061206)
AC_INIT(lmms, 0.2.1-svn20061209, lmms-devel/at/lists/dot/sf/dot/net)
AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20061209)
AM_CONFIG_HEADER(config.h)
@@ -15,9 +15,11 @@ AC_PROG_LN_S
AC_PROG_GCC_TRADITIONAL
AM_PROG_LIBTOOL
CFLAGS="$CFLAGS -I${prefix}/include"
CPPFLAGS="$CPPFLAGS -I${prefix}/include"
LDFLAGS="$LDFLAGS -L${prefix}/bin"
if ! test -z "${prefix}" -o "${prefix}" = "NONE" ; then
CFLAGS="$CFLAGS -I${prefix}/include"
CPPFLAGS="$CPPFLAGS -I${prefix}/include"
LDFLAGS="$LDFLAGS -L${prefix}/bin"
fi
AH_TEMPLATE(BUILD_LINUX, [Build LMMS for Linux])
AH_TEMPLATE(BUILD_WIN32, [Build LMMS for Win32])

View File

@@ -97,6 +97,7 @@ public:
private:
tabWidget * m_targetsTabWidget;
envelopeAndLFOWidget * m_envLFOWidgets[TARGET_COUNT];
instrumentTrack * m_instrumentTrack;
// filter-stuff
groupBox * m_filterGroupBox;

View File

@@ -87,6 +87,22 @@ public:
virtual f_cnt_t FASTCALL beatLen( notePlayHandle * _n ) const;
// some instruments need a certain number of release-frames even
// if no envelope is active - such instruments can re-implement this
// method for returning how many frames they at least like to have for
// release
virtual f_cnt_t desiredReleaseFrames( void ) const
{
return( 0 );
}
// monophonic instruments can re-implement this indicate that they do
// not allow more then one note being played at the same time
virtual bool isMonophonic( void ) const
{
return( FALSE );
}
// instrument-play-handles use this for checking whether they can mark
// themselves as done, so that mixer trashes them
inline virtual bool valid( void ) const

View File

@@ -107,6 +107,11 @@ public:
void FASTCALL playNote( notePlayHandle * _n, bool _try_parallelizing );
QString instrumentName( void ) const;
inline const instrument * getInstrument( void ) const
{
return( m_instrument );
}
void FASTCALL deleteNotePluginData( notePlayHandle * _n );
// name-stuff

View File

@@ -172,7 +172,7 @@ public:
return( FALSE );
}
inline void removePlayHandle( playHandle * _ph )
inline void removePlayHandle( const playHandle * _ph )
{
m_playHandlesToRemove.push_back( _ph );
}
@@ -287,6 +287,7 @@ public slots:
void setHighQuality( bool _hq_on = FALSE );
void setClipScaling( bool _state );
signals:
void sampleRateChanged( void );
void nextAudioBuffer( const surroundSampleFrame *, int _frames );
@@ -294,7 +295,7 @@ signals:
private:
mixer( engine * _engine );
~mixer();
virtual ~mixer();
void startProcessing( void );
void stopProcessing( void );
@@ -341,7 +342,7 @@ private:
int m_parallelizingLevel;
playHandleVector m_playHandles;
playHandleVector m_playHandlesToRemove;
constPlayHandleVector m_playHandlesToRemove;
qualityLevels m_qualityLevel;
float m_masterGain;

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() &&