コード例 #1
0
ファイル: articulation.cpp プロジェクト: Archer90/MuseScore
void Articulation::read(const QDomElement& de)
      {
      setSubtype(Articulation_Staccato);    // default
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            const QString& tag(e.tagName());
            const QString& val(e.text());
            if (tag == "subtype")
                  setSubtype(val);
            else if (tag == "channel")
                  _channelName = e.attribute("name");
            else if (tag == "anchor")
                  _anchor = ArticulationAnchor(val.toInt());
            else if (tag == "direction") {
                  Direction dir = AUTO;
                  if (val == "up")
                        dir = UP;
                  else if (val == "down")
                        dir = DOWN;
                  else if (val == "auto")
                        dir = AUTO;
                  else
                        domError(e);
                  setDirection(dir);
                  }
            else if (!Element::readProperties(e))
                  domError(e);
            }
      }
コード例 #2
0
ファイル: articulation.cpp プロジェクト: aiena/MuseScore
void Articulation::read(const QDomElement& de)
      {
      setSubtype(Articulation_Fermata);    // default // backward compatibility (no type = ufermata in 1.2)
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            const QString& tag(e.tagName());
            const QString& val(e.text());
            if (tag == "subtype")
                  setSubtype(val);
            else if (tag == "channel")
                  _channelName = e.attribute("name");
            else if (tag == "anchor")
                  _anchor = ArticulationAnchor(val.toInt());
            else if (tag == "direction") {
                  MScore::Direction dir = MScore::AUTO;
                  if (val == "up")
                        dir = MScore::UP;
                  else if (val == "down")
                        dir = MScore::DOWN;
                  else if (val == "auto")
                        dir = MScore::AUTO;
                  else
                        domError(e);
                  setDirection(dir);
                  }
            else if (!Element::readProperties(e))
                  domError(e);
            }
      }
コード例 #3
0
ファイル: articulation.cpp プロジェクト: SSMN/MuseScore
void Articulation::read(QDomElement e)
      {
      setSubtype(0);    // default
      for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            QString tag(e.tagName());
            QString val(e.text());
            if (tag == "idx")                         // obsolete
                  setSubtype(val.toInt());
            else if (tag == "channel")
                  _channelName = e.attribute("name");
            else if (tag == "anchor")
                  _anchor = ArticulationAnchor(val.toInt());
            else if (tag == "direction") {
                  Direction dir = AUTO;
                  if (val == "up")
                        dir = UP;
                  else if (val == "down")
                        dir = DOWN;
                  else if (val == "auto")
                        dir = AUTO;
                  else
                        domError(e);
//                  printf("setDirection %s %d\n", qPrintable(val), int(dir));
                  setDirection(dir);
                  }
            else if (!Element::readProperties(e))
                  domError(e);
            }
/* if (subtype() == Articulation_Schleifer) {
            printf("Schleifer %f %f\n", readPos().x(), readPos().y());
            setReadPos(QPointF());
            }
      */
      }
コード例 #4
0
ファイル: barline.cpp プロジェクト: aeliot/MuseScore
void BarLine::read(const QDomElement& de)
      {
      // if bar line belongs to a staff, span values default to staff values
      if(staff()) {
            _span       = staff()->barLineSpan();
            _spanFrom   = staff()->barLineFrom();
            _spanTo     = staff()->barLineTo();
      }
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            const QString& tag(e.tagName());
            const QString& val(e.text());
            if (tag == "subtype") {
                  bool ok;
                  int i = val.toInt(&ok);
                  if (!ok)
                        setSubtype(val);
                  else {
                        BarLineType ct = NORMAL_BAR;
                        switch (i) {
                              default:
                              case  0: ct = NORMAL_BAR; break;
                              case  1: ct = DOUBLE_BAR; break;
                              case  2: ct = START_REPEAT; break;
                              case  3: ct = END_REPEAT; break;
                              case  4: ct = BROKEN_BAR; break;
                              case  5: ct = END_BAR; break;
                              case  6: ct = END_START_REPEAT; break;
                              case  7: ct = DOTTED_BAR; break;
                              }
                        setSubtype(ct);
                        }
                  if(parent() && parent()->type() == SEGMENT) {
                        Measure* m = static_cast<Segment*>(parent())->measure();
                        if(subtype() != m->endBarLineType())
                              setCustomSubtype(true);
                        }
                  }
            else if (tag == "customSubtype")
                  setCustomSubtype(val.toInt() != 0);
            else if (tag == "span") {
                  _span       = val.toInt();
                  _spanFrom   = e.attribute("from", QString::number(_spanFrom)).toInt();
                  _spanTo     = e.attribute("to", QString::number(_spanTo)).toInt();
                  // WARNING: following statements assume staff and staff bar line spans are correctly set
                  if(staff() && (_span != staff()->barLineSpan()
                              || _spanFrom != staff()->barLineFrom() || _spanTo != staff()->barLineTo()))
                        _customSpan = true;
                  }
            else if (tag == "Articulation") {
                  Articulation* a = new Articulation(score());
                  a->read(e);
                  add(a);
                  }
            else if (!Element::readProperties(e))
                  domError(e);
            }
      }
コード例 #5
0
ファイル: accidental.cpp プロジェクト: Archer90/MuseScore
void Accidental::setSubtype(const QString& tag)
      {
      int n = sizeof(accList)/sizeof(*accList);
      for (int i = 0; i < n; ++i) {
            if (accList[i].tag == tag) {
                  setSubtype(AccidentalType(i));
                  return;
                  }
            }
      setSubtype(ACC_NONE);
      }
コード例 #6
0
ファイル: staffstate.cpp プロジェクト: Isenbarth/MuseScore
void StaffState::setSubtype(const QString& s)
      {
      if (s == "instrument")
            setSubtype(STAFF_STATE_INSTRUMENT);
      else if (s == "type")
            setSubtype(STAFF_STATE_TYPE);
      else if (s == "visible")
            setSubtype(STAFF_STATE_VISIBLE);
      else if (s == "invisible")
            setSubtype(STAFF_STATE_INVISIBLE);
      }
コード例 #7
0
ファイル: chordline.cpp プロジェクト: alexkonradi/MuseScore
void ChordLine::read(const QDomElement& de)
      {
      path = QPainterPath();
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            QString tag(e.tagName());
            if (tag == "Path") {
                  path = QPainterPath();
                  QPointF curveTo;
                  QPointF p1;
                  int state = 0;
                  for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
                        QString tag(ee.tagName());
                        if (tag == "Element") {
                              int type = ee.attribute("type").toInt();
                              qreal x = ee.attribute("x").toDouble();
                              qreal y = ee.attribute("y").toDouble();
                              switch(QPainterPath::ElementType(type)) {
                                    case QPainterPath::MoveToElement:
                                          path.moveTo(x, y);
                                          break;
                                    case QPainterPath::LineToElement:
                                          path.lineTo(x, y);
                                          break;
                                    case QPainterPath::CurveToElement:
                                          curveTo.rx() = x;
                                          curveTo.ry() = y;
                                          state = 1;
                                          break;
                                    case QPainterPath::CurveToDataElement:
                                          if (state == 1) {
                                                p1.rx() = x;
                                                p1.ry() = y;
                                                state = 2;
                                                }
                                          else if (state == 2) {
                                                path.cubicTo(curveTo, p1, QPointF(x, y));
                                                state = 0;
                                                }
                                          break;
                                    }
                              }
                        else
                              domError(ee);
                        }
                  modified = true;
                  setSubtype(ChordLineType(0));
                  }
            else if (tag == "subtype")
                  setSubtype(ChordLineType(e.text().toInt()));
            else if (!Element::readProperties(e))
                  domError(e);
            }
      }
コード例 #8
0
ファイル: dynamic.cpp プロジェクト: Isenbarth/MuseScore
void Dynamic::setSubtype(const QString& tag)
      {
      int n = sizeof(dynList)/sizeof(*dynList);
      for (int i = 0; i < n; ++i) {
            if (dynList[i].tag == tag) {
                  setSubtype(DynamicType(i));
                  setText(QString::fromUtf8(dynList[i].text));
                  return;
                  }
            }
      setSubtype(DYNAMIC_OTHER);
      setText(tag);
      }
コード例 #9
0
ファイル: articulation.cpp プロジェクト: aiena/MuseScore
void Articulation::setSubtype(const QString& s)
      {
      if (s[0].isDigit()) {         // for backward compatibility
            setSubtype(ArticulationType(s.toInt()));
            return;
            }
      int st;
      for (st = 0; st < ARTICULATIONS; ++st) {
            if (articulationList[st].name == s)
                  break;
            }
      if (st == ARTICULATIONS) {
            struct {
                  const char* name;
                  bool up;
                  ArticulationType type;
                  } al[] = {
                  { "umarcato",         true,  Articulation_Marcato },
                  { "dmarcato",         false, Articulation_Marcato },
                  { "ufermata",         true,  Articulation_Fermata },
                  { "dfermata",         false, Articulation_Fermata },
                  { "ushortfermata",    true,  Articulation_Shortfermata },
                  { "dshortfermata",    false, Articulation_Shortfermata },
                  { "ulongfermata",     true,  Articulation_Longfermata },
                  { "dlongfermata",     false, Articulation_Longfermata },
                  { "uverylongfermata", true,  Articulation_Verylongfermata },
                  { "dverylongfermata", false, Articulation_Verylongfermata },
                  // watch out, bug in 1.2 uportato and dportato are reversed
                  { "dportato",         true,  Articulation_Portato },
                  { "uportato",         false, Articulation_Portato },
                  { "ustaccatissimo",   true,  Articulation_Staccatissimo },
                  { "dstaccatissimo",   false, Articulation_Staccatissimo }
                  };

            int i;
            int n = sizeof(al) / sizeof(*al);
            for (i = 0; i < n; ++i) {
                  if (s == al[i].name) {
                        _up = al[i].up;
                        _direction = (_up ? MScore::UP : MScore::DOWN);
                        st  = int(al[i].type);
                        break;
                        }
                  }
            if (i == n) {
                  st = 0;
                  qDebug("Articulation: unknown <%s>\n", qPrintable(s));
                  }
            }
      setSubtype(ArticulationType(st));
      }
コード例 #10
0
ファイル: repeat.cpp プロジェクト: SSMN/MuseScore
Marker::Marker(Score* s)
   : Text(s)
      {
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      setSubtype(TEXT_REPEAT);
      setTextStyle(TEXT_STYLE_REPEAT);
      }
コード例 #11
0
void Articulation::read(XmlReader& e)
      {
      setArticulationType(ArticulationType::Fermata);    // default // backward compatibility (no type = ufermata in 1.2)
      while (e.readNextStartElement()) {
            const QStringRef& tag(e.name());
            if (tag == "subtype")
                  setSubtype(e.readElementText());
            else if (tag == "channel") {
                  _channelName = e.attribute("name");
                  e.readNext();
                  }
            else if (tag == "anchor") {
                  _anchor = ArticulationAnchor(e.readInt());
                  anchorStyle = PropertyStyle::UNSTYLED;
                  }
            else if (tag == "direction")
                  setProperty(P_ID::DIRECTION, Ms::getProperty(P_ID::DIRECTION, e));
            else if ( tag == "ornamentStyle")
                  setProperty(P_ID::ORNAMENT_STYLE, Ms::getProperty(P_ID::ORNAMENT_STYLE, e));
            else if ( tag == "play")
                  setPlayArticulation(e.readBool());
            else if (tag == "timeStretch")
                  _timeStretch = e.readDouble();
            else if (tag == "offset") {
                  if (score()->mscVersion() > 114)
                        Element::readProperties(e);
                  else
                        e.skipCurrentElement(); // ignore manual layout in older scores
                  }
            else if (!Element::readProperties(e))
                  e.unknown();
            }
      }
コード例 #12
0
CRMAcctCluster::CRMAcctCluster(QWidget* pParent, const char* pName) :
    VirtualCluster(pParent, pName)
{
    addNumberWidget(new CRMAcctLineEdit(this, pName));
    setNameVisible(true);
    setSubtype(CRMAcctLineEdit::Crmacct);
}
コード例 #13
0
ファイル: line.cpp プロジェクト: Isenbarth/MuseScore
bool LineSegment::readProperties(XmlReader& e)
      {
      const QStringRef& tag(e.name());
      if (tag == "subtype")
            setSubtype(SpannerSegmentType(e.readInt()));
      else if (tag == "off1")       // obsolete
            setUserOff(e.readPoint() * spatium());
      else if (tag == "off2")
            setUserOff2(e.readPoint() * spatium());
      else if (tag == "pos") {
            if (score()->mscVersion() > 114) {
                  qreal _spatium = spatium();
                  setUserOff(QPointF());
                  setReadPos(e.readPoint() * _spatium);
                  }
            else
                  e.readNext();
            }
#if 0
      else if (tag == "pos") {
            QPointF rp = e.readPoint() * spatium();
            if ((score()->mscVersion() <= 114) && (type() == VOLTA_SEGMENT)) {
                  rp.ry() -= spatium();
                  }
            setReadPos(rp);
            }
#endif
      else if (!Element::readProperties(e)) {
            e.unknown();
            return false;
            }
      return true;
      }
コード例 #14
0
ファイル: npc.cpp プロジェクト: Ablu/invertika
NPC::NPC(int id, int subtype, Map *map):
    Being(id, subtype, map)
{
    setSubtype(subtype);

    setShowName(true);
}
コード例 #15
0
ファイル: dynamics.cpp プロジェクト: SSMN/MuseScore
Dynamic::Dynamic(const Dynamic& d)
   : Text(d)
      {
      setSubtype(subtype());
      _velocity = d._velocity;
      _dynType  = d._dynType;
      }
コード例 #16
0
BackgroundSuppressionShell::BackgroundSuppressionShell() :
            mCurrentFrame(0), mCurrentProgress(0.0), mProgressStep(1.0), mpRaster(NULL), mSingleForegroundMask(false), mpTemporaryBuffer(NULL)
{
   setSubtype("Background Estimation");
   setAbortSupported(true);
   setWizardSupported(true);
   mpAnimation.addSignal(SIGNAL_NAME(Animation, FrameChanged), Slot(this, &BackgroundSuppressionShell::processNextStreamingFrame));
}
コード例 #17
0
ファイル: tempotext.cpp プロジェクト: SSMN/MuseScore
TempoText::TempoText(Score* s)
   : Text(s)
      {
      _tempo = 2.0;
      _followText = false;
      setSubtype(TEXT_TEMPO);
      setTextStyle(TEXT_STYLE_TEMPO);
      }
コード例 #18
0
ファイル: barline.cpp プロジェクト: Mistobaan/MuseScore
BarLine::BarLine(Score* s)
   : Element(s)
      {
      setSubtype(NORMAL_BAR);
      _span = 1;
      yoff  = 0.0;
      setHeight(4.0 * spatium()); // for use in palettes
      }
コード例 #19
0
ファイル: stafftext.cpp プロジェクト: SSMN/MuseScore
StaffText::StaffText(Score* s)
   : Text(s)
      {
      setSubtype(TEXT_STAFF);
      setTextStyle(TEXT_STYLE_STAFF);
      _setAeolusStops = false;
      clearAeolusStops();
      }
コード例 #20
0
ファイル: articulation.cpp プロジェクト: aiena/MuseScore
Articulation::Articulation(Score* s)
   : Element(s)
      {
      _direction = MScore::AUTO;
      _up = true;
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      setSubtype(Articulation_Fermata);
      }
コード例 #21
0
ファイル: tremolo.cpp プロジェクト: aeliot/MuseScore
Tremolo::Tremolo(Score* score)
   : Element(score)
      {
      setSubtype(TREMOLO_R8);
      _chord1  = 0;
      _chord2  = 0;
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      }
コード例 #22
0
ファイル: bracket.cpp プロジェクト: cymerio/MuseScore
void Bracket::read(XmlReader& e)
      {
      QString t(e.attribute("type", "Normal"));

      if (t == "Normal")
            setSubtype(BRACKET_NORMAL);
      else if (t == "Akkolade")
            setSubtype(BRACKET_AKKOLADE);
      else
            qDebug("unknown brace type <%s>\n", t.toLatin1().data());

      while (e.readNextStartElement()) {
            if (e.name() == "level")
                  _column = e.readInt();
            else if (!Element::readProperties(e))
                  e.unknown();
            }
      }
コード例 #23
0
ファイル: bracket.cpp プロジェクト: coliveira/MuseScore
void Bracket::read(const QDomElement& de)
      {
      QString t(de.attribute("type", "Normal"));

      if (t == "Normal")
            setSubtype(BRACKET_NORMAL);
      else if (t == "Akkolade")
            setSubtype(BRACKET_AKKOLADE);
      else
            qDebug("unknown brace type <%s>\n", t.toLatin1().data());

      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            if (e.tagName() == "level")
                  _column = e.text().toInt();
            else if (!Element::readProperties(e))
                  domError(e);
            }
      }
コード例 #24
0
ファイル: segment.cpp プロジェクト: SSMN/MuseScore
Segment::Segment(Measure* m, SegmentType st, int t)
   : Element(m->score())
      {
      setParent(m);
      setSubtype(st);
      setTick(t);
      init();
      empty = true;
      }
コード例 #25
0
PicturesPlotWidgetExporter::PicturesPlotWidgetExporter(PicturesDetails *pDetails) : PicturesExporter(pDetails)
{
   setName(pDetails->name() + " Plot Widget Exporter");
   setShortDescription(pDetails->shortDescription() + " Plot Widget Exporter");
   setDescription(pDetails->description() + " Plot Widget Exporter");
   setSubtype(TypeConverter::toString<PlotWidget>());
   setDescriptorId("{2B7C526C-F752-466c-B72C-11A0BD263F23}-" + pDetails->name());
   setProductionStatus(pDetails->isProduction());
}
コード例 #26
0
ファイル: dynamic.cpp プロジェクト: johey/MuseScore
Dynamic::Dynamic(Score* s)
   : Text(s)
      {
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      _velocity = -1;
      _dynType  = DYNAMIC_PART;
      setSubtype(0);
      setTextStyleType(TEXT_STYLE_DYNAMICS);
      }
コード例 #27
0
ファイル: tremolo.cpp プロジェクト: aeliot/MuseScore
void Tremolo::read(const QDomElement& de)
      {
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            if (e.tagName() == "subtype")
                  setSubtype(e.text());
            else if (!Element::readProperties(e))
                  domError(e);
            }
      }
コード例 #28
0
RangeProfilePlotManager::RangeProfilePlotManager() : mpPlot(NULL), mpView(NULL), mpMode(NULL)
{
   setName("Range Profile Plot Manager");
   setVersion(SPECTRAL_VERSION_NUMBER);
   setCopyright(SPECTRAL_COPYRIGHT);
   setDescription("Manage range profile plots.");
   setDescriptorId("{2dc48270-fd6f-42b7-acf5-604125f64ffb}");
   setSubtype("Plot");
   setProductionStatus(SPECTRAL_IS_PRODUCTION_RELEASE);
}
コード例 #29
0
ファイル: text.cpp プロジェクト: SSMN/MuseScore
void Text::setSubtype(const QString& s)
      {
      int st = 0;
      if (s == "Title")
            st = TEXT_TITLE;
      else if (s == "Subtitle")
            st = TEXT_SUBTITLE;
      else if (s == "Composer")
            st = TEXT_COMPOSER;
      else if (s == "Poet")
            st = TEXT_POET;
      else if (s == "Translator")
            st = TEXT_TRANSLATOR;
      else if (s == "MeasureNumber")
            st = TEXT_MEASURE_NUMBER;
      else if (s == "Fingering")
            st = TEXT_FINGERING;
      else if (s == "InstrumentLong")
            st = TEXT_INSTRUMENT_LONG;
      else if (s == "InstrumentShort")
            st = TEXT_INSTRUMENT_SHORT;
      else if (s == "InstrumentExcerpt")
            st = TEXT_INSTRUMENT_EXCERPT;
      else if (s == "Tempo")
            st = TEXT_TEMPO;
      else if (s == "Lyric")
            st = TEXT_LYRIC;
      else if (s == "Tuplet")
            st = TEXT_TUPLET;
      else if (s == "System")
            st = TEXT_SYSTEM;
      else if (s == "Staff")
            st = TEXT_STAFF;
      else if (s == "Chordname")
            st = TEXT_CHORD;
      else if (s == "RehearsalMark")
            st = TEXT_REHEARSAL_MARK;
      else if (s == "Repeat")
            st = TEXT_REPEAT;
      else if (s == "Volta")
            st = TEXT_VOLTA;
      else if (s == "Frame")
            st = TEXT_FRAME;
      else if (s == "TextLine")
            st = TEXT_TEXTLINE;
      else if (s == "StringNumber")
            st = TEXT_STRING_NUMBER;
      else if (s == "InstrumentChange")
            st = TEXT_INSTRUMENT_CHANGE;
      else if (s == "LyricsVerseNumber")
            st = TEXT_LYRICS_VERSE_NUMBER;
      else
            printf("setSubtype: unknown type <%s>\n", qPrintable(s));
      setSubtype(st);
      }
コード例 #30
0
ファイル: FitsImporter.cpp プロジェクト: Tom-VdE/opticks
FitsSignatureImporter::FitsSignatureImporter()
{
   /*
    * Does the same thing as the regular impoter, just makes
    * it available to signature only import dialogs.
    */
   setDescriptorId("{171d5147-cb9b-405c-9bf2-b0fe5f4a2be1}");
   setName("FITS Signature Importer");
   setSubtype("Signature");
   setWizardSupported(false);
}