Beispiel #1
0
void SynthControl::recallButtonClicked()
{
    if (!_score) {
        qDebug("no score");
        return;
    }

    SynthesizerState state;
    QString s(dataPath + "/synthesizer.xml");
    QFile f(s);
    if (!f.open(QIODevice::ReadOnly)) {
        qDebug("cannot read synthesizer settings <%s>", qPrintable(s));
        return;
    }
    XmlReader e(&f);
    while (e.readNextStartElement()) {
        if (e.name() == "Synthesizer")
            state.read(e);
        else
            e.unknown();
    }
    synti->setState(state);
    updateGui();

    storeButton->setEnabled(false);
    recallButton->setEnabled(false);

    loadButton->setEnabled(true);
    saveButton->setEnabled(true);
    changeTuningButton->setEnabled(false);
}
Beispiel #2
0
SynthesizerState MasterSynthesizer::state() const
{
    SynthesizerState ss;
    SynthesizerGroup g;
    g.setName("master");
    g.push_back(IdValue(0, QString("%1").arg(_effect[0] ? _effect[0]->name() : "none")));
    g.push_back(IdValue(1, QString("%1").arg(_effect[1] ? _effect[1]->name() : "none")));
    g.push_back(IdValue(2, QString("%1").arg(gain())));
    ss.push_back(g);
    for (Synthesizer* s : _synthesizer)
        ss.push_back(s->state());
    if (_effect[0])
        ss.push_back(_effect[0]->state());
    if (_effect[1])
        ss.push_back(_effect[1]->state());
    return ss;
}
Beispiel #3
0
void MasterSynthesizer::init()
      {
      SynthesizerState state;
      QString s(dataPath + "/synthesizer.xml");
      QFile f(s);
      if (!f.open(QIODevice::ReadOnly)) {
            qDebug("cannot read synthesizer settings <%s>", qPrintable(s));
            setState(defaultState);
            return;
            }
      XmlReader e(&f);
      while (e.readNextStartElement()) {
            if (e.name() == "Synthesizer")
                  state.read(e);
            else
                  e.unknown();
            }
      setState(state);
      }
SynthesizerState MasterSynthesizer::state() const
      {
      SynthesizerState ss;
      SynthesizerGroup g;
      g.setName("master");
      g.push_back(IdValue(0, QString("%1").arg(_effect[0] ? _effect[0]->name() : "NoEffect")));
      g.push_back(IdValue(1, QString("%1").arg(_effect[1] ? _effect[1]->name() : "NoEffect")));
      g.push_back(IdValue(2, QString("%1").arg(gain())));
      g.push_back(IdValue(3, QString("%1").arg(masterTuning())));
      g.push_back(IdValue(4, QString("%1").arg(dynamicsMethod())));
      g.push_back(IdValue(5, QString("%1").arg(ccToUseIndex())));
      ss.push_back(g);
      for (Synthesizer* s : _synthesizer)
            ss.push_back(s->state());
      if (_effect[0])
            ss.push_back(_effect[0]->state());
      if (_effect[1])
            ss.push_back(_effect[1]->state());
      return ss;
      }