/// Performs deserialization for the class /// @param stream Power Tab input stream to load from /// @param version File version /// @return True if the object was deserialized, false if not bool FloatingText::DoDeserialize(PowerTabInputStream & stream, wxWord version) { //------Last Checked------// // - Dec 7, 2004 stream.ReadMFCString(m_text); wxCHECK(stream.CheckState(), false); stream.ReadMFCRect(m_rect); wxCHECK(stream.CheckState(), false); stream >> m_flags; wxCHECK(stream.CheckState(), false); m_fontSetting.Deserialize(stream, version); wxCHECK(stream.CheckState(), false); return (stream.CheckState()); }
/// Performs deserialization for the class /// @param stream Power Tab input stream to load from /// @param version File version /// @return True if the object was deserialized, false if not bool System::DoDeserialize(PowerTabInputStream& stream, wxWord version) { //------Last Checked------// // - Jan 14, 2005 // Version 1.0 and 1.0.2 if (version == PowerTabFileHeader::FILEVERSION_1_0 || version == PowerTabFileHeader::FILEVERSION_1_0_2) { wxByte key; wxWord endBar; stream.ReadMFCRect(m_rect); wxCHECK(stream.CheckState(), false); stream >> key >> endBar >> m_positionSpacing >> m_rhythmSlashSpacingAbove >> m_rhythmSlashSpacingBelow >> m_extraSpacing; wxCHECK(stream.CheckState(), false); // Update the key signature at start of section (always shown) wxByte keyType = (wxByte)((key >> 4) & 0xf); wxByte keyAccidentals = (wxByte)(key & 0xf); m_startBar.GetKeySignatureRef().Show(); // Cancellation if (keyType > 2) m_startBar.GetKeySignatureRef().SetCancellation(); keyType = (wxByte)(((keyType % 2) == 1) ? KeySignature::majorKey : KeySignature::minorKey); m_startBar.GetKeySignatureRef().SetKey(keyType, keyAccidentals); // Update the ending bar wxByte barType = HIBYTE(endBar); wxByte repeatCount = LOBYTE(endBar); m_endBar.SetBarlineData(barType, repeatCount); //SetEndBar(barType, repeatCount); m_directionArray.Deserialize(stream, version); wxCHECK(stream.CheckState(), false); m_chordTextArray.Deserialize(stream, version); wxCHECK(stream.CheckState(), false); m_rhythmSlashArray.Deserialize(stream, version); wxCHECK(stream.CheckState(), false); m_staffArray.Deserialize(stream, version); wxCHECK(stream.CheckState(), false); m_barlineArray.Deserialize(stream, version); wxCHECK(stream.CheckState(), false); // Any barline at position zero is now stored in the section m_startBar if (GetBarlineCount() > 0) { Barline* barline = m_barlineArray[0]; if (barline != NULL) { if (barline->GetPosition() == 0) { m_startBar = *barline; delete barline; m_barlineArray.RemoveAt(0); } } } // Update key signs that aren't show to match active key sign KeySignature* activeKeySignature = m_startBar.GetKeySignaturePtr(); size_t i = 0; size_t count = m_barlineArray.GetCount(); for (; i < count; i++) { KeySignature& keySignature = m_barlineArray[i]->GetKeySignatureRef(); // Key on bar doesn't match active if (keySignature != *activeKeySignature) { // Key isn't shown, update key to match if (!keySignature.IsShown()) { keySignature = *activeKeySignature; keySignature.Hide(); keySignature.SetCancellation(false); } // Update active key activeKeySignature = m_barlineArray[i]->GetKeySignaturePtr(); } } }