/** * Injects a leaf or a node into $this. * Updated parameters for Jinzora 3.0. * * $pathArray can set the following fields: * genre, subgenre, artist, album, disk, track * If anything is not set, this function will try and pull * the information from $this. * * @author Ben Dodson * @since version - Jul 28, 2006 */ function inject($pathArray, $filename, $meta = false) { if (!isset($pathArray['genre']) && false !== ($info = getInformation($this, "genre"))) { $pathArray['genre'] = $info; } if (!isset($pathArray['subgenre']) && false !== ($info = getInformation($this, "subgenre"))) { $pathArray['subgenre'] = $info; } if (!isset($pathArray['artist']) && false !== ($info = getInformation($this, "artist"))) { $pathArray['artist'] = $info; } if (!isset($pathArray['album']) && false !== ($info = getInformation($this, "album"))) { $pathArray['album'] = $info; } if (!isset($pathArray['disk']) && false !== ($info = getInformation($this, "disk"))) { $pathArray['disk'] = $info; } $mpath = buildPath($pathArray); $root = new jzMediaNode(); $res = $root->oldInject($mpath, $filename); if (is_object($res) and $res->isLeaf()) { $be = new jzBackend(); $be->registerFile($filename, $mpath); if (is_array($meta) && sizeof($meta) > 0) { $res->setMeta($meta, "cache"); $res->playpath = $filename; } } return $res; }