#1226 New optional parameter length added to the GreenBox::addAudioClipToPlaylist() method.

This commit is contained in:
tomash 2005-09-29 11:00:44 +00:00
parent eee7429d48
commit a45ae563bb
2 changed files with 12 additions and 6 deletions

View file

@ -500,12 +500,14 @@ class GreenBox extends BasicStor{
* @param sessid string, session ID
* @param fadeIn string, optional, in time format hh:mm:ss.ssssss
* @param fadeOut string, dtto
* @param length string - optional length in extent format -
* for webstream (or for overrule length of audioclip)
* @param pause string, optional - pause between half-faded points
* in time format hh:mm:ss.ssssss
* @return string, generated playlistElement gunid
*/
function addAudioClipToPlaylist($token, $acId, $sessid,
$fadeIn=NULL, $fadeOut=NULL, $pause=NULL)
$fadeIn=NULL, $fadeOut=NULL, $length=NULL, $pause=NULL)
{
require_once"Playlist.php";
$pl =& Playlist::recallByToken($this, $token);
@ -525,11 +527,11 @@ class GreenBox extends BasicStor{
);
}
*/
# $res = $pl->addAudioClip($acId, $fadeIn, $fadeOut, NULL, $pause);
$res = $pl->addAudioClip($acId, $fadeIn, $fadeOut, NULL);
// $res = $pl->addAudioClip($acId, $fadeIn, $fadeOut, NULL, $pause);
$res = $pl->addAudioClip($acId, $fadeIn, $fadeOut, NULL, $length);
if(PEAR::isError($res)) return $res;
// recalculate offsets and total length:
# $r = $pl->recalculateTimes($pause);
// $r = $pl->recalculateTimes($pause);
$r = $pl->recalculateTimes();
if(PEAR::isError($r)){ return $r; }
return $res;

View file

@ -164,7 +164,7 @@ class Playlist extends StoredFile{
* @param parid int - parent record id
* @param offset string - relative offset in extent format
* @param acGunid string - audioClip gunid
* @param acLen string - audiClip length in extent format
* @param acLen string - audioClip length in extent format
* @param acTit string - audioClip title
* @param fadeIn string - fadeIn value in ss.ssssss or extent format
* @param fadeOut string - fadeOut value in ss.ssssss or extent format
@ -296,15 +296,19 @@ class Playlist extends StoredFile{
* @param fadeIn string, optional, in time format hh:mm:ss.ssssss
* @param fadeOut string, dtto
* @param plElGunid string - optional playlist element gunid
* @param length string - optional length in extent format -
* for webstream (or for overrule length of audioclip)
* @return string, generated playlistElement gunid
*/
function addAudioClip($acId, $fadeIn=NULL, $fadeOut=NULL, $plElGunid=NULL)
function addAudioClip($acId, $fadeIn=NULL, $fadeOut=NULL, $plElGunid=NULL,
$length=NULL)
{
$plGunid = $this->gunid;
// get information about audioClip
$acInfo = $this->getAcInfo($acId);
if(PEAR::isError($acInfo)){ return $acInfo; }
extract($acInfo); // 'acGunid', 'acLen', 'acTit', 'elType'
if(!is_null($length)) $acLen = $length;
// get information about playlist and containers
$plInfo = $this->getPlInfo();
if(PEAR::isError($plInfo)){ return $plInfo; }