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 : #include "scorecallbacks.h"
23 :
24 : #include "engraving/dom/engravingitem.h"
25 : #include "inotationinteraction.h"
26 :
27 : #include "log.h"
28 :
29 : using namespace mu::notation;
30 :
31 0 : void ScoreCallbacks::dataChanged(const muse::RectF&)
32 : {
33 0 : NOT_IMPLEMENTED;
34 0 : }
35 :
36 0 : void ScoreCallbacks::updateAll()
37 : {
38 0 : NOT_IMPLEMENTED;
39 0 : }
40 :
41 0 : void ScoreCallbacks::drawBackground(muse::draw::Painter*, const muse::RectF&) const
42 : {
43 0 : NOT_IMPLEMENTED;
44 0 : }
45 :
46 0 : double ScoreCallbacks::selectionProximity() const
47 : {
48 0 : return m_selectionProximity;
49 : }
50 :
51 0 : void ScoreCallbacks::setSelectionProximity(double proximity)
52 : {
53 0 : m_selectionProximity = proximity;
54 0 : }
55 :
56 0 : void ScoreCallbacks::setDropTarget(mu::engraving::EngravingItem* dropTarget)
57 : {
58 0 : IF_ASSERT_FAILED(m_interaction) {
59 0 : return;
60 : }
61 :
62 0 : m_interaction->setDropTarget(dropTarget, false);
63 : }
64 :
65 0 : void ScoreCallbacks::changeEditElement(mu::engraving::EngravingItem* newElement)
66 : {
67 0 : IF_ASSERT_FAILED(m_interaction) {
68 0 : return;
69 : }
70 :
71 0 : m_interaction->changeEditElement(newElement);
72 : }
73 :
74 0 : void ScoreCallbacks::adjustCanvasPosition(const mu::engraving::EngravingItem* el, int staffIndex)
75 : {
76 0 : IF_ASSERT_FAILED(m_interaction) {
77 0 : return;
78 : }
79 :
80 0 : m_interaction->showItem(el, staffIndex);
81 : }
82 :
83 0 : void ScoreCallbacks::setNotationInteraction(INotationInteraction* interaction)
84 : {
85 0 : m_interaction = interaction;
86 0 : }
|