fix #268110
This commit is contained in:
parent
c68c9455d7
commit
f26ebf688f
19 changed files with 172 additions and 166 deletions
|
@ -24,6 +24,7 @@
|
||||||
#include "marker.h"
|
#include "marker.h"
|
||||||
#include "stafflines.h"
|
#include "stafflines.h"
|
||||||
#include "spanner.h"
|
#include "spanner.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
namespace Ms {
|
namespace Ms {
|
||||||
|
|
||||||
|
@ -499,8 +500,10 @@ void BarLine::read(XmlReader& e)
|
||||||
bool BarLine::acceptDrop(EditData& data) const
|
bool BarLine::acceptDrop(EditData& data) const
|
||||||
{
|
{
|
||||||
ElementType type = data.element->type();
|
ElementType type = data.element->type();
|
||||||
if (type == ElementType::BAR_LINE)
|
if (type == ElementType::BAR_LINE) {
|
||||||
|
printf("may drop\n");
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
return (type == ElementType::ARTICULATION
|
return (type == ElementType::ARTICULATION
|
||||||
&& segment()
|
&& segment()
|
||||||
|
@ -518,6 +521,7 @@ Element* BarLine::drop(EditData& data)
|
||||||
Element* e = data.element;
|
Element* e = data.element;
|
||||||
|
|
||||||
if (e->isBarLine()) {
|
if (e->isBarLine()) {
|
||||||
|
printf("drop\n");
|
||||||
BarLine* bl = toBarLine(e);
|
BarLine* bl = toBarLine(e);
|
||||||
BarLineType st = bl->barLineType();
|
BarLineType st = bl->barLineType();
|
||||||
|
|
||||||
|
@ -559,8 +563,7 @@ Element* BarLine::drop(EditData& data)
|
||||||
// Update repeat flags
|
// Update repeat flags
|
||||||
//---------------------------------------------
|
//---------------------------------------------
|
||||||
|
|
||||||
Measure* m = segment()->measure();
|
undoChangeBarLineType(this, st);
|
||||||
score()->undoChangeBarLine(m, st, segment()->segmentType());
|
|
||||||
delete e;
|
delete e;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1097,6 +1100,18 @@ bool BarLine::setProperty(P_ID id, const QVariant& v)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------
|
||||||
|
// undoChangeProperty
|
||||||
|
//---------------------------------------------------------
|
||||||
|
|
||||||
|
void BarLine::undoChangeProperty(P_ID id, const QVariant& v, PropertyFlags ps)
|
||||||
|
{
|
||||||
|
if (id == P_ID::BARLINE_TYPE && segment())
|
||||||
|
undoChangeBarLineType(this, v.value<BarLineType>());
|
||||||
|
else
|
||||||
|
ScoreElement::undoChangeProperty(id, v, ps);
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
// propertyDefault
|
// propertyDefault
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
|
@ -127,6 +127,8 @@ class BarLine final : public Element {
|
||||||
virtual QVariant getProperty(P_ID propertyId) const override;
|
virtual QVariant getProperty(P_ID propertyId) const override;
|
||||||
virtual bool setProperty(P_ID propertyId, const QVariant&) override;
|
virtual bool setProperty(P_ID propertyId, const QVariant&) override;
|
||||||
virtual QVariant propertyDefault(P_ID propertyId) const override;
|
virtual QVariant propertyDefault(P_ID propertyId) const override;
|
||||||
|
virtual void undoChangeProperty(P_ID id, const QVariant&, PropertyFlags ps);
|
||||||
|
using ScoreElement::undoChangeProperty;
|
||||||
|
|
||||||
static qreal layoutWidth(Score*, BarLineType);
|
static qreal layoutWidth(Score*, BarLineType);
|
||||||
|
|
||||||
|
|
|
@ -666,17 +666,6 @@ Element* Box::drop(EditData& data)
|
||||||
e->setParent(this);
|
e->setParent(this);
|
||||||
score()->undoAddElement(e);
|
score()->undoAddElement(e);
|
||||||
return e;
|
return e;
|
||||||
#if 0
|
|
||||||
case ElementType::BAR_LINE: {
|
|
||||||
MeasureBase* mb = next();
|
|
||||||
if (!mb || !mb->isMeasure()) {
|
|
||||||
delete e;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
score()->undoChangeBarLine(toMeasure(mb), toBarLine(e)->barLineType(), true);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1380,8 +1380,7 @@ void Score::upDown(bool up, UpDownMode mode)
|
||||||
}
|
}
|
||||||
// store the fretting change before undoChangePitch() chooses
|
// store the fretting change before undoChangePitch() chooses
|
||||||
// a fretting of its own liking!
|
// a fretting of its own liking!
|
||||||
undoChangeProperty(oNote, P_ID::FRET, fret);
|
oNote->undoChangeProperty(P_ID::FRET, fret);
|
||||||
// undoChangeProperty(oNote, P_ID::STRING, string);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1459,11 +1458,11 @@ void Score::upDown(bool up, UpDownMode mode)
|
||||||
else if (staff->staffType(tick)->group() == StaffGroup::TAB) {
|
else if (staff->staffType(tick)->group() == StaffGroup::TAB) {
|
||||||
bool refret = false;
|
bool refret = false;
|
||||||
if (oNote->string() != string) {
|
if (oNote->string() != string) {
|
||||||
undoChangeProperty(oNote, P_ID::STRING, string);
|
oNote->undoChangeProperty(P_ID::STRING, string);
|
||||||
refret = true;
|
refret = true;
|
||||||
}
|
}
|
||||||
if (oNote->fret() != fret) {
|
if (oNote->fret() != fret) {
|
||||||
undoChangeProperty(oNote, P_ID::FRET, fret);
|
oNote->undoChangeProperty(P_ID::FRET, fret);
|
||||||
refret = true;
|
refret = true;
|
||||||
}
|
}
|
||||||
if (refret) {
|
if (refret) {
|
||||||
|
@ -1808,11 +1807,11 @@ void Score::cmdResetBeamMode()
|
||||||
continue;
|
continue;
|
||||||
if (cr->type() == ElementType::CHORD) {
|
if (cr->type() == ElementType::CHORD) {
|
||||||
if (cr->beamMode() != Beam::Mode::AUTO)
|
if (cr->beamMode() != Beam::Mode::AUTO)
|
||||||
undoChangeProperty(cr, P_ID::BEAM_MODE, int(Beam::Mode::AUTO));
|
cr->undoChangeProperty(P_ID::BEAM_MODE, int(Beam::Mode::AUTO));
|
||||||
}
|
}
|
||||||
else if (cr->type() == ElementType::REST) {
|
else if (cr->type() == ElementType::REST) {
|
||||||
if (cr->beamMode() != Beam::Mode::NONE)
|
if (cr->beamMode() != Beam::Mode::NONE)
|
||||||
undoChangeProperty(cr, P_ID::BEAM_MODE, int(Beam::Mode::NONE));
|
cr->undoChangeProperty(P_ID::BEAM_MODE, int(Beam::Mode::NONE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2225,7 +2224,7 @@ void Score::cmdMirrorNoteHead()
|
||||||
if (e->type() == ElementType::NOTE) {
|
if (e->type() == ElementType::NOTE) {
|
||||||
Note* note = toNote(e);
|
Note* note = toNote(e);
|
||||||
if (note->staff() && note->staff()->isTabStaff(note->chord()->tick()))
|
if (note->staff() && note->staff()->isTabStaff(note->chord()->tick()))
|
||||||
note->score()->undoChangeProperty(e, P_ID::GHOST, !note->ghost());
|
e->undoChangeProperty(P_ID::GHOST, !note->ghost());
|
||||||
else {
|
else {
|
||||||
MScore::DirectionH d = note->userMirror();
|
MScore::DirectionH d = note->userMirror();
|
||||||
if (d == MScore::DirectionH::AUTO)
|
if (d == MScore::DirectionH::AUTO)
|
||||||
|
@ -2310,7 +2309,7 @@ void Score::cmdMoveRest(Rest* rest, Direction dir)
|
||||||
pos.ry() -= spatium();
|
pos.ry() -= spatium();
|
||||||
else if (dir == Direction::DOWN)
|
else if (dir == Direction::DOWN)
|
||||||
pos.ry() += spatium();
|
pos.ry() += spatium();
|
||||||
undoChangeProperty(rest, P_ID::USER_OFF, pos);
|
rest->undoChangeProperty(P_ID::USER_OFF, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
|
@ -571,7 +571,7 @@ bool Score::rewriteMeasures(Measure* fm, const Fraction& ns, int staffIdx)
|
||||||
if (m->first(SegmentType::TimeSig))
|
if (m->first(SegmentType::TimeSig))
|
||||||
break;
|
break;
|
||||||
Fraction fr(ns);
|
Fraction fr(ns);
|
||||||
undoChangeProperty(m, P_ID::TIMESIG_NOMINAL, QVariant::fromValue(fr));
|
m->undoChangeProperty(P_ID::TIMESIG_NOMINAL, QVariant::fromValue(fr));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -715,9 +715,9 @@ void Score::cmdAddTimeSig(Measure* fm, int staffIdx, TimeSig* ts, bool local)
|
||||||
Measure* fm = score->tick2measure(tick);
|
Measure* fm = score->tick2measure(tick);
|
||||||
for (Measure* m = fm; m != lm; m = m->nextMeasure()) {
|
for (Measure* m = fm; m != lm; m = m->nextMeasure()) {
|
||||||
bool changeActual = m->len() == m->timesig();
|
bool changeActual = m->len() == m->timesig();
|
||||||
undoChangeProperty(m, P_ID::TIMESIG_NOMINAL, QVariant::fromValue(ns));
|
m->undoChangeProperty(P_ID::TIMESIG_NOMINAL, QVariant::fromValue(ns));
|
||||||
if (changeActual)
|
if (changeActual)
|
||||||
undoChangeProperty(m, P_ID::TIMESIG_ACTUAL, QVariant::fromValue(ns));
|
m->undoChangeProperty(P_ID::TIMESIG_ACTUAL, QVariant::fromValue(ns));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int n = nstaves();
|
int n = nstaves();
|
||||||
|
@ -738,7 +738,7 @@ void Score::cmdAddTimeSig(Measure* fm, int staffIdx, TimeSig* ts, bool local)
|
||||||
//
|
//
|
||||||
if (fm == score->firstMeasure() && fm->nextMeasure() && (fm->len() != fm->timesig())) {
|
if (fm == score->firstMeasure() && fm->nextMeasure() && (fm->len() != fm->timesig())) {
|
||||||
// handle upbeat
|
// handle upbeat
|
||||||
undoChangeProperty(fm, P_ID::TIMESIG_NOMINAL, QVariant::fromValue(ns));
|
fm->undoChangeProperty(P_ID::TIMESIG_NOMINAL, QVariant::fromValue(ns));
|
||||||
Measure* m = fm->nextMeasure();
|
Measure* m = fm->nextMeasure();
|
||||||
Segment* s = m->findSegment(SegmentType::TimeSig, m->tick());
|
Segment* s = m->findSegment(SegmentType::TimeSig, m->tick());
|
||||||
fm = s ? 0 : fm->nextMeasure();
|
fm = s ? 0 : fm->nextMeasure();
|
||||||
|
@ -1198,7 +1198,7 @@ void Score::cmdSetBeamMode(Beam::Mode mode)
|
||||||
{
|
{
|
||||||
for (ChordRest* cr : getSelectedChordRests()) {
|
for (ChordRest* cr : getSelectedChordRests()) {
|
||||||
if (cr)
|
if (cr)
|
||||||
undoChangeProperty(cr, P_ID::BEAM_MODE, int(mode));
|
cr->undoChangeProperty(P_ID::BEAM_MODE, int(mode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1229,19 +1229,19 @@ void Score::cmdFlip()
|
||||||
continue;
|
continue;
|
||||||
else {
|
else {
|
||||||
Direction dir = chord->up() ? Direction::DOWN : Direction::UP;
|
Direction dir = chord->up() ? Direction::DOWN : Direction::UP;
|
||||||
undoChangeProperty(chord, P_ID::STEM_DIRECTION, QVariant::fromValue<Direction>(dir));
|
chord->undoChangeProperty(P_ID::STEM_DIRECTION, QVariant::fromValue<Direction>(dir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (e->isBeam()) {
|
else if (e->isBeam()) {
|
||||||
Beam* beam = toBeam(e);
|
Beam* beam = toBeam(e);
|
||||||
Direction dir = beam->up() ? Direction::DOWN : Direction::UP;
|
Direction dir = beam->up() ? Direction::DOWN : Direction::UP;
|
||||||
undoChangeProperty(beam, P_ID::STEM_DIRECTION, QVariant::fromValue<Direction>(dir));
|
beam->undoChangeProperty(P_ID::STEM_DIRECTION, QVariant::fromValue<Direction>(dir));
|
||||||
}
|
}
|
||||||
else if (e->isSlurTieSegment()) {
|
else if (e->isSlurTieSegment()) {
|
||||||
SlurTie* slur = toSlurTieSegment(e)->slurTie();
|
SlurTie* slur = toSlurTieSegment(e)->slurTie();
|
||||||
Direction dir = slur->up() ? Direction::DOWN : Direction::UP;
|
Direction dir = slur->up() ? Direction::DOWN : Direction::UP;
|
||||||
undoChangeProperty(slur, P_ID::SLUR_DIRECTION, QVariant::fromValue<Direction>(dir));
|
slur->undoChangeProperty(P_ID::SLUR_DIRECTION, QVariant::fromValue<Direction>(dir));
|
||||||
}
|
}
|
||||||
else if (e->isHairpinSegment()) {
|
else if (e->isHairpinSegment()) {
|
||||||
Hairpin* h = toHairpinSegment(e)->hairpin();
|
Hairpin* h = toHairpinSegment(e)->hairpin();
|
||||||
|
@ -1252,7 +1252,7 @@ void Score::cmdFlip()
|
||||||
case HairpinType::CRESC_LINE: st = HairpinType::DECRESC_LINE; break;
|
case HairpinType::CRESC_LINE: st = HairpinType::DECRESC_LINE; break;
|
||||||
case HairpinType::DECRESC_LINE: st = HairpinType::CRESC_LINE; break;
|
case HairpinType::DECRESC_LINE: st = HairpinType::CRESC_LINE; break;
|
||||||
}
|
}
|
||||||
undoChangeProperty(h, P_ID::HAIRPIN_TYPE, int(st));
|
h->undoChangeProperty(P_ID::HAIRPIN_TYPE, int(st));
|
||||||
}
|
}
|
||||||
else if (e->isArticulation()) {
|
else if (e->isArticulation()) {
|
||||||
Articulation* a = toArticulation(e);
|
Articulation* a = toArticulation(e);
|
||||||
|
@ -1274,18 +1274,18 @@ void Score::cmdFlip()
|
||||||
aa = ArticulationAnchor::TOP_STAFF;
|
aa = ArticulationAnchor::TOP_STAFF;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// undoChangeProperty(a, P_ID::DIRECTION, a->up() ? Direction::DOWN : Direction::UP);
|
// a->undoChangeProperty(P_ID::DIRECTION, a->up() ? Direction::DOWN : Direction::UP);
|
||||||
undoChangeProperty(a, P_ID::ARTICULATION_ANCHOR, int(aa));
|
a->undoChangeProperty(P_ID::ARTICULATION_ANCHOR, int(aa));
|
||||||
}
|
}
|
||||||
else if (e->isTuplet()) {
|
else if (e->isTuplet()) {
|
||||||
Tuplet* tuplet = toTuplet(e);
|
Tuplet* tuplet = toTuplet(e);
|
||||||
Direction d = tuplet->isUp() ? Direction::DOWN : Direction::UP;
|
Direction d = tuplet->isUp() ? Direction::DOWN : Direction::UP;
|
||||||
undoChangeProperty(tuplet, P_ID::DIRECTION, QVariant::fromValue<Direction>(d));
|
tuplet->undoChangeProperty(P_ID::DIRECTION, QVariant::fromValue<Direction>(d));
|
||||||
}
|
}
|
||||||
else if (e->isNoteDot()) {
|
else if (e->isNoteDot()) {
|
||||||
Note* note = toNote(e->parent());
|
Note* note = toNote(e->parent());
|
||||||
Direction d = note->dotIsUp() ? Direction::DOWN : Direction::UP;
|
Direction d = note->dotIsUp() ? Direction::DOWN : Direction::UP;
|
||||||
undoChangeProperty(note, P_ID::DOT_POSITION, QVariant::fromValue<Direction>(d));
|
note->undoChangeProperty(P_ID::DOT_POSITION, QVariant::fromValue<Direction>(d));
|
||||||
}
|
}
|
||||||
else if (e->isTempoText()
|
else if (e->isTempoText()
|
||||||
|| e->isStaffText()
|
|| e->isStaffText()
|
||||||
|
@ -1653,7 +1653,7 @@ void Score::deleteItem(Element* el)
|
||||||
|
|
||||||
case ElementType::TEXT:
|
case ElementType::TEXT:
|
||||||
if (el->parent()->isTBox())
|
if (el->parent()->isTBox())
|
||||||
undoChangeProperty(el, P_ID::TEXT, QString());
|
el->undoChangeProperty(P_ID::TEXT, QString());
|
||||||
else
|
else
|
||||||
undoRemoveElement(el);
|
undoRemoveElement(el);
|
||||||
break;
|
break;
|
||||||
|
@ -2287,7 +2287,7 @@ void Score::colorItem(Element* element)
|
||||||
|
|
||||||
foreach(Element* e, selection().elements()) {
|
foreach(Element* e, selection().elements()) {
|
||||||
if (e->color() != c) {
|
if (e->color() != c) {
|
||||||
undoChangeProperty(e, P_ID::COLOR, c);
|
e->undoChangeProperty(P_ID::COLOR, c);
|
||||||
e->setGenerated(false);
|
e->setGenerated(false);
|
||||||
addRefresh(e->abbox());
|
addRefresh(e->abbox());
|
||||||
if (e->isBarLine()) {
|
if (e->isBarLine()) {
|
||||||
|
@ -3090,24 +3090,6 @@ void Score::cloneVoice(int strack, int dtrack, Segment* sf, int lTick, bool link
|
||||||
//TODO ?? doLayoutRange(start, lTick);
|
//TODO ?? doLayoutRange(start, lTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// undoChangeProperty
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Score::undoChangeProperty(ScoreElement* e, P_ID t, const QVariant& st, PropertyFlags ps)
|
|
||||||
{
|
|
||||||
if (propertyLink(t)) {
|
|
||||||
for (ScoreElement* ee : e->linkList()) {
|
|
||||||
if (ee->getProperty(t) != st || ee->propertyFlags(t) != ps)
|
|
||||||
undo(new ChangeProperty(ee, t, st, ps));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (e->getProperty(t) != st || e->propertyFlags(t) != ps)
|
|
||||||
undo(new ChangeProperty(e, t, st, ps));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
// undoPropertyChanged
|
// undoPropertyChanged
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
@ -3628,7 +3610,7 @@ void Score::undoInsertStaff(Staff* staff, int ridx, bool createRests)
|
||||||
|
|
||||||
void Score::undoChangeInvisible(Element* e, bool v)
|
void Score::undoChangeInvisible(Element* e, bool v)
|
||||||
{
|
{
|
||||||
undoChangeProperty(e, P_ID::VISIBLE, v);
|
e->undoChangeProperty(P_ID::VISIBLE, v);
|
||||||
e->setGenerated(false);
|
e->setGenerated(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4301,12 +4283,12 @@ void Score::undoRemoveElement(Element* element)
|
||||||
|
|
||||||
void Score::undoChangeTuning(Note* n, qreal v)
|
void Score::undoChangeTuning(Note* n, qreal v)
|
||||||
{
|
{
|
||||||
undoChangeProperty(n, P_ID::TUNING, v);
|
n->undoChangeProperty(P_ID::TUNING, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Score::undoChangeUserMirror(Note* n, MScore::DirectionH d)
|
void Score::undoChangeUserMirror(Note* n, MScore::DirectionH d)
|
||||||
{
|
{
|
||||||
undoChangeProperty(n, P_ID::MIRROR_HEAD, int(d));
|
n->undoChangeProperty(P_ID::MIRROR_HEAD, int(d));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
@ -4390,7 +4372,7 @@ void Score::undoInsertTime(int tick, int len)
|
||||||
// +----spanner--------+
|
// +----spanner--------+
|
||||||
// +---add---
|
// +---add---
|
||||||
//
|
//
|
||||||
undoChangeProperty(s, P_ID::SPANNER_TICKS, s->ticks() + len);
|
s->undoChangeProperty(P_ID::SPANNER_TICKS, s->ticks() + len);
|
||||||
}
|
}
|
||||||
else if (tick <= s->tick()) {
|
else if (tick <= s->tick()) {
|
||||||
//
|
//
|
||||||
|
@ -4400,7 +4382,7 @@ void Score::undoInsertTime(int tick, int len)
|
||||||
// and
|
// and
|
||||||
// +----spanner--------
|
// +----spanner--------
|
||||||
// +---add---+
|
// +---add---+
|
||||||
undoChangeProperty(s, P_ID::SPANNER_TICK, s->tick() + len);
|
s->undoChangeProperty(P_ID::SPANNER_TICK, s->tick() + len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -4413,7 +4395,7 @@ void Score::undoInsertTime(int tick, int len)
|
||||||
int t = s->tick() + len;
|
int t = s->tick() + len;
|
||||||
if (t < 0)
|
if (t < 0)
|
||||||
t = 0;
|
t = 0;
|
||||||
undoChangeProperty(s, P_ID::SPANNER_TICK, t);
|
s->undoChangeProperty(P_ID::SPANNER_TICK, t);
|
||||||
}
|
}
|
||||||
else if ((s->tick() < tick) && (s->tick2() > tick2)) {
|
else if ((s->tick() < tick) && (s->tick2() > tick2)) {
|
||||||
//
|
//
|
||||||
|
@ -4423,7 +4405,7 @@ void Score::undoInsertTime(int tick, int len)
|
||||||
//
|
//
|
||||||
int t2 = s->tick2() + len;
|
int t2 = s->tick2() + len;
|
||||||
if (t2 > s->tick()) {
|
if (t2 > s->tick()) {
|
||||||
undoChangeProperty(s, P_ID::SPANNER_TICKS, s->ticks() + len);
|
s->undoChangeProperty(P_ID::SPANNER_TICKS, s->ticks() + len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else if (s->tick() >= tick && s->tick2() < tick2) {
|
// else if (s->tick() >= tick && s->tick2() < tick2) {
|
||||||
|
@ -4448,8 +4430,8 @@ void Score::undoInsertTime(int tick, int len)
|
||||||
undoRemoveElement(s);
|
undoRemoveElement(s);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
undoChangeProperty(s, P_ID::SPANNER_TICK, s->tick() - d1);
|
s->undoChangeProperty(P_ID::SPANNER_TICK, s->tick() - d1);
|
||||||
undoChangeProperty(s, P_ID::SPANNER_TICKS, len);
|
s->undoChangeProperty(P_ID::SPANNER_TICKS, len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4493,70 +4475,4 @@ void Score::undoRemoveMeasures(Measure* m1, Measure* m2)
|
||||||
undo(new RemoveMeasures(m1, m2));
|
undo(new RemoveMeasures(m1, m2));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// undoChangeBarLine
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Score::undoChangeBarLine(Measure* measure, BarLineType barType, SegmentType segmentType)
|
|
||||||
{
|
|
||||||
int tick = measure->tick();
|
|
||||||
|
|
||||||
for (Score* s : scoreList()) {
|
|
||||||
Measure* m = s->tick2measure(tick);
|
|
||||||
// Measure* nm = m->nextMeasure();
|
|
||||||
|
|
||||||
switch (barType) {
|
|
||||||
case BarLineType::END:
|
|
||||||
case BarLineType::NORMAL:
|
|
||||||
case BarLineType::DOUBLE:
|
|
||||||
case BarLineType::BROKEN:
|
|
||||||
case BarLineType::DOTTED: {
|
|
||||||
Segment* segment;
|
|
||||||
if (segmentType == SegmentType::EndBarLine) {
|
|
||||||
s->undoChangeProperty(m, P_ID::REPEAT_END, false);
|
|
||||||
// if (nm)
|
|
||||||
// s->undoChangeProperty(nm, P_ID::REPEAT_START, false);
|
|
||||||
segment = m->findSegment(SegmentType::EndBarLine, m->endTick());
|
|
||||||
if (segment) {
|
|
||||||
for (Element* e : segment->elist()) {
|
|
||||||
if (e) {
|
|
||||||
e->undoChangeProperty(P_ID::BARLINE_TYPE, QVariant::fromValue(barType));
|
|
||||||
e->undoChangeProperty(P_ID::GENERATED, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (segmentType == SegmentType::BeginBarLine) {
|
|
||||||
segment = m->undoGetSegment(SegmentType::BeginBarLine, tick);
|
|
||||||
for (Element* e : segment->elist()) {
|
|
||||||
if (e) {
|
|
||||||
e->undoChangeProperty(P_ID::BARLINE_TYPE, QVariant::fromValue(barType));
|
|
||||||
e->undoChangeProperty(P_ID::GENERATED, false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
BarLine* bl = new BarLine(s);
|
|
||||||
bl->setBarLineType(barType);
|
|
||||||
bl->setParent(segment);
|
|
||||||
bl->setTrack(0);
|
|
||||||
bl->setSpanStaff(s->nstaves());
|
|
||||||
undo(new AddElement(bl));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (segmentType == SegmentType::StartRepeatBarLine) {
|
|
||||||
s->undoChangeProperty(m, P_ID::REPEAT_START, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case BarLineType::START_REPEAT:
|
|
||||||
s->undoChangeProperty(m, P_ID::REPEAT_START, true);
|
|
||||||
break;
|
|
||||||
case BarLineType::END_REPEAT:
|
|
||||||
s->undoChangeProperty(m, P_ID::REPEAT_END, true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -367,9 +367,6 @@ class Element : public ScoreElement {
|
||||||
qreal magS() const;
|
qreal magS() const;
|
||||||
|
|
||||||
bool isPrintable() const;
|
bool isPrintable() const;
|
||||||
// virtual bool isSpanner() const { return false; }
|
|
||||||
// virtual bool isSpannerSegment() const { return false; }
|
|
||||||
|
|
||||||
qreal point(const Spatium sp) const { return sp.val() * spatium(); }
|
qreal point(const Spatium sp) const { return sp.val() * spatium(); }
|
||||||
|
|
||||||
virtual int tick() const; // utility, searches for segment / segment parent
|
virtual int tick() const; // utility, searches for segment / segment parent
|
||||||
|
|
|
@ -1735,8 +1735,8 @@ void Score::createMMRest(Measure* m, Measure* lm, const Fraction& len)
|
||||||
BarLine* bd = toBarLine(ds->element(staffIdx * VOICES));
|
BarLine* bd = toBarLine(ds->element(staffIdx * VOICES));
|
||||||
BarLine* bs = toBarLine(e);
|
BarLine* bs = toBarLine(e);
|
||||||
if (bd->barLineType() != bs->barLineType()) {
|
if (bd->barLineType() != bs->barLineType()) {
|
||||||
undoChangeProperty(bd, P_ID::BARLINE_TYPE, QVariant::fromValue(bs->barLineType()));
|
bd->undoChangeProperty(P_ID::BARLINE_TYPE, QVariant::fromValue(bs->barLineType()));
|
||||||
undoChangeProperty(bd, P_ID::GENERATED, true);
|
bd->undoChangeProperty(P_ID::GENERATED, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1484,15 +1484,24 @@ Element* Measure::drop(EditData& data)
|
||||||
// or if Ctrl key used
|
// or if Ctrl key used
|
||||||
if ((bl->spanFrom() && bl->spanTo()) || data.control()) {
|
if ((bl->spanFrom() && bl->spanTo()) || data.control()) {
|
||||||
// get existing bar line for this staff, and drop the change to it
|
// get existing bar line for this staff, and drop the change to it
|
||||||
Segment* seg = undoGetSegment(SegmentType::EndBarLine, tick() + ticks());
|
Segment* seg = undoGetSegmentR(SegmentType::EndBarLine, ticks());
|
||||||
BarLine* cbl = toBarLine(seg->element(staffIdx * VOICES));
|
BarLine* cbl = toBarLine(seg->element(staffIdx * VOICES));
|
||||||
if (cbl)
|
if (cbl)
|
||||||
cbl->drop(data);
|
cbl->drop(data);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// if dropped bar line refers to line subtype
|
// drop to first end barline
|
||||||
score()->undoChangeBarLine(this, bl->barLineType(), SegmentType::EndBarLine);
|
Segment* seg = findSegmentR(SegmentType::EndBarLine, ticks());
|
||||||
delete e;
|
if (seg) {
|
||||||
|
for (Element* ee : seg->elist()) {
|
||||||
|
if (ee) {
|
||||||
|
ee->drop(data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
delete e;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -619,7 +619,7 @@ class Score : public QObject, ScoreElement {
|
||||||
void undoChangeUserMirror(Note*, MScore::DirectionH);
|
void undoChangeUserMirror(Note*, MScore::DirectionH);
|
||||||
void undoChangeKeySig(Staff* ostaff, int tick, KeySigEvent);
|
void undoChangeKeySig(Staff* ostaff, int tick, KeySigEvent);
|
||||||
void undoChangeClef(Staff* ostaff, Segment*, ClefType st);
|
void undoChangeClef(Staff* ostaff, Segment*, ClefType st);
|
||||||
void undoChangeProperty(ScoreElement*, P_ID, const QVariant&, PropertyFlags ps = PropertyFlags::NOSTYLE);
|
// void undoChangeProperty(ScoreElement*, P_ID, const QVariant&, PropertyFlags ps = PropertyFlags::NOSTYLE);
|
||||||
void undoPropertyChanged(Element*, P_ID, const QVariant& v);
|
void undoPropertyChanged(Element*, P_ID, const QVariant& v);
|
||||||
void undoPropertyChanged(ScoreElement*, P_ID, const QVariant& v);
|
void undoPropertyChanged(ScoreElement*, P_ID, const QVariant& v);
|
||||||
inline virtual UndoStack* undoStack() const;
|
inline virtual UndoStack* undoStack() const;
|
||||||
|
@ -628,7 +628,7 @@ class Score : public QObject, ScoreElement {
|
||||||
void undoAddBracket(Staff* staff, int level, BracketType type, int span);
|
void undoAddBracket(Staff* staff, int level, BracketType type, int span);
|
||||||
void undoRemoveBracket(Bracket*);
|
void undoRemoveBracket(Bracket*);
|
||||||
void undoInsertTime(int tick, int len);
|
void undoInsertTime(int tick, int len);
|
||||||
void undoChangeBarLine(Measure*, BarLineType, SegmentType type);
|
// void undoChangeBarLine(Measure*, BarLineType, SegmentType type);
|
||||||
void undoChangeStyleVal(StyleIdx idx, const QVariant& v);
|
void undoChangeStyleVal(StyleIdx idx, const QVariant& v);
|
||||||
|
|
||||||
Note* setGraceNote(Chord*, int pitch, NoteType type, int len);
|
Note* setGraceNote(Chord*, int pitch, NoteType type, int len);
|
||||||
|
|
|
@ -33,8 +33,8 @@ static const ElementName elementNames[] = {
|
||||||
{ ElementType::INSTRUMENT_NAME, "InstrumentName", QT_TRANSLATE_NOOP("elementName", "Instrument Name") },
|
{ ElementType::INSTRUMENT_NAME, "InstrumentName", QT_TRANSLATE_NOOP("elementName", "Instrument Name") },
|
||||||
{ ElementType::SLUR_SEGMENT, "SlurSegment", QT_TRANSLATE_NOOP("elementName", "Slur Segment") },
|
{ ElementType::SLUR_SEGMENT, "SlurSegment", QT_TRANSLATE_NOOP("elementName", "Slur Segment") },
|
||||||
{ ElementType::TIE_SEGMENT, "TieSegment", QT_TRANSLATE_NOOP("elementName", "Tie Segment") },
|
{ ElementType::TIE_SEGMENT, "TieSegment", QT_TRANSLATE_NOOP("elementName", "Tie Segment") },
|
||||||
{ ElementType::STAFF_LINES, "StaffLines", QT_TRANSLATE_NOOP("elementName", "Staff Lines") },
|
|
||||||
{ ElementType::BAR_LINE, "BarLine", QT_TRANSLATE_NOOP("elementName", "Barline") },
|
{ ElementType::BAR_LINE, "BarLine", QT_TRANSLATE_NOOP("elementName", "Barline") },
|
||||||
|
{ ElementType::STAFF_LINES, "StaffLines", QT_TRANSLATE_NOOP("elementName", "Staff Lines") },
|
||||||
{ ElementType::SYSTEM_DIVIDER, "SystemDivider", QT_TRANSLATE_NOOP("elementName", "System Divider") },
|
{ ElementType::SYSTEM_DIVIDER, "SystemDivider", QT_TRANSLATE_NOOP("elementName", "System Divider") },
|
||||||
{ ElementType::STEM_SLASH, "StemSlash", QT_TRANSLATE_NOOP("elementName", "Stem Slash") },
|
{ ElementType::STEM_SLASH, "StemSlash", QT_TRANSLATE_NOOP("elementName", "Stem Slash") },
|
||||||
{ ElementType::ARPEGGIO, "Arpeggio", QT_TRANSLATE_NOOP("elementName", "Arpeggio") },
|
{ ElementType::ARPEGGIO, "Arpeggio", QT_TRANSLATE_NOOP("elementName", "Arpeggio") },
|
||||||
|
@ -181,6 +181,24 @@ void ScoreElement::undoResetProperty(P_ID id)
|
||||||
undoChangeProperty(id, propertyDefault(id), f);
|
undoChangeProperty(id, propertyDefault(id), f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------
|
||||||
|
// changeProperties
|
||||||
|
//---------------------------------------------------------
|
||||||
|
|
||||||
|
static void changeProperties(ScoreElement* e, P_ID t, const QVariant& st, PropertyFlags ps)
|
||||||
|
{
|
||||||
|
if (propertyLink(t)) {
|
||||||
|
for (ScoreElement* ee : e->linkList()) {
|
||||||
|
if (ee->getProperty(t) != st || ee->propertyFlags(t) != ps)
|
||||||
|
ee->score()->undo(new ChangeProperty(ee, t, st, ps));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (e->getProperty(t) != st || e->propertyFlags(t) != ps)
|
||||||
|
e->score()->undo(new ChangeProperty(e, t, st, ps));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
// undoChangeProperty
|
// undoChangeProperty
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
@ -218,9 +236,9 @@ void ScoreElement::undoChangeProperty(P_ID id, const QVariant& v, PropertyFlags
|
||||||
auto l = subStyle(SubStyle(v.toInt()));
|
auto l = subStyle(SubStyle(v.toInt()));
|
||||||
// Change to SubStyle defaults
|
// Change to SubStyle defaults
|
||||||
for (const StyledProperty& p : l)
|
for (const StyledProperty& p : l)
|
||||||
score()->undoChangeProperty(this, p.propertyIdx, score()->styleV(p.styleIdx), PropertyFlags::STYLED);
|
changeProperties(this, p.propertyIdx, score()->styleV(p.styleIdx), PropertyFlags::STYLED);
|
||||||
}
|
}
|
||||||
score()->undoChangeProperty(this, id, v, ps);
|
changeProperties(this, id, v, ps);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
@ -313,10 +331,10 @@ void ScoreElement::undoUnlink()
|
||||||
QList<ScoreElement*> ScoreElement::linkList() const
|
QList<ScoreElement*> ScoreElement::linkList() const
|
||||||
{
|
{
|
||||||
QList<ScoreElement*> el;
|
QList<ScoreElement*> el;
|
||||||
if (links())
|
if (_links)
|
||||||
el.append(*links());
|
el.append(*_links);
|
||||||
else
|
else
|
||||||
el.append((Element*)this);
|
el.append(const_cast<ScoreElement*>(this));
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ class ScoreElement {
|
||||||
|
|
||||||
virtual StyleIdx getPropertyStyle(P_ID) const;
|
virtual StyleIdx getPropertyStyle(P_ID) const;
|
||||||
|
|
||||||
void undoChangeProperty(P_ID id, const QVariant&, PropertyFlags ps);
|
virtual void undoChangeProperty(P_ID id, const QVariant&, PropertyFlags ps);
|
||||||
void undoChangeProperty(P_ID id, const QVariant&);
|
void undoChangeProperty(P_ID id, const QVariant&);
|
||||||
void undoResetProperty(P_ID id);
|
void undoResetProperty(P_ID id);
|
||||||
|
|
||||||
|
|
|
@ -202,9 +202,9 @@ void StringData::fretChords(Chord * chord) const
|
||||||
note->setFretConflict(true);
|
note->setFretConflict(true);
|
||||||
// store fretting change without affecting chord context
|
// store fretting change without affecting chord context
|
||||||
if (nFret != nNewFret)
|
if (nFret != nNewFret)
|
||||||
note->score()->undoChangeProperty(note, P_ID::FRET, nNewFret);
|
note->undoChangeProperty(P_ID::FRET, nNewFret);
|
||||||
if (nString != nNewString)
|
if (nString != nNewString)
|
||||||
note->score()->undoChangeProperty(note, P_ID::STRING, nNewString);
|
note->undoChangeProperty(P_ID::STRING, nNewString);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// note can be fretted: use string
|
// note can be fretted: use string
|
||||||
|
@ -232,9 +232,9 @@ void StringData::fretChords(Chord * chord) const
|
||||||
|
|
||||||
// if fretting did change, store as a fret change
|
// if fretting did change, store as a fret change
|
||||||
if (nFret != nNewFret)
|
if (nFret != nNewFret)
|
||||||
note->score()->undoChangeProperty(note, P_ID::FRET, nNewFret);
|
note->undoChangeProperty(P_ID::FRET, nNewFret);
|
||||||
if (nString != nNewString)
|
if (nString != nNewString)
|
||||||
note->score()->undoChangeProperty(note, P_ID::STRING, nNewString);
|
note->undoChangeProperty(P_ID::STRING, nNewString);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for any remaining fret conflict
|
// check for any remaining fret conflict
|
||||||
|
|
|
@ -33,8 +33,8 @@ enum class ElementType {
|
||||||
INSTRUMENT_NAME,
|
INSTRUMENT_NAME,
|
||||||
SLUR_SEGMENT,
|
SLUR_SEGMENT,
|
||||||
TIE_SEGMENT,
|
TIE_SEGMENT,
|
||||||
STAFF_LINES,
|
|
||||||
BAR_LINE,
|
BAR_LINE,
|
||||||
|
STAFF_LINES,
|
||||||
SYSTEM_DIVIDER,
|
SYSTEM_DIVIDER,
|
||||||
STEM_SLASH,
|
STEM_SLASH,
|
||||||
ARPEGGIO,
|
ARPEGGIO,
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#include "sig.h"
|
#include "sig.h"
|
||||||
#include "tuplet.h"
|
#include "tuplet.h"
|
||||||
#include "sym.h"
|
#include "sym.h"
|
||||||
|
#include "barline.h"
|
||||||
|
#include "undo.h"
|
||||||
|
|
||||||
namespace Ms {
|
namespace Ms {
|
||||||
|
|
||||||
|
@ -1024,5 +1026,61 @@ std::vector<SymId> toTimeSigString(const QString& s)
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------
|
||||||
|
// undoChangeBarLineType
|
||||||
|
//---------------------------------------------------------
|
||||||
|
|
||||||
|
void undoChangeBarLineType(BarLine* bl, BarLineType barType)
|
||||||
|
{
|
||||||
|
Measure* m = bl->measure();
|
||||||
|
|
||||||
|
switch (barType) {
|
||||||
|
case BarLineType::END:
|
||||||
|
case BarLineType::NORMAL:
|
||||||
|
case BarLineType::DOUBLE:
|
||||||
|
case BarLineType::BROKEN:
|
||||||
|
case BarLineType::DOTTED: {
|
||||||
|
SegmentType segmentType = bl->segment()->segmentType();
|
||||||
|
if (segmentType == SegmentType::EndBarLine) {
|
||||||
|
m->undoChangeProperty(P_ID::REPEAT_END, false);
|
||||||
|
Segment* segment = m->findSegmentR(SegmentType::EndBarLine, m->ticks());
|
||||||
|
if (segment) {
|
||||||
|
for (Element* e : segment->elist()) {
|
||||||
|
if (e) {
|
||||||
|
e->score()->undo(new ChangeProperty(e, P_ID::BARLINE_TYPE, QVariant::fromValue(barType), PropertyFlags::NOSTYLE));
|
||||||
|
e->score()->undo(new ChangeProperty(e, P_ID::GENERATED, false, PropertyFlags::NOSTYLE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (segmentType == SegmentType::BeginBarLine) {
|
||||||
|
Segment* segment = m->undoGetSegmentR(SegmentType::BeginBarLine, 0);
|
||||||
|
for (Element* e : segment->elist()) {
|
||||||
|
if (e) {
|
||||||
|
e->score()->undo(new ChangeProperty(e, P_ID::BARLINE_TYPE, QVariant::fromValue(barType), PropertyFlags::NOSTYLE));
|
||||||
|
e->score()->undo(new ChangeProperty(e, P_ID::GENERATED, false, PropertyFlags::NOSTYLE));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
BarLine* bl = new BarLine(bl->score());
|
||||||
|
bl->setBarLineType(barType);
|
||||||
|
bl->setParent(segment);
|
||||||
|
bl->setTrack(0);
|
||||||
|
bl->setSpanStaff(bl->score()->nstaves());
|
||||||
|
bl->score()->undo(new AddElement(bl));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (segmentType == SegmentType::StartRepeatBarLine)
|
||||||
|
m->undoChangeProperty(P_ID::REPEAT_START, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BarLineType::START_REPEAT:
|
||||||
|
m->undoChangeProperty(P_ID::REPEAT_START, true);
|
||||||
|
break;
|
||||||
|
case BarLineType::END_REPEAT:
|
||||||
|
m->undoChangeProperty(P_ID::REPEAT_END, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ class System;
|
||||||
class Element;
|
class Element;
|
||||||
class Note;
|
class Note;
|
||||||
class Tuplet;
|
class Tuplet;
|
||||||
|
class BarLine;
|
||||||
|
|
||||||
enum class ClefType : signed char;
|
enum class ClefType : signed char;
|
||||||
|
|
||||||
|
@ -85,6 +86,8 @@ extern int step2pitch(int step);
|
||||||
extern Segment* skipTuplet(Tuplet* tuplet);
|
extern Segment* skipTuplet(Tuplet* tuplet);
|
||||||
extern std::vector<SymId> toTimeSigString(const QString&);
|
extern std::vector<SymId> toTimeSigString(const QString&);
|
||||||
|
|
||||||
|
extern void undoChangeBarLineType(BarLine* bl, BarLineType barType);
|
||||||
|
|
||||||
|
|
||||||
} // namespace Ms
|
} // namespace Ms
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -41,24 +41,20 @@ void ScoreView::setDropTarget(const Element* el)
|
||||||
if (dropTarget != el) {
|
if (dropTarget != el) {
|
||||||
if (dropTarget) {
|
if (dropTarget) {
|
||||||
dropTarget->setDropTarget(false);
|
dropTarget->setDropTarget(false);
|
||||||
// _score->addRefresh(dropTarget->canvasBoundingRect());
|
|
||||||
dropTarget = 0;
|
dropTarget = 0;
|
||||||
}
|
}
|
||||||
dropTarget = el;
|
dropTarget = el;
|
||||||
if (dropTarget) {
|
if (dropTarget) {
|
||||||
dropTarget->setDropTarget(true);
|
dropTarget->setDropTarget(true);
|
||||||
// _score->addRefresh(dropTarget->canvasBoundingRect());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!dropAnchor.isNull()) {
|
if (!dropAnchor.isNull()) {
|
||||||
QRectF r;
|
QRectF r;
|
||||||
r.setTopLeft(dropAnchor.p1());
|
r.setTopLeft(dropAnchor.p1());
|
||||||
r.setBottomRight(dropAnchor.p2());
|
r.setBottomRight(dropAnchor.p2());
|
||||||
// _score->addRefresh(r.normalized());
|
|
||||||
dropAnchor = QLineF();
|
dropAnchor = QLineF();
|
||||||
}
|
}
|
||||||
if (dropRectangle.isValid()) {
|
if (dropRectangle.isValid()) {
|
||||||
// _score->addRefresh(dropRectangle);
|
|
||||||
dropRectangle = QRectF();
|
dropRectangle = QRectF();
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
|
@ -369,6 +365,10 @@ void ScoreView::dragMoveEvent(QDragMoveEvent* event)
|
||||||
case ElementType::FRET_DIAGRAM:
|
case ElementType::FRET_DIAGRAM:
|
||||||
case ElementType::STAFFTYPE_CHANGE: {
|
case ElementType::STAFFTYPE_CHANGE: {
|
||||||
QList<Element*> el = elementsAt(pos);
|
QList<Element*> el = elementsAt(pos);
|
||||||
|
printf("elements at\n");
|
||||||
|
for (Element* e : el)
|
||||||
|
printf(" %s\n", e->name());
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
setDropTarget(0);
|
setDropTarget(0);
|
||||||
for (const Element* e : el) {
|
for (const Element* e : el) {
|
||||||
|
|
|
@ -164,16 +164,16 @@ void PartEdit::playbackVoiceChanged()
|
||||||
switch (voice) {
|
switch (voice) {
|
||||||
case 0:
|
case 0:
|
||||||
printf("undo\n");
|
printf("undo\n");
|
||||||
score->undoChangeProperty(staff, P_ID::PLAYBACK_VOICE1, val);
|
staff->undoChangeProperty(P_ID::PLAYBACK_VOICE1, val);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
score->undoChangeProperty(staff, P_ID::PLAYBACK_VOICE2, val);
|
staff->undoChangeProperty(P_ID::PLAYBACK_VOICE2, val);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
score->undoChangeProperty(staff, P_ID::PLAYBACK_VOICE3, val);
|
staff->undoChangeProperty(P_ID::PLAYBACK_VOICE3, val);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
score->undoChangeProperty(staff, P_ID::PLAYBACK_VOICE4, val);
|
staff->undoChangeProperty(P_ID::PLAYBACK_VOICE4, val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,10 +399,10 @@ void ScoreView::elementPropertyAction(const QString& cmd, Element* e)
|
||||||
delete r;
|
delete r;
|
||||||
}
|
}
|
||||||
else if (cmd == "smallNote")
|
else if (cmd == "smallNote")
|
||||||
score()->undoChangeProperty(e, P_ID::SMALL, !static_cast<Note*>(e)->small());
|
e->undoChangeProperty(P_ID::SMALL, !static_cast<Note*>(e)->small());
|
||||||
else if (cmd == "clef-courtesy") {
|
else if (cmd == "clef-courtesy") {
|
||||||
bool show = !static_cast<Clef*>(e)->showCourtesy();
|
bool show = !static_cast<Clef*>(e)->showCourtesy();
|
||||||
score()->undoChangeProperty(e, P_ID::SHOW_COURTESY, show);
|
e->undoChangeProperty(P_ID::SHOW_COURTESY, show);
|
||||||
}
|
}
|
||||||
else if (cmd == "st-props") {
|
else if (cmd == "st-props") {
|
||||||
StaffTextProperties rp(static_cast<StaffText*>(e));
|
StaffTextProperties rp(static_cast<StaffText*>(e));
|
||||||
|
@ -486,7 +486,7 @@ void ScoreView::elementPropertyAction(const QString& cmd, Element* e)
|
||||||
nlb->setStartWithLongNames(sbp.startWithLongNames());
|
nlb->setStartWithLongNames(sbp.startWithLongNames());
|
||||||
nlb->setStartWithMeasureOne(sbp.startWithMeasureOne());
|
nlb->setStartWithMeasureOne(sbp.startWithMeasureOne());
|
||||||
// propagate in parts
|
// propagate in parts
|
||||||
score()->undoChangeProperty(lb, P_ID::PAUSE, sbp.pause());
|
lb->undoChangeProperty(P_ID::PAUSE, sbp.pause());
|
||||||
score()->undoChangeElement(lb, nlb);
|
score()->undoChangeElement(lb, nlb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3283,8 +3283,8 @@ void ScoreView::cmdChangeEnharmonic(bool both)
|
||||||
int string = n->line() + (both ? 1 : -1);
|
int string = n->line() + (both ? 1 : -1);
|
||||||
int fret = staff->part()->instrument()->stringData()->fret(n->pitch(), string, staff, n->chord()->tick());
|
int fret = staff->part()->instrument()->stringData()->fret(n->pitch(), string, staff, n->chord()->tick());
|
||||||
if (fret != -1) {
|
if (fret != -1) {
|
||||||
score()->undoChangeProperty(n, P_ID::FRET, fret);
|
n->undoChangeProperty(P_ID::FRET, fret);
|
||||||
score()->undoChangeProperty(n, P_ID::STRING, string);
|
n->undoChangeProperty(P_ID::STRING, string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue