MuseScore/mtest/guitarpro/sforzato.gp4-ref.mscx
Maurizio M. Gavioli 93e31dc04c Fix #18869 : restore original clef on ChangeStaffType undo
When a staff type change is undone, the previous staff clef is not restored, if it has been changed to suit the new staff type.

Fixed by storing the original initial clef and restoring it on undo. Should fix the following issues: #18869, #23374, #24294 and, possibly others too.

- Added to ChangeStaffType class an initialClef member variable to hold the original staff initial clef type list.
- ChangeStaffType::flip() split into undo() and redo(), as the managing the clef and setting the staff type must be applied in reversed order in the two cases.
- Clef::layout() now hides a clef not compatible with the staff group, if the clef is not generated or changes it to the same clef as the staff initial clef if generated
- TAB ad-hoc code in Clef::layout() to check for compatibility between the clef type and the staff group generalized to all groups removed.
- Fixed GuitarPro test reference scores, which all contained wrong clefs for the TAB staves.

Tested with a few 2.0 and 1.3 scores; more tests are probably necessary.
2014-05-27 01:47:30 +02:00

360 lines
10 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<museScore version="1.24">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
<Division>480</Division>
<Style>
<page-layout>
<page-height>1683.78</page-height>
<page-width>1190.55</page-width>
<page-margins type="even">
<left-margin>56.6929</left-margin>
<right-margin>56.6929</right-margin>
<top-margin>56.6929</top-margin>
<bottom-margin>113.386</bottom-margin>
</page-margins>
<page-margins type="odd">
<left-margin>56.6929</left-margin>
<right-margin>56.6929</right-margin>
<top-margin>56.6929</top-margin>
<bottom-margin>113.386</bottom-margin>
</page-margins>
</page-layout>
<Spatium>1.76389</Spatium>
</Style>
<showInvisible>1</showInvisible>
<showUnprintable>1</showUnprintable>
<showFrames>1</showFrames>
<showMargins>0</showMargins>
<metaTag name="arranger"></metaTag>
<metaTag name="composer"></metaTag>
<metaTag name="copyright"></metaTag>
<metaTag name="lyricist"></metaTag>
<metaTag name="movementNumber"></metaTag>
<metaTag name="movementTitle"></metaTag>
<metaTag name="poet"></metaTag>
<metaTag name="source"></metaTag>
<metaTag name="translator"></metaTag>
<metaTag name="workNumber"></metaTag>
<metaTag name="workTitle"></metaTag>
<PageList>
<Page>
<System>
</System>
<System>
</System>
</Page>
</PageList>
<Part>
<Staff id="1">
<StaffType group="pitched">
</StaffType>
</Staff>
<trackName>Track 1</trackName>
<Instrument>
<longName pos="0">Track 1</longName>
<trackName></trackName>
<StringData>
<frets>24</frets>
<string>40</string>
<string>45</string>
<string>50</string>
<string>55</string>
<string>59</string>
<string>64</string>
</StringData>
<Channel>
<program value="25"/>
<controller ctrl="7" value="127"/>
<controller ctrl="10" value="63"/>
<controller ctrl="93" value="255"/>
<controller ctrl="91" value="255"/>
</Channel>
</Instrument>
</Part>
<Staff id="1">
<VBox>
<height>10</height>
<lid>0</lid>
</VBox>
<Measure number="1">
<Clef>
<concertClefType>G8vb</concertClefType>
<transposingClefType>G8vb</transposingClefType>
</Clef>
<KeySig>
<lid>1</lid>
<accidental>0</accidental>
</KeySig>
<TimeSig>
<lid>2</lid>
<sigN>4</sigN>
<sigD>4</sigD>
<showCourtesySig>1</showCourtesySig>
</TimeSig>
<Tempo>
<tempo>2</tempo>
<lid>3</lid>
<text><sym>noteQuarterUp</sym> = 120</text>
</Tempo>
<Rest>
<lid>4</lid>
<durationType>quarter</durationType>
</Rest>
<Rest>
<lid>5</lid>
<durationType>quarter</durationType>
</Rest>
<Dynamic>
<subtype>f</subtype>
<velocity>96</velocity>
<lid>6</lid>
</Dynamic>
<Chord>
<lid>7</lid>
<durationType>quarter</durationType>
<Articulation>
<subtype>sforzato</subtype>
</Articulation>
<Note>
<lid>8</lid>
<pitch>59</pitch>
<tpc>19</tpc>
<fret>0</fret>
<string>1</string>
</Note>
</Chord>
<Rest>
<lid>9</lid>
<durationType>quarter</durationType>
</Rest>
</Measure>
<Measure number="2">
<Rest>
<lid>11</lid>
<durationType>measure</durationType>
<duration z="1" n="1"/>
</Rest>
<BarLine>
<subtype>end</subtype>
<span>1</span>
</BarLine>
</Measure>
</Staff>
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
<Division>480</Division>
<Style>
<createMultiMeasureRests>1</createMultiMeasureRests>
<page-layout>
<page-height>1683.78</page-height>
<page-width>1190.55</page-width>
<page-margins type="even">
<left-margin>56.6929</left-margin>
<right-margin>56.6929</right-margin>
<top-margin>56.6929</top-margin>
<bottom-margin>113.386</bottom-margin>
</page-margins>
<page-margins type="odd">
<left-margin>56.6929</left-margin>
<right-margin>56.6929</right-margin>
<top-margin>56.6929</top-margin>
<bottom-margin>113.386</bottom-margin>
</page-margins>
</page-layout>
<Spatium>1.76389</Spatium>
</Style>
<showInvisible>1</showInvisible>
<showUnprintable>1</showUnprintable>
<showFrames>1</showFrames>
<showMargins>0</showMargins>
<PageList>
<Page>
<System>
</System>
<System>
</System>
</Page>
</PageList>
<Part>
<Staff id="1">
<linkedTo>1</linkedTo>
<StaffType group="pitched">
</StaffType>
<bracket type="0" span="2"/>
</Staff>
<Staff id="2">
<linkedTo>1</linkedTo>
<StaffType group="tablature">
<name>Tab. 6-str common</name>
<lines>6</lines>
<lineDistance>1.5</lineDistance>
<timesig>0</timesig>
<durations>0</durations>
<durationFontName>MuseScore Tab Modern</durationFontName>
<durationFontSize>15</durationFontSize>
<durationFontY>0</durationFontY>
<fretFontName>MuseScore Tab Serif</fretFontName>
<fretFontSize>9</fretFontSize>
<fretFontY>0</fretFontY>
<linesThrough>0</linesThrough>
<minimStyle>1</minimStyle>
<onLines>1</onLines>
<showRests>0</showRests>
<stemsDown>1</stemsDown>
<stemsThrough>0</stemsThrough>
<upsideDown>0</upsideDown>
<useNumbers>1</useNumbers>
</StaffType>
<bracket type="-1" span="0"/>
</Staff>
<trackName></trackName>
<Instrument>
<longName pos="0">Track 1</longName>
<trackName></trackName>
<StringData>
<frets>24</frets>
<string>40</string>
<string>45</string>
<string>50</string>
<string>55</string>
<string>59</string>
<string>64</string>
</StringData>
<Channel>
<program value="25"/>
<controller ctrl="7" value="127"/>
<controller ctrl="10" value="63"/>
<controller ctrl="93" value="255"/>
<controller ctrl="91" value="255"/>
</Channel>
</Instrument>
</Part>
<Staff id="1">
<VBox>
<height>10</height>
<lid>0</lid>
<Text>
<style>Instrument Name (Part)</style>
<text>Track 1</text>
</Text>
</VBox>
<Measure number="1">
<Clef>
<concertClefType>G8vb</concertClefType>
<transposingClefType>G8vb</transposingClefType>
</Clef>
<KeySig>
<lid>1</lid>
<accidental>0</accidental>
</KeySig>
<TimeSig>
<lid>2</lid>
<sigN>4</sigN>
<sigD>4</sigD>
<showCourtesySig>1</showCourtesySig>
</TimeSig>
<Tempo>
<tempo>2</tempo>
<lid>3</lid>
<text><sym>noteQuarterUp</sym> = 120</text>
</Tempo>
<Rest>
<lid>4</lid>
<durationType>quarter</durationType>
</Rest>
<Rest>
<lid>5</lid>
<durationType>quarter</durationType>
</Rest>
<Dynamic>
<subtype>f</subtype>
<velocity>96</velocity>
<lid>6</lid>
</Dynamic>
<Chord>
<lid>7</lid>
<durationType>quarter</durationType>
<Articulation>
<subtype>sforzato</subtype>
</Articulation>
<Note>
<lid>8</lid>
<pitch>59</pitch>
<tpc>19</tpc>
<fret>0</fret>
<string>1</string>
</Note>
</Chord>
<Rest>
<lid>9</lid>
<durationType>quarter</durationType>
</Rest>
</Measure>
<Measure number="2">
<Rest>
<lid>11</lid>
<durationType>measure</durationType>
<duration z="1" n="1"/>
</Rest>
<BarLine>
<subtype>end</subtype>
<span>1</span>
</BarLine>
</Measure>
</Staff>
<Staff id="2">
<Measure number="1">
<Clef>
<concertClefType>TAB2</concertClefType>
<transposingClefType>TAB2</transposingClefType>
</Clef>
<KeySig>
<lid>1</lid>
<accidental>0</accidental>
</KeySig>
<Rest>
<lid>4</lid>
<durationType>quarter</durationType>
</Rest>
<Rest>
<lid>5</lid>
<durationType>quarter</durationType>
</Rest>
<Chord>
<lid>7</lid>
<durationType>quarter</durationType>
<Articulation>
<subtype>sforzato</subtype>
</Articulation>
<Note>
<lid>8</lid>
<pitch>59</pitch>
<tpc>19</tpc>
<fret>0</fret>
<string>1</string>
</Note>
</Chord>
<Rest>
<lid>9</lid>
<durationType>quarter</durationType>
</Rest>
</Measure>
<Measure number="2">
<Rest>
<lid>11</lid>
<durationType>measure</durationType>
<duration z="1" n="1"/>
</Rest>
<BarLine>
<subtype>end</subtype>
<span>1</span>
</BarLine>
</Measure>
</Staff>
<name>Track 1</name>
</Score>
</Score>
</museScore>