MuseScore  3.4
Music composition and notation
edit.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2019 Werner Schweer and others
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 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __EDIT_H__
21 #define __EDIT_H__
22 
23 #include "hairpin.h" // for HairpinType
24 
30 namespace Ms {
31 
32 class ChordRest;
33 class Score;
34 class Selection;
35 
36 //-----------------------------------------------------------------------------
37 // Editor
39 //-----------------------------------------------------------------------------
40 
41 class Editor {
43  bool needCommit;
44 
45  void finishChanges();
46 
47  public:
48  Editor(Score* s, bool allowNonUnique = false);
49  Editor(const Editor&) = delete;
50  Editor(Editor&&);
51  Editor& operator=(const Editor&) = delete;
53  ~Editor();
54 
55  void rollback();
56  void commit();
57 
58  Hairpin* addHairpin(HairpinType, ChordRest* cr1, ChordRest* cr2 = nullptr, bool toCr2End = true);
59 // std::vector<Hairpin*> addHairpins(HairpinType, const Selection&);
60 
61  friend class Score;
62  };
63 
64 } // namespace Ms
65 
66 #endif
67 
HairpinType
Definition: hairpin.h:27
bool needCommit
Definition: edit.h:43
Editor & operator=(const Editor &)=delete
void rollback()
Score * score
Definition: edit.h:42
Definition: hairpin.h:84
Definition: score.h:391
Editor(Score *s, bool allowNonUnique=false)
void finishChanges()
Definition: aeolus.cpp:26
Contains a score editing logic.
Definition: edit.h:41
Hairpin * addHairpin(HairpinType, ChordRest *cr1, ChordRest *cr2=nullptr, bool toCr2End=true)
void commit()
Definition: chordrest.h:48