From 649f62e058fd98e1655dd640b6c44ce9bbf24767 Mon Sep 17 00:00:00 2001 From: sebastian Date: Mon, 22 Mar 2010 15:23:30 +0000 Subject: [PATCH] #2358 Update HTML UI playlist editor to include cue in/cue out functionality --- .../htmlUI/var/formmask/generic.inc.php | 41 ++++++++-- .../modules/htmlUI/var/html/ui_browser.php | 6 +- .../modules/htmlUI/var/html/ui_handler.php | 4 +- .../src/modules/htmlUI/var/templates/menu.tpl | 2 +- .../var/templates/playlist/actionhandler.tpl | 6 +- .../htmlUI/var/templates/playlist/editor.tpl | 16 +++- .../htmlUI/var/templates/playlist/main.tpl | 2 +- .../popup/PLAYLIST.setClipLength.tpl | 43 +++++++++++ .../popup/PLAYLIST.setItemPlaylength.tpl | 45 ----------- .../var/templates/script/contextmenu.js.tpl | 8 +- .../modules/htmlUI/var/ui_playlist.class.php | 74 +++++++++++++++---- .../htmlUI/var/ui_smartyExtensions.inc.php | 32 ++------ 12 files changed, 169 insertions(+), 110 deletions(-) create mode 100644 campcaster/src/modules/htmlUI/var/templates/popup/PLAYLIST.setClipLength.tpl delete mode 100644 campcaster/src/modules/htmlUI/var/templates/popup/PLAYLIST.setItemPlaylength.tpl diff --git a/campcaster/src/modules/htmlUI/var/formmask/generic.inc.php b/campcaster/src/modules/htmlUI/var/formmask/generic.inc.php index 975bce456..23c43151a 100644 --- a/campcaster/src/modules/htmlUI/var/formmask/generic.inc.php +++ b/campcaster/src/modules/htmlUI/var/formmask/generic.inc.php @@ -653,7 +653,7 @@ $ui_fmask = array( ) ) ), - 'PL.setItemPlaylength' => array( + 'PL.setClipLength' => array( 'act' => array( 'element' => 'act', 'type' => 'hidden', @@ -670,11 +670,37 @@ $ui_fmask = array( 'element' => 'duration', 'type' => 'hidden' ), - 'playlength' => array( - 'element' => 'playlength', - 'type' => 'date', - 'label' => 'Playlength', - 'options' => array('format' => 'His'), + 'clipStart' => array( + 'element' => 'clipStart', + 'type' => 'select', + 'label' => 'Cue in: ', + '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' => '

' ), array( 'element' => 'cancel', @@ -691,9 +717,8 @@ $ui_fmask = array( ), array( 'element' => 'submitter', - 'type' => 'button', + 'type' => 'submit', 'label' => 'Submit', - 'attributes'=> array('onClick' => 'PL_checkItemPlaylength()'), 'groupit' => TRUE ), array( diff --git a/campcaster/src/modules/htmlUI/var/html/ui_browser.php b/campcaster/src/modules/htmlUI/var/html/ui_browser.php index 243308581..44e883e54 100644 --- a/campcaster/src/modules/htmlUI/var/html/ui_browser.php +++ b/campcaster/src/modules/htmlUI/var/html/ui_browser.php @@ -116,9 +116,9 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){ $Smarty->display('popup/PLAYLIST.arrangeItems.tpl'); break; - case "PL.setItemPlaylengthForm": - $Smarty->assign('dynform', $uiBrowser->PLAYLIST->setItemPlaylengthForm($_REQUEST['id'], $_REQUEST['elemId'], $ui_fmask['PL.setItemPlaylength'])); - $Smarty->display('popup/PLAYLIST.setItemPlaylength.tpl'); + case "PL.setClipLength": + $Smarty->assign('dynform', $uiBrowser->PLAYLIST->setClipLengthForm($_REQUEST['id'], $_REQUEST['elemId'], $ui_fmask['PL.setClipLength'])); + $Smarty->display('popup/PLAYLIST.setClipLength.tpl'); break; case "PL.export": diff --git a/campcaster/src/modules/htmlUI/var/html/ui_handler.php b/campcaster/src/modules/htmlUI/var/html/ui_handler.php index 346509d75..9e6978ba7 100644 --- a/campcaster/src/modules/htmlUI/var/html/ui_handler.php +++ b/campcaster/src/modules/htmlUI/var/html/ui_handler.php @@ -273,8 +273,8 @@ switch ($_REQUEST['act']) { $uiHandler->PLAYLIST->setReload(); break; - case "PL.setItemPlaylength": - $uiHandler->PLAYLIST->setItemPlaylength($_REQUEST['elemId'], $_REQUEST['playlength']); + case "PL.setClipLength": + $uiHandler->PLAYLIST->setClipLength($_REQUEST['elemId'], $ui_fmask['PL.setClipLength']); $uiHandler->PLAYLIST->setReload(); break; diff --git a/campcaster/src/modules/htmlUI/var/templates/menu.tpl b/campcaster/src/modules/htmlUI/var/templates/menu.tpl index 49dfabc1d..841edf697 100644 --- a/campcaster/src/modules/htmlUI/var/templates/menu.tpl +++ b/campcaster/src/modules/htmlUI/var/templates/menu.tpl @@ -39,7 +39,7 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
  • ##Edit Playlist##
  • {else} {if $PL->reportLookedPL()} -
  • ##Open last Playlist##
  • +
  • ##Reopen Playlist##
  • {else}
  • ##New empty Playlist##
  • {/if} diff --git a/campcaster/src/modules/htmlUI/var/templates/playlist/actionhandler.tpl b/campcaster/src/modules/htmlUI/var/templates/playlist/actionhandler.tpl index 09b2216ee..99c71bddb 100644 --- a/campcaster/src/modules/htmlUI/var/templates/playlist/actionhandler.tpl +++ b/campcaster/src/modules/htmlUI/var/templates/playlist/actionhandler.tpl @@ -2,13 +2,11 @@ style="cursor: pointer" onClick="return contextmenu('{$i.attrs.id}', {if $i.type|lower == 'webstream'} - 'listen', '{$i.gunid}', - {* 'PL.changeItemPlaylength', *} + 'listen', '{$i.gunid}', 'PL.setCliplength', {/if} {if $i.type|lower == 'audioclip'} - 'listen', '{$i.gunid}', - {* 'PL.changeItemPlaylength', *} + 'listen', '{$i.gunid}', 'PL.setCliplength', {/if} 'PL.removeItem' diff --git a/campcaster/src/modules/htmlUI/var/templates/playlist/editor.tpl b/campcaster/src/modules/htmlUI/var/templates/playlist/editor.tpl index 5fb4ddb79..1563ca095 100644 --- a/campcaster/src/modules/htmlUI/var/templates/playlist/editor.tpl +++ b/campcaster/src/modules/htmlUI/var/templates/playlist/editor.tpl @@ -18,7 +18,8 @@ ##Title## - ##Duration## + ##Clip length## + ##Original## ##Artist## ##Type## ##Move## @@ -26,14 +27,20 @@ {foreach from=$PL->getFlat($PL->activeId) key='pos' item='i'} + {* ##Fade## {$i.fadein_ms|string_format:"%d"} ms + + *} {$i.title} + + {assign var="_playlength" value=$i.attrs.clipLength}{niceTime in=$_playlength} + {assign var="_duration" value=$i.playlength}{niceTime in=$_duration} @@ -48,14 +55,17 @@ {/foreach} {if isset($pos)} + {* ##Fade## {$i.fadeout_ms|string_format:"%d"} ms + + *} {else} - ##No Entry## + ##Empty playlist## {/if} @@ -63,7 +73,7 @@ diff --git a/campcaster/src/modules/htmlUI/var/templates/playlist/main.tpl b/campcaster/src/modules/htmlUI/var/templates/playlist/main.tpl index b124034ff..f94bdc003 100644 --- a/campcaster/src/modules/htmlUI/var/templates/playlist/main.tpl +++ b/campcaster/src/modules/htmlUI/var/templates/playlist/main.tpl @@ -14,7 +14,7 @@

    ##Playlist Editor##

     

    {if $PL->reportLookedPL()} - + {else} {/if} diff --git a/campcaster/src/modules/htmlUI/var/templates/popup/PLAYLIST.setClipLength.tpl b/campcaster/src/modules/htmlUI/var/templates/popup/PLAYLIST.setClipLength.tpl new file mode 100644 index 000000000..19c5d7ae0 --- /dev/null +++ b/campcaster/src/modules/htmlUI/var/templates/popup/PLAYLIST.setClipLength.tpl @@ -0,0 +1,43 @@ +{include file="popup/header.tpl"} + + + + + + + +
    +
    + + +
    + {include file="sub/dynForm_plain.tpl} +
    +
    +
    + + + + + + diff --git a/campcaster/src/modules/htmlUI/var/templates/popup/PLAYLIST.setItemPlaylength.tpl b/campcaster/src/modules/htmlUI/var/templates/popup/PLAYLIST.setItemPlaylength.tpl deleted file mode 100644 index 6e7feae32..000000000 --- a/campcaster/src/modules/htmlUI/var/templates/popup/PLAYLIST.setItemPlaylength.tpl +++ /dev/null @@ -1,45 +0,0 @@ -{include file="popup/header.tpl"} - - - - - - - -
    -
    - - -
    - {include file="sub/dynForm_plain.tpl} -
    -
    -
    - - - - - - diff --git a/campcaster/src/modules/htmlUI/var/templates/script/contextmenu.js.tpl b/campcaster/src/modules/htmlUI/var/templates/script/contextmenu.js.tpl index 0268e5d67..77cda9cdc 100644 --- a/campcaster/src/modules/htmlUI/var/templates/script/contextmenu.js.tpl +++ b/campcaster/src/modules/htmlUI/var/templates/script/contextmenu.js.tpl @@ -1,6 +1,6 @@ {literal}