/** * Insert a new playlist element. * * @param int $plId * id of Playlist * @param int $fileId * id of File * @param string $offset * relative offset in extent format * @param string $clipstart * audioClip clipstart in extent format * @param string $clipEnd * audioClip clipEnd in extent format * @param string $clipLength * audioClip playlength in extent format (?) * @param string $acGunid * audioClip gunid * @param string $acLen * audioClip length in extent format * @param string $acTit * audioClip title * @param string $fadeIn * fadeIn value in ss.ssssss or extent format * @param string $fadeOut * fadeOut value in ss.ssssss or extent format * @return array with fields: * <ul> * <li>plElId int - record id of playlistElement</li> * <li>plElGunid string - gl.unique id of playlistElement</li> * <li>fadeInId int - record id</li> * <li>fadeOutId int - record id</li> * </ul> */ private function insertPlaylistElement($plId, $fileId, $pos, $clipLength, $cuein, $cueout, $fadeIn = NULL, $fadeOut = NULL) { $defaultFade = Application_Model_Preference::GetDefaultFade(); if (is_null($fadeIn)) { if ($defaultFade != "") { $fadeIn = $defaultFade; } else { $fadeIn = '00:00:00.000'; } } if (is_null($fadeOut)) { if ($defaultFade != "") { $fadeOut = $defaultFade; } else { $fadeOut = '00:00:00.000'; } } $row = new CcPlaylistcontents(); $row->setDbPlaylistId($plId); $row->setDbFileId($fileId); $row->setDbPosition($pos); $row->save(); $row->setDbCliplength($clipLength); $row->setDbCuein($cuein); $row->setDbCueout($cueout); $row->setDbFadein($fadeIn); $row->setDbFadeout($fadeOut); return TRUE; }
private function insertPlaylistElement($info) { $row = new CcPlaylistcontents(); $row->setDbPlaylistId($this->id); $row->setDbPosition($info["pos"]); $row->setDbCliplength($info["cliplength"]); $row->setDbCuein($info["cuein"]); $row->setDbCueout($info["cueout"]); $row->setDbFadein(Application_Common_DateHelper::secondsToPlaylistTime($info["fadein"])); $row->setDbFadeout(Application_Common_DateHelper::secondsToPlaylistTime($info["fadeout"])); if ($info["ftype"] == "audioclip") { $row->setDbFileId($info["id"]); $row->setDbTrackOffset($info["crossfadeDuration"]); $type = 0; } elseif ($info["ftype"] == "stream") { $row->setDbStreamId($info["id"]); $type = 1; } elseif ($info["ftype"] == "block") { $row->setDbBlockId($info["id"]); $type = 2; } $row->setDbType($type); $row->save($this->con); // above save result update on cc_playlist table on length column. // but $this->pl doesn't get updated automatically // so we need to manually grab it again from DB so it has updated values // It is something to do FORMAT_ON_DEMAND( Lazy Loading ) $this->pl = CcPlaylistQuery::create()->findPK($this->id); }