MuseScore  3.4
Music composition and notation
excerpt.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2008-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 __EXCERPT_H__
14 #define __EXCERPT_H__
15 
16 #include "fraction.h"
17 
18 namespace Ms {
19 
20 class MasterScore;
21 class Score;
22 class Part;
23 class Measure;
24 class XmlWriter;
25 class Staff;
26 class XmlReader;
27 
28 //---------------------------------------------------------
29 // @@ Excerpt
30 //---------------------------------------------------------
31 
32 #include <QMultiMap>
33 
34 class Excerpt : public QObject {
36 
37  Score* _partScore { 0 };
38  QString _title;
39  QList<Part*> _parts;
40  QMultiMap<int, int> _tracks;
41 
42  public:
43  Excerpt(MasterScore* s = 0) { _oscore = s; }
44  Excerpt(const Excerpt& ex, bool copyPartScore = true);
45 
46  ~Excerpt();
47 
48  QList<Part*>& parts() { return _parts; }
49  void setParts(const QList<Part*>& p) { _parts = p; }
50 
51 
52  QMultiMap<int, int>& tracks() { return _tracks; }
53  void setTracks(const QMultiMap<int, int>& t) { _tracks = t; }
54 
55  MasterScore* oscore() const { return _oscore; }
56  Score* partScore() const { return _partScore; }
57  void setPartScore(Score* s);
58 
59  void read(XmlReader&);
60 
61  bool operator!=(const Excerpt&) const;
62  bool operator==(const Excerpt&) const;
63 
64  QString title() const { return _title; }
65  void setTitle(const QString& s) { _title = s; }
66 
67  static QList<Excerpt*> createAllExcerpt(MasterScore* score);
68  static QString createName(const QString& partName, QList<Excerpt*>&);
69  static void createExcerpt(Excerpt*);
70  static void cloneStaves(Score* oscore, Score* score, const QList<int>& map, QMultiMap<int, int>& allTracks);
71  static void cloneStaff(Staff* ostaff, Staff* nstaff);
72  static void cloneStaff2(Staff* ostaff, Staff* nstaff, const Fraction& stick, const Fraction& etick);
73  };
74 
75 } // namespace Ms
76 #endif
77 
void read(XmlReader &)
Definition: excerpt.cpp:70
Global staff data not directly related to drawing.
Definition: staff.h:62
Score * partScore() const
Definition: excerpt.h:56
void setPartScore(Score *s)
Definition: excerpt.cpp:1223
Definition: xml.h:67
void setTitle(const QString &s)
Definition: excerpt.h:65
Definition: score.h:1227
MasterScore * _oscore
Definition: excerpt.h:35
QMultiMap< int, int > & tracks()
Definition: excerpt.h:52
Definition: score.h:391
QString title() const
Definition: excerpt.h:64
Excerpt(MasterScore *s=0)
Definition: excerpt.h:43
QString _title
Definition: excerpt.h:38
void setTracks(const QMultiMap< int, int > &t)
Definition: excerpt.h:53
MasterScore * oscore() const
Definition: excerpt.h:55
Definition: aeolus.cpp:26
static QList< Excerpt * > createAllExcerpt(MasterScore *score)
Definition: excerpt.cpp:1176
Definition: xmlwriter.h:26
static QString createName(const QString &partName, QList< Excerpt *> &)
Definition: excerpt.cpp:1198
QMultiMap< int, int > _tracks
Definition: excerpt.h:40
bool operator==(const Excerpt &) const
Definition: excerpt.cpp:113
QList< Part * > & parts()
Definition: excerpt.h:48
Score * _partScore
Definition: excerpt.h:37
Definition: excerpt.h:34
Definition: xmlreader.h:28
void setParts(const QList< Part *> &p)
Definition: excerpt.h:49
Definition: fraction.h:46
~Excerpt()
Definition: excerpt.cpp:62
QList< Part * > _parts
Definition: excerpt.h:39
static void cloneStaves(Score *oscore, Score *score, const QList< int > &map, QMultiMap< int, int > &allTracks)
Definition: excerpt.cpp:436
static void cloneStaff2(Staff *ostaff, Staff *nstaff, const Fraction &stick, const Fraction &etick)
Definition: excerpt.cpp:1004
bool operator!=(const Excerpt &) const
Definition: excerpt.cpp:96
static void createExcerpt(Excerpt *)
Definition: excerpt.cpp:130
static void cloneStaff(Staff *ostaff, Staff *nstaff)
Definition: excerpt.cpp:825