1 
2 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
3 
4 /*
5     Rosegarden
6     A MIDI and audio sequencer and musical notation editor.
7     Copyright 2000-2021 the Rosegarden development team.
8 
9     Other copyrights also apply to some parts of this work.  Please
10     see the AUTHORS file and individual file headers for details.
11 
12     This program is free software; you can redistribute it and/or
13     modify it under the terms of the GNU General Public License as
14     published by the Free Software Foundation; either version 2 of the
15     License, or (at your option) any later version.  See the file
16     COPYING included with this distribution for more information.
17 */
18 
19 #ifndef RG_NOTATIONCHORD_H
20 #define RG_NOTATIONCHORD_H
21 
22 #include "base/NotationTypes.h"
23 #include "base/Sets.h"
24 #include "NotationElement.h"
25 
26 class Iterator;
27 
28 
29 namespace Rosegarden
30 {
31 
32 class Quantizer;
33 class NotationProperties;
34 
35 
36 class NotationChord : public GenericChord<NotationElement,
37                                           NotationElementList,
38                                           true>
39 {
40 public:
41     NotationChord(NotationElementList &c,
42                   NotationElementList::iterator i,
43                   const Quantizer *quantizer,
44                   const NotationProperties &properties,
45                   const Clef &clef = Clef::DefaultClef,
46                   const Key &key = Key::DefaultKey);
47 
~NotationChord()48     ~NotationChord() override { }
49 
getHighestNoteHeight()50     virtual int getHighestNoteHeight() const {
51         return getHeight(getHighestNote());
52     }
getLowestNoteHeight()53     virtual int getLowestNoteHeight() const {
54         return getHeight(getLowestNote());
55     }
56 
57     virtual bool hasStem() const;
58     virtual bool hasStemUp() const;
59 
60     virtual bool hasNoteHeadShifted() const;
61     virtual bool isNoteHeadShifted(const NotationElementList::iterator &itr)
62         const;
63 
64     void applyAccidentalShiftProperties();
65 
66     virtual int getMaxAccidentalShift(bool &extra) const;
67     virtual int getAccidentalShift(const NotationElementList::iterator &itr,
68                                    bool &extra) const;
69 
70 protected:
71     const NotationProperties &m_properties;
72     Clef m_clef;
73     Key m_key;
74 
75 
76     int getHeight(const Iterator&) const;
77 };
78 
79 
80 
81 }
82 
83 #endif
84