"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core/Song.cpp" between
lmms-1.2.0-rc7.tar.gz and lmms-1.2.0-rc8.tar.gz

About: LMMS (Linux MultiMedia Studio) is a sound generation system (creation of melodies and beats, synthesis and mixing of sounds, arranging of samples; full MIDI support). Release candidate.

Song.cpp  (lmms-1.2.0-rc7):Song.cpp  (lmms-1.2.0-rc8)
skipping to change at line 246 skipping to change at line 246
// if looping-mode is enabled and we are outside of the looping // if looping-mode is enabled and we are outside of the looping
// range, go to the beginning of the range // range, go to the beginning of the range
if( m_playPos[m_playMode] < tl->loopBegin() || if( m_playPos[m_playMode] < tl->loopBegin() ||
m_playPos[m_playMode] >= tl->loopEnd() ) m_playPos[m_playMode] >= tl->loopEnd() )
{ {
m_elapsedMilliSeconds = m_elapsedMilliSeconds =
( tl->loopBegin().getTicks() * 60 * 1000 / 48 ) / getTempo(); ( tl->loopBegin().getTicks() * 60 * 1000 / 48 ) / getTempo();
m_playPos[m_playMode].setTicks( m_playPos[m_playMode].setTicks(
tl->loopBegin().getTicks() ); tl->loopBegin().getTicks() );
m_vstSyncController.setAbsolutePosition(
tl->loopBegin().getTicks() );
m_vstSyncController.setPlaybackJumped( true ); m_vstSyncController.setPlaybackJumped( true );
emit updateSampleTracks(); emit updateSampleTracks();
} }
} }
if( m_playPos[m_playMode].jumped() ) if( m_playPos[m_playMode].jumped() )
{ {
m_vstSyncController.setPlaybackJumped( true ); m_vstSyncController.setPlaybackJumped( true );
m_playPos[m_playMode].setJumped( false ); m_playPos[m_playMode].setJumped( false );
skipping to change at line 274 skipping to change at line 272
{ {
m_vstSyncController.update(); m_vstSyncController.update();
float currentFrame = m_playPos[m_playMode].currentFrame(); float currentFrame = m_playPos[m_playMode].currentFrame();
// did we play a tick? // did we play a tick?
if( currentFrame >= framesPerTick ) if( currentFrame >= framesPerTick )
{ {
int ticks = m_playPos[m_playMode].getTicks() + int ticks = m_playPos[m_playMode].getTicks() +
( int )( currentFrame / framesPerTick ); ( int )( currentFrame / framesPerTick );
m_vstSyncController.setAbsolutePosition( ticks );
// did we play a whole tact? // did we play a whole tact?
if( ticks >= MidiTime::ticksPerTact() ) if( ticks >= MidiTime::ticksPerTact() )
{ {
// per default we just continue playing even if // per default we just continue playing even if
// there's no more stuff to play // there's no more stuff to play
// (song-play-mode) // (song-play-mode)
int maxTact = m_playPos[m_playMode].getTact() int maxTact = m_playPos[m_playMode].getTact()
+ 2; + 2;
// then decide whether to go over to next tact // then decide whether to go over to next tact
skipping to change at line 313 skipping to change at line 309
>= maxTact ) >= maxTact )
{ {
// then start from beginning and keep // then start from beginning and keep
// offset // offset
ticks %= ( maxTact * MidiTime::ticksPerTa ct() ); ticks %= ( maxTact * MidiTime::ticksPerTa ct() );
// wrap milli second counter // wrap milli second counter
m_elapsedMilliSeconds = m_elapsedMilliSeconds =
( ticks * 60 * 1000 / 48 ) / getT empo(); ( ticks * 60 * 1000 / 48 ) / getT empo();
m_vstSyncController.setAbsolutePosition( ticks );
m_vstSyncController.setPlaybackJumped( tr ue ); m_vstSyncController.setPlaybackJumped( tr ue );
} }
} }
m_playPos[m_playMode].setTicks( ticks ); m_playPos[m_playMode].setTicks( ticks );
if( checkLoop ) if( checkLoop )
{ {
m_vstSyncController.startCycle( m_vstSyncController.startCycle(
tl->loopBegin().getTicks(), tl->loopEnd() .getTicks() ); tl->loopBegin().getTicks(), tl->loopEnd() .getTicks() );
skipping to change at line 335 skipping to change at line 330
// past the looping range, return to the // past the looping range, return to the
// beginning of the range // beginning of the range
if( m_playPos[m_playMode] >= tl->loopEnd() ) if( m_playPos[m_playMode] >= tl->loopEnd() )
{ {
ticks = tl->loopBegin().getTicks(); ticks = tl->loopBegin().getTicks();
m_playPos[m_playMode].setTicks( ticks ); m_playPos[m_playMode].setTicks( ticks );
m_elapsedMilliSeconds = m_elapsedMilliSeconds =
( ticks * 60 * 1000 / 48 ) / getT empo(); ( ticks * 60 * 1000 / 48 ) / getT empo();
m_vstSyncController.setAbsolutePosition( ticks );
m_vstSyncController.setPlaybackJumped( tr ue ); m_vstSyncController.setPlaybackJumped( tr ue );
}
else if( m_playPos[m_playMode] == tl->loopEnd() -
1 )
{
emit updateSampleTracks(); emit updateSampleTracks();
} }
} }
else else
{ {
m_vstSyncController.stopCycle(); m_vstSyncController.stopCycle();
} }
currentFrame = fmodf( currentFrame, framesPerTick ); currentFrame = fmodf( currentFrame, framesPerTick );
m_playPos[m_playMode].setCurrentFrame( currentFrame ); m_playPos[m_playMode].setCurrentFrame( currentFrame );
} }
if( framesPlayed == 0 )
{
// update VST sync position after we've corrected frame/
// tick count but before actually playing any frames
m_vstSyncController.setAbsolutePosition(
m_playPos[m_playMode].getTicks()
+ m_playPos[m_playMode].currentFrame()
/ (double) framesPerTick );
}
f_cnt_t framesToPlay = f_cnt_t framesToPlay =
Engine::mixer()->framesPerPeriod() - framesPlayed; Engine::mixer()->framesPerPeriod() - framesPlayed;
f_cnt_t framesLeft = ( f_cnt_t )framesPerTick - f_cnt_t framesLeft = ( f_cnt_t )framesPerTick -
( f_cnt_t )currentFrame; ( f_cnt_t )currentFrame;
// skip last frame fraction // skip last frame fraction
if( framesLeft == 0 ) if( framesLeft == 0 )
{ {
++framesPlayed; ++framesPlayed;
m_playPos[m_playMode].setCurrentFrame( currentFrame m_playPos[m_playMode].setCurrentFrame( currentFrame
skipping to change at line 671 skipping to change at line 673
else else
{ {
m_playPos[m_playMode].setTicks( 0 ); m_playPos[m_playMode].setTicks( 0 );
m_elapsedMilliSeconds = 0; m_elapsedMilliSeconds = 0;
} }
m_playing = false; m_playing = false;
m_playPos[m_playMode].setCurrentFrame( 0 ); m_playPos[m_playMode].setCurrentFrame( 0 );
m_vstSyncController.setPlaybackState( m_exporting ); m_vstSyncController.setPlaybackState( m_exporting );
m_vstSyncController.setAbsolutePosition( m_playPos[m_playMode].getTicks() m_vstSyncController.setAbsolutePosition(
); m_playPos[m_playMode].getTicks()
+ m_playPos[m_playMode].currentFrame()
/ (double) Engine::framesPerTick() );
// remove all note-play-handles that are active // remove all note-play-handles that are active
Engine::mixer()->clear(); Engine::mixer()->clear();
m_playMode = Mode_None; m_playMode = Mode_None;
emit playbackStateChanged(); emit playbackStateChanged();
} }
void Song::startExport() void Song::startExport()
 End of changes. 7 change blocks. 
12 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)