Palette* MuseScore::newLinesPalette() { Palette* sp = new Palette; sp->setName(QT_TRANSLATE_NOOP("Palette", "Lines")); sp->setMag(.8); sp->setGrid(82, 35); sp->setDrawGrid(true); qreal w = gscore->spatium() * 8; Slur* slur = new Slur(gscore); slur->setId(0); sp->append(slur, qApp->translate("lines", "Slur")); Hairpin* gabel0 = new Hairpin(gscore); gabel0->setHairpinType(Hairpin::Type::CRESCENDO); gabel0->setLen(w); sp->append(gabel0, qApp->translate("lines", "Crescendo")); Hairpin* gabel1 = new Hairpin(gscore); gabel1->setHairpinType(Hairpin::Type::DECRESCENDO); gabel1->setLen(w); sp->append(gabel1, QT_TRANSLATE_NOOP("Palette", "Diminuendo")); Volta* volta = new Volta(gscore); volta->setVoltaType(Volta::Type::CLOSED); volta->setLen(w); volta->setText("1."); QList<int> il; il.append(1); volta->setEndings(il); sp->append(volta, QT_TRANSLATE_NOOP("Palette", "Prima volta")); volta = new Volta(gscore); volta->setVoltaType(Volta::Type::CLOSED); volta->setLen(w); volta->setText("2."); il.clear(); il.append(2); volta->setEndings(il); sp->append(volta, QT_TRANSLATE_NOOP("Palette", "Seconda volta")); volta = new Volta(gscore); volta->setVoltaType(Volta::Type::CLOSED); volta->setLen(w); volta->setText("3."); il.clear(); il.append(3); volta->setEndings(il); sp->append(volta, QT_TRANSLATE_NOOP("Palette", "Terza volta")); volta = new Volta(gscore); volta->setVoltaType(Volta::Type::OPEN); volta->setLen(w); volta->setText("2."); il.clear(); il.append(2); volta->setEndings(il); sp->append(volta, QT_TRANSLATE_NOOP("Palette", "Seconda volta 2")); Ottava* ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_8VA); ottava->setLen(w); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "8va")); ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_8VB); ottava->setLen(w); ottava->setPlacement(Element::Placement::BELOW); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "8vb")); ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_15MA); ottava->setLen(w); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "15ma")); ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_15MB); ottava->setLen(w); ottava->setPlacement(Element::Placement::BELOW); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "15mb")); ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_22MA); ottava->setLen(w); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "22ma")); ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_22MB); ottava->setLen(w); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "22mb")); Pedal* pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginText("<sym>keyboardPedalPed</sym>"); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); pedal->setEndHook(true); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginHook(true); pedal->setEndHook(true); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginHook(true); pedal->setEndHook(true); pedal->setEndHookType(HookType::HOOK_45); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginHook(true); pedal->setBeginHookType(HookType::HOOK_45); pedal->setEndHook(true); pedal->setEndHookType(HookType::HOOK_45); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginHook(true); pedal->setBeginHookType(HookType::HOOK_45); pedal->setEndHook(true); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); Trill* trill = new Trill(gscore); trill->setLen(w); sp->append(trill, QT_TRANSLATE_NOOP("Palette", "Trill line")); trill = new Trill(gscore); trill->setTrillType("upprall"); trill->setLen(w); sp->append(trill, QT_TRANSLATE_NOOP("Palette", "Upprall line")); trill = new Trill(gscore); trill->setTrillType("downprall"); trill->setLen(w); sp->append(trill, QT_TRANSLATE_NOOP("Palette", "Downprall line")); trill = new Trill(gscore); trill->setTrillType("prallprall"); trill->setLen(w); sp->append(trill, QT_TRANSLATE_NOOP("Palette", "Prallprall line")); trill = new Trill(gscore); trill->setTrillType("pure"); trill->setLen(w); sp->append(trill, QT_TRANSLATE_NOOP("Palette", "Wavy line")); TextLine* textLine = new TextLine(gscore); textLine->setLen(w); textLine->setBeginText("VII"); textLine->setEndHook(true); sp->append(textLine, QT_TRANSLATE_NOOP("Palette", "Text line")); TextLine* line = new TextLine(gscore); line->setLen(w); line->setDiagonal(true); sp->append(line, QT_TRANSLATE_NOOP("Palette", "Line")); Ambitus* a = new Ambitus(gscore); sp->append(a, QT_TRANSLATE_NOOP("Palette", "Ambitus")); return sp; }
Palette* MuseScore::newLinesPalette() { Palette* sp = new Palette; sp->setName(qApp->translate("lines", "Lines")); sp->setMag(.8); sp->setGrid(82, 23); sp->setDrawGrid(true); qreal w = gscore->spatium() * 7; Slur* slur = new Slur(gscore); slur->setId(0); sp->append(slur, qApp->translate("lines", "Slur")); Hairpin* gabel0 = new Hairpin(gscore); gabel0->setSubtype(Hairpin::CRESCENDO); gabel0->setLen(w); sp->append(gabel0, qApp->translate("lines", "Crescendo")); Hairpin* gabel1 = new Hairpin(gscore); gabel1->setSubtype(Hairpin::DECRESCENDO); gabel1->setLen(w); sp->append(gabel1, qApp->translate("lines", "Diminuendo")); Volta* volta = new Volta(gscore); volta->setSubtype(Volta::VOLTA_CLOSED); volta->setLen(w); volta->setText("1."); QList<int> il; il.append(1); volta->setEndings(il); sp->append(volta, qApp->translate("lines", "Prima volta")); volta = new Volta(gscore); volta->setSubtype(Volta::VOLTA_CLOSED); volta->setLen(w); volta->setText("2."); il.clear(); il.append(2); volta->setEndings(il); sp->append(volta, qApp->translate("lines", "Seconda volta")); volta = new Volta(gscore); volta->setSubtype(Volta::VOLTA_CLOSED); volta->setLen(w); volta->setText("3."); il.clear(); il.append(3); volta->setEndings(il); sp->append(volta, qApp->translate("lines", "Terza volta")); volta = new Volta(gscore); volta->setSubtype(Volta::VOLTA_OPEN); volta->setLen(w); volta->setText("2."); il.clear(); il.append(2); volta->setEndings(il); sp->append(volta, qApp->translate("lines", "Seconda volta 2")); Ottava* ottava = new Ottava(gscore); ottava->setSubtype(Ottava::OTTAVA_8VA); ottava->setLen(w); sp->append(ottava, qApp->translate("lines", "8va")); ottava = new Ottava(gscore); ottava->setSubtype(Ottava::OTTAVA_15MA); ottava->setLen(w); sp->append(ottava, qApp->translate("lines", "15ma")); ottava = new Ottava(gscore); ottava->setSubtype(Ottava::OTTAVA_8VB); ottava->setLen(w); sp->append(ottava, qApp->translate("lines", "8vb")); ottava = new Ottava(gscore); ottava->setSubtype(Ottava::OTTAVA_15MB); ottava->setLen(w); sp->append(ottava, qApp->translate("lines", "15mb")); Pedal* pedal = new Pedal(gscore); pedal->setLen(w); sp->append(pedal, qApp->translate("lines", "Pedal")); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setEndHookType(HOOK_45); sp->append(pedal, qApp->translate("lines", "Pedal")); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginSymbol(noSym); pedal->setBeginHook(true); pedal->setBeginHookType(HOOK_45); pedal->setEndHookType(HOOK_45); sp->append(pedal, qApp->translate("lines", "Pedal")); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginSymbol(noSym); pedal->setBeginHook(true); pedal->setBeginHookType(HOOK_45); sp->append(pedal, qApp->translate("lines", "Pedal")); Trill* trill = new Trill(gscore); trill->setLen(w); sp->append(trill, qApp->translate("lines", "Trill line")); trill = new Trill(gscore); trill->setSubtype("upprall"); trill->setLen(w); sp->append(trill, qApp->translate("lines", "Upprall line")); trill = new Trill(gscore); trill->setSubtype("downprall"); trill->setLen(w); sp->append(trill, qApp->translate("lines", "Downprall line")); trill = new Trill(gscore); trill->setSubtype("prallprall"); trill->setLen(w); sp->append(trill, qApp->translate("lines", "Prallprall line")); trill = new Trill(gscore); trill->setSubtype("pure"); trill->setLen(w); sp->append(trill, qApp->translate("lines", "Wavy line")); TextLine* textLine = new TextLine(gscore); textLine->setLen(w); textLine->setBeginText("VII", gscore->textStyle(TEXT_STYLE_TEXTLINE)); textLine->setEndHook(true); sp->append(textLine, qApp->translate("lines", "Text line")); TextLine* line = new TextLine(gscore); line->setLen(w); line->setDiagonal(true); sp->append(line, qApp->translate("lines", "Line")); return sp; }
Palette* MuseScore::newLinesPalette(bool basic) { Palette* sp = new Palette; sp->setName(QT_TRANSLATE_NOOP("Palette", "Lines")); sp->setMag(.8); sp->setGrid(82, 35); sp->setDrawGrid(true); qreal w = gscore->spatium() * 8; Slur* slur = new Slur(gscore); sp->append(slur, qApp->translate("lines", "Slur")); Hairpin* gabel0 = new Hairpin(gscore); gabel0->setHairpinType(Hairpin::Type::CRESCENDO); gabel0->setLen(w); sp->append(gabel0, qApp->translate("lines", "Crescendo")); Hairpin* gabel1 = new Hairpin(gscore); gabel1->setHairpinType(Hairpin::Type::DECRESCENDO); gabel1->setLen(w); sp->append(gabel1, QT_TRANSLATE_NOOP("Palette", "Diminuendo")); Volta* volta = new Volta(gscore); volta->setVoltaType(Volta::Type::CLOSED); volta->setLen(w); volta->setText("1."); QList<int> il; il.append(1); volta->setEndings(il); sp->append(volta, QT_TRANSLATE_NOOP("Palette", "Prima volta")); volta = new Volta(gscore); volta->setVoltaType(Volta::Type::CLOSED); volta->setLen(w); volta->setText("2."); il.clear(); il.append(2); volta->setEndings(il); sp->append(volta, QT_TRANSLATE_NOOP("Palette", "Seconda volta")); if (!basic) { volta = new Volta(gscore); volta->setVoltaType(Volta::Type::CLOSED); volta->setLen(w); volta->setText("3."); il.clear(); il.append(3); volta->setEndings(il); sp->append(volta, QT_TRANSLATE_NOOP("Palette", "Terza volta")); } volta = new Volta(gscore); volta->setVoltaType(Volta::Type::OPEN); volta->setLen(w); volta->setText("2."); il.clear(); il.append(2); volta->setEndings(il); sp->append(volta, QT_TRANSLATE_NOOP("Palette", "Seconda volta 2")); Ottava* ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_8VA); ottava->setLen(w); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "8va")); ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_8VB); ottava->setLen(w); ottava->setPlacement(Element::Placement::BELOW); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "8vb")); if (!basic) { ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_15MA); ottava->setLen(w); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "15ma")); ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_15MB); ottava->setLen(w); ottava->setPlacement(Element::Placement::BELOW); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "15mb")); ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_22MA); ottava->setLen(w); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "22ma")); ottava = new Ottava(gscore); ottava->setOttavaType(Ottava::Type::OTTAVA_22MB); ottava->setLen(w); sp->append(ottava, QT_TRANSLATE_NOOP("Palette", "22mb")); } Pedal* pedal; if (!basic) { pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginText("<sym>keyboardPedalPed</sym>"); pedal->setContinueText("(<sym>keyboardPedalPed</sym>)"); pedal->setEndHook(true); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginText("<sym>keyboardPedalPed</sym>"); pedal->setContinueText("(<sym>keyboardPedalPed</sym>)"); pedal->setEndText("<sym>keyboardPedalUp</sym>"); Align align = pedal->endTextElement()->textStyle().align(); align = (align & AlignmentFlags::VMASK) | AlignmentFlags::HCENTER; pedal->endTextElement()->textStyle().setAlign(align); pedal->setLineVisible(false); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); } pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginHook(true); pedal->setEndHook(true); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginHook(true); pedal->setEndHook(true); pedal->setEndHookType(HookType::HOOK_45); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginHook(true); pedal->setBeginHookType(HookType::HOOK_45); pedal->setEndHook(true); pedal->setEndHookType(HookType::HOOK_45); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); pedal = new Pedal(gscore); pedal->setLen(w); pedal->setBeginHook(true); pedal->setBeginHookType(HookType::HOOK_45); pedal->setEndHook(true); sp->append(pedal, QT_TRANSLATE_NOOP("Palette", "Pedal")); if (!basic) { for (int i = 0; i < trillTableSize(); i++) { Trill* trill = new Trill(gscore); trill->setTrillType(trillTable[i].type); trill->setLen(w); sp->append(trill, qApp->translate("trillType", trillTable[i].userName.toUtf8().constData())); } TextLine* textLine = new TextLine(gscore); textLine->setLen(w); textLine->setBeginText("VII"); textLine->setEndHook(true); sp->append(textLine, QT_TRANSLATE_NOOP("Palette", "Text line")); TextLine* line = new TextLine(gscore); line->setLen(w); line->setDiagonal(true); sp->append(line, QT_TRANSLATE_NOOP("Palette", "Line")); Ambitus* a = new Ambitus(gscore); sp->append(a, QT_TRANSLATE_NOOP("Palette", "Ambitus")); } return sp; }
void MuseScore::lineMenu() { if (linePalette == 0) { Palette* sp = new Palette(); sp->resize(400, 300); linePalette = new PaletteScrollArea(sp); linePalette->setRestrictHeight(false); linePalette->setWindowTitle(tr("MuseScore: Lines")); sp->setGrid(100, 30); double l = gscore->spatium() * 8; Slur* slur = new Slur(gscore); slur->setId(0); sp->append(slur, tr("Slur")); Hairpin* gabel0 = new Hairpin(gscore); gabel0->setSubtype(0); gabel0->setLen(l); sp->append(gabel0, tr("Crescendo")); Hairpin* gabel1 = new Hairpin(gscore); gabel1->setSubtype(1); gabel1->setLen(l); sp->append(gabel1, tr("Diminuendo")); Volta* volta = new Volta(gscore); volta->setLen(l); volta->setText("1."); QList<int> il; il.clear(); il.append(1); volta->setEndings(il); volta->setSubtype(VOLTA_CLOSED); sp->append(volta, tr("Prima volta")); volta = new Volta(gscore); volta->setLen(l); volta->setText("2."); il.clear(); il.append(2); volta->setEndings(il); volta->setSubtype(VOLTA_CLOSED); sp->append(volta, tr("Seconda volta")); volta = new Volta(gscore); volta->setLen(l); volta->setText("3."); il.clear(); il.append(3); volta->setEndings(il); volta->setSubtype(VOLTA_CLOSED); sp->append(volta, tr("Terza volta")); volta = new Volta(gscore); volta->setLen(l); volta->setText("2."); il.clear(); il.append(2); volta->setEndings(il); volta->setSubtype(VOLTA_OPEN); sp->append(volta, tr("Seconda volta")); //-------- Ottava* ottava = new Ottava(gscore); ottava->setSubtype(0); ottava->setLen(l); sp->append(ottava, tr("8va")); ottava = new Ottava(gscore); ottava->setSubtype(1); ottava->setLen(l); sp->append(ottava, tr("15ma")); ottava = new Ottava(gscore); ottava->setSubtype(2); ottava->setLen(l); sp->append(ottava, tr("8vb")); ottava = new Ottava(gscore); ottava->setSubtype(3); ottava->setLen(l); sp->append(ottava, tr("15mb")); //------- Pedal* pedal = new Pedal(gscore); pedal->setLen(l); sp->append(pedal, tr("Pedal")); pedal = new Pedal(gscore); pedal->setLen(l); pedal->setEndHookType(HOOK_45); sp->append(pedal, tr("Pedal")); pedal = new Pedal(gscore); pedal->setLen(l); pedal->setBeginSymbol(-1); pedal->setBeginHook(true); pedal->setBeginHookHeight(Spatium(-1.5)); pedal->setBeginHookType(HOOK_45); pedal->setEndHookType(HOOK_45); sp->append(pedal, tr("Pedal")); pedal = new Pedal(gscore); pedal->setLen(l); pedal->setBeginSymbol(-1); pedal->setBeginHook(true); pedal->setBeginHookHeight(Spatium(-1.5)); pedal->setBeginHookType(HOOK_45); sp->append(pedal, tr("Pedal")); //------- Trill* trill = new Trill(gscore); trill->setLen(l); sp->append(trill, tr("Trill line")); TextLine* textLine = new TextLine(gscore); textLine->setBeginText("VII"); sp->append(textLine, tr("Text line")); textLine->setEndHook(true); textLine->setEndHookHeight(Spatium(1.5)); TextLine* line = new TextLine(gscore); line->setDiagonal(true); sp->append(line, tr("Line")); } linePalette->show(); linePalette->raise(); }