@@ -651,7 +651,7 @@ void Staff::write(XmlWriter& xml) const
651
651
}
652
652
653
653
if (invisible (Fraction (0 ,1 )))
654
- xml.tag (" invisible" , invisible (Fraction (0 ,1 ))); // obsolete?
654
+ xml.tag (" invisible" , invisible (Fraction (0 ,1 )));
655
655
if (hideWhenEmpty () != HideMode::AUTO)
656
656
xml.tag (" hideWhenEmpty" , int (hideWhenEmpty ()));
657
657
if (cutaway ())
@@ -723,7 +723,7 @@ bool Staff::readProperties(XmlReader& e)
723
723
else if (tag == " small" ) // obsolete
724
724
staffType (Fraction (0 ,1 ))->setSmall (e.readInt ());
725
725
else if (tag == " invisible" )
726
- staffType (Fraction (0 ,1 ))->setInvisible (e.readInt ()); // obsolete?
726
+ staffType (Fraction (0 ,1 ))->setInvisible (e.readInt ()); // same as: setInvisible(Fraction(0,1)), e.readInt())
727
727
else if (tag == " hideWhenEmpty" )
728
728
setHideWhenEmpty (HideMode (e.readInt ()));
729
729
else if (tag == " cutaway" )
@@ -775,7 +775,7 @@ bool Staff::readProperties(XmlReader& e)
775
775
}
776
776
}
777
777
else if (tag == " color" )
778
- _color = e.readColor ();
778
+ staffType ( Fraction ( 0 , 1 ))-> setColor ( e.readColor () );
779
779
else if (tag == " transposeDiatonic" )
780
780
e.setTransposeDiatonic (e.readInt ());
781
781
else if (tag == " transposeChromatic" )
@@ -1177,6 +1177,24 @@ bool Staff::showLedgerLines(const Fraction& tick) const
1177
1177
return staffType (tick)->showLedgerLines ();
1178
1178
}
1179
1179
1180
+ // ---------------------------------------------------------
1181
+ // color
1182
+ // ---------------------------------------------------------
1183
+
1184
+ QColor Staff::color (const Fraction& tick) const
1185
+ {
1186
+ return staffType (tick)->color ();
1187
+ }
1188
+
1189
+ // ---------------------------------------------------------
1190
+ // setColor
1191
+ // ---------------------------------------------------------
1192
+
1193
+ void Staff::setColor (const Fraction& tick, const QColor& val)
1194
+ {
1195
+ staffType (tick)->setColor (val);
1196
+ }
1197
+
1180
1198
// ---------------------------------------------------------
1181
1199
// updateOttava
1182
1200
// ---------------------------------------------------------
@@ -1313,8 +1331,10 @@ QVariant Staff::getProperty(Pid id) const
1313
1331
return staffType (Fraction (0 ,1 ))->small ();
1314
1332
case Pid::MAG:
1315
1333
return staffType (Fraction (0 ,1 ))->userMag ();
1334
+ case Pid::STAFF_INVISIBLE:
1335
+ return staffType (Fraction (0 ,1 ))->invisible ();
1316
1336
case Pid::COLOR:
1317
- return color ();
1337
+ return staffType ( Fraction ( 0 , 1 ))-> color ();
1318
1338
case Pid::PLAYBACK_VOICE1:
1319
1339
return playbackVoice (0 );
1320
1340
case Pid::PLAYBACK_VOICE2:
@@ -1359,7 +1379,7 @@ bool Staff::setProperty(Pid id, const QVariant& v)
1359
1379
}
1360
1380
break ;
1361
1381
case Pid::COLOR:
1362
- setColor (v.value <QColor>());
1382
+ setColor (Fraction ( 0 , 1 ), v.value <QColor>());
1363
1383
break ;
1364
1384
case Pid::PLAYBACK_VOICE1:
1365
1385
setPlaybackVoice (0 , v.toBool ());
@@ -1550,4 +1570,3 @@ void Staff::setInvisible(const Fraction& tick, bool val)
1550
1570
}
1551
1571
1552
1572
1553
-
0 commit comments