can get cues/fades to display in new playlist builder.

cannot change them yet.
This commit is contained in:
naomiaro 2011-01-16 19:31:10 -05:00
parent 3674989461
commit 8887ce24d1
6 changed files with 97 additions and 14 deletions

View file

@ -229,27 +229,47 @@ class PlaylistController extends Zend_Controller_Action
public function setCueAction()
{
$request = $this->getRequest();
$pos = $this->_getParam('pos');
$cueIn = $this->_getParam('cueIn', null);
$cueOut = $this->_getParam('cueOut', null);
$pl = $this->getPlaylist();
$response = $pl->changeClipLength($pos, $cueIn, $cueOut);
die(json_encode($response));
if($request->isPost()) {
$cueIn = $this->_getParam('cueIn', null);
$cueOut = $this->_getParam('cueOut', null);
$response = $pl->changeClipLength($pos, $cueIn, $cueOut);
die(json_encode($response));
}
$cues = $pl->getCueInfo($pos);
$this->view->cueIn = $cues[0];
$this->view->cueOut = $cues[1];
$this->view->html = $this->view->render('playlist/set-cue.phtml');
}
public function setFadeAction()
{
$request = $this->getRequest();
$pos = $this->_getParam('pos');
$fadeIn = $this->_getParam('fadeIn', null);
$fadeOut = $this->_getParam('fadeOut', null);
$pl = $this->getPlaylist();
$response = $pl->changeFadeInfo($pos, $fadeIn, $fadeOut);
die(json_encode($response));
if($request->isPost()) {
$fadeIn = $this->_getParam('fadeIn', null);
$fadeOut = $this->_getParam('fadeOut', null);
$response = $pl->changeFadeInfo($pos, $fadeIn, $fadeOut);
die(json_encode($response));
}
$fades = $pl->getFadeInfo($pos);
$this->view->fadeIn = $fades[0];
$fades = $pl->getFadeInfo($pos-1);
$this->view->fadeOut = $fades[1];
$this->view->html = $this->view->render('playlist/set-fade.phtml');
}
public function deleteAction()

View file

@ -600,6 +600,19 @@ class Playlist {
return TRUE;
}
public function getFadeInfo($pos) {
$row = CcPlaylistcontentsQuery::create()
->joinWith(CcFilesPeer::OM_CLASS)
->filterByDbPlaylistId($this->id)
->filterByDbPosition($pos)
->findOne();
$fadeIn = $row->getDbFadein();
$fadeOut = $row->getDbFadeout();
return array($fadeIn, $fadeOut);
}
/**
* Change fadeIn and fadeOut values for playlist Element
@ -657,6 +670,20 @@ class Playlist {
return array("fadeIn"=>$fadeIn, "fadeOut"=>$fadeOut);
}
public function getCueInfo($pos) {
$row = CcPlaylistcontentsQuery::create()
->joinWith(CcFilesPeer::OM_CLASS)
->filterByDbPlaylistId($this->id)
->filterByDbPosition($pos)
->findOne();
$cueIn = $row->getDBCuein();
$cueOut = $row->getDbCueout();
return array($cueIn, $cueOut);
}
/**
* Change cueIn/cueOut values for playlist element
*

View file

@ -15,7 +15,7 @@
<li class="spl_empty">Empty playlist</li>
<?php endif; ?>
</ul>
<div id="spl_cue_edit"></div>
<div id="spl_editor"></div>
<?php else : ?>
<div>No open playlist</div>
<?php endif; ?>

View file

@ -1 +1,8 @@
<br /><br /><center>View script for controller <b>Playlist</b> and script/action name <b>setCue</b></center>
<div class="spl_cue_in">
<span>Cue In:</span>
<span><?php echo $this->cueIn; ?></span>
</div>
<div class="spl_cue_out">
<span>Cue Out:</span>
<span><?php echo $this->cueOut; ?></span>
</div>

View file

@ -1 +1,8 @@
<br /><br /><center>View script for controller <b>Playlist</b> and script/action name <b>setFade</b></center>
<div class="spl_fade_out">
<span>Fade Out:</span>
<span><?php echo $this->fadeOut; ?></span>
</div>
<div class="spl_fade_in">
<span>Fade In:</span>
<span><?php echo $this->fadeIn; ?></span>
</div>

View file

@ -2,6 +2,12 @@
//Side Playlist Functions
//--------------------------------------------------------------------------------------------------------------------------------
function setEditorContent(json) {
$("#spl_editor")
.empty()
.append(json.html);
}
function highlightActive(el) {
$("#spl_sortable")
.find(".ui-state-active")
@ -13,13 +19,29 @@ function highlightActive(el) {
function openFadeEditor(event) {
event.stopPropagation();
var pos, url;
pos = $(this).attr("id").split("_").pop();
url = '/Playlist/set-fade/format/json';
url = url + '/pos/' + pos;
highlightActive(this);
$.get(url, setEditorContent);
}
function openCueEditor(event) {
event.stopPropagation();
var pos, url;
pos = $(this).attr("id").split("_").pop();
url = '/Playlist/set-cue/format/json';
url = url + '/pos/' + pos;
highlightActive(this);
$.get(url, setEditorContent);
}
function setSPLContent(json) {