Skip to content

Commit

Permalink
reset play panel when last score is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Jul 2, 2012
1 parent ed5c94c commit de36470
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions mscore/playpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void PlayPanel::setScore(Score* s)
setRelTempo(1.0);
setEndpos(0);
heartBeat(0, 0);
updatePosLabel(0);
}
update();
}
Expand Down Expand Up @@ -169,8 +170,6 @@ void PlayPanel::heartBeat(int tick, int utick)
{
if (cachedTickPosition == utick)
return;
if (cs == 0)
return;
updatePosLabel(utick);
posSlider->setValue(utick);
}
Expand Down Expand Up @@ -210,11 +209,14 @@ void PlayPanel::updateTimeLabel(int sec)
void PlayPanel::updatePosLabel(int utick)
{
cachedTickPosition = utick;

int bar, beat, t;
int tick = cs->repeatList()->utick2tick(utick);
cs->sigmap()->tickValues(tick, &bar, &beat, &t);

int bar = 0;
int beat = 0;
int t = 0;
int tick = 0;
if (cs) {
tick = cs->repeatList()->utick2tick(utick);
cs->sigmap()->tickValues(tick, &bar, &beat, &t);
}
char buffer[32];
sprintf(buffer, "%03d.%02d", bar+1, beat+1);
posLabel->setText(QString(buffer));
Expand Down

0 comments on commit de36470

Please sign in to comment.