StaffText::StaffText(SubStyle ss, Score* s) : Text(ss, s) { setFlags(ElementFlag::MOVABLE | ElementFlag::SELECTABLE | ElementFlag::ON_STAFF); setPlacement(Placement::ABOVE); // default setSwingParameters(MScore::division / 2, 60); }
StaffText::StaffText(Score* s) : Text(s) { setFlags(ElementFlag::MOVABLE | ElementFlag::SELECTABLE | ElementFlag::ON_STAFF); setTextStyleType(TextStyleType::STAFF); _setAeolusStops = false; _swing = false; clearAeolusStops(); setSwingParameters(MScore::division / 2, 60); }
bool StaffTextBase::readProperties(XmlReader& e) { const QStringRef& tag(e.name()); if (tag == "MidiAction") { int channel = e.intAttribute("channel", 0); QString name = e.attribute("name"); bool found = false; int n = _channelActions.size(); for (int i = 0; i < n; ++i) { ChannelActions* a = &_channelActions[i]; if (a->channel == channel) { a->midiActionNames.append(name); found = true; break; } } if (!found) { ChannelActions a; a.channel = channel; a.midiActionNames.append(name); _channelActions.append(a); } e.readNext(); } else if (tag == "channelSwitch" || tag == "articulationChange") { int voice = e.intAttribute("voice", -1); if (voice >= 0 && voice < VOICES) _channelNames[voice] = e.attribute("name"); else if (voice == -1) { // no voice applies channel to all voices for // compatibility for (int i = 0; i < VOICES; ++i) _channelNames[i] = e.attribute("name"); } e.readNext(); } else if (tag == "aeolus") { int group = e.intAttribute("group", -1); if (group >= 0 && group < 4) aeolusStops[group] = e.readInt(); else e.readNext(); _setAeolusStops = true; } else if (tag == "swing") { QString swingUnit = e.attribute("unit",""); int unit = 0; if (swingUnit == TDuration(TDuration::DurationType::V_EIGHTH).name()) unit = MScore::division / 2; else if (swingUnit == TDuration(TDuration::DurationType::V_16TH).name()) unit = MScore:: division / 4; else if (swingUnit == TDuration(TDuration::DurationType::V_ZERO).name()) unit = 0; int ratio = e.intAttribute("ratio", 60); setSwing(true); setSwingParameters(unit, ratio); e.readNext(); } else if (!TextBase::readProperties(e)) return false; return true; }
StaffTextBase::StaffTextBase(Score* s, Tid tid, ElementFlags flags) : TextBase(s, tid, flags) { setSwingParameters(MScore::division / 2, 60); }
StaffTextBase::StaffTextBase(Score* s, ElementFlags flags) : TextBase(s, flags) { setPlacement(Placement::ABOVE); // default setSwingParameters(MScore::division / 2, 60); }