-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Expand file tree
/
Copy pathbracketItem.h
More file actions
86 lines (69 loc) · 2.71 KB
/
bracketItem.h
File metadata and controls
86 lines (69 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* 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_BRACKET_ITEM_H
#define MU_ENGRAVING_BRACKET_ITEM_H
#include "engravingitem.h"
#include "stafflabel.h"
#include "../types/types.h"
namespace mu::engraving {
class Factory;
//---------------------------------------------------------
// BracketItem
//---------------------------------------------------------
class BracketItem final : public EngravingItem
{
OBJECT_ALLOCATOR(engraving, BracketItem)
public:
EngravingItem* clone() const override;
PropertyValue getProperty(Pid) const override;
bool setProperty(Pid, const PropertyValue&) override;
PropertyValue propertyDefault(Pid id) const override;
size_t bracketSpan() const { return m_bracketSpan; }
BracketType bracketType() const { return m_bracketType; }
void setBracketSpan(size_t v) { m_bracketSpan = v; }
void setBracketType(BracketType v) { m_bracketType = v; }
Staff* staff() const { return m_staff; }
void setStaff(Staff* s) { m_staff = s; }
size_t column() const { return m_column; }
void setColumn(size_t v) { m_column = v; }
StaffLabel& label() { return m_name; }
const StaffLabel& label() const { return m_name; }
const String& longName() const { return m_name.longName(); }
const String& shortName() const { return m_name.shortName(); }
bool showText() const { return m_showText; }
bool showBracket() const { return m_showBracket; }
bool intersects(const BracketItem* other) const;
bool intersects(staff_idx_t first, staff_idx_t last) const;
private:
friend class Factory;
BracketItem(EngravingItem* parent);
BracketItem(EngravingItem* parent, BracketType a, int b);
BracketType m_bracketType = BracketType::NO_BRACKET;
size_t m_column = 0;
size_t m_bracketSpan = 0;
Staff* m_staff = nullptr;
StaffLabel m_name = StaffLabel(muse::mtrc("systemBrackets", "GROUP"), muse::mtrc("systemBrackets", "GR.", "Short for GROUP"));
bool m_showText = true;
bool m_showBracket = true;
};
}
#endif