Skip to content
Snippets Groups Projects
Commit dbb0db97 authored by SeeLook's avatar SeeLook :musical_note:
Browse files

Fixed reading string and fret numbers from XML ('technical' attribute in...

Fixed reading string and fret numbers from XML ('technical' attribute in 'notations' key), this way tips of melody on a chart displays string numbers if level has set it to TRUE
(grafted from c39f3017a8bbd474a986fc1d91a55e909d3bca40)
parent 295aa603
No related branches found
No related tags found
No related merge requests found
/*************************************************************************** /***************************************************************************
* Copyright (C) 2014 by Tomasz Bojczuk * * Copyright (C) 2014-2016 by Tomasz Bojczuk *
* tomaszbojczuk@gmail.com * * tomaszbojczuk@gmail.com *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/ ***************************************************************************/
#include "tchunk.h" #include "tchunk.h"
#include "trhythm.h" #include "trhythm.h"
#include "tnote.h" #include "tnote.h"
#include <QXmlStreamWriter> #include <QtCore/qxmlstream.h>
Tchunk::Tchunk(const Tnote& pitch, const Trhythm& rhythm, const TfingerPos& fretPos) : Tchunk::Tchunk(const Tnote& pitch, const Trhythm& rhythm, const TfingerPos& fretPos) :
...@@ -75,9 +75,12 @@ bool Tchunk::fromXml(QXmlStreamReader& xml, int* staffNr) { ...@@ -75,9 +75,12 @@ bool Tchunk::fromXml(QXmlStreamReader& xml, int* staffNr) {
xml.skipCurrentElement(); xml.skipCurrentElement();
} else if (xml.name() == "type") } else if (xml.name() == "type")
m_rhythm.setNoteValue(xml.readElementText().toStdString()); m_rhythm.setNoteValue(xml.readElementText().toStdString());
else if (xml.name() == "notations") else if (xml.name() == QLatin1String("notations")) {
m_fretPos.fromXml(xml); xml.readNextStartElement();
else if (xml.name() == "voice") { if (xml.name() == QLatin1String("technical"))
m_fretPos.fromXml(xml);
xml.skipCurrentElement();
} else if (xml.name() == QLatin1String("voice")) {
if (xml.readElementText().toInt() != 1) { if (xml.readElementText().toInt() != 1) {
ok = false; ok = false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment