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 <QMultiMap> 17 18 #include "fraction.h" 19 20 namespace Ms { 21 22 class MasterScore; 23 class Score; 24 class Part; 25 class Measure; 26 class XmlWriter; 27 class Staff; 28 class XmlReader; 29 30 //--------------------------------------------------------- 31 // @@ Excerpt 32 //--------------------------------------------------------- 33 34 35 class Excerpt : public QObject { 36 MasterScore* _oscore; 37 38 Score* _partScore { 0 }; 39 QString _title; 40 QList<Part*> _parts; 41 QMultiMap<int, int> _tracks; 42 43 public: 44 Excerpt(MasterScore* s = 0) { _oscore = s; } 45 Excerpt(const Excerpt& ex, bool copyPartScore = true); 46 47 ~Excerpt(); 48 parts()49 QList<Part*>& parts() { return _parts; } setParts(const QList<Part * > & p)50 void setParts(const QList<Part*>& p) { _parts = p; } 51 52 int nstaves() const; 53 tracks()54 QMultiMap<int, int>& tracks() { return _tracks; } setTracks(const QMultiMap<int,int> & t)55 void setTracks(const QMultiMap<int, int>& t) { _tracks = t; } 56 oscore()57 MasterScore* oscore() const { return _oscore; } partScore()58 Score* partScore() const { return _partScore; } 59 void setPartScore(Score* s); 60 61 void read(XmlReader&); 62 63 bool operator!=(const Excerpt&) const; 64 bool operator==(const Excerpt&) const; 65 title()66 QString title() const { return _title; } setTitle(const QString & s)67 void setTitle(const QString& s) { _title = s; } 68 69 static QList<Excerpt*> createAllExcerpt(MasterScore* score); 70 static QString createName(const QString& partName, QList<Excerpt*>&); 71 static void createExcerpt(Excerpt*); 72 static void cloneStaves(Score* oscore, Score* score, const QList<int>& map, QMultiMap<int, int>& allTracks); 73 static void cloneStaff(Staff* ostaff, Staff* nstaff); 74 static void cloneStaff2(Staff* ostaff, Staff* nstaff, const Fraction& stick, const Fraction& etick); 75 static void processLinkedClone(Element* ne, Score* score, int strack); 76 }; 77 78 } // namespace Ms 79 #endif 80 81