Skip to content

Commit

Permalink
Fix instrument converting
Browse files Browse the repository at this point in the history
  • Loading branch information
PhysSong committed Oct 22, 2018
1 parent 94908ce commit e81f9b0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/tracks/InstrumentTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ void InstrumentTrackWindow::dropEvent( QDropEvent* event )
!strcmp(oldIns->descriptor()->name, "zynaddsubfx");

DataFile savedSettings(DataFile::SongProject);
QDomDocument* newDoc;
QDomDocument newDoc("ZynAddSubFX-data");
const char* newNode;

if(convert)
Expand All @@ -1762,17 +1762,16 @@ void InstrumentTrackWindow::dropEvent( QDropEvent* event )
if(!xmzNode.isNull())
{
newNode = "ZASF";
newDoc = new QDomDocument("ZynAddSubFX-data");
QDomNode zasf = newDoc->createElement(newNode);
newDoc->appendChild(zasf);
QDomNode zasf = newDoc.createElement(newNode);
newDoc.appendChild(zasf);

QString str;
QTextStream stream(&str);
stream << "<?xml version=\"1.0f\" "
"encoding=\"UTF-8\"?>\n"
<< "<!DOCTYPE ZynAddSubFX-data>\n";
xmzNode.save(stream, 1);
QDomCDATASection cdata = newDoc->
QDomCDATASection cdata = newDoc.
createCDATASection(str);
zasf.appendChild(cdata);

Expand All @@ -1799,7 +1798,7 @@ void InstrumentTrackWindow::dropEvent( QDropEvent* event )
if(convert)
{
m_track->instrument()->restoreState(
newDoc->namedItem(newNode).toElement());
newDoc.namedItem(newNode).toElement());
}

Engine::getSong()->setModified();
Expand Down

0 comments on commit e81f9b0

Please sign in to comment.