Ejemplo n.º 1
0
void StaffType::writeProperties(Xml& xml) const
      {
      xml.tag("name", name());
      if (lines() != 5)
            xml.tag("lines", lines());
      if (lineDistance().val() != 1.0)
            xml.tag("lineDistance", lineDistance().val());
      if (!genClef())
            xml.tag("clef", genClef());
      if (slashStyle())
            xml.tag("slashStyle", slashStyle());
      if (!showBarlines())
            xml.tag("barlines", showBarlines());
      }
Ejemplo n.º 2
0
void MeasureProperties::apply()
      {
      Score* score = m->score();

      for (int staffIdx = 0; staffIdx < score->nstaves(); ++staffIdx) {
            MStaff* ms = m->mstaff(staffIdx);
            bool v = visible(staffIdx);
            bool s = slashStyle(staffIdx);
            if (ms->visible() != v || ms->slashStyle() != s)
                  score->undo(new ChangeMStaffProperties(ms, v, s));
            }

      m->undoChangeProperty(P_ID::REPEAT_COUNT, repeatCount());
      m->undoChangeProperty(P_ID::BREAK_MMR, breakMultiMeasureRest->isChecked());
      m->undoChangeProperty(P_ID::USER_STRETCH, layoutStretch->value());
      m->undoChangeProperty(P_ID::MEASURE_NUMBER_MODE, measureNumberMode->currentIndex());
      m->undoChangeProperty(P_ID::NO_OFFSET, measureNumberOffset->value());
      m->undoChangeProperty(P_ID::IRREGULAR, isIrregular());

      if (m->len() != len()) {
            ScoreRange range;
            range.read(m->first(), m->last());
            if (range.canWrite(len()))
                  m->adjustToLen(len());
            else if (!MScore::noGui) {
                  QMessageBox::warning(0,
                     QT_TRANSLATE_NOOP("MeasureProperties", "MuseScore"),
                     QT_TRANSLATE_NOOP("MeasureProperties", "cannot change measure length:\n"
                     "tuplet would cross measure")
                     );
                  }
            }
      score->update();
      }
Ejemplo n.º 3
0
void MeasureProperties::apply()
      {
      Score* score = m->score();

      for (int staffIdx = 0; staffIdx < score->nstaves(); ++staffIdx) {
            MStaff* ms = m->mstaff(staffIdx);
            bool v = visible(staffIdx);
            bool s = slashStyle(staffIdx);
            if (ms->visible() != v || ms->slashStyle() != s)
                  score->undo(new ChangeMStaffProperties(ms, v, s));
            }
      if (isIrregular() != m->irregular()
         || breakMultiMeasureRest->isChecked() != m->breakMultiMeasureRest()
         || repeatCount() != m->repeatCount()
         || layoutStretch->value() != m->userStretch()
         || measureNumberOffset->value() != m->noOffset()
         || m->len() != len()
         ) {
            score->undo(new ChangeMeasureProperties(
               m,
               breakMultiMeasureRest->isChecked(),
               repeatCount(),
               layoutStretch->value(),
               measureNumberOffset->value(),
               isIrregular())
               );
            if (m->len() != len()) {
                  m->adjustToLen(len());
                  score->select(m, SELECT_RANGE, 0);
                  }
            }
      score->select(0, SELECT_SINGLE, 0);
      score->end();
      }
Ejemplo n.º 4
0
void StaffType::writeProperties(Xml& xml) const
      {
      xml.tag("name", name());
      // uncontionally write properties: staff types are read back over a copy of the built-in types
      // and properties may be different across types => each might need to be properly (re-)set
      xml.tag("lines", lines());
      xml.tag("lineDistance", lineDistance().val());
      xml.tag("clef", genClef());
      xml.tag("slashStyle", slashStyle());
      xml.tag("barlines", showBarlines());
      xml.tag("timesig", genTimesig());
      }