#2358 Update HTML UI playlist editor to include cue in/cue out functionality
This commit is contained in:
parent
413d711511
commit
649f62e058
|
@ -653,7 +653,7 @@ $ui_fmask = array(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'PL.setItemPlaylength' => array(
|
'PL.setClipLength' => array(
|
||||||
'act' => array(
|
'act' => array(
|
||||||
'element' => 'act',
|
'element' => 'act',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
|
@ -670,11 +670,37 @@ $ui_fmask = array(
|
||||||
'element' => 'duration',
|
'element' => 'duration',
|
||||||
'type' => 'hidden'
|
'type' => 'hidden'
|
||||||
),
|
),
|
||||||
'playlength' => array(
|
'clipStart' => array(
|
||||||
'element' => 'playlength',
|
'element' => 'clipStart',
|
||||||
'type' => 'date',
|
'type' => 'select',
|
||||||
'label' => 'Playlength',
|
'label' => 'Cue in: ',
|
||||||
'options' => array('format' => 'His'),
|
'options' => array(),
|
||||||
|
'attributes' => 'onChange="return PL_setClipLength(this)"',
|
||||||
|
'groupit' => true
|
||||||
|
),
|
||||||
|
'clipLength' => array(
|
||||||
|
'element' => 'clipLength',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => 'Length: ',
|
||||||
|
'options' => array(),
|
||||||
|
'attributes' => 'onChange="return PL_setClipLength(this)"',
|
||||||
|
'groupit' => true
|
||||||
|
),
|
||||||
|
'clipEnd' => array(
|
||||||
|
'element' => 'clipEnd',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => 'Cue out: ',
|
||||||
|
'options' => array(),
|
||||||
|
'attributes' => 'onChange="return PL_setClipLength(this)"',
|
||||||
|
'groupit' => true
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'group' => array('clipStart', 'clipLength', 'clipEnd')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'elemnt' => 'linebreak',
|
||||||
|
'type' => 'static',
|
||||||
|
'text' => '<p></p>'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'cancel',
|
'element' => 'cancel',
|
||||||
|
@ -691,9 +717,8 @@ $ui_fmask = array(
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'submitter',
|
'element' => 'submitter',
|
||||||
'type' => 'button',
|
'type' => 'submit',
|
||||||
'label' => 'Submit',
|
'label' => 'Submit',
|
||||||
'attributes'=> array('onClick' => 'PL_checkItemPlaylength()'),
|
|
||||||
'groupit' => TRUE
|
'groupit' => TRUE
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -116,9 +116,9 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){
|
||||||
$Smarty->display('popup/PLAYLIST.arrangeItems.tpl');
|
$Smarty->display('popup/PLAYLIST.arrangeItems.tpl');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "PL.setItemPlaylengthForm":
|
case "PL.setClipLength":
|
||||||
$Smarty->assign('dynform', $uiBrowser->PLAYLIST->setItemPlaylengthForm($_REQUEST['id'], $_REQUEST['elemId'], $ui_fmask['PL.setItemPlaylength']));
|
$Smarty->assign('dynform', $uiBrowser->PLAYLIST->setClipLengthForm($_REQUEST['id'], $_REQUEST['elemId'], $ui_fmask['PL.setClipLength']));
|
||||||
$Smarty->display('popup/PLAYLIST.setItemPlaylength.tpl');
|
$Smarty->display('popup/PLAYLIST.setClipLength.tpl');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "PL.export":
|
case "PL.export":
|
||||||
|
|
|
@ -273,8 +273,8 @@ switch ($_REQUEST['act']) {
|
||||||
$uiHandler->PLAYLIST->setReload();
|
$uiHandler->PLAYLIST->setReload();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "PL.setItemPlaylength":
|
case "PL.setClipLength":
|
||||||
$uiHandler->PLAYLIST->setItemPlaylength($_REQUEST['elemId'], $_REQUEST['playlength']);
|
$uiHandler->PLAYLIST->setClipLength($_REQUEST['elemId'], $ui_fmask['PL.setClipLength']);
|
||||||
$uiHandler->PLAYLIST->setReload();
|
$uiHandler->PLAYLIST->setReload();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
|
||||||
<li><a href="{$UI_BROWSER}?id={$START.fid}&act=PL.simpleManagement">##Edit Playlist##</a></li>
|
<li><a href="{$UI_BROWSER}?id={$START.fid}&act=PL.simpleManagement">##Edit Playlist##</a></li>
|
||||||
{else}
|
{else}
|
||||||
{if $PL->reportLookedPL()}
|
{if $PL->reportLookedPL()}
|
||||||
<li><a onClick="hpopup('{$UI_HANDLER}?act=PL.unlook')">##Open last Playlist##</a></li>
|
<li><a onClick="hpopup('{$UI_HANDLER}?act=PL.unlook')">##Reopen Playlist##</a></li>
|
||||||
{else}
|
{else}
|
||||||
<li><a onClick="hpopup('{$UI_HANDLER}?act=PL.create')">##New empty Playlist##</a></li>
|
<li><a onClick="hpopup('{$UI_HANDLER}?act=PL.create')">##New empty Playlist##</a></li>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -2,13 +2,11 @@ style="cursor: pointer"
|
||||||
onClick="return contextmenu('{$i.attrs.id}',
|
onClick="return contextmenu('{$i.attrs.id}',
|
||||||
|
|
||||||
{if $i.type|lower == 'webstream'}
|
{if $i.type|lower == 'webstream'}
|
||||||
'listen', '{$i.gunid}',
|
'listen', '{$i.gunid}', 'PL.setCliplength',
|
||||||
{* 'PL.changeItemPlaylength', *}
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $i.type|lower == 'audioclip'}
|
{if $i.type|lower == 'audioclip'}
|
||||||
'listen', '{$i.gunid}',
|
'listen', '{$i.gunid}', 'PL.setCliplength',
|
||||||
{* 'PL.changeItemPlaylength', *}
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
'PL.removeItem'
|
'PL.removeItem'
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
<tr class="blue_head">
|
<tr class="blue_head">
|
||||||
<td style="width: 30px"><input type="checkbox" name="all" onClick="collector_switchAll('PL')"></td>
|
<td style="width: 30px"><input type="checkbox" name="all" onClick="collector_switchAll('PL')"></td>
|
||||||
<td style="width: 200px">##Title##</td>
|
<td style="width: 200px">##Title##</td>
|
||||||
<td> ##Duration##</td>
|
<td style="white-space: nowrap">##Clip length##</td>
|
||||||
|
<td> ##Original##</td>
|
||||||
<td style="width: 200px">##Artist##</td>
|
<td style="width: 200px">##Artist##</td>
|
||||||
<td style="width: 30px;">##Type##</td>
|
<td style="width: 30px;">##Type##</td>
|
||||||
<td style="width: 30px; border: 0">##Move##</td>
|
<td style="width: 30px; border: 0">##Move##</td>
|
||||||
|
@ -26,14 +27,20 @@
|
||||||
<!-- end repeat after 14 columns -->
|
<!-- end repeat after 14 columns -->
|
||||||
<!-- start item -->
|
<!-- start item -->
|
||||||
{foreach from=$PL->getFlat($PL->activeId) key='pos' item='i'}
|
{foreach from=$PL->getFlat($PL->activeId) key='pos' item='i'}
|
||||||
|
{*
|
||||||
<!-- fade information -->
|
<!-- fade information -->
|
||||||
<tr onClick="return contextmenu('{$i.attrs.id}', {if $i.firstInList == 1}'PL.changeFadeIn'{else}'PL.changeTransition'{/if})" style="background-color: #bbb">
|
<tr onClick="return contextmenu('{$i.attrs.id}', {if $i.firstInList == 1}'PL.changeFadeIn'{else}'PL.changeTransition'{/if})" style="background-color: #bbb">
|
||||||
<td></td>
|
<td></td>
|
||||||
<td colspan="5" style="border: 0; cursor: pointer">##Fade## {$i.fadein_ms|string_format:"%d"} ms</td>
|
<td colspan="5" style="border: 0; cursor: pointer">##Fade## {$i.fadein_ms|string_format:"%d"} ms</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- /fade information -->
|
||||||
|
*}
|
||||||
<tr class="{cycle values='blue1, blue2'}">
|
<tr class="{cycle values='blue1, blue2'}">
|
||||||
<td><input type="checkbox" class="checkbox" name="{$i.attrs.id}"/></td>
|
<td><input type="checkbox" class="checkbox" name="{$i.attrs.id}"/></td>
|
||||||
<td {include file="playlist/actionhandler.tpl"}>{$i.title}</td>
|
<td {include file="playlist/actionhandler.tpl"}>{$i.title}</td>
|
||||||
|
<td {include file="playlist/actionhandler.tpl"} style="text-align: right">
|
||||||
|
{assign var="_playlength" value=$i.attrs.clipLength}{niceTime in=$_playlength}
|
||||||
|
</td>
|
||||||
<td {include file="playlist/actionhandler.tpl"} style="text-align: right">
|
<td {include file="playlist/actionhandler.tpl"} style="text-align: right">
|
||||||
{assign var="_duration" value=$i.playlength}{niceTime in=$_duration}
|
{assign var="_duration" value=$i.playlength}{niceTime in=$_duration}
|
||||||
</td>
|
</td>
|
||||||
|
@ -48,14 +55,17 @@
|
||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{if isset($pos)}
|
{if isset($pos)}
|
||||||
|
{*
|
||||||
<!-- fade information -->
|
<!-- fade information -->
|
||||||
<tr onClick="return contextmenu('{$i.attrs.id}', 'PL.changeFadeOut')" style="background-color: #bbb">
|
<tr onClick="return contextmenu('{$i.attrs.id}', 'PL.changeFadeOut')" style="background-color: #bbb">
|
||||||
<td></td>
|
<td></td>
|
||||||
<td colspan="5" style="border: 0; cursor: pointer">##Fade## {$i.fadeout_ms|string_format:"%d"} ms</td>
|
<td colspan="5" style="border: 0; cursor: pointer">##Fade## {$i.fadeout_ms|string_format:"%d"} ms</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- /fade information -->
|
||||||
|
*}
|
||||||
{else}
|
{else}
|
||||||
<tr class="{cycle values='blue1, blue2'}">
|
<tr class="{cycle values='blue1, blue2'}">
|
||||||
<td style="border: 0" colspan="6" align="center">##No Entry##</td>
|
<td style="border: 0" colspan="7" align="center">##Empty playlist##</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
<!-- end item -->
|
<!-- end item -->
|
||||||
|
@ -63,7 +73,7 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" style="width: 569px;">
|
<div class="footer" style="width: 569px;">
|
||||||
<input type="button" class="button_large" onClick="collector_submit('PL', '0&popup[]=PL.changeAllTransitions', '{$UI_BROWSER}', 'chgAllTrans', 400, 150)" value="##Change Fades##" />
|
{* <input type="button" class="button_large" onClick="collector_submit('PL', '0&popup[]=PL.changeAllTransitions', '{$UI_BROWSER}', 'chgAllTrans', 400, 150)" value="##Change Fades##" /> *}
|
||||||
<input type="button" class="button_large" onClick="collector_submit('PL', 'PL.removeItem')" value="##Remove Selected##" />
|
<input type="button" class="button_large" onClick="collector_submit('PL', 'PL.removeItem')" value="##Remove Selected##" />
|
||||||
<input type="button" class="button_large" onClick="collector_clearAll('PL', 'PL.removeItem')" value="##Clear Playlist##" />
|
<input type="button" class="button_large" onClick="collector_clearAll('PL', 'PL.removeItem')" value="##Clear Playlist##" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<h1>##Playlist Editor##</h1>
|
<h1>##Playlist Editor##</h1>
|
||||||
<p> </p>
|
<p> </p>
|
||||||
{if $PL->reportLookedPL()}
|
{if $PL->reportLookedPL()}
|
||||||
<input type="button" value="##Open last Playlist##" onClick="hpopup('{$UI_HANDLER}?act=PL.unlook')" class="button_wide">
|
<input type="button" value="##Reopen Playlist##" onClick="hpopup('{$UI_HANDLER}?act=PL.unlook')" class="button_wide">
|
||||||
{else}
|
{else}
|
||||||
<input type="button" value="##New empty Playlist##" onClick="hpopup('{$UI_HANDLER}?act=PL.create')" class="button_wide">
|
<input type="button" value="##New empty Playlist##" onClick="hpopup('{$UI_HANDLER}?act=PL.create')" class="button_wide">
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
{include file="popup/header.tpl"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table height="100%" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="border: 0">
|
||||||
|
<center>
|
||||||
|
<table width="100%" height="100%">
|
||||||
|
<tr><td style="border: 0">
|
||||||
|
{include file="sub/dynForm_plain.tpl}
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
</center>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<script language="javascript">
|
||||||
|
{literal}
|
||||||
|
function PL_setClipLength(changed_elem)
|
||||||
|
{
|
||||||
|
var duration = parseInt(document.forms[0].elements['duration'].value);
|
||||||
|
var clipLength = parseInt(document.forms[0].elements['clipLength'].value);
|
||||||
|
var clipStart = parseInt(document.forms[0].elements['clipStart'].value);
|
||||||
|
var clipEnd = parseInt(document.forms[0].elements['clipEnd'].value);
|
||||||
|
|
||||||
|
if (changed_elem.name == 'clipLength') {
|
||||||
|
document.forms[0].elements['clipEnd'].value = clipLength + clipStart;
|
||||||
|
} else {
|
||||||
|
if (clipEnd - clipStart <=0 ) {
|
||||||
|
alert('##Remaining cliplength need to has a positive value.##');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
document.forms[0].elements['clipLength'].value = clipEnd - clipStart;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
{include file="popup/header.tpl"}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<table height="100%" width="100%">
|
|
||||||
<tr>
|
|
||||||
<td style="border: 0">
|
|
||||||
<center>
|
|
||||||
<table width="100%" height="100%">
|
|
||||||
<tr><td style="border: 0">
|
|
||||||
{include file="sub/dynForm_plain.tpl}
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</center>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<script language="javascript">
|
|
||||||
{literal}
|
|
||||||
function PL_checkItemPlaylength()
|
|
||||||
{
|
|
||||||
zero = new Date('january 01 1970 00:00:00');
|
|
||||||
max = new Date('january 01 1970 '+document.forms[0].elements['duration'].value);
|
|
||||||
curr = new Date('january 01 1970 '+document.forms[0].elements['playlength[H]'].value+':'
|
|
||||||
+document.forms[0].elements['playlength[i]'].value+':'
|
|
||||||
+document.forms[0].elements['playlength[s]'].value);
|
|
||||||
|
|
||||||
if (max.getTime() != zero.getTime() && max.getTime() < curr.getTime()) {
|
|
||||||
alert('##Playlength cannot be longer than item duration##');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (curr.getTime() == zero.getTime()) {
|
|
||||||
alert('##Playlength cannot be zero##');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
document.forms[0].submit();
|
|
||||||
}
|
|
||||||
{/literal}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{literal}
|
{literal}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// www.jjam.de - Kontextmenü mit JavaScript - Version 15.12.2002
|
// www.jjam.de - Kontextmen<EFBFBD> mit JavaScript - Version 15.12.2002
|
||||||
|
|
||||||
// Browser detection
|
// Browser detection
|
||||||
ie5 = (document.getElementById && document.all && document.styleSheets) ? 1 : 0;
|
ie5 = (document.getElementById && document.all && document.styleSheets) ? 1 : 0;
|
||||||
|
@ -19,7 +19,7 @@ function contextmenu(param) {
|
||||||
|
|
||||||
var sp2 = " ";
|
var sp2 = " ";
|
||||||
var sp5 = sp2 + sp2 + " "; // Leerzeichen als Abstandshalter (flexibler und code-sparender als eine aufwendige Tabellenkonstruktion) ;
|
var sp5 = sp2 + sp2 + " "; // Leerzeichen als Abstandshalter (flexibler und code-sparender als eine aufwendige Tabellenkonstruktion) ;
|
||||||
var oF = "onfocus = 'if (this.blur) this.blur()'"; // Um hässlichen Linkrahmen in einigen Browsern zu vermeiden;
|
var oF = "onfocus = 'if (this.blur) this.blur()'"; // Um h<EFBFBD>sslichen Linkrahmen in einigen Browsern zu vermeiden;
|
||||||
var entry = new Array();
|
var entry = new Array();
|
||||||
//contextmenuStatus = 0;
|
//contextmenuStatus = 0;
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ function contextmenu(param) {
|
||||||
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=PL.setItemPlaylengthForm&id="+param+"', 'PL.setStreamPlaylength', 400, 50)\" "+oF+"> ##Add to playlist## </a></li>";
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=PL.setItemPlaylengthForm&id="+param+"', 'PL.setStreamPlaylength', 400, 50)\" "+oF+"> ##Add to playlist## </a></li>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "PL.changeItemPlaylength":
|
case "PL.setCliplength":
|
||||||
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=PL.setItemPlaylengthForm&elemId="+param+"', 'PL.setItemPlaylength', 400, 50)\" "+oF+"> ##Change playlegth## </a></li>";
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=PL.setClipLength&elemId="+param+"', 'PL.setClipLength', 400, 50)\" "+oF+"> ##Set clip length## </a></li>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "PL.removeItem":
|
case "PL.removeItem":
|
||||||
|
|
|
@ -166,6 +166,7 @@ class uiPlaylist
|
||||||
$this->Base->_retMsg('Playlist "$1" saved.', $this->Base->getMetadataValue($tmpid, UI_MDATA_KEY_TITLE));
|
$this->Base->_retMsg('Playlist "$1" saved.', $this->Base->getMetadataValue($tmpid, UI_MDATA_KEY_TITLE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->Base->SCRATCHPAD->reloadMetadata();
|
||||||
return $this->activeId;
|
return $this->activeId;
|
||||||
} // fn save
|
} // fn save
|
||||||
|
|
||||||
|
@ -240,13 +241,28 @@ class uiPlaylist
|
||||||
} // fn loadLookedFromPref
|
} // fn loadLookedFromPref
|
||||||
|
|
||||||
|
|
||||||
public function addItem($elemIds, $duration=null)
|
/**
|
||||||
|
* Add item to playlist
|
||||||
|
*
|
||||||
|
* @param int $elemIds
|
||||||
|
* @param array $duration
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
|
public function addItem($elemIds, $duration=NULL)
|
||||||
{
|
{
|
||||||
$this->changed = TRUE;
|
$this->changed = TRUE;
|
||||||
$fadeIn = null;
|
$fadeIn = NULL;
|
||||||
$fadeOut = null;
|
$fadeOut = NULL;
|
||||||
$pause = null;
|
$length = NULL;
|
||||||
|
$clipstart = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
gstreamer bug:
|
||||||
|
Warning: The clipEnd can't be bigger than ninety nine percent (99%) of the clipLength,
|
||||||
|
this means also if no clipEnd is defined it should be 00:00:00.000000 and not the clipLength.
|
||||||
|
$clipend = '00:00:00.000000';
|
||||||
|
*/
|
||||||
|
|
||||||
if (!$elemIds) {
|
if (!$elemIds) {
|
||||||
if (UI_WARNING) {
|
if (UI_WARNING) {
|
||||||
$this->Base->_retMsg('No item(s) selected.');
|
$this->Base->_retMsg('No item(s) selected.');
|
||||||
|
@ -260,7 +276,7 @@ class uiPlaylist
|
||||||
$length = sprintf('%02d', $duration['H']).':'.sprintf('%02d', $duration['i']).':'.sprintf('%02d', $duration['s']).'.000000';
|
$length = sprintf('%02d', $duration['H']).':'.sprintf('%02d', $duration['i']).':'.sprintf('%02d', $duration['s']).'.000000';
|
||||||
}
|
}
|
||||||
foreach ($elemIds as $elemId) {
|
foreach ($elemIds as $elemId) {
|
||||||
$r = $this->Base->gb->addAudioClipToPlaylist($this->token, $elemId, $this->Base->sessid, $fadeIn, $fadeOut, $length, $pause);
|
$r = $this->Base->gb->addAudioClipToPlaylist($this->token, $elemId, $this->Base->sessid, $fadeIn, $fadeOut, $length, $clipstart, $clipend);
|
||||||
if (PEAR::isError($r)) {
|
if (PEAR::isError($r)) {
|
||||||
if (UI_VERBOSE === TRUE) {
|
if (UI_VERBOSE === TRUE) {
|
||||||
print_r($r);
|
print_r($r);
|
||||||
|
@ -572,27 +588,59 @@ class uiPlaylist
|
||||||
} // fn changeAllTransitionsForm
|
} // fn changeAllTransitionsForm
|
||||||
|
|
||||||
|
|
||||||
public function setItemPlaylengthForm($id, $elemId, $mask)
|
public function setClipLengthForm($id, $elemId, $mask)
|
||||||
{
|
{
|
||||||
if (isset($elemId)) {
|
if (isset($elemId)) {
|
||||||
$mask['act']['constant'] = 'PL.setItemPlaylength';
|
$mask['act']['constant'] = 'PL.setClipLength';
|
||||||
$mask['elemId']['constant'] = $elemId;
|
$mask['elemId']['constant'] = $elemId;
|
||||||
$element = $this->getCurrElement($elemId);
|
$element = $this->getCurrElement($elemId);
|
||||||
$mask['playlength']['default'] = substr($element['playlength'], 0, 8);
|
$playLegthS = Playlist::playlistTimeToSeconds($element['playlength']);
|
||||||
$mask['duration']['constant'] = substr($element['duration'], 0, 8);
|
$clipStartS = Playlist::playlistTimeToSeconds($element['attrs']['clipStart']);
|
||||||
|
$clipEndS = Playlist::playlistTimeToSeconds($element['attrs']['clipEnd']);
|
||||||
|
$mask['duration']['constant'] = round($playLegthS);
|
||||||
|
$mask['clipLength']['default'] = round($clipEndS - $clipStartS);
|
||||||
|
$mask['clipStart']['default'] = round($clipStartS);
|
||||||
|
$mask['clipEnd']['default'] = round($clipEndS);
|
||||||
|
for ($n=0; $n<=round($playLegthS); $n++) {
|
||||||
|
$options[$n] = date('i:s', $n);
|
||||||
|
}
|
||||||
|
$mask['clipStart']['options'] = $options;
|
||||||
|
$mask['clipLength']['options'] = $options;
|
||||||
|
$mask['clipEnd']['options'] = array_reverse(array_reverse($options), true);
|
||||||
} else {
|
} else {
|
||||||
$mask['act']['constant'] = 'PL.addItem';
|
$mask['act']['constant'] = 'PL.addItem';
|
||||||
$mask['id']['constant'] = $id;
|
$mask['id']['constant'] = $id;
|
||||||
$mask['playlength']['default'] = substr($this->Base->getMetadataValue($id, UI_MDATA_KEY_DURATION), 0, 8);
|
$mask['clipLength']['default'] = substr($this->Base->getMetadataValue($id, UI_MDATA_KEY_DURATION), 0, 8);
|
||||||
$mask['duration']['constant'] = $mask['playlength']['default'];
|
$mask['duration']['constant'] = $mask['playlength']['default'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$form = new HTML_QuickForm('PL_setItemPlaylengthForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
$form = new HTML_QuickForm('PL_setClipLengthForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||||
uiBase::parseArrayToForm($form, $mask);
|
uiBase::parseArrayToForm($form, $mask);
|
||||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||||
$form->accept($renderer);
|
$form->accept($renderer);
|
||||||
return $renderer->toArray();
|
return $renderer->toArray();
|
||||||
} // fn setItemPlaylengthForm
|
} // fn setClipLengthForm
|
||||||
|
|
||||||
|
function setClipLength($p_elemId, &$p_mask)
|
||||||
|
{
|
||||||
|
$form = new HTML_QuickForm('PL_setClipLengthForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||||
|
uiBase::parseArrayToForm($form, $p_mask);
|
||||||
|
|
||||||
|
if (!$form->validate()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$values = $form->exportValues();
|
||||||
|
$elem = $this->getCurrElement($values['elemId']);
|
||||||
|
if (!$elem) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$clipStart = GreenBox::secondsToPlaylistTime($values['clipStart']);
|
||||||
|
$clipEnd = GreenBox::secondsToPlaylistTime($values['clipEnd']);
|
||||||
|
|
||||||
|
$this->Base->gb->changeClipLength($this->token, $p_elemId, $clipStart, $clipEnd, $this->Base->sessid);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function metaDataForm($langid)
|
public function metaDataForm($langid)
|
||||||
|
|
|
@ -127,31 +127,11 @@ function S_getSecond($param)
|
||||||
*/
|
*/
|
||||||
function S_niceTime($param)
|
function S_niceTime($param)
|
||||||
{
|
{
|
||||||
extract($param);
|
require_once("../../../storageServer/var/Playlist.php");
|
||||||
|
|
||||||
if (strpos($in, '.')) {
|
$sec = round(Playlist::playlistTimeToSeconds($param['in']));
|
||||||
list ($in, $lost) = explode('.', $in);
|
$formatted = isset($param['all']) && $sec >= 3600 ? strftime('%H:%M:%S', $sec) : strftime(' %M:%S', $sec);
|
||||||
}
|
|
||||||
$in = str_replace(' ', '', $in);
|
return $formatted;
|
||||||
$h = 0;
|
|
||||||
$i = 0;
|
|
||||||
$s = 0;
|
|
||||||
if (preg_match('/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/', $in)) {
|
|
||||||
list($h, $i, $s) = explode(':', $in);
|
|
||||||
} elseif (preg_match('/^[0-9]{1,2}:[0-9]{1,2}$/', $in)) {
|
|
||||||
list($i, $s) = explode(':', $in);
|
|
||||||
} else {
|
|
||||||
$s = $in;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((isset($all) && $all) || ($h > 0) ) {
|
|
||||||
$H = sprintf('%02d', $h).':';
|
|
||||||
} else {
|
|
||||||
$H = ' ';
|
|
||||||
}
|
|
||||||
$I = sprintf('%02d', $i).':';
|
|
||||||
$S = sprintf('%02d', $s);
|
|
||||||
|
|
||||||
return $H.$I.$S;
|
|
||||||
} // fn S_niceTime
|
} // fn S_niceTime
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue