Esempio n. 1
0
void Album::write(Xml& xml)
      {
      xml.header();
      xml.stag("museScore version=\"" MSC_VERSION "\"");
      save(xml);
      xml.etag();
      }
Esempio n. 2
0
void MidiInstrument::write(int level, Xml& xml)
      {
      xml.header();
      xml.tag(level, "muse version=\"1.0\"");
      level++;
      xml.nput(level, "<MidiInstrument name=\"%s\"", Xml::xmlString(iname()).toLatin1().constData());
      
      if(_nullvalue != -1)
      {
        QString nv; 
        nv.setNum(_nullvalue);
        xml.nput(" nullparam=\"%s\"", nv.toLatin1().constData());
      }  
      xml.put(">");

      level++;
      for (ciPatchGroup g = pg.begin(); g != pg.end(); ++g) {
            PatchGroup* pgp = *g;
            const PatchList& pl = pgp->patches;
            xml.tag(level, "PatchGroup name=\"%s\"", Xml::xmlString(pgp->name).toLatin1().constData());
            level++;
            for (ciPatch p = pl.begin(); p != pl.end(); ++p)
                  (*p)->write(level, xml);
            level--;
            xml.etag(level, "PatchGroup");
            }
      for (iMidiController ic = _controller->begin(); ic != _controller->end(); ++ic)
            ic->second->write(level, xml);
      if(!_sysex.isEmpty())
      {
        int j = _sysex.size();
        for(int i = 0; i < j; ++i)
          _sysex.at(i)->write(level, xml);
      }
      
      xml.tag(level++, "Init");
      for(ciEvent ev=_midiInit->begin(); ev != _midiInit->end(); ++ev)
        ev->second.write(level, xml, MusECore::Pos(0, true));
      xml.etag(--level, "Init");
      
      // -------------
      // TODO: What about _midiReset, _midiState, and _initScript ?
      // -------------
      
      writeDrummaps(level, xml);
      
      level--;
      xml.etag(level, "MidiInstrument");
      level--;
      xml.etag(level, "muse");
      }
Esempio n. 3
0
void MidiInstrument::write(int level, Xml& xml)
{
    xml.header();
    xml.tag(level, "los version=\"1.0\"");
    level++;
    xml.nput(level, "<MidiInstrument name=\"%s\" panValue=\"%f\"",
            Xml::xmlString(iname()).toLatin1().constData(), m_panValue);

    if (_nullvalue != -1)
    {
        QString nv;
        nv.setNum(_nullvalue);
        xml.nput(" nullparam=\"%s\"", nv.toLatin1().constData());
    }
    xml.put(">");

    // -------------
    // What about Init, Reset, State, and InitScript ?
    // -------------

    level++;
    for (ciPatchGroup g = pg.begin(); g != pg.end(); ++g)
    {
        PatchGroup* pgp = *g;
        const PatchList& pl = pgp->patches;
        xml.tag(level, "PatchGroup name=\"%s\"", Xml::xmlString(pgp->name).toLatin1().constData());
        level++;
        for (ciPatch p = pl.begin(); p != pl.end(); ++p)
            (*p)->write(level, xml);
        level--;
        xml.etag(level, "PatchGroup");
    }
    for (iMidiController ic = _controller->begin(); ic != _controller->end(); ++ic)
        ic->second->write(level, xml);
    for(QHash<int, KeyMap*>::const_iterator km = m_keymaps.begin(); km != m_keymaps.end(); ++km)
    {
        KeyMap *m = km.value();
        m->write(level, xml);
    }
    level--;
    xml.etag(level, "MidiInstrument");
    level--;
    xml.etag(level, "los");
}