void Visitor<Reader<JSONObject>>::readFrom(const AutomationModel& autom) { m_obj["PluginsMetadata"] = toJsonValue(*autom.pluginModelList); m_obj["Curve"] = toJsonObject(autom.curve()); m_obj["Address"] = toJsonObject(autom.address()); m_obj["Min"] = autom.min(); m_obj["Max"] = autom.max(); }
void Visitor<Reader<DataStream>>::readFrom(const AutomationModel& autom) { readFrom(*autom.pluginModelList); m_stream << autom.address(); m_stream << autom.min(); m_stream << autom.max(); readFrom(autom.curve()); insertDelimiter(); }
void Visitor<Writer<JSONObject>>::writeTo(AutomationModel& autom) { Deserializer<JSONValue> elementPluginDeserializer(m_obj["PluginsMetadata"]); autom.pluginModelList = new iscore::ElementPluginModelList{elementPluginDeserializer, &autom}; Deserializer<JSONObject> curve_deser{m_obj["Curve"].toObject()}; autom.setCurve(new CurveModel{curve_deser, &autom}); autom.setAddress(fromJsonObject<iscore::Address>(m_obj["Address"].toObject())); autom.setMin(m_obj["Min"].toDouble()); autom.setMax(m_obj["Max"].toDouble()); }
void Visitor<Writer<DataStream>>::writeTo(AutomationModel& autom) { autom.pluginModelList = new iscore::ElementPluginModelList{*this, &autom}; autom.setCurve(new CurveModel{*this, &autom}); iscore::Address address; double min, max; m_stream >> address >> min >> max; autom.setAddress(address); autom.setMin(min); autom.setMax(max); checkDelimiter(); }