Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-Studio-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) 2021 MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 :
23 : #ifndef MU_ENGRAVING_PEDAL_H
24 : #define MU_ENGRAVING_PEDAL_H
25 :
26 : #include "textlinebase.h"
27 :
28 : namespace mu::engraving {
29 : class Pedal;
30 :
31 : //---------------------------------------------------------
32 : // @@ PedalSegment
33 : //---------------------------------------------------------
34 :
35 : class PedalSegment final : public TextLineBaseSegment
36 : {
37 142 : OBJECT_ALLOCATOR(engraving, PedalSegment)
38 : DECLARE_CLASSOF(ElementType::PEDAL_SEGMENT)
39 :
40 : public:
41 : PedalSegment(Pedal* sp);
42 :
43 1 : PedalSegment* clone() const override { return new PedalSegment(*this); }
44 : Pedal* pedal() const { return toPedal(spanner()); }
45 :
46 : friend class Pedal;
47 : };
48 :
49 : //---------------------------------------------------------
50 : // @@ Pedal
51 : //---------------------------------------------------------
52 :
53 : class Pedal final : public TextLineBase
54 : {
55 305 : OBJECT_ALLOCATOR(engraving, Pedal)
56 1429 : DECLARE_CLASSOF(ElementType::PEDAL)
57 :
58 : Sid getPropertyStyle(Pid) const override;
59 :
60 : protected:
61 : Sid defaultPosSid() const override;
62 : PointF linePos(Grip, System**) const override;
63 :
64 : public:
65 : static const String PEDAL_SYMBOL;
66 : static const String STAR_SYMBOL;
67 :
68 : Pedal(DummyParentOr<EngravingItem> parent);
69 :
70 2 : Pedal* clone() const override { return new Pedal(*this); }
71 :
72 1109 : Anchor anchor() const override { return Anchor::SEGMENT; }
73 :
74 : LineSegment* createLineSegment() override;
75 : PropertyValue propertyDefault(Pid propertyId) const override;
76 : bool setProperty(Pid propertyId, const PropertyValue& v) override;
77 :
78 : Pedal* findNextInStaff() const;
79 : bool connect45HookToNext() const;
80 :
81 : friend class PedalLine;
82 : };
83 : } // namespace mu::engraving
84 : #endif
|