bool SmugMug::getImages(OwnedArray<ImageItem>& images, SmugID albumId) { StringPairArray params; params.set(("AlbumID"), String(albumId.id)); params.set(("AlbumKey"), albumId.key); params.set(("Heavy"), ("1")); XmlElement* n = smugMugRequest(("smugmug.images.get"), params); if (n) { XmlElement* a = n->getChildByName(("Album")); if (a) { XmlElement* i = a->getChildByName(("Images")); if (i) { XmlElement* img = i->getChildByName(("Image")); while (img) { ImageItem* itm = new ImageItem(); itm->id.id = img->getIntAttribute(("id")); itm->id.key = img->getStringAttribute(("Key")); itm->filename = img->getStringAttribute(("FileName")); itm->caption = img->getStringAttribute(("")); itm->keywords = img->getStringAttribute(("")); itm->position = img->getIntAttribute(("Position")); itm->date = img->getStringAttribute(("Date")); itm->format = img->getStringAttribute(("Format")); itm->serial = img->getIntAttribute(("Serial")); itm->watermark = img->getBoolAttribute(("Watermark")); itm->size = img->getIntAttribute(("Size")); itm->width = img->getIntAttribute(("Width")); itm->height = img->getIntAttribute(("Height")); itm->md5sum = img->getStringAttribute(("MD5Sum")); itm->lastUpdated = img->getStringAttribute(("LastUpdated")); itm->originalURL = img->getStringAttribute(("OriginalURL")); itm->largeURL = img->getStringAttribute(("LargeURL")); itm->mediumURL = img->getStringAttribute(("MediumURL")); itm->smallURL = img->getStringAttribute(("SmallURL")); itm->tinyURL = img->getStringAttribute(("TinyURL")); itm->thumbURL = img->getStringAttribute(("ThumbURL")); itm->albumURL = img->getStringAttribute(("AlbumURL")); images.add(itm); img = img->getNextElementWithTagName(("Image")); } } } delete n; return images.size() > 0; } return false; }
bool ColouredElement::loadColourAttributes (const XmlElement& xml) { fillType.restoreFromString (xml.getStringAttribute ("fill", String::empty)); isStrokePresent = showOutline && xml.getBoolAttribute ("hasStroke", false); strokeType.restoreFromString (xml.getStringAttribute ("stroke", String::empty)); strokeType.fill.restoreFromString (xml.getStringAttribute ("strokeColour", String::empty)); return true; }
virtual void setFromXML(const XmlElement& inXML) override { // DBGM("In DecibelParameter::setFromXML(inXML) "); XmlElement* thisXML = inXML.getChildByName(this->name); setValue(thisXML->getDoubleAttribute("parameterValue", -9876.5)); setDefaultValue(thisXML->getDoubleAttribute("defaultValue", -9876.5)); setShouldBeSmoothed(thisXML->getBoolAttribute("isSmoothed", false)); setMinDecibels(thisXML->getDoubleAttribute("minDecibels", -9876.5)); setMaxDecibels(thisXML->getDoubleAttribute("maxDecibels", -9876.5)); setUnityDecibels(thisXML->getDoubleAttribute("unityDecibels", -9876.5)); setMidValue(thisXML->getDoubleAttribute("midValue", -9876.5)); }
bool JucerDocument::loadFromXml (const XmlElement& xml) { if (xml.hasTagName (jucerCompXmlTag) && getTypeName().equalsIgnoreCase (xml.getStringAttribute ("documentType"))) { className = xml.getStringAttribute ("className", defaultClassName); templateFile = xml.getStringAttribute ("template", String::empty); componentName = xml.getStringAttribute ("componentName", String::empty); parentClasses = xml.getStringAttribute ("parentClasses", defaultParentClasses); constructorParams = xml.getStringAttribute ("constructorParams", String::empty); variableInitialisers = xml.getStringAttribute ("variableInitialisers", String::empty); fixedSize = xml.getBoolAttribute ("fixedSize", false); initialWidth = xml.getIntAttribute ("initialWidth", 300); initialHeight = xml.getIntAttribute ("initialHeight", 200); snapGridPixels = xml.getIntAttribute ("snapPixels", snapGridPixels); snapActive = xml.getBoolAttribute ("snapActive", snapActive); snapShown = xml.getBoolAttribute ("snapShown", snapShown); componentOverlayOpacity = (float) xml.getDoubleAttribute ("overlayOpacity", 0.0); activeExtraMethods.clear(); if (XmlElement* const methods = xml.getChildByName ("METHODS")) forEachXmlChildElementWithTagName (*methods, e, "METHOD") activeExtraMethods.addIfNotAlreadyThere (e->getStringAttribute ("name")); activeExtraMethods.trim(); activeExtraMethods.removeEmptyStrings(); changed(); getUndoManager().clearUndoHistory(); return true; } return false; }
bool PluginDescription::loadFromXml (const XmlElement& xml) { if (xml.hasTagName ("PLUGIN")) { name = xml.getStringAttribute ("name"); descriptiveName = xml.getStringAttribute ("descriptiveName", name); pluginFormatName = xml.getStringAttribute ("format"); category = xml.getStringAttribute ("category"); manufacturerName = xml.getStringAttribute ("manufacturer"); version = xml.getStringAttribute ("version"); fileOrIdentifier = xml.getStringAttribute ("file"); uid = xml.getStringAttribute ("uid").getHexValue32(); isInstrument = xml.getBoolAttribute ("isInstrument", false); lastFileModTime = Time (xml.getStringAttribute ("fileTime").getHexValue64()); numInputChannels = xml.getIntAttribute ("numInputs"); numOutputChannels = xml.getIntAttribute ("numOutputs"); hasSharedContainer = xml.getBoolAttribute ("isShell", false); return true; } return false; }
bool PaintElementPath::loadFromXml (const XmlElement& xml) { if (xml.hasTagName (getTagName())) { position.restoreFromXml (xml, position); loadColourAttributes (xml); nonZeroWinding = xml.getBoolAttribute ("nonZeroWinding", true); restorePathFromString (xml.getAllSubText().trim()); return true; } jassertfalse; return false; }
//============================================================================== bool KeyPressMappingSet::restoreFromXml (const XmlElement& xmlVersion) { if (xmlVersion.hasTagName ("KEYMAPPINGS")) { if (xmlVersion.getBoolAttribute ("basedOnDefaults", true)) { // if the XML was created as a set of differences from the default mappings, // (i.e. by calling createXml (true)), then we need to first restore the defaults. resetToDefaultMappings(); } else { // if the XML was created calling createXml (false), then we need to clear all // the keys and treat the xml as describing the entire set of mappings. clearAllKeyPresses(); } forEachXmlChildElement (xmlVersion, map) { const CommandID commandId = map->getStringAttribute ("commandId").getHexValue32(); if (commandId != 0) { const KeyPress key (KeyPress::createFromDescription (map->getStringAttribute ("key"))); if (map->hasTagName ("MAPPING")) { addKeyPress (commandId, key); } else if (map->hasTagName ("UNMAPPING")) { for (int i = mappings.size(); --i >= 0;) if (mappings.getUnchecked(i)->commandID == commandId) mappings.getUnchecked(i)->keypresses.removeAllInstancesOf (key); } } } return true; } return false; }