MuseScore/libmscore/excerpt.h

79 lines
2.3 KiB
C
Raw Normal View History

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__
#include <QMultiMap>
#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; }
Excerpt(const Excerpt& ex, bool copyPartScore = true);
~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;
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);
static QString createName(const QString& partName, QList<Excerpt*>&);
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);
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