moved framesPerTact() from songEditor to engine

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@276 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Javier Serrano Polo
2006-08-01 21:28:20 +00:00
parent e6ff4b1c4b
commit 629641dc33
5 changed files with 21 additions and 20 deletions

View File

@@ -105,9 +105,16 @@ public:
void close( void );
float framesPerTact( void ) const
{
return( m_frames_per_tact );
}
void updateFramesPerTact( void );
private:
bool m_hasGUI;
float m_frames_per_tact;
mixer * m_mixer;
mainWindow * m_mainWindow;

View File

@@ -89,7 +89,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
( m_instrumentTrack->getVolume() / 100.0f ) *
127 ), 0, 127 ) ),
midiTime::fromFrames( m_framesAhead,
m_instrumentTrack->eng()->getSongEditor()->framesPerTact() ) );
m_instrumentTrack->eng()->framesPerTact() ) );
}
@@ -274,17 +274,12 @@ void notePlayHandle::noteOff( const f_cnt_t _s )
FALSE );
}
// send MIDI-note-off-event
// TODO: move framesPerTact() to engine
if( m_instrumentTrack->eng()->getSongEditor() )
{
m_instrumentTrack->processOutEvent( midiEvent( NOTE_OFF,
m_instrumentTrack->processOutEvent( midiEvent( NOTE_OFF,
m_instrumentTrack->m_midiPort->outputChannel(),
key(), 0 ),
midiTime::fromFrames(
m_framesBeforeRelease,
m_instrumentTrack->eng()->getSongEditor()
->framesPerTact() ) );
}
m_instrumentTrack->eng()->framesPerTact() ) );
}
else
{

View File

@@ -385,7 +385,7 @@ bool FASTCALL bbTrack::play( const midiTime & _start,
vlist<trackContentObject *> tcos;
getTCOsInRange( tcos, _start, _start +static_cast<Sint32>( _frames *
64 / eng()->getSongEditor()->framesPerTact() ) );
64 / eng()->framesPerTact() ) );
if ( tcos.size() == 0 )
{

View File

@@ -631,7 +631,7 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
// create (timed) note-play-handle
notePlayHandle * nph = new
notePlayHandle( this,
_time.frames( eng()->getSongEditor()->framesPerTact() ),
_time.frames( eng()->framesPerTact() ),
valueRanges<f_cnt_t>::max, n );
if( eng()->getMixer()->addPlayHandle(
nph ) )
@@ -653,8 +653,8 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
// recording notes into a pattern
note done_note( NULL,
midiTime( static_cast<f_cnt_t>(
n->totalFramesPlayed() * 64 /
eng()->getSongEditor()->framesPerTact() ) ),
n->totalFramesPlayed() * 64 /
eng()->framesPerTact() ) ),
0, n->tone(), n->octave(),
n->getVolume(), n->getPanning() );
n->noteOff();
@@ -755,8 +755,8 @@ void instrumentTrack::deleteNotePluginData( notePlayHandle * _n )
if( m_notes[_n->key()] == _n )
{
note done_note( NULL, midiTime( static_cast<f_cnt_t>(
_n->totalFramesPlayed() * 64 /
eng()->getSongEditor()->framesPerTact() ) ),
_n->totalFramesPlayed() * 64 /
eng()->framesPerTact() ) ),
0, _n->tone(), _n->octave(),
_n->getVolume(), _n->getPanning() );
_n->noteOff();
@@ -894,7 +894,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
// calculate samples per tact; need that later when calculating
// sample-pos of a note
float frames_per_tact = eng()->getSongEditor()->framesPerTact();
float frames_per_tact = eng()->framesPerTact();
vlist<trackContentObject *> tcos;
if( _tco_num >= 0 )

View File

@@ -100,7 +100,7 @@ void FASTCALL sampleTCO::play( sampleFrame * _ab, f_cnt_t _start_frame,
{
_start_frame = static_cast<Uint32>( tMax( 0.0f, _start_frame -
startPosition() *
eng()->getSongEditor()->framesPerTact() / 64 ) );
eng()->framesPerTact() / 64 ) );
m_sampleBuffer.play( _ab, _start_frame, _frames );
}
@@ -254,8 +254,7 @@ void sampleTCO::paintEvent( QPaintEvent * _pe )
midiTime sampleTCO::getSampleLength( void ) const
{
return( static_cast<Sint32>( m_sampleBuffer.frames() /
eng()->getSongEditor()->framesPerTact() *
64 ) );
eng()->framesPerTact() * 64 ) );
}
@@ -445,7 +444,7 @@ bool FASTCALL sampleTrack::play( const midiTime & _start,
vlist<trackContentObject *> tcos;
getTCOsInRange( tcos, _start, _start+static_cast<Sint32>( _frames * 64 /
eng()->getSongEditor()->framesPerTact() ) );
eng()->framesPerTact() ) );
if ( tcos.size() == 0 )
{
@@ -459,7 +458,7 @@ bool FASTCALL sampleTrack::play( const midiTime & _start,
, m_volume, m_volume
#endif
} ;
float fpt = eng()->getSongEditor()->framesPerTact();
float fpt = eng()->framesPerTact();
for( vlist<trackContentObject *>::iterator it = tcos.begin();
it != tcos.end(); ++it )