Skip to content

Commit

Permalink
Merge pull request #2628 from Jojo-Schmitz/repeat-barlines
Browse files Browse the repository at this point in the history
add repeat barlines to Repeats Palette and fix translations
  • Loading branch information
lasconic committed May 25, 2016
2 parents 626ae90 + d7ed91e commit 60f7518
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions mscore/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,28 +325,28 @@ Palette* MuseScore::newBarLinePalette(bool basic)
const BarLineTableItem* bti = BarLine::barLineTableItem(i);
if (!bti)
break;
BarLine* b = new BarLine(gscore);
BarLine* b = new BarLine(gscore);
b->setBarLineType(bti->type);
sp->append(b, qApp->translate("Palette", bti->name));
sp->append(b, BarLine::userTypeName(bti->type));
}

if (!basic) {
// bar line spans
struct {
int from, to;
const char* name;
} span[] = {
const char* userName;
} spans[] = {
{ BARLINE_SPAN_TICK1_FROM, BARLINE_SPAN_TICK1_TO, QT_TRANSLATE_NOOP("Palette", "Tick 1 span") },
{ BARLINE_SPAN_TICK2_FROM, BARLINE_SPAN_TICK2_TO, QT_TRANSLATE_NOOP("Palette", "Tick 2 span") },
{ BARLINE_SPAN_SHORT1_FROM,BARLINE_SPAN_SHORT1_TO,QT_TRANSLATE_NOOP("Palette", "Short 1 span") },
{ BARLINE_SPAN_SHORT2_FROM,BARLINE_SPAN_SHORT2_TO,QT_TRANSLATE_NOOP("Palette", "Short 2 span") },
};
for (unsigned i = 0; i < sizeof(span)/sizeof(*span); ++i) {
BarLine* b = new BarLine(gscore);
for (auto span : spans) {
BarLine* b = new BarLine(gscore);
b->setBarLineType(BarLineType::NORMAL);
b->setSpanFrom(span[i].from);
b->setSpanTo(span[i].to);
sp->append(b, qApp->translate("Palette", span[i].name));
b->setSpanFrom(span.from);
b->setSpanTo(span.to);
sp->append(b, qApp->translate("Palette", span.userName));
}
}
return sp;
Expand Down Expand Up @@ -382,6 +382,25 @@ Palette* MuseScore::newRepeatsPalette()
sp->append(jp, qApp->translate("jumpType", jumpTypeTable[i].userText.toUtf8().constData()));
}

for (unsigned i = 0;; ++i) {
const BarLineTableItem* bti = BarLine::barLineTableItem(i);
if (!bti)
break;
switch (bti->type) {
case BarLineType::START_REPEAT:
case BarLineType::END_REPEAT:
case BarLineType::END_START_REPEAT:
break;
default:
continue;
}

BarLine* b = new BarLine(gscore);
b->setBarLineType(bti->type);
PaletteCell* cell= sp->append(b, BarLine::userTypeName(bti->type));
cell->drawStaff = false;
}

return sp;
}

Expand Down

0 comments on commit 60f7518

Please sign in to comment.