Repository navigation
Support number notation jianpu #31626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7e356ba
a341a9c
0af70ef
3c17047
67379b9
28188d6
8aa7bab
0a89c4a
1a8e8b0
670b7a8
715c0fd
f395751
123bfea
9561cdb
3ed8d86
ff0de9d
e49530c
f5a8a10
8d0b7b6
490c41c
ab40944
f632f00
d4b75c8
c3a7e31
a07a32d
0f082d9
ccbf5f5
90006a8
a117f17
75e7eba
d7cc196
87b9146
af9e0b6
536ca5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| /* | ||
| * SPDX-License-Identifier: GPL-3.0-only | ||
| * MuseScore-Studio-CLA-applies | ||
| * | ||
| * MuseScore Studio | ||
| * Music Composition & Notation | ||
| * | ||
| * Copyright (C) 2021 MuseScore Limited | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License version 3 as | ||
| * published by the Free Software Foundation. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| #include "durationline.h" | ||
|
|
||
| #include "chord.h" | ||
| #include "measure.h" | ||
| #include "rest.h" | ||
| #include "staff.h" | ||
| #include "system.h" | ||
|
|
||
| #include "log.h" | ||
|
|
||
| using namespace mu; | ||
|
|
||
| namespace mu::engraving { | ||
| //--------------------------------------------------------- | ||
| // DurationLine | ||
| //--------------------------------------------------------- | ||
|
|
||
| DurationLine::DurationLine(DummyParentOr<ChordRest> parent) | ||
| : EngravingItem(ElementType::DURATION_LINE, parent) | ||
| { | ||
| setSelectable(false); | ||
| } | ||
|
|
||
| //--------------------------------------------------------- | ||
| // pagePos | ||
| //--------------------------------------------------------- | ||
|
|
||
| PointF DurationLine::pagePos() const | ||
| { | ||
| if (ChordRest* chordRest = this->chordRest()) { | ||
| if (Measure* measure = chordRest->measure()) { | ||
| if (System* system = measure->system()) { | ||
| if (system->staves().size() > staffIdx()) { | ||
| if (SysStaff* staff = system->staff(staffIdx())) { | ||
| double yp = y() + staff->y() + system->y(); | ||
| return PointF(pageX(), yp); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return EngravingItem::pagePos(); | ||
| } | ||
|
|
||
| //--------------------------------------------------------- | ||
| // spatiumChanged | ||
| //--------------------------------------------------------- | ||
|
|
||
| void DurationLine::spatiumChanged(double oldValue, double newValue) | ||
| { | ||
| if (oldValue != 0.0) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove this whole function, but for future reference use |
||
| m_len = (m_len / oldValue) * newValue; | ||
| } | ||
| } | ||
|
|
||
| //--------------------------------------------------------- | ||
| // mag | ||
| //--------------------------------------------------------- | ||
|
|
||
| double DurationLine::mag() const | ||
| { | ||
| auto* parent = ownershipParent(); | ||
| if (parent && parent->isRest()) { | ||
| return toRest(parent)->mag(); | ||
| } | ||
| if (parent && parent->isChord()) { | ||
| return toChord(parent)->mag(); | ||
| } | ||
| const Staff* st = staff(); | ||
| return st ? st->staffMag(this) : 1.0; | ||
| } | ||
|
|
||
| //--------------------------------------------------------- | ||
| // chord | ||
| //--------------------------------------------------------- | ||
|
|
||
| ChordRest* DurationLine::chordRest() const | ||
| { | ||
| auto* parent = ownershipParent(); | ||
| if (parent && parent->isChordRest()) { | ||
| return toChordRest(parent); | ||
| } else { | ||
| return nullptr; | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /* | ||
| * SPDX-License-Identifier: GPL-3.0-only | ||
| * MuseScore-Studio-CLA-applies | ||
| * | ||
| * MuseScore Studio | ||
| * Music Composition & Notation | ||
| * | ||
| * Copyright (C) 2021 MuseScore Limited | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License version 3 as | ||
| * published by the Free Software Foundation. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| #ifndef MU_ENGRAVING_DURATIONLINE_H | ||
| #define MU_ENGRAVING_DURATIONLINE_H | ||
|
|
||
| #include "engravingitem.h" | ||
|
|
||
| namespace mu::engraving { | ||
| //--------------------------------------------------------- | ||
| // @@ DurationLine | ||
| /// Graphic representation of a duration line. | ||
| //! | ||
| //! parent: ChordRest | ||
| //! x-origin: Chord | ||
| //! y-origin: SStaff | ||
| //--------------------------------------------------------- | ||
|
|
||
| class DurationLine final : public EngravingItem | ||
| { | ||
| OBJECT_ALLOCATOR(engraving, DurationLine) | ||
| DECLARE_CLASSOF(ElementType::DURATION_LINE) | ||
|
|
||
| public: | ||
| DurationLine(DummyParentOr<ChordRest>); | ||
| ~DurationLine() override = default; | ||
| DurationLine& operator=(const DurationLine&) = delete; | ||
|
|
||
| DurationLine* clone() const override { return new DurationLine(*this); } | ||
|
|
||
| PointF pagePos() const override; ///< position in page coordinates | ||
| ChordRest* chordRest() const; | ||
| double mag() const; | ||
|
|
||
| double len() const { return m_len; } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be moved to |
||
| void setLen(double v) { m_len = v; } | ||
|
|
||
| void spatiumChanged(double /*oldValue*/, double /*newValue*/) override; | ||
|
|
||
| struct LayoutData : public EngravingItem::LayoutData { | ||
| double lineWidth = 0.0; | ||
| }; | ||
| DECLARE_LAYOUTDATA_METHODS(DurationLine); | ||
|
|
||
| private: | ||
|
|
||
| double m_len = 0.0; | ||
| }; | ||
| } // namespace mu::engraving | ||
| #endif | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -340,6 +340,7 @@ class EngravingItem : public EngravingObject | |||||
| bool hasStaff() const; | ||||||
| const StaffType* staffType() const; | ||||||
| bool onTabStaff() const; | ||||||
| bool isJianpuStaff() const; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| Part* part() const; | ||||||
| Part* originPart() const; // Delegates to an origin part for items in shared parts | ||||||
|
|
||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.