update for Jump and Marker elements
This commit is contained in:
parent
a873ef12da
commit
d846e3d0d3
20 changed files with 762 additions and 482 deletions
|
@ -22,7 +22,8 @@ if (SCRIPT_INTERFACE)
|
|||
rest.h segment.h shadownote.h simpletext.h slur.h spacer.h spanner.h
|
||||
stafftext.h stem.h symbol.h system.h tempotext.h textframe.h text.h
|
||||
textline.h timesig.h tremolobar.h tremolo.h trill.h tuplet.h volta.h
|
||||
score.h cursor.h page.h part.h staff.h mscore.h staffstate.h
|
||||
score.h cursor.h page.h part.h staff.h mscore.h staffstate.h marker.h
|
||||
jump.h
|
||||
)
|
||||
endif (SCRIPT_INTERFACE)
|
||||
|
||||
|
@ -73,7 +74,7 @@ add_library (
|
|||
property.cpp range.cpp elementmap.cpp notedot.cpp imageStore.cpp
|
||||
qzip.cpp audio.cpp splitMeasure.cpp joinMeasure.cpp midifile.cpp
|
||||
exportmidi.cpp cursor.cpp read114.cpp sparm.cpp paste.cpp
|
||||
bsymbol.cpp
|
||||
bsymbol.cpp marker.cpp jump.cpp
|
||||
)
|
||||
if (SCRIPT_INTERFACE)
|
||||
set_target_properties (
|
||||
|
|
|
@ -79,6 +79,8 @@
|
|||
#include "notedot.h"
|
||||
#include "textframe.h"
|
||||
#include "image.h"
|
||||
#include "marker.h"
|
||||
#include "jump.h"
|
||||
|
||||
// extern bool showInvisible;
|
||||
|
||||
|
|
201
libmscore/jump.cpp
Normal file
201
libmscore/jump.cpp
Normal file
|
@ -0,0 +1,201 @@
|
|||
//=============================================================================
|
||||
// MuseScore
|
||||
// Music Composition & Notation
|
||||
//
|
||||
// Copyright (C) 2002-2013 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
|
||||
//=============================================================================
|
||||
|
||||
#include "jump.h"
|
||||
#include "score.h"
|
||||
|
||||
//---------------------------------------------------------
|
||||
// JumpTypeTable
|
||||
//---------------------------------------------------------
|
||||
|
||||
struct JumpTypeTable {
|
||||
JumpType type;
|
||||
const char* text;
|
||||
const char* jumpTo;
|
||||
const char* playUntil;
|
||||
const char* continueAt;
|
||||
};
|
||||
|
||||
static const JumpTypeTable jumpTypeTable[] = {
|
||||
{ JumpType::DC, "D.C.", "start", "end", "" },
|
||||
{ JumpType::DC_AL_FINE, "D.C. al Fine", "start", "fine", "" },
|
||||
{ JumpType::DC_AL_CODA, "D.C. al Coda", "start", "coda", "codab" },
|
||||
{ JumpType::DS_AL_CODA, "D.S. al Coda", "segno", "coda", "codab" },
|
||||
{ JumpType::DS_AL_FINE, "D.S. al Fine", "segno", "fine", "" },
|
||||
{ JumpType::DS, "D.S.", "segno", "end", "" }
|
||||
};
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Jump
|
||||
//---------------------------------------------------------
|
||||
|
||||
Jump::Jump(Score* s)
|
||||
: Text(s)
|
||||
{
|
||||
setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
|
||||
setTextStyle(s->textStyle(TEXT_STYLE_REPEAT));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// setJumpType
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Jump::setJumpType(JumpType t)
|
||||
{
|
||||
for (const JumpTypeTable& p : jumpTypeTable) {
|
||||
if (p.type == t) {
|
||||
setText(p.text);
|
||||
setJumpTo(p.jumpTo);
|
||||
setPlayUntil(p.playUntil);
|
||||
setContinueAt(p.continueAt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// jumpType
|
||||
//---------------------------------------------------------
|
||||
|
||||
JumpType Jump::jumpType() const
|
||||
{
|
||||
for (const JumpTypeTable& t : jumpTypeTable) {
|
||||
if (_jumpTo == t.jumpTo && _playUntil == t.playUntil && _continueAt == t.continueAt)
|
||||
return t.type;
|
||||
}
|
||||
return JumpType::USER;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// read
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Jump::read(XmlReader& e)
|
||||
{
|
||||
while (e.readNextStartElement()) {
|
||||
const QStringRef& tag(e.name());
|
||||
if (tag == "jumpTo")
|
||||
_jumpTo = e.readElementText();
|
||||
else if (tag == "playUntil")
|
||||
_playUntil = e.readElementText();
|
||||
else if (tag == "continueAt")
|
||||
_continueAt = e.readElementText();
|
||||
else if (!Text::readProperties(e))
|
||||
e.unknown();
|
||||
}
|
||||
setTextStyle(score()->textStyle(TEXT_STYLE_REPEAT_RIGHT));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// write
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Jump::write(Xml& xml) const
|
||||
{
|
||||
xml.stag(name());
|
||||
Text::writeProperties(xml);
|
||||
xml.tag("jumpTo", _jumpTo);
|
||||
xml.tag("playUntil", _playUntil);
|
||||
xml.tag("continueAt", _continueAt);
|
||||
xml.etag();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// undoSetJumpTo
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Jump::undoSetJumpTo(const QString& s)
|
||||
{
|
||||
score()->undoChangeProperty(this, P_JUMP_TO, s);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// undoSetPlayUntil
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Jump::undoSetPlayUntil(const QString& s)
|
||||
{
|
||||
score()->undoChangeProperty(this, P_PLAY_UNTIL, s);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// undoSetContinueAt
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Jump::undoSetContinueAt(const QString& s)
|
||||
{
|
||||
score()->undoChangeProperty(this, P_CONTINUE_AT, s);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// getProperty
|
||||
//---------------------------------------------------------
|
||||
|
||||
QVariant Jump::getProperty(P_ID propertyId) const
|
||||
{
|
||||
switch (propertyId) {
|
||||
case P_JUMP_TO:
|
||||
return jumpTo();
|
||||
case P_PLAY_UNTIL:
|
||||
return playUntil();
|
||||
case P_CONTINUE_AT:
|
||||
return continueAt();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return Text::getProperty(propertyId);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// setProperty
|
||||
//---------------------------------------------------------
|
||||
|
||||
bool Jump::setProperty(P_ID propertyId, const QVariant& v)
|
||||
{
|
||||
switch (propertyId) {
|
||||
case P_JUMP_TO:
|
||||
setJumpTo(v.toString());
|
||||
break;
|
||||
case P_PLAY_UNTIL:
|
||||
setPlayUntil(v.toString());
|
||||
break;
|
||||
case P_CONTINUE_AT:
|
||||
setContinueAt(v.toString());
|
||||
break;
|
||||
default:
|
||||
if (!Text::setProperty(propertyId, v))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
score()->setLayoutAll(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// propertyDefault
|
||||
//---------------------------------------------------------
|
||||
|
||||
QVariant Jump::propertyDefault(P_ID propertyId) const
|
||||
{
|
||||
switch (propertyId) {
|
||||
case P_JUMP_TO:
|
||||
case P_PLAY_UNTIL:
|
||||
case P_CONTINUE_AT:
|
||||
return QString();
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return Text::propertyDefault(propertyId);
|
||||
}
|
||||
|
||||
|
85
libmscore/jump.h
Normal file
85
libmscore/jump.h
Normal file
|
@ -0,0 +1,85 @@
|
|||
//=============================================================================
|
||||
// MuseScore
|
||||
// Music Composition & Notation
|
||||
// $Id: repeat.h 5516 2012-04-02 20:25:43Z wschweer $
|
||||
//
|
||||
// Copyright (C) 2002-2013 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 __JUMP_H__
|
||||
#define __JUMP_H__
|
||||
|
||||
#include "text.h"
|
||||
|
||||
//---------------------------------------------------------
|
||||
// JumpType
|
||||
//---------------------------------------------------------
|
||||
|
||||
enum class JumpType {
|
||||
DC,
|
||||
DC_AL_FINE,
|
||||
DC_AL_CODA,
|
||||
DS_AL_CODA,
|
||||
DS_AL_FINE,
|
||||
DS,
|
||||
USER
|
||||
};
|
||||
|
||||
//---------------------------------------------------------
|
||||
// @@ Jump
|
||||
/// Jump label
|
||||
//
|
||||
// @P jumpTo QString
|
||||
// @P playUntil QString
|
||||
// @P continueAt QString
|
||||
//---------------------------------------------------------
|
||||
|
||||
class Jump : public Text {
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QString jumpTo READ jumpTo WRITE undoSetJumpTo)
|
||||
Q_PROPERTY(QString playUntil READ playUntil WRITE undoSetPlayUntil)
|
||||
Q_PROPERTY(QString continueAt READ continueAt WRITE undoSetContinueAt)
|
||||
|
||||
QString _jumpTo;
|
||||
QString _playUntil;
|
||||
QString _continueAt;
|
||||
|
||||
public:
|
||||
Jump(Score*);
|
||||
|
||||
void setJumpType(JumpType t);
|
||||
JumpType jumpType() const;
|
||||
|
||||
virtual Jump* clone() const { return new Jump(*this); }
|
||||
virtual ElementType type() const { return JUMP; }
|
||||
|
||||
virtual void read(XmlReader&);
|
||||
virtual void write(Xml& xml) const;
|
||||
|
||||
QString jumpTo() const { return _jumpTo; }
|
||||
QString playUntil() const { return _playUntil; }
|
||||
QString continueAt() const { return _continueAt; }
|
||||
void setJumpTo(const QString& s) { _jumpTo = s; }
|
||||
void setPlayUntil(const QString& s) { _playUntil = s; }
|
||||
void setContinueAt(const QString& s) { _continueAt = s; }
|
||||
void undoSetJumpTo(const QString& s);
|
||||
void undoSetPlayUntil(const QString& s);
|
||||
void undoSetContinueAt(const QString& s);
|
||||
|
||||
virtual bool systemFlag() const { return true; }
|
||||
|
||||
virtual QVariant getProperty(P_ID propertyId) const;
|
||||
virtual bool setProperty(P_ID propertyId, const QVariant&);
|
||||
virtual QVariant propertyDefault(P_ID) const;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(JumpType)
|
||||
|
||||
#endif
|
||||
|
264
libmscore/marker.cpp
Normal file
264
libmscore/marker.cpp
Normal file
|
@ -0,0 +1,264 @@
|
|||
//=============================================================================
|
||||
// MuseScore
|
||||
// Music Composition & Notation
|
||||
//
|
||||
// Copyright (C) 2002-2013 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
|
||||
//=============================================================================
|
||||
|
||||
#include "marker.h"
|
||||
#include "score.h"
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Marker
|
||||
//---------------------------------------------------------
|
||||
|
||||
Marker::Marker(Score* s)
|
||||
: Text(s)
|
||||
{
|
||||
_markerType = MarkerType::FINE;
|
||||
setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE | ELEMENT_ON_STAFF);
|
||||
setTextStyle(s->textStyle(TEXT_STYLE_REPEAT));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// setMarkerType
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::setMarkerType(MarkerType t)
|
||||
{
|
||||
_markerType = t;
|
||||
switch(t) {
|
||||
case MarkerType::SEGNO:
|
||||
setText(symbols[score()->symIdx()][segnoSym].toString());
|
||||
setLabel("segno");
|
||||
break;
|
||||
|
||||
case MarkerType::VARSEGNO:
|
||||
setText(symbols[score()->symIdx()][varsegnoSym].toString());
|
||||
setLabel("varsegno");
|
||||
break;
|
||||
|
||||
case MarkerType::CODA:
|
||||
setText(symbols[score()->symIdx()][codaSym].toString());
|
||||
setLabel("codab");
|
||||
break;
|
||||
|
||||
case MarkerType::VARCODA:
|
||||
setText(symbols[score()->symIdx()][varcodaSym].toString());
|
||||
setLabel("varcoda");
|
||||
break;
|
||||
|
||||
case MarkerType::CODETTA:
|
||||
setText(symbols[score()->symIdx()][codaSym].toString());
|
||||
setLabel("codetta");
|
||||
break;
|
||||
|
||||
case MarkerType::FINE:
|
||||
setText("Fine");
|
||||
setLabel("fine");
|
||||
break;
|
||||
|
||||
case MarkerType::TOCODA:
|
||||
setText("To Coda");
|
||||
setLabel("coda");
|
||||
break;
|
||||
|
||||
case MarkerType::USER:
|
||||
break;
|
||||
|
||||
default:
|
||||
qDebug("unknown marker type %d\n", t);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// styleChanged
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::styleChanged()
|
||||
{
|
||||
setMarkerType(_markerType);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// adjustReadPos
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::adjustReadPos()
|
||||
{
|
||||
if (!readPos().isNull()) {
|
||||
QPointF uo;
|
||||
if (score()->mscVersion() <= 114) {
|
||||
// rebase from Measure to Segment
|
||||
uo = userOff();
|
||||
uo.rx() -= segment()->pos().x();
|
||||
// 1.2 is always HCENTER aligned
|
||||
if ((align() & ALIGN_HMASK) == 0) // ALIGN_LEFT
|
||||
uo.rx() -= bbox().width() * .5;
|
||||
}
|
||||
else
|
||||
uo = readPos() - ipos();
|
||||
setUserOff(uo);
|
||||
setReadPos(QPointF());
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// markerType
|
||||
//---------------------------------------------------------
|
||||
|
||||
MarkerType Marker::markerType(const QString& s) const
|
||||
{
|
||||
if (s == "segno")
|
||||
return MarkerType::SEGNO;
|
||||
else if (s == "varsegno")
|
||||
return MarkerType::VARSEGNO;
|
||||
else if (s == "codab")
|
||||
return MarkerType::CODA;
|
||||
else if (s == "varcoda")
|
||||
return MarkerType::VARCODA;
|
||||
else if (s == "codetta")
|
||||
return MarkerType::CODETTA;
|
||||
else if (s == "fine")
|
||||
return MarkerType::FINE;
|
||||
else if (s == "coda")
|
||||
return MarkerType::TOCODA;
|
||||
else
|
||||
return MarkerType::USER;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// read
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::read(XmlReader& e)
|
||||
{
|
||||
MarkerType mt = MarkerType::SEGNO;
|
||||
|
||||
while (e.readNextStartElement()) {
|
||||
const QStringRef& tag(e.name());
|
||||
if (tag == "label") {
|
||||
QString s(e.readElementText());
|
||||
setLabel(s);
|
||||
mt = markerType(s);
|
||||
}
|
||||
else if (!Text::readProperties(e))
|
||||
e.unknown();
|
||||
}
|
||||
switch (mt) {
|
||||
case MarkerType::SEGNO:
|
||||
case MarkerType::VARSEGNO:
|
||||
case MarkerType::CODA:
|
||||
case MarkerType::VARCODA:
|
||||
case MarkerType::CODETTA:
|
||||
setTextStyleType(TEXT_STYLE_REPEAT_LEFT);
|
||||
break;
|
||||
|
||||
case MarkerType::FINE:
|
||||
case MarkerType::TOCODA:
|
||||
setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
|
||||
break;
|
||||
|
||||
case MarkerType::USER:
|
||||
setTextStyleType(TEXT_STYLE_REPEAT);
|
||||
break;
|
||||
}
|
||||
setMarkerType(mt);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// write
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::write(Xml& xml) const
|
||||
{
|
||||
xml.stag(name());
|
||||
Text::writeProperties(xml);
|
||||
xml.tag("label", _label);
|
||||
xml.etag();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// undoSetLabel
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::undoSetLabel(const QString& s)
|
||||
{
|
||||
score()->undoChangeProperty(this, P_LABEL, s);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// undoSetMarkerType
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::undoSetMarkerType(MarkerType t)
|
||||
{
|
||||
score()->undoChangeProperty(this, P_MARKER_TYPE, int(t));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// getProperty
|
||||
//---------------------------------------------------------
|
||||
|
||||
QVariant Marker::getProperty(P_ID propertyId) const
|
||||
{
|
||||
switch (propertyId) {
|
||||
case P_LABEL:
|
||||
return label();
|
||||
case P_MARKER_TYPE:
|
||||
return int(markerType());
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return Text::getProperty(propertyId);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// setProperty
|
||||
//---------------------------------------------------------
|
||||
|
||||
bool Marker::setProperty(P_ID propertyId, const QVariant& v)
|
||||
{
|
||||
switch (propertyId) {
|
||||
case P_LABEL:
|
||||
setLabel(v.toString());
|
||||
break;
|
||||
case P_MARKER_TYPE:
|
||||
setMarkerType(MarkerType(v.toInt()));
|
||||
break;
|
||||
default:
|
||||
if (!Text::setProperty(propertyId, v))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
score()->setLayoutAll(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// propertyDefault
|
||||
//---------------------------------------------------------
|
||||
|
||||
QVariant Marker::propertyDefault(P_ID propertyId) const
|
||||
{
|
||||
switch (propertyId) {
|
||||
case P_LABEL:
|
||||
return QString();
|
||||
|
||||
case P_MARKER_TYPE:
|
||||
return int(MarkerType::FINE);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return Text::propertyDefault(propertyId);
|
||||
}
|
||||
|
||||
|
||||
|
84
libmscore/marker.h
Normal file
84
libmscore/marker.h
Normal file
|
@ -0,0 +1,84 @@
|
|||
//=============================================================================
|
||||
// MuseScore
|
||||
// Music Composition & Notation
|
||||
// $Id: repeat.h 5516 2012-04-02 20:25:43Z wschweer $
|
||||
//
|
||||
// Copyright (C) 2002-2013 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 __MARKER_H__
|
||||
#define __MARKER_H__
|
||||
|
||||
#include "text.h"
|
||||
|
||||
//---------------------------------------------------------
|
||||
// MarkerType
|
||||
//---------------------------------------------------------
|
||||
|
||||
enum class MarkerType {
|
||||
SEGNO,
|
||||
VARSEGNO,
|
||||
CODA,
|
||||
VARCODA,
|
||||
CODETTA,
|
||||
FINE,
|
||||
TOCODA,
|
||||
USER
|
||||
};
|
||||
|
||||
//---------------------------------------------------------
|
||||
// @@ Marker
|
||||
//
|
||||
// @P label QString
|
||||
// @P markerType MArkerType
|
||||
//---------------------------------------------------------
|
||||
|
||||
class Marker : public Text {
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QString label READ label WRITE undoSetLabel)
|
||||
Q_PROPERTY(MarkerType markerType READ markerType WRITE undoSetMarkerType)
|
||||
|
||||
MarkerType _markerType;
|
||||
QString _label; ///< referenced from Jump() element
|
||||
|
||||
MarkerType markerType(const QString&) const;
|
||||
|
||||
public:
|
||||
Marker(Score*);
|
||||
|
||||
void setMarkerType(MarkerType t);
|
||||
MarkerType markerType() const { return _markerType; }
|
||||
|
||||
virtual Marker* clone() const { return new Marker(*this); }
|
||||
virtual ElementType type() const { return MARKER; }
|
||||
|
||||
Segment* segment() const { return (Segment*)parent(); }
|
||||
Measure* measure() const { return (Measure*)parent()->parent(); }
|
||||
|
||||
virtual void read(XmlReader&);
|
||||
virtual void write(Xml& xml) const;
|
||||
|
||||
QString label() const { return _label; }
|
||||
void setLabel(const QString& s) { _label = s; }
|
||||
void undoSetLabel(const QString& s);
|
||||
void undoSetMarkerType(MarkerType t);
|
||||
|
||||
virtual void styleChanged();
|
||||
virtual bool systemFlag() const { return true; }
|
||||
virtual void adjustReadPos();
|
||||
|
||||
virtual QVariant getProperty(P_ID propertyId) const;
|
||||
virtual bool setProperty(P_ID propertyId, const QVariant&);
|
||||
virtual QVariant propertyDefault(P_ID) const;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(MarkerType)
|
||||
|
||||
#endif
|
||||
|
|
@ -23,6 +23,9 @@
|
|||
#include "volta.h"
|
||||
#include "ottava.h"
|
||||
#include "trill.h"
|
||||
#include "repeat.h"
|
||||
#include "jump.h"
|
||||
#include "marker.h"
|
||||
|
||||
qreal MScore::PDPI = 1200;
|
||||
qreal MScore::DPI = 1200;
|
||||
|
@ -86,6 +89,8 @@ void MScore::init()
|
|||
qRegisterMetaType<Ottava::OttavaType>("OttavaType");
|
||||
qRegisterMetaType<Trill::TrillType>("TrillType");
|
||||
qRegisterMetaType<Element::DynamicRange>("DynamicRange");
|
||||
qRegisterMetaType<JumpType>("JumpType");
|
||||
qRegisterMetaType<MarkerType>("MarkerType");
|
||||
#endif
|
||||
|
||||
DPMM = DPI / INCH; // dots/mm
|
||||
|
|
|
@ -123,6 +123,10 @@ static const PropertyData propertyList[] = {
|
|||
{ P_PLACEMENT, "placement", T_PLACEMENT },
|
||||
{ P_VELOCITY, "velocity", T_INT },
|
||||
|
||||
{ P_JUMP_TO, "jumpTo", T_STRING },
|
||||
{ P_PLAY_UNTIL, "playUntil", T_STRING },
|
||||
{ P_CONTINUE_AT, "continueAt", T_STRING },
|
||||
|
||||
{ P_END, "", T_INT }
|
||||
};
|
||||
|
||||
|
|
|
@ -117,6 +117,12 @@ enum P_ID {
|
|||
P_PLACEMENT,
|
||||
P_VELOCITY,
|
||||
|
||||
P_JUMP_TO,
|
||||
P_PLAY_UNTIL,
|
||||
P_CONTINUE_AT,
|
||||
P_LABEL,
|
||||
P_MARKER_TYPE,
|
||||
|
||||
P_END
|
||||
};
|
||||
|
||||
|
|
|
@ -75,294 +75,3 @@ Fraction RepeatMeasure::duration() const
|
|||
return measure()->len();
|
||||
return Fraction(0, 1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Marker
|
||||
//---------------------------------------------------------
|
||||
|
||||
Marker::Marker(Score* s)
|
||||
: Text(s)
|
||||
{
|
||||
setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE | ELEMENT_ON_STAFF);
|
||||
setTextStyle(s->textStyle(TEXT_STYLE_REPEAT));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// setMarkerType
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::setMarkerType(MarkerType t)
|
||||
{
|
||||
_markerType = t;
|
||||
switch(t) {
|
||||
case MARKER_SEGNO:
|
||||
setText(symbols[score()->symIdx()][segnoSym].toString());
|
||||
setLabel("segno");
|
||||
break;
|
||||
|
||||
case MARKER_VARSEGNO:
|
||||
setText(symbols[score()->symIdx()][varsegnoSym].toString());
|
||||
setLabel("varsegno");
|
||||
break;
|
||||
|
||||
case MARKER_CODA:
|
||||
setText(symbols[score()->symIdx()][codaSym].toString());
|
||||
setLabel("codab");
|
||||
break;
|
||||
|
||||
case MARKER_VARCODA:
|
||||
setText(symbols[score()->symIdx()][varcodaSym].toString());
|
||||
setLabel("varcoda");
|
||||
break;
|
||||
|
||||
case MARKER_CODETTA:
|
||||
setText(symbols[score()->symIdx()][codaSym].toString());
|
||||
setLabel("codetta");
|
||||
break;
|
||||
|
||||
case MARKER_FINE:
|
||||
setText("Fine");
|
||||
setLabel("fine");
|
||||
break;
|
||||
|
||||
case MARKER_TOCODA:
|
||||
setText("To Coda");
|
||||
setLabel("coda");
|
||||
break;
|
||||
|
||||
case MARKER_USER:
|
||||
break;
|
||||
|
||||
default:
|
||||
qDebug("unknown marker type %d\n", t);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// styleChanged
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::styleChanged()
|
||||
{
|
||||
setMarkerType(_markerType);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// adjustReadPos
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::adjustReadPos()
|
||||
{
|
||||
if (!readPos().isNull()) {
|
||||
QPointF uo;
|
||||
if (score()->mscVersion() <= 114) {
|
||||
// rebase from Measure to Segment
|
||||
uo = userOff();
|
||||
uo.rx() -= segment()->pos().x();
|
||||
// 1.2 is always HCENTER aligned
|
||||
if ((align() & ALIGN_HMASK) == 0) // ALIGN_LEFT
|
||||
uo.rx() -= bbox().width() * .5;
|
||||
}
|
||||
else
|
||||
uo = readPos() - ipos();
|
||||
setUserOff(uo);
|
||||
setReadPos(QPointF());
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// markerType
|
||||
//---------------------------------------------------------
|
||||
|
||||
MarkerType Marker::markerType(const QString& s) const
|
||||
{
|
||||
if (s == "segno")
|
||||
return MARKER_SEGNO;
|
||||
else if (s == "varsegno")
|
||||
return MARKER_VARSEGNO;
|
||||
else if (s == "codab")
|
||||
return MARKER_CODA;
|
||||
else if (s == "varcoda")
|
||||
return MARKER_VARCODA;
|
||||
else if (s == "codetta")
|
||||
return MARKER_CODETTA;
|
||||
else if (s == "fine")
|
||||
return MARKER_FINE;
|
||||
else if (s == "coda")
|
||||
return MARKER_TOCODA;
|
||||
else
|
||||
return MARKER_USER;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// read
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::read(XmlReader& e)
|
||||
{
|
||||
MarkerType mt = MARKER_SEGNO;
|
||||
|
||||
while (e.readNextStartElement()) {
|
||||
const QStringRef& tag(e.name());
|
||||
if (tag == "label") {
|
||||
QString s(e.readElementText());
|
||||
setLabel(s);
|
||||
mt = markerType(s);
|
||||
}
|
||||
else if (!Text::readProperties(e))
|
||||
e.unknown();
|
||||
}
|
||||
switch (mt) {
|
||||
case MARKER_SEGNO:
|
||||
case MARKER_VARSEGNO:
|
||||
case MARKER_CODA:
|
||||
case MARKER_VARCODA:
|
||||
case MARKER_CODETTA:
|
||||
setTextStyleType(TEXT_STYLE_REPEAT_LEFT);
|
||||
break;
|
||||
|
||||
case MARKER_FINE:
|
||||
case MARKER_TOCODA:
|
||||
setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
|
||||
break;
|
||||
|
||||
case MARKER_USER:
|
||||
setTextStyleType(TEXT_STYLE_REPEAT);
|
||||
break;
|
||||
}
|
||||
setMarkerType(mt);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// write
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Marker::write(Xml& xml) const
|
||||
{
|
||||
xml.stag(name());
|
||||
Text::writeProperties(xml);
|
||||
xml.tag("label", _label);
|
||||
xml.etag();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Jump
|
||||
//---------------------------------------------------------
|
||||
|
||||
Jump::Jump(Score* s)
|
||||
: Text(s)
|
||||
{
|
||||
setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
|
||||
setTextStyle(s->textStyle(TEXT_STYLE_REPEAT));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// setJumpType
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Jump::setJumpType(int t)
|
||||
{
|
||||
switch(t) {
|
||||
case JUMP_DC:
|
||||
setText("D.C.");
|
||||
setJumpTo("start");
|
||||
setPlayUntil("end");
|
||||
break;
|
||||
|
||||
case JUMP_DC_AL_FINE:
|
||||
setText("D.C. al Fine");
|
||||
setJumpTo("start");
|
||||
setPlayUntil("fine");
|
||||
break;
|
||||
|
||||
case JUMP_DC_AL_CODA:
|
||||
setText("D.C. al Coda");
|
||||
setJumpTo("start");
|
||||
setPlayUntil("coda");
|
||||
setContinueAt("codab");
|
||||
break;
|
||||
|
||||
case JUMP_DS_AL_CODA:
|
||||
setText("D.S. al Coda");
|
||||
setJumpTo("segno");
|
||||
setPlayUntil("coda");
|
||||
setContinueAt("codab");
|
||||
break;
|
||||
|
||||
case JUMP_DS_AL_FINE:
|
||||
setText("D.S. al Fine");
|
||||
setJumpTo("segno");
|
||||
setPlayUntil("fine");
|
||||
break;
|
||||
|
||||
case JUMP_DS:
|
||||
setText("D.S.");
|
||||
setJumpTo("segno");
|
||||
setPlayUntil("end");
|
||||
break;
|
||||
|
||||
case JUMP_USER:
|
||||
break;
|
||||
|
||||
default:
|
||||
qDebug("unknown jump type\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// jumpType
|
||||
//---------------------------------------------------------
|
||||
|
||||
int Jump::jumpType() const
|
||||
{
|
||||
if (_jumpTo == "start" && _playUntil == "end" && _continueAt == "")
|
||||
return JUMP_DC;
|
||||
else if (_jumpTo == "start" && _playUntil == "fine" && _continueAt == "")
|
||||
return JUMP_DC_AL_FINE;
|
||||
else if (_jumpTo == "start" && _playUntil == "coda" && _continueAt == "codab")
|
||||
return JUMP_DC_AL_CODA;
|
||||
else if (_jumpTo == "segno" && _playUntil == "coda" && _continueAt == "codab")
|
||||
return JUMP_DS_AL_CODA;
|
||||
else if (_jumpTo == "segno" && _playUntil == "fine" && _continueAt == "")
|
||||
return JUMP_DS_AL_FINE;
|
||||
else if (_jumpTo == "segno" && _playUntil == "end" && _continueAt == "")
|
||||
return JUMP_DS;
|
||||
return JUMP_USER;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// read
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Jump::read(XmlReader& e)
|
||||
{
|
||||
while (e.readNextStartElement()) {
|
||||
const QStringRef& tag(e.name());
|
||||
if (tag == "jumpTo")
|
||||
_jumpTo = e.readElementText();
|
||||
else if (tag == "playUntil")
|
||||
_playUntil = e.readElementText();
|
||||
else if (tag == "continueAt")
|
||||
_continueAt = e.readElementText();
|
||||
else if (!Text::readProperties(e))
|
||||
e.unknown();
|
||||
}
|
||||
setTextStyle(score()->textStyle(TEXT_STYLE_REPEAT_RIGHT));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// write
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Jump::write(Xml& xml) const
|
||||
{
|
||||
xml.stag(name());
|
||||
Text::writeProperties(xml);
|
||||
xml.tag("jumpTo", _jumpTo);
|
||||
xml.tag("playUntil", _playUntil);
|
||||
xml.tag("continueAt", _continueAt);
|
||||
xml.etag();
|
||||
}
|
||||
|
||||
|
|
|
@ -39,93 +39,5 @@ class RepeatMeasure : public Rest {
|
|||
virtual Fraction duration() const;
|
||||
};
|
||||
|
||||
enum MarkerType {
|
||||
MARKER_SEGNO,
|
||||
MARKER_VARSEGNO,
|
||||
MARKER_CODA,
|
||||
MARKER_VARCODA,
|
||||
MARKER_CODETTA,
|
||||
MARKER_FINE,
|
||||
MARKER_TOCODA,
|
||||
MARKER_USER
|
||||
};
|
||||
|
||||
//---------------------------------------------------------
|
||||
// @@ Marker
|
||||
//---------------------------------------------------------
|
||||
|
||||
class Marker : public Text {
|
||||
Q_OBJECT
|
||||
|
||||
MarkerType _markerType;
|
||||
QString _label; ///< referenced from Jump() element
|
||||
|
||||
MarkerType markerType(const QString&) const;
|
||||
|
||||
public:
|
||||
Marker(Score*);
|
||||
|
||||
void setMarkerType(MarkerType t);
|
||||
MarkerType markerType() const { return _markerType; }
|
||||
|
||||
virtual Marker* clone() const { return new Marker(*this); }
|
||||
virtual ElementType type() const { return MARKER; }
|
||||
|
||||
Segment* segment() const { return (Segment*)parent(); }
|
||||
Measure* measure() const { return (Measure*)parent()->parent(); }
|
||||
|
||||
virtual void read(XmlReader&);
|
||||
virtual void write(Xml& xml) const;
|
||||
|
||||
QString label() const { return _label; }
|
||||
void setLabel(const QString& s) { _label = s; }
|
||||
|
||||
virtual void styleChanged();
|
||||
virtual bool systemFlag() const { return true; }
|
||||
virtual void adjustReadPos();
|
||||
};
|
||||
|
||||
enum {
|
||||
JUMP_DC,
|
||||
JUMP_DC_AL_FINE,
|
||||
JUMP_DC_AL_CODA,
|
||||
JUMP_DS_AL_CODA,
|
||||
JUMP_DS_AL_FINE,
|
||||
JUMP_DS,
|
||||
JUMP_USER
|
||||
};
|
||||
|
||||
//---------------------------------------------------------
|
||||
// @@ Jump
|
||||
//---------------------------------------------------------
|
||||
|
||||
class Jump : public Text {
|
||||
Q_OBJECT
|
||||
|
||||
QString _jumpTo;
|
||||
QString _playUntil;
|
||||
QString _continueAt;
|
||||
|
||||
public:
|
||||
Jump(Score*);
|
||||
|
||||
void setJumpType(int t);
|
||||
int jumpType() const;
|
||||
|
||||
virtual Jump* clone() const { return new Jump(*this); }
|
||||
virtual ElementType type() const { return JUMP; }
|
||||
|
||||
virtual void read(XmlReader&);
|
||||
virtual void write(Xml& xml) const;
|
||||
|
||||
QString jumpTo() const { return _jumpTo; }
|
||||
QString playUntil() const { return _playUntil; }
|
||||
QString continueAt() const { return _continueAt; }
|
||||
void setJumpTo(const QString& s) { _jumpTo = s; }
|
||||
void setPlayUntil(const QString& s) { _playUntil = s; }
|
||||
void setContinueAt(const QString& s) { _continueAt = s; }
|
||||
virtual bool systemFlag() const { return true; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -14,10 +14,11 @@
|
|||
#include "repeatlist.h"
|
||||
#include "score.h"
|
||||
#include "measure.h"
|
||||
#include "repeat.h"
|
||||
#include "tempo.h"
|
||||
#include "volta.h"
|
||||
#include "segment.h"
|
||||
#include "marker.h"
|
||||
#include "jump.h"
|
||||
|
||||
//---------------------------------------------------------
|
||||
// searchVolta
|
||||
|
|
|
@ -78,6 +78,8 @@ using std::cout;
|
|||
#include "libmscore/tremolo.h"
|
||||
#include "libmscore/tuplet.h"
|
||||
#include "libmscore/volta.h"
|
||||
#include "libmscore/marker.h"
|
||||
#include "libmscore/jump.h"
|
||||
#include "musescore.h"
|
||||
|
||||
static const int MAX_SLURS = 8;
|
||||
|
@ -491,20 +493,20 @@ void ExportLy::bracktest()
|
|||
|
||||
void ExportLy::instructionJump(Jump* jp)
|
||||
{
|
||||
int jtp = jp->jumpType();
|
||||
JumpType jtp = jp->jumpType();
|
||||
QString words = "\n \\once\\override Score.RehearsalMark #'self-alignment-X = #RIGHT \n ";
|
||||
|
||||
if (jtp == JUMP_DC)
|
||||
if (jtp == JumpType::DC)
|
||||
words += "\\mark \"Da capo\" ";
|
||||
else if (jtp == JUMP_DC_AL_FINE)
|
||||
else if (jtp == JumpType::DC_AL_FINE)
|
||||
words += "\\DCalfine ";
|
||||
else if (jtp == JUMP_DC_AL_CODA)
|
||||
else if (jtp == JumpType::DC_AL_CODA)
|
||||
words += "\\DCalcoda";
|
||||
else if (jtp == JUMP_DS_AL_CODA)
|
||||
else if (jtp == JumpType::DS_AL_CODA)
|
||||
words += "\\DSalcoda";
|
||||
else if (jtp == JUMP_DS_AL_FINE)
|
||||
else if (jtp == JumpType::DS_AL_FINE)
|
||||
words += "\\DSalfine";
|
||||
else if (jtp == JUMP_DS)
|
||||
else if (jtp == JumpType::DS)
|
||||
words += "\\mark \\markup{Dal segno \\raise #2 \\halign#-1 \\musicglyph #\"scripts.segno\"}";
|
||||
else
|
||||
qDebug("jump type=%d not implemented\n", jtp);
|
||||
|
@ -519,21 +521,21 @@ void ExportLy::instructionJump(Jump* jp)
|
|||
|
||||
void ExportLy::instructionMarker(Marker* m)
|
||||
{
|
||||
int mtp = m->markerType();
|
||||
MarkerType mtp = m->markerType();
|
||||
QString words = "";
|
||||
if (mtp == MARKER_CODA)
|
||||
if (mtp == MarkerType::CODA)
|
||||
words = "\\theCoda ";
|
||||
else if (mtp == MARKER_CODETTA)
|
||||
else if (mtp == MarkerType::CODETTA)
|
||||
words = "\\codetta";
|
||||
else if (mtp == MARKER_SEGNO)
|
||||
else if (mtp == MarkerType::SEGNO)
|
||||
words = "\\thesegno";
|
||||
else if (mtp == MARKER_FINE)
|
||||
else if (mtp == MarkerType::FINE)
|
||||
words = "\\fine";
|
||||
else if (mtp == MARKER_TOCODA)
|
||||
else if (mtp == MarkerType::TOCODA)
|
||||
words = "\\gotocoda ";
|
||||
else if (mtp == MARKER_VARCODA)
|
||||
else if (mtp == MarkerType::VARCODA)
|
||||
words = "\\varcodasign ";
|
||||
else if (mtp == MARKER_USER)
|
||||
else if (mtp == MarkerType::USER)
|
||||
qDebug("unknown user marker\n");
|
||||
else
|
||||
qDebug("marker type=%d not implemented\n", mtp);
|
||||
|
@ -551,22 +553,22 @@ void ExportLy::instructionMarker(Marker* m)
|
|||
|
||||
QString ExportLy::primitiveJump(Jump* jp)
|
||||
{
|
||||
int jtp = jp->jumpType();
|
||||
JumpType jtp = jp->jumpType();
|
||||
QString words = "";
|
||||
|
||||
cout << "primitivejump\n";
|
||||
|
||||
if (jtp == JUMP_DC)
|
||||
if (jtp == JumpType::DC)
|
||||
words = "Da capo";
|
||||
else if (jtp == JUMP_DC_AL_FINE)
|
||||
else if (jtp == JumpType::DC_AL_FINE)
|
||||
words = "D.C. al fine";
|
||||
else if (jtp == JUMP_DC_AL_CODA)
|
||||
else if (jtp == JumpType::DC_AL_CODA)
|
||||
words = "D.C. al coda";
|
||||
else if (jtp == JUMP_DS_AL_CODA)
|
||||
else if (jtp == JumpType::DS_AL_CODA)
|
||||
words = "D.S. al coda";
|
||||
else if (jtp == JUMP_DS_AL_FINE)
|
||||
else if (jtp == JumpType::DS_AL_FINE)
|
||||
words = "D.S. al fine";
|
||||
else if (jtp == JUMP_DS)
|
||||
else if (jtp == JumpType::DS)
|
||||
words = "Dal segnoX \\musicglyph #\"scripts.segno\"";
|
||||
else
|
||||
qDebug("jump type=%d not implemented\n", jtp);
|
||||
|
@ -580,22 +582,22 @@ QString ExportLy::primitiveJump(Jump* jp)
|
|||
|
||||
QString ExportLy::primitiveMarker(Marker* m)
|
||||
{
|
||||
int mtp = m->markerType();
|
||||
MarkerType mtp = m->markerType();
|
||||
QString words = "";
|
||||
if (mtp == MARKER_CODA) //the coda
|
||||
if (mtp == MarkerType::CODA) //the coda
|
||||
// words = "\\line{\\halign #-0.75\\noBreak \\codaspace \\resumeStaff \\showClefKey \musicglyph #\"scripts.coda\" \\musicglyph #\"scripts.coda\"}";
|
||||
words = "\\line{\\halign #-0.75 \\musicglyph #\"scripts.coda\" \\musicglyph #\"scripts.coda\"}";
|
||||
else if (mtp == MARKER_CODETTA)
|
||||
else if (mtp == MarkerType::CODETTA)
|
||||
words = "\\line {\\musicglyph #\"scripts.coda\" \\hspace #-1.3 \\musicglyph #\"scripts.coda\"} } \n";
|
||||
else if (mtp == MARKER_SEGNO)
|
||||
else if (mtp == MarkerType::SEGNO)
|
||||
words = "\\musicglyph #\"scripts.segno\"";
|
||||
else if (mtp == MARKER_FINE)
|
||||
else if (mtp == MarkerType::FINE)
|
||||
words = "{\"Fine\"} \\mark \\markup {\\musicglyph #\"scripts.ufermata\" } \\bar \"\bar \"||\" } \n";
|
||||
else if (mtp == MARKER_TOCODA)
|
||||
else if (mtp == MarkerType::TOCODA)
|
||||
words = "\\musicglyph #\"scripts.coda\"";
|
||||
else if (mtp == MARKER_VARCODA)
|
||||
else if (mtp == MarkerType::VARCODA)
|
||||
words = "\\musicglyph#\"scripts.varcoda\"";
|
||||
else if (mtp == MARKER_USER)
|
||||
else if (mtp == MarkerType::USER)
|
||||
qDebug("unknown user marker\n");
|
||||
else
|
||||
qDebug("marker type=%d not implemented\n", mtp);
|
||||
|
@ -1748,9 +1750,9 @@ void ExportLy::findMarkerAtMeasureStart(Measure* m)
|
|||
if (tp == Element::MARKER)
|
||||
{ //only markers, not jumps, are used at measure start.
|
||||
Marker* ma = (Marker*) dir;
|
||||
int mtp = ma->markerType();
|
||||
MarkerType mtp = ma->markerType();
|
||||
//discard markers which belong at measure end:
|
||||
if (!(mtp == MARKER_FINE || mtp == MARKER_TOCODA))
|
||||
if (!(mtp == MarkerType::FINE || mtp == MarkerType::TOCODA))
|
||||
{
|
||||
cout << "marker found at measure: " << measurenumber << "\n";
|
||||
// instructionMarker(ma);
|
||||
|
@ -1794,9 +1796,9 @@ void ExportLy::jumpAtMeasureStop(Measure* m)
|
|||
else if (tp == Element::MARKER)
|
||||
{
|
||||
Marker* ma = (Marker*) dir;
|
||||
int mtp = ma->markerType();
|
||||
MarkerType mtp = ma->markerType();
|
||||
//only print markers which belong at measure end:
|
||||
if (mtp == MARKER_FINE || mtp == MARKER_TOCODA)
|
||||
if (mtp == MarkerType::FINE || mtp == MarkerType::TOCODA)
|
||||
{
|
||||
//print the marker in part one
|
||||
instructionMarker(ma);
|
||||
|
|
|
@ -68,7 +68,8 @@
|
|||
#include "libmscore/keysig.h"
|
||||
#include "libmscore/bracket.h"
|
||||
#include "libmscore/arpeggio.h"
|
||||
#include "libmscore/repeat.h"
|
||||
#include "libmscore/jump.h"
|
||||
#include "libmscore/marker.h"
|
||||
#include "libmscore/tremolo.h"
|
||||
#include "libmscore/trill.h"
|
||||
#include "libmscore/harmony.h"
|
||||
|
@ -3100,32 +3101,32 @@ void ExportMusicXml::lyrics(const QList<Lyrics*>* ll, const int trk)
|
|||
|
||||
static void directionJump(Xml& xml, const Jump* const jp)
|
||||
{
|
||||
int jtp = jp->jumpType();
|
||||
JumpType jtp = jp->jumpType();
|
||||
QString words = "";
|
||||
QString type = "";
|
||||
QString sound = "";
|
||||
if (jtp == JUMP_DC) {
|
||||
if (jtp == JumpType::DC) {
|
||||
if (jp->getText() == "")
|
||||
words = "D.C.";
|
||||
else
|
||||
words = jp->getText();
|
||||
sound = "dacapo=\"yes\"";
|
||||
}
|
||||
else if (jtp == JUMP_DC_AL_FINE) {
|
||||
else if (jtp == JumpType::DC_AL_FINE) {
|
||||
if (jp->getText() == "")
|
||||
words = "D.C. al Fine";
|
||||
else
|
||||
words = jp->getText();
|
||||
sound = "dacapo=\"yes\"";
|
||||
}
|
||||
else if (jtp == JUMP_DC_AL_CODA) {
|
||||
else if (jtp == JumpType::DC_AL_CODA) {
|
||||
if (jp->getText() == "")
|
||||
words = "D.C. al Coda";
|
||||
else
|
||||
words = jp->getText();
|
||||
sound = "dacapo=\"yes\"";
|
||||
}
|
||||
else if (jtp == JUMP_DS_AL_CODA) {
|
||||
else if (jtp == JumpType::DS_AL_CODA) {
|
||||
if (jp->getText() == "")
|
||||
words = "D.S. al Coda";
|
||||
else
|
||||
|
@ -3135,7 +3136,7 @@ static void directionJump(Xml& xml, const Jump* const jp)
|
|||
else
|
||||
sound = "dalsegno=\"" + jp->jumpTo() + "\"";
|
||||
}
|
||||
else if (jtp == JUMP_DS_AL_FINE) {
|
||||
else if (jtp == JumpType::DS_AL_FINE) {
|
||||
if (jp->getText() == "")
|
||||
words = "D.S. al Fine";
|
||||
else
|
||||
|
@ -3145,7 +3146,7 @@ static void directionJump(Xml& xml, const Jump* const jp)
|
|||
else
|
||||
sound = "dalsegno=\"" + jp->jumpTo() + "\"";
|
||||
}
|
||||
else if (jtp == JUMP_DS) {
|
||||
else if (jtp == JumpType::DS) {
|
||||
words = "D.S.";
|
||||
if (jp->jumpTo() == "")
|
||||
sound = "dalsegno=\"1\"";
|
||||
|
@ -3171,11 +3172,11 @@ static void directionJump(Xml& xml, const Jump* const jp)
|
|||
|
||||
static void directionMarker(Xml& xml, const Marker* const m)
|
||||
{
|
||||
int mtp = m->markerType();
|
||||
MarkerType mtp = m->markerType();
|
||||
QString words = "";
|
||||
QString type = "";
|
||||
QString sound = "";
|
||||
if (mtp == MARKER_CODA) {
|
||||
if (mtp == MarkerType::CODA) {
|
||||
type = "coda";
|
||||
if (m->label() == "")
|
||||
sound = "coda=\"1\"";
|
||||
|
@ -3184,18 +3185,18 @@ static void directionMarker(Xml& xml, const Marker* const m)
|
|||
// sound = "coda=\"" + m->label() + "\"";
|
||||
sound = "coda=\"coda\"";
|
||||
}
|
||||
else if (mtp == MARKER_SEGNO) {
|
||||
else if (mtp == MarkerType::SEGNO) {
|
||||
type = "segno";
|
||||
if (m->label() == "")
|
||||
sound = "segno=\"1\"";
|
||||
else
|
||||
sound = "segno=\"" + m->label() + "\"";
|
||||
}
|
||||
else if (mtp == MARKER_FINE) {
|
||||
else if (mtp == MarkerType::FINE) {
|
||||
words = "Fine";
|
||||
sound = "fine=\"yes\"";
|
||||
}
|
||||
else if (mtp == MARKER_TOCODA) {
|
||||
else if (mtp == MarkerType::TOCODA) {
|
||||
if (m->getText() == "")
|
||||
words = "To Coda";
|
||||
else
|
||||
|
@ -3276,19 +3277,19 @@ static void repeatAtMeasureStart(Xml& xml, Attributes& attr, Measure* m, int str
|
|||
{
|
||||
// filter out the markers at measure Start
|
||||
const Marker* const mk = static_cast<const Marker* const>(e);
|
||||
int mtp = mk->markerType();
|
||||
MarkerType mtp = mk->markerType();
|
||||
#ifdef DEBUG_REPEATS
|
||||
qDebug("repeatAtMeasureStart: marker type %d", mtp);
|
||||
#endif
|
||||
if ( mtp == MARKER_SEGNO
|
||||
|| mtp == MARKER_CODA
|
||||
if ( mtp == MarkerType::SEGNO
|
||||
|| mtp == MarkerType::CODA
|
||||
) {
|
||||
qDebug(" -> handled");
|
||||
attr.doAttr(xml, false);
|
||||
directionMarker(xml, mk);
|
||||
}
|
||||
else if ( mtp == MARKER_FINE
|
||||
|| mtp == MARKER_TOCODA
|
||||
else if ( mtp == MarkerType::FINE
|
||||
|| mtp == MarkerType::TOCODA
|
||||
) {
|
||||
#ifdef DEBUG_REPEATS
|
||||
qDebug(" -> ignored");
|
||||
|
@ -3352,20 +3353,20 @@ static void repeatAtMeasureStop(Xml& xml, Measure* m, int strack, int etrack, in
|
|||
{
|
||||
// filter out the markers at measure stop
|
||||
const Marker* const mk = static_cast<const Marker* const>(e);
|
||||
int mtp = mk->markerType();
|
||||
MarkerType mtp = mk->markerType();
|
||||
#ifdef DEBUG_REPEATS
|
||||
qDebug("repeatAtMeasureStop: marker type %d", mtp);
|
||||
#endif
|
||||
if ( mtp == MARKER_FINE
|
||||
|| mtp == MARKER_TOCODA
|
||||
if ( mtp == MarkerType::FINE
|
||||
|| mtp == MarkerType::TOCODA
|
||||
) {
|
||||
#ifdef DEBUG_REPEATS
|
||||
qDebug(" -> handled");
|
||||
#endif
|
||||
directionMarker(xml, mk);
|
||||
}
|
||||
else if ( mtp == MARKER_SEGNO
|
||||
|| mtp == MARKER_CODA
|
||||
else if ( mtp == MarkerType::SEGNO
|
||||
|| mtp == MarkerType::CODA
|
||||
) {
|
||||
#ifdef DEBUG_REPEATS
|
||||
qDebug(" -> ignored");
|
||||
|
|
|
@ -61,6 +61,8 @@
|
|||
#include "libmscore/volta.h"
|
||||
#include "libmscore/chordlist.h"
|
||||
#include "libmscore/rehearsalmark.h"
|
||||
#include "libmscore/marker.h"
|
||||
#include "libmscore/jump.h"
|
||||
|
||||
class MeasureToTick {
|
||||
public:
|
||||
|
@ -2053,49 +2055,49 @@ void OveToMScore::convertRepeats(Measure* measure, int part, int staff, int trac
|
|||
switch(type) {
|
||||
case OVE::Repeat_Segno:{
|
||||
Marker* marker = new Marker(score_);
|
||||
marker->setMarkerType(MARKER_SEGNO);
|
||||
marker->setMarkerType(MarkerType::SEGNO);
|
||||
e = marker;
|
||||
break;
|
||||
}
|
||||
case OVE::Repeat_Coda:{
|
||||
Marker* marker = new Marker(score_);
|
||||
marker->setMarkerType(MARKER_CODA);
|
||||
marker->setMarkerType(MarkerType::CODA);
|
||||
e = marker;
|
||||
break;
|
||||
}
|
||||
case OVE::Repeat_DSAlCoda:{
|
||||
Jump* jp = new Jump(score_);
|
||||
jp->setJumpType(JUMP_DS_AL_CODA);
|
||||
jp->setJumpType(JumpType::DS_AL_CODA);
|
||||
e = jp;
|
||||
break;
|
||||
}
|
||||
case OVE::Repeat_DSAlFine:{
|
||||
Jump* jp = new Jump(score_);
|
||||
jp->setJumpType(JUMP_DS_AL_FINE);
|
||||
jp->setJumpType(JumpType::DS_AL_FINE);
|
||||
e = jp;
|
||||
break;
|
||||
}
|
||||
case OVE::Repeat_DCAlCoda:{
|
||||
Jump* jp = new Jump(score_);
|
||||
jp->setJumpType(JUMP_DC_AL_CODA);
|
||||
jp->setJumpType(JumpType::DC_AL_CODA);
|
||||
e = jp;
|
||||
break;
|
||||
}
|
||||
case OVE::Repeat_DCAlFine:{
|
||||
Jump* jp = new Jump(score_);
|
||||
jp->setJumpType(JUMP_DC_AL_FINE);
|
||||
jp->setJumpType(JumpType::DC_AL_FINE);
|
||||
e = jp;
|
||||
break;
|
||||
}
|
||||
case OVE::Repeat_ToCoda:{
|
||||
Marker* m = new Marker(score_);
|
||||
m->setMarkerType(MARKER_TOCODA);
|
||||
m->setMarkerType(MarkerType::TOCODA);
|
||||
e = m;
|
||||
break;
|
||||
}
|
||||
case OVE::Repeat_Fine:{
|
||||
Marker* m = new Marker(score_);
|
||||
m->setMarkerType(MARKER_FINE);
|
||||
m->setMarkerType(MarkerType::FINE);
|
||||
e = m;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -101,6 +101,8 @@
|
|||
#include "libmscore/tablature.h"
|
||||
#include "libmscore/drumset.h"
|
||||
#include "libmscore/beam.h"
|
||||
#include "libmscore/jump.h"
|
||||
#include "libmscore/marker.h"
|
||||
#include "importxmlfirstpass.h"
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -2560,52 +2562,52 @@ void MusicXml::direction(Measure* measure, int staff, QDomElement e)
|
|||
// avoid duplicated code
|
||||
m->setTextStyleType(TEXT_STYLE_REPEAT_LEFT);
|
||||
// apparently this MUST be after setTextStyle
|
||||
m->setMarkerType(MARKER_SEGNO);
|
||||
m->setMarkerType(MarkerType::SEGNO);
|
||||
}
|
||||
else if (repeat == "coda") {
|
||||
m = new Marker(score);
|
||||
m->setTextStyleType(TEXT_STYLE_REPEAT_LEFT);
|
||||
m->setMarkerType(MARKER_CODA);
|
||||
m->setMarkerType(MarkerType::CODA);
|
||||
}
|
||||
else if (repeat == "fine") {
|
||||
m = new Marker(score);
|
||||
m->setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
|
||||
m->setMarkerType(MARKER_FINE);
|
||||
m->setMarkerType(MarkerType::FINE);
|
||||
}
|
||||
else if (repeat == "toCoda") {
|
||||
m = new Marker(score);
|
||||
m->setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
|
||||
m->setMarkerType(MARKER_TOCODA);
|
||||
m->setMarkerType(MarkerType::TOCODA);
|
||||
}
|
||||
else if (repeat == "daCapo") {
|
||||
jp = new Jump(score);
|
||||
jp->setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
|
||||
jp->setJumpType(JUMP_DC);
|
||||
jp->setJumpType(JumpType::DC);
|
||||
}
|
||||
else if (repeat == "daCapoAlCoda") {
|
||||
jp = new Jump(score);
|
||||
jp->setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
|
||||
jp->setJumpType(JUMP_DC_AL_CODA);
|
||||
jp->setJumpType(JumpType::DC_AL_CODA);
|
||||
}
|
||||
else if (repeat == "daCapoAlFine") {
|
||||
jp = new Jump(score);
|
||||
jp->setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
|
||||
jp->setJumpType(JUMP_DC_AL_FINE);
|
||||
jp->setJumpType(JumpType::DC_AL_FINE);
|
||||
}
|
||||
else if (repeat == "dalSegno") {
|
||||
jp = new Jump(score);
|
||||
jp->setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
|
||||
jp->setJumpType(JUMP_DS);
|
||||
jp->setJumpType(JumpType::DS);
|
||||
}
|
||||
else if (repeat == "dalSegnoAlCoda") {
|
||||
jp = new Jump(score);
|
||||
jp->setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
|
||||
jp->setJumpType(JUMP_DS_AL_CODA);
|
||||
jp->setJumpType(JumpType::DS_AL_CODA);
|
||||
}
|
||||
else if (repeat == "dalSegnoAlFine") {
|
||||
jp = new Jump(score);
|
||||
jp->setTextStyleType(TEXT_STYLE_REPEAT_RIGHT);
|
||||
jp->setJumpType(JUMP_DS_AL_FINE);
|
||||
jp->setJumpType(JumpType::DS_AL_FINE);
|
||||
}
|
||||
if (jp) {
|
||||
jp->setTrack((staff + rstaff) * VOICES);
|
||||
|
|
|
@ -18,12 +18,8 @@
|
|||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//=============================================================================
|
||||
|
||||
#include "libmscore/repeat.h"
|
||||
#include "libmscore/sym.h"
|
||||
#include "libmscore/score.h"
|
||||
#include "libmscore/system.h"
|
||||
#include "libmscore/measure.h"
|
||||
#include "globals.h"
|
||||
#include "libmscore/jump.h"
|
||||
#include "libmscore/marker.h"
|
||||
#include "jumpproperties.h"
|
||||
#include "markerproperties.h"
|
||||
|
||||
|
@ -49,9 +45,9 @@ JumpProperties::JumpProperties(Jump* jp, QWidget* parent)
|
|||
|
||||
void JumpProperties::saveValues()
|
||||
{
|
||||
jump->setJumpTo(jumpTo->text());
|
||||
jump->setPlayUntil(playUntil->text());
|
||||
jump->setContinueAt(continueAt->text());
|
||||
jump->undoSetJumpTo(jumpTo->text());
|
||||
jump->undoSetPlayUntil(playUntil->text());
|
||||
jump->undoSetContinueAt(continueAt->text());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -74,6 +70,6 @@ MarkerProperties::MarkerProperties(Marker* mk, QWidget* parent)
|
|||
|
||||
void MarkerProperties::saveValues()
|
||||
{
|
||||
marker->setLabel(label->text());
|
||||
marker->undoSetLabel(label->text());
|
||||
}
|
||||
|
||||
|
|
|
@ -72,6 +72,8 @@
|
|||
#include "libmscore/harmony.h"
|
||||
#include "libmscore/rehearsalmark.h"
|
||||
#include "shortcut.h"
|
||||
#include "libmscore/marker.h"
|
||||
#include "libmscore/jump.h"
|
||||
|
||||
extern bool useFactorySettings;
|
||||
|
||||
|
@ -293,56 +295,56 @@ Palette* MuseScore::newRepeatsPalette()
|
|||
sp->append(rm, tr("Repeat measure sign"));
|
||||
|
||||
Marker* mk = new Marker(gscore);
|
||||
mk->setMarkerType(MARKER_SEGNO);
|
||||
mk->setMarkerType(MarkerType::SEGNO);
|
||||
sp->append(mk, tr("Segno"));
|
||||
|
||||
mk = new Marker(gscore);
|
||||
mk->setMarkerType(MARKER_VARSEGNO);
|
||||
mk->setMarkerType(MarkerType::VARSEGNO);
|
||||
PaletteCell* cell = sp->append(mk, tr("Segno Variation"), "", 0.6);
|
||||
cell->yoffset = -2;
|
||||
|
||||
mk = new Marker(gscore);
|
||||
mk->setMarkerType(MARKER_CODA);
|
||||
mk->setMarkerType(MarkerType::CODA);
|
||||
sp->append(mk, tr("Coda"));
|
||||
|
||||
mk = new Marker(gscore);
|
||||
mk->setMarkerType(MARKER_VARCODA);
|
||||
mk->setMarkerType(MarkerType::VARCODA);
|
||||
sp->append(mk, tr("Varied coda"));
|
||||
|
||||
mk = new Marker(gscore);
|
||||
mk->setMarkerType(MARKER_CODETTA);
|
||||
mk->setMarkerType(MarkerType::CODETTA);
|
||||
sp->append(mk, tr("Codetta"));
|
||||
|
||||
mk = new Marker(gscore);
|
||||
mk->setMarkerType(MARKER_FINE);
|
||||
mk->setMarkerType(MarkerType::FINE);
|
||||
sp->append(mk, tr("Fine"));
|
||||
|
||||
Jump* jp = new Jump(gscore);
|
||||
jp->setJumpType(JUMP_DC);
|
||||
jp->setJumpType(JumpType::DC);
|
||||
sp->append(jp, tr("Da Capo"));
|
||||
|
||||
jp = new Jump(gscore);
|
||||
jp->setJumpType(JUMP_DC_AL_FINE);
|
||||
jp->setJumpType(JumpType::DC_AL_FINE);
|
||||
sp->append(jp, tr("Da Capo al Fine"));
|
||||
|
||||
jp = new Jump(gscore);
|
||||
jp->setJumpType(JUMP_DC_AL_CODA);
|
||||
jp->setJumpType(JumpType::DC_AL_CODA);
|
||||
sp->append(jp, tr("Da Capo al Coda"));
|
||||
|
||||
jp = new Jump(gscore);
|
||||
jp->setJumpType(JUMP_DS_AL_CODA);
|
||||
jp->setJumpType(JumpType::DS_AL_CODA);
|
||||
sp->append(jp, tr("D.S al Coda"));
|
||||
|
||||
jp = new Jump(gscore);
|
||||
jp->setJumpType(JUMP_DS_AL_FINE);
|
||||
jp->setJumpType(JumpType::DS_AL_FINE);
|
||||
sp->append(jp, tr("D.S al Fine"));
|
||||
|
||||
jp = new Jump(gscore);
|
||||
jp->setJumpType(JUMP_DS);
|
||||
jp->setJumpType(JumpType::DS);
|
||||
sp->append(jp, tr("D.S"));
|
||||
|
||||
mk = new Marker(gscore);
|
||||
mk->setMarkerType(MARKER_TOCODA);
|
||||
mk->setMarkerType(MarkerType::TOCODA);
|
||||
sp->append(mk, tr("To Coda"));
|
||||
return sp;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,8 @@
|
|||
#include "libmscore/fret.h"
|
||||
#include "libmscore/instrchange.h"
|
||||
#include "libmscore/slur.h"
|
||||
#include "libmscore/repeat.h"
|
||||
#include "libmscore/jump.h"
|
||||
#include "libmscore/marker.h"
|
||||
|
||||
//---------------------------------------------------------
|
||||
// genPropertyMenu1
|
||||
|
|
|
@ -90,7 +90,7 @@ void TestPlugins::plugins02()
|
|||
qDebug(" line %d: %s", e.line(), qPrintable(e.description()));
|
||||
}
|
||||
else {
|
||||
qreal width = object->property("width").toDouble();
|
||||
qreal width = object->property("width").toDouble();
|
||||
qreal height = object->property("height").toDouble();
|
||||
QCOMPARE(width, 150.0);
|
||||
QCOMPARE(height, 75.0);
|
||||
|
|
Loading…
Reference in a new issue