2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
|
|
|
//
|
|
|
|
// Copyright (C) 2008-2011 Werner Schweer
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License version 2
|
|
|
|
// as published by the Free Software Foundation and appearing in
|
|
|
|
// the file LICENCE.GPL
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
#ifndef __EXCERPT_H__
|
|
|
|
#define __EXCERPT_H__
|
|
|
|
|
2020-02-15 12:51:50 +01:00
|
|
|
#include <QMultiMap>
|
|
|
|
|
2019-01-30 15:13:54 +01:00
|
|
|
#include "fraction.h"
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
namespace Ms {
|
|
|
|
|
2016-03-11 12:18:46 +01:00
|
|
|
class MasterScore;
|
2012-05-26 14:26:10 +02:00
|
|
|
class Score;
|
|
|
|
class Part;
|
2016-07-31 15:23:11 +02:00
|
|
|
class Measure;
|
2016-11-19 11:51:21 +01:00
|
|
|
class XmlWriter;
|
2012-05-26 14:26:10 +02:00
|
|
|
class Staff;
|
2013-01-11 18:10:18 +01:00
|
|
|
class XmlReader;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
//---------------------------------------------------------
|
2015-04-22 21:22:06 +02:00
|
|
|
// @@ Excerpt
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2016-07-31 15:23:11 +02:00
|
|
|
|
2015-04-22 21:22:06 +02:00
|
|
|
class Excerpt : public QObject {
|
2016-03-11 12:18:46 +01:00
|
|
|
MasterScore* _oscore;
|
2016-09-16 12:07:37 +02:00
|
|
|
|
2016-03-11 12:18:46 +01:00
|
|
|
Score* _partScore { 0 };
|
2012-05-26 14:26:10 +02:00
|
|
|
QString _title;
|
|
|
|
QList<Part*> _parts;
|
2016-07-31 15:23:11 +02:00
|
|
|
QMultiMap<int, int> _tracks;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
public:
|
2016-07-31 15:23:11 +02:00
|
|
|
Excerpt(MasterScore* s = 0) { _oscore = s; }
|
2019-02-21 01:30:35 +01:00
|
|
|
Excerpt(const Excerpt& ex, bool copyPartScore = true);
|
|
|
|
|
2017-11-14 17:53:25 +01:00
|
|
|
~Excerpt();
|
2014-11-04 12:08:25 +01:00
|
|
|
|
2014-11-27 14:50:02 +01:00
|
|
|
QList<Part*>& parts() { return _parts; }
|
|
|
|
void setParts(const QList<Part*>& p) { _parts = p; }
|
2016-10-10 18:37:28 +02:00
|
|
|
|
2016-03-11 12:18:46 +01:00
|
|
|
|
2016-07-31 15:23:11 +02:00
|
|
|
QMultiMap<int, int>& tracks() { return _tracks; }
|
2016-10-10 18:37:28 +02:00
|
|
|
void setTracks(const QMultiMap<int, int>& t) { _tracks = t; }
|
2016-07-31 15:23:11 +02:00
|
|
|
|
2016-10-10 18:37:28 +02:00
|
|
|
MasterScore* oscore() const { return _oscore; }
|
2014-11-27 14:50:02 +01:00
|
|
|
Score* partScore() const { return _partScore; }
|
2016-10-10 18:37:28 +02:00
|
|
|
void setPartScore(Score* s);
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2013-01-11 18:10:18 +01:00
|
|
|
void read(XmlReader&);
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
bool operator!=(const Excerpt&) const;
|
2015-12-15 18:23:47 +01:00
|
|
|
bool operator==(const Excerpt&) const;
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
QString title() const { return _title; }
|
2014-11-04 12:08:25 +01:00
|
|
|
void setTitle(const QString& s) { _title = s; }
|
2016-03-11 12:18:46 +01:00
|
|
|
|
|
|
|
static QList<Excerpt*> createAllExcerpt(MasterScore* score);
|
2017-01-04 20:43:25 +01:00
|
|
|
static QString createName(const QString& partName, QList<Excerpt*>&);
|
2016-10-12 11:09:53 +02:00
|
|
|
static void createExcerpt(Excerpt*);
|
|
|
|
static void cloneStaves(Score* oscore, Score* score, const QList<int>& map, QMultiMap<int, int>& allTracks);
|
|
|
|
static void cloneStaff(Staff* ostaff, Staff* nstaff);
|
2019-01-30 15:13:54 +01:00
|
|
|
static void cloneStaff2(Staff* ostaff, Staff* nstaff, const Fraction& stick, const Fraction& etick);
|
2012-05-26 14:26:10 +02:00
|
|
|
};
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
} // namespace Ms
|
2012-05-26 14:26:10 +02:00
|
|
|
#endif
|
|
|
|
|