int Clef::GetClefLocOffset() const { if (this->HasSameasLink() && this->GetSameasLink()->Is(CLEF)) { Clef *sameas = dynamic_cast<Clef *>(this->GetSameasLink()); assert(sameas); return sameas->GetClefLocOffset(); } int offset = 0; if (GetShape() == CLEFSHAPE_G) offset = -4; else if (GetShape() == CLEFSHAPE_F) offset = 4; offset += (GetLine() - 1) * 2; int disPlace = 0; if (GetDisPlace() == STAFFREL_basic_above) disPlace = -1; else if (GetDisPlace() == STAFFREL_basic_below) disPlace = 1; if ((disPlace != 0) && (GetDis() != OCTAVE_DIS_NONE)) offset += (disPlace * (GetDis() - 1)); return offset; }
int Clef::GetClefLocOffset() const { int offset = 0; if (GetShape() == CLEFSHAPE_G) offset = -4; else if (GetShape() == CLEFSHAPE_F) offset = 4; offset += (GetLine() - 1) * 2; int disPlace = 0; if (GetDisPlace() == PLACE_above) disPlace = -1; else if (GetDisPlace() == PLACE_below) disPlace = 1; if ((disPlace != 0) && (GetDis() != OCTAVE_DIS_NONE)) offset += (disPlace * (GetDis() - 1)); return offset; }
int Clef::GetClefId() { return GetDisPlace() << 24 | GetDis() << 16 | GetShape() << 8 | GetLine(); }