Пример #1
0
TabDurationSymbol::TabDurationSymbol(Score* s, StaffTypeTablature * tab, TDuration::DurationType type, int dots)
   : Element(s)
      {
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      setGenerated(true);
      setDuration(type, dots, tab);
      }
Пример #2
0
bool Hairpin::setProperty(P_ID id, const QVariant& v)
      {
      switch (id) {
            case P_ID::HAIRPIN_CIRCLEDTIP:
                _hairpinCircledTip = v.toBool();
                break;
            case P_ID::HAIRPIN_TYPE:
                  setHairpinType(Type(v.toInt()));
                  setGenerated(false);
                  break;
            case P_ID::VELO_CHANGE:
                  _veloChange = v.toInt();
                  break;
            case P_ID::DYNAMIC_RANGE:
                  _dynRange = Dynamic::Range(v.toInt());
                  break;
            case P_ID::LINE_WIDTH:
                  lineWidthStyle = PropertyStyle::UNSTYLED;
                  TextLine::setProperty(id, v);
                  break;
            case P_ID::HAIRPIN_HEIGHT:
                  hairpinHeightStyle = PropertyStyle::UNSTYLED;
                  _hairpinHeight = v.value<Spatium>();
                  break;
            case P_ID::HAIRPIN_CONT_HEIGHT:
                  hairpinContHeightStyle = PropertyStyle::UNSTYLED;
                  _hairpinContHeight = v.value<Spatium>();
                  break;
            default:
                  return TextLine::setProperty(id, v);
            }
      triggerLayout();
      return true;
      }
Пример #3
0
bool Hairpin::setProperty(P_ID id, const QVariant& v)
      {
      switch (id) {
            case P_HAIRPIN_TYPE:
                  _hairpinType = HairpinType(v.toInt());
                  setGenerated(false);
                  break;
            case P_VELO_CHANGE:
                  _veloChange = v.toInt();
                  break;
            case P_DYNAMIC_RANGE:
                  _dynRange = DynamicRange(v.toInt());
                  break;
            case P_LINE_WIDTH:
                  lineWidthStyle = PropertyStyle::UNSTYLED;
                  SLine::setProperty(id, v);
                  break;
            case P_HAIRPIN_HEIGHT:
                  hairpinHeightStyle = PropertyStyle::UNSTYLED;
                  _hairpinHeight = Spatium(v.toDouble());
                  break;
            case P_HAIRPIN_CONT_HEIGHT:
                  hairpinContHeightStyle = PropertyStyle::UNSTYLED;
                  _hairpinContHeight = Spatium(v.toDouble());
                  break;
            default:
                  return SLine::setProperty(id, v);
            }
      return true;
      }
Пример #4
0
bool Image::setProperty(Pid propertyId, const QVariant& v)
      {
      bool rv = true;
      score()->addRefresh(canvasBoundingRect());
      switch(propertyId) {
            case Pid::AUTOSCALE:
                  setAutoScale(v.toBool());
                  break;
            case Pid::SIZE:
                  setSize(v.toSizeF());
                  break;
            case Pid::LOCK_ASPECT_RATIO:
                  setLockAspectRatio(v.toBool());
                  break;
            case Pid::SIZE_IS_SPATIUM:
                  {
                  QSizeF s = size2pixel(_size);
                  setSizeIsSpatium(v.toBool());
                  _size = pixel2size(s);
                  }
                  break;
            default:
                  rv = Element::setProperty(propertyId, v);
                  break;
            }
      setGenerated(false);
      _dirty = true;
      triggerLayout();
      return rv;
      }
Пример #5
0
bool Image::setProperty(P_ID propertyId, const QVariant& v)
      {
      bool rv = true;
      score()->addRefresh(canvasBoundingRect());
      switch(propertyId) {
            case P_AUTOSCALE:
                  setAutoScale(v.toBool());
                  break;
            case P_SIZE:
                  setSize(v.toSizeF());
                  break;
            case P_SCALE:
                  setScale(v.toSizeF());
                  break;
            case P_LOCK_ASPECT_RATIO:
                  setLockAspectRatio(v.toBool());
                  break;
            case P_SIZE_IS_SPATIUM:
                  setSizeIsSpatium(v.toBool());
                  break;
            default:
                  rv = Element::setProperty(propertyId, v);
                  break;
            }
      setGenerated(false);
      score()->setLayoutAll(true);
      return rv;
      }
Пример #6
0
TabDurationSymbol::TabDurationSymbol(Score* s)
   : Element(s)
      {
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      setGenerated(true);
      _tab  = 0;
      _text = QString();
      }
Пример #7
0
void Q3SqlCursor::setCalculated(const QString& name, bool calculated)
{
    int pos = indexOf(name);
    if (pos < 0)
        return;
    d->infoBuffer[pos].setCalculated(calculated);
    if (calculated)
        setGenerated(pos, false);
}
Пример #8
0
LyricsLine::LyricsLine(Score* s)
  : SLine(s, ElementFlag::NOT_SELECTABLE)
      {
      setGenerated(true);           // no need to save it, as it can be re-generated
      setDiagonal(false);
      setLineWidth(score()->styleP(Sid::lyricsDashLineThickness));
      setAnchor(Spanner::Anchor::SEGMENT);
      _nextLyrics = 0;
      }
Пример #9
0
void QSqlCursor::setCalculated( const QString& name, bool calculated )
{
    int pos = position( name );
    if ( pos < 0 )
	return;
    d->infoBuffer[ pos ].setCalculated( calculated );
    if ( calculated )
	setGenerated( pos, FALSE );
}
Пример #10
0
bool LayoutBreak::setProperty(int propertyId, const QVariant& v)
      {
      Property<LayoutBreak>* p = property(propertyId);
      if (p) {
            ::setProperty(p->type, ((*this).*(p->data))(), v);
            setGenerated(false);
            return true;
            }
      return Element::setProperty(propertyId, v);
      }
Пример #11
0
Bracket::Bracket(Score* s)
   : Element(s)
      {
      _subtype = BRACKET_AKKOLADE;
      h2       = 3.5 * spatium();
      _column  = 0;
      _span    = 1;
      yoff     = 0.0;
      setGenerated(true);     // brackets are not saved
      }
Пример #12
0
Bracket::Bracket(Score* s)
    : Element(s)
{
    _bracketType = BRACKET_BRACE;
    h2           = 3.5 * spatium();
    _column      = 0;
    _span        = 0;
    _firstStaff  = 0;
    _lastStaff   = 0;
    setGenerated(true);     // brackets are not saved
}
Пример #13
0
LyricsLine::LyricsLine(Score* s)
  : SLine(s)
      {
      setFlags(0);

      setGenerated(true);           // no need to save it, as it can be re-generated
      setDiagonal(false);
      setLineWidth(Spatium(LYRICS_DASH_DEFAULT_LINE_THICKNESS));
      setAnchor(Spanner::Anchor::SEGMENT);
      _nextLyrics = nullptr;
      }
Пример #14
0
bool LayoutBreak::setProperty(const QString& name, const QDomElement& e)
      {
      for (int i = 0; i < PROPERTIES; ++i) {
            if (propertyList[i].name == name) {
                  QVariant v = ::getProperty(propertyList[i].type, e);
                  ::setProperty(propertyList[i].type, ((*this).*(propertyList[i].data))(), v);
                  setGenerated(false);
                  return true;
                  }
            }
      return Element::setProperty(name, e);
      }
Пример #15
0
bool Text::setProperty(P_ID propertyId, const QVariant& v)
      {
      score()->addRefresh(canvasBoundingRect());
      Property<Text>* p = property(propertyId);
      bool rv = true;
      if (p) {
            setVariant(propertyId, ((*this).*(p->data))(), v);
            setGenerated(false);
            }
      else
            rv = Element::setProperty(propertyId, v);
      score()->setLayoutAll(true);
      return rv;
      }
Пример #16
0
bool Breath::setProperty(P_ID propertyId, const QVariant& v)
      {
      switch(propertyId) {
            case P_ID::PAUSE:
                  setPause(v.toDouble());
                  break;
            default:
                  if (!Element::setProperty(propertyId, v))
                        return false;
                  break;
            }
      triggerLayout();
      setGenerated(false);
      return true;
      }
Пример #17
0
bool Box::setProperty(const QString& name, const QDomElement& e)
{
    for (int i = 0;; ++i) {
        P_ID id = propertyList[i].id;
        if (id == P_END)
            break;
        if (propertyName(id) == name) {
            QVariant v = ::getProperty(id, e);
            setVariant(id, ((*this).*(propertyList[i].data))(), v);
            setGenerated(false);
            return true;
        }
    }
    return Element::setProperty(name, e);
}
Пример #18
0
bool KeySig::setProperty(P_ID propertyId, const QVariant& v)
      {
      switch(propertyId) {
            case P_ID::SHOW_COURTESY:
                  setShowCourtesy(v.toBool());
                  break;
            default:
                  if (!Element::setProperty(propertyId, v))
                        return false;
                  break;
            }
      score()->setLayoutAll(true);
      setGenerated(false);
      return true;
      }
Пример #19
0
bool Text::setProperty(P_ID propertyId, const QVariant& v)
      {
      score()->addRefresh(canvasBoundingRect());
      bool rv = true;
      switch(propertyId) {
            case P_TEXT_STYLE:
                  _styleIndex = v.toInt();
                  setGenerated(false);
                  break;
            default:
                  rv = Element::setProperty(propertyId, v);
                  break;
            }
      score()->setLayoutAll(true);
      return rv;
      }
Пример #20
0
bool Spacer::setProperty(P_ID propertyId, const QVariant& v)
      {
      switch(propertyId) {
            case P_ID::SPACE:
                  setGap(v.toDouble());
                  break;
            default:
                  if (!Element::setProperty(propertyId, v))
                        return false;
                  break;
            }
      layout0();
      score()->setLayoutAll(true);
      setGenerated(false);
      return true;
      }
Пример #21
0
bool Hairpin::setProperty(P_ID id, const QVariant& v)
      {
      switch (id) {
            case P_HAIRPIN_TYPE:
                  _hairpinType = HairpinType(v.toInt());
                  setGenerated(false);
                  break;
            case P_VELO_CHANGE:
                  _veloChange = v.toInt();
                  break;
            case P_DYNAMIC_RANGE:
                  _dynRange = DynamicRange(v.toInt());
                  break;
            default:
                  return SLine::setProperty(id, v);
            }
      return true;
      }
Пример #22
0
GMapHome::GMapHome(Biome *biome_, GMapSlot wall_, GMapSlot door_)
    : GMap(biome_)
{
    // Biome
    biome = biome_;

    // Wall type
    gMapSlotWall = wall_;

    // Door type
    gMapSlotDoor = door_;

    // Not Generated
    setGenerated(false);

    // Entered
    setEntered(true);
}
Пример #23
0
bool LayoutBreak::setProperty(P_ID propertyId, const QVariant& v)
      {
      switch(propertyId) {
            case P_LAYOUT_BREAK:
                  setLayoutBreakType(LayoutBreakType(v.toInt()));
                  break;
            case P_PAUSE:
                  setPause(v.toDouble());
                  break;
            default:
                  if (!Element::setProperty(propertyId, v))
                        return false;
                  break;
            }
      score()->setLayoutAll(true);
      setGenerated(false);
      return true;
      }
Пример #24
0
bool TimeSig::setProperty(P_ID propertyId, const QVariant& v)
      {
      switch (propertyId) {
            case P_ID::SHOW_COURTESY:
                  if (generated())
                        return false;
                  setShowCourtesySig(v.toBool());
                  break;
            case P_ID::NUMERATOR_STRING:
                  setNumeratorString(v.toString());
                  break;
            case P_ID::DENOMINATOR_STRING:
                  setDenominatorString(v.toString());
                  break;
            case P_ID::GROUPS:
                  setGroups(v.value<Groups>());
                  break;
            case P_ID::TIMESIG:
                  setSig(v.value<Fraction>());
                  break;
            case P_ID::TIMESIG_GLOBAL:
                  setGlobalSig(v.value<Fraction>());
                  break;
            case P_ID::TIMESIG_STRETCH:
                  setStretch(v.value<Fraction>());
                  break;
            case P_ID::TIMESIG_TYPE:
                  _timeSigType = (TimeSigType)(v.toInt());
                  break;
            case P_ID::SCALE:
                  _scale = v.toSizeF();
                  break;
            default:
                  if (!Element::setProperty(propertyId, v))
                        return false;
                  break;
            }
      score()->setLayoutAll();      // TODO
      setGenerated(false);
      return true;
      }
Пример #25
0
void GMapHome::generate(int dW, int dH)
{
    // Generate home

    // Set

    // Width
    int hWidth = 10 + randi(10);

    // Height
    int hHeight = hWidth/2;

    // Create clear slots
    for(int mX = -hWidth; mX < alignX(dW) + hWidth*2; mX++)
    {
        // X
        int x = cameraX(alignX(dW)) + mX;

        for(int mY = -hHeight; mY < alignY(dH) + hHeight*2; mY++)
        {
            // Y
            int y = cameraY(alignY(dH)) + mY;

            // Create

            slot[x][y] = new GMapSlot();
        }
    }

    // Home coords
    const int homeX = -hWidth/2;
    const int homeY = -hHeight/2;

    // Generate

    // Home
    for(int mX = -hWidth/2; mX < hWidth/2; mX++)
    {
        for(int mY = -hHeight/2; mY < hHeight/2; mY++)
        {
            slot[mX][mY] = generateSlot();
        }
    }

    // Walls

    // Up / Down
    for(int mX = -hWidth/2; mX <= hWidth/2; mX++)
    {
        // Wall

        slot[mX][-hHeight/2] = &gMapSlotWall;
        slot[mX][hHeight/2] = &gMapSlotWall;
    }

    // Left / Right
    for(int mY = -hHeight/2; mY <= hHeight/2; mY++)
    {
        // Wall

        slot[-hWidth/2][mY] = &gMapSlotWall;
        slot[hWidth/2][mY] = &gMapSlotWall;
    }

    // Door

    // Select angle (left up / right down)

    // Left Up
    int angleX = homeX;
    int angleY = homeY;

    bool leftUp = true;

    // Right down
    if(luck(50.0f))
    {
        angleX *= -1;
        angleY *= -1;

        leftUp = false;
    }

    // Get indent
    int indentX = 1+randi(hWidth-2);
    int indentY = 1+randi(hHeight-2);

    if(!leftUp)
    {
        indentX *= -1;
        indentY *= -1;
    }

    // Set
    int doorX = angleX + indentX;
    int doorY = angleY + indentY;

    if(luck(50.0f))
    {
        slot[homeX][doorY] = &gMapSlotDoor;
        doorX = angleX;
    }
    else
    {
        slot[doorX][homeY] = &gMapSlotDoor;
        doorY = angleY;
    }

    // Set player coords

    // Get
    int playerX_ = getPlayerX();
    int playerY_ = getPlayerY();

    if(leftUp)
    {
        if(angleX == doorX)
        {
            playerX_ = doorX+1;
            playerY_ = doorY;
        }
        else if(angleY == doorY)
        {
            playerY_ = doorY+1;
            playerX_ = doorX;
        }
    }
    else
    {
        if(angleX == doorX)
        {
            playerX_ = doorX-1;
            playerY_ = doorY;
        }
        else if(angleY == doorY)
        {
            playerY_ = doorY-1;
            playerX_ = doorX;
        }
    }

    // Set
    setPlayerX(playerX_);
    setPlayerY(playerY_);

    // Set free generated slot of player coords
    GMapSlot *slot_;
    while(!slot[getPlayerX()][getPlayerY()]->is_free())
    {
        // Generate
        slot_ = generateSlot();

        // Set
        slot[playerX_][playerY_] = slot_;
    }

    // Generated
    setGenerated(true);
}
Пример #26
0
void QSqlRecord::setGenerated(const QString& name, bool generated)
{
    setGenerated(indexOf(name), generated);
}
Пример #27
0
LyricsLineSegment::LyricsLineSegment(Score* s)
      : LineSegment(s, ElementFlag::ON_STAFF | ElementFlag::NOT_SELECTABLE)
      {
      setGenerated(true);
      }