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_NOTEDOT_H
24 : #define MU_ENGRAVING_NOTEDOT_H
25 :
26 : #include "engravingitem.h"
27 :
28 : namespace mu::engraving {
29 : class Factory;
30 : class Note;
31 : class Rest;
32 :
33 : //---------------------------------------------------------
34 : // @@ NoteDot
35 : //---------------------------------------------------------
36 :
37 : class NoteDot final : public EngravingItem
38 : {
39 1655 : OBJECT_ALLOCATOR(engraving, NoteDot)
40 1429 : DECLARE_CLASSOF(ElementType::NOTEDOT)
41 :
42 : public:
43 :
44 0 : NoteDot* clone() const override { return new NoteDot(*this); }
45 : double mag() const override;
46 :
47 0 : Note* note() const { return ownershipParent()->isNote() ? toNote(ownershipParent()) : 0; }
48 0 : Rest* rest() const { return ownershipParent()->isRest() ? toRest(ownershipParent()) : 0; }
49 : EngravingItem* elementBase() const override;
50 :
51 : private:
52 : friend class Factory;
53 : NoteDot(DummyParentOr<Note> parent);
54 : NoteDot(Rest* parent);
55 : };
56 : } // namespace mu::engraving
57 : #endif
|