fixes for timesig dialog

This commit is contained in:
ws 2013-04-29 16:34:05 +02:00
parent 1ec148995a
commit 1d3e89ee0d
4 changed files with 13 additions and 11 deletions

View file

@ -2018,6 +2018,7 @@ void Score::layoutSystems2()
void Score::layoutLinear()
{
curMeasure = first();
curSystem = 0;
System* system = getNextSystem(true, false);
system->setInstrumentNames(true);
qreal xo;

View file

@ -45,21 +45,17 @@ void MCursor::createMeasures()
{
Measure* measure;
for (;;) {
int tick = 0;
measure = _score->lastMeasure();
if (measure) {
int t = measure->tick() + measure->ticks();
if (t > _tick)
tick = measure->tick() + measure->ticks();
if (tick > _tick)
break;
}
measure = new Measure(_score);
int t = 0;
Measure* lm = _score->lastMeasure();
if (lm) {
t = lm->tick() + lm->ticks();
}
measure->setTick(t);
measure->setTimesig(Fraction(4,4));
measure->setLen(Fraction(4,4));
measure->setTick(tick);
measure->setTimesig(_sig);
measure->setLen(_sig);
_score->measures()->add(measure);
}
}

View file

@ -20,6 +20,8 @@ class Fraction;
class TimeSig;
class Chord;
#include "fraction.h"
//---------------------------------------------------------
// MCursor
//---------------------------------------------------------
@ -28,6 +30,7 @@ class MCursor {
Score* _score;
int _tick;
int _track;
Fraction _sig;
void createMeasures();
@ -44,6 +47,7 @@ class MCursor {
void move(int track, int tick);
Score* score() const { return _score; }
void setScore(Score* s) { _score = s; }
void setTimesig(Fraction f) { _sig = f; }
};
#endif

View file

@ -39,11 +39,12 @@ static Score* createScore(TimeSig* ts, int n, TDuration::DurationType t, std::ve
{
Fraction sig(ts->sig());
MCursor c;
c.setTimesig(ts->sig());
c.createScore("score8");
c.addPart("voice");
c.move(0, 0);
c.addKeySig(0);
TimeSig* nts = c.addTimeSig(Fraction(4,4));
TimeSig* nts = c.addTimeSig(ts->sig());
GroupNode node {0, 0};
Groups ng;
ng.push_back(node);