1 //=============================================================================
2 //  MuseScore
3 //  Music Composition & Notation
4 //
5 //  Copyright (C) 2002-2011 Werner Schweer
6 //
7 //  This program is free software; you can redistribute it and/or modify
8 //  it under the terms of the GNU General Public License version 2
9 //  as published by the Free Software Foundation and appearing in
10 //  the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __PEDAL_H__
14 #define __PEDAL_H__
15 
16 #include "textlinebase.h"
17 
18 namespace Ms {
19 
20 class Pedal;
21 
22 //---------------------------------------------------------
23 //   @@ PedalSegment
24 //---------------------------------------------------------
25 
26 class PedalSegment final : public TextLineBaseSegment {
27 
getPropertyStyle(Pid)28       Sid getPropertyStyle(Pid) const override;
29 
30    public:
31       PedalSegment(Spanner* sp, Score* s) : TextLineBaseSegment(sp, s, ElementFlag::MOVABLE | ElementFlag::ON_STAFF) {}
32 
type()33       ElementType type() const override       { return ElementType::PEDAL_SEGMENT; }
clone()34       PedalSegment* clone() const override    { return new PedalSegment(*this);    }
pedal()35       Pedal* pedal() const                    { return toPedal(spanner());          }
36       void layout() override;
37 
38       friend class Pedal;
39       };
40 
41 //---------------------------------------------------------
42 //   @@ Pedal
43 //---------------------------------------------------------
44 
45 class Pedal final : public TextLineBase {
46 
47       Sid getPropertyStyle(Pid) const override;
48 
49    protected:
50       QPointF linePos(Grip, System**) const override;
51 
52    public:
53       Pedal(Score* s);
54 
clone()55       Pedal* clone() const override     { return new Pedal(*this);   }
type()56       ElementType type() const override { return ElementType::PEDAL; }
57 
58       void read(XmlReader&) override;
59       void write(XmlWriter& xml) const override;
60 
61       LineSegment* createLineSegment() override;
62       QVariant propertyDefault(Pid propertyId) const override;
63 
64       friend class PedalLine;
65       };
66 
67 }     // namespace Ms
68 #endif
69 
70