first version of playlist builder with cues/fades. need to do some work to display errors, look to see if I can position the cursor better on the contenteditable spans within the lis because jQuery sortable is interfering with normal operation. don't have a fade in/out for theplaylist overall yet.

This commit is contained in:
naomiaro 2011-02-07 18:44:42 -05:00
parent 84b8b6ffe3
commit 8f8c4716cc
11 changed files with 148 additions and 156 deletions

View file

@ -7,11 +7,6 @@ class PlaylistController extends Zend_Controller_Action
public function init()
{
if(!Zend_Auth::getInstance()->hasIdentity())
{
$this->_redirect('login/index');
}
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('add-item', 'json')
->addActionContext('delete-item', 'json')
@ -247,6 +242,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->pos = $pos;
$this->view->cueIn = $cues[0];
$this->view->cueOut = $cues[1];
$this->view->origLength = $cues[2];
$this->view->html = $this->view->render('playlist/set-cue.phtml');
}
@ -266,12 +262,12 @@ class PlaylistController extends Zend_Controller_Action
return;
}
$this->view->pos = $pos;
$this->view->pos = intval($pos);
$fades = $pl->getFadeInfo($pos);
$fades = $pl->getFadeInfo($pos+1);
$this->view->fadeIn = $fades[0];
$fades = $pl->getFadeInfo($pos-1);
$fades = $pl->getFadeInfo($pos);
$this->view->fadeOut = $fades[1];
$this->view->html = $this->view->render('playlist/set-fade.phtml');
}

View file

@ -582,8 +582,8 @@ class Playlist {
$sql = "SELECT INTERVAL '{$fadeIn}' > INTERVAL '{$clipLength}'";
$r = $con->query($sql);
if($r->fetchColumn(0)) {
$errArray["error"]="Fade In can't be larger than overall playlength.";
return $errArray;
//"Fade In can't be larger than overall playlength.";
$fadeIn = $clipLength;
}
$row->setDbFadein($fadeIn);
@ -593,8 +593,8 @@ class Playlist {
$sql = "SELECT INTERVAL '{$fadeOut}' > INTERVAL '{$clipLength}'";
$r = $con->query($sql);
if($r->fetchColumn(0)) {
$errArray["error"]="Fade Out can't be larger than overall playlength.";
return $errArray;
//Fade Out can't be larger than overall playlength.";
$fadeOut = $clipLength;
}
$row->setDbFadeout($fadeOut);
@ -613,10 +613,12 @@ class Playlist {
->filterByDbPosition($pos)
->findOne();
$file = $row->getCcFiles();
$origLength = $file->getDbLength();
$cueIn = $row->getDBCuein();
$cueOut = $row->getDbCueout();
return array($cueIn, $cueOut);
return array($cueIn, $cueOut, $origLength);
}
/**
@ -739,7 +741,6 @@ class Playlist {
$r = $con->query($sql);
if($r->fetchColumn(0)){
$fadeIn = $cliplength;
$row->setDbFadein($fadeIn);
}
@ -747,7 +748,6 @@ class Playlist {
$r = $con->query($sql);
if($r->fetchColumn(0)){
$fadeOut = $cliplength;
$row->setDbFadein($fadeOut);
}

View file

@ -10,16 +10,11 @@
<div class="clear"></div>
<div class="" style="clear:both; float:none; width:100%;">
<ul id="spl_sortable">
<?php if (count($this->pl->getContents())) : ?>
<?php echo $this->partialLoop('playlist/sidebarcontent.phtml', $this->pl->getContents()); ?>
<?php else : ?>
<li class="spl_empty">Empty playlist</li>
<?php endif; ?>
<ul id="spl_sortable">
<?php echo $this->render('playlist/update.phtml') ?>
</ul>
</div>
<div id="spl_error" class="ui-state-error ui-corner-all" style="display: none"></div>
<?php else : ?>
<div>No open playlist</div>
<?php endif; ?>

View file

@ -1,6 +1,14 @@
<dl id="spl_cue_editor" class="inline-list">
<dt>Cue In:</dt>
<dd id="spl_cue_in_<?php echo $this->pos; ?>"><span contenteditable="true" class="spl_text_input"><?php echo $this->cueIn; ?></span></dd>
<dd id="spl_cue_in_<?php echo $this->pos; ?>" class="spl_cue_in">
<span contenteditable="true" class="spl_text_input"><?php echo $this->cueIn; ?></span>
</dd>
<dd><span class="edit-error"></span></dd>
<dt>Cue Out:</dt>
<dd id="spl_cue_out_<?php echo $this->pos; ?>"><span contenteditable="true" class="spl_text_input"><?php echo $this->cueOut; ?></span></dd>
<dd id="spl_cue_out_<?php echo $this->pos; ?>" class="spl_cue_out">
<span contenteditable="true" class="spl_text_input"><?php echo $this->cueOut; ?></span>
</dd>
<dd><span class="edit-error"></span></dd>
<dt>Original Length:</dt>
<dd id="spl_original"><span><?php echo $this->origLength; ?></span></dd>
</dl>

View file

@ -1,6 +1,10 @@
<dl id="spl_editor" class="inline-list">
<dt>Fade out:</dt>
<dd id="spl_fade_out_<?php echo $this->pos -1; ?>"><span contenteditable="true" class="spl_text_input"><?php echo $this->fadeOut; ?></span></dd>
<dd id="spl_fade_out_<?php echo $this->pos; ?>" class="spl_fade_out">
<span contenteditable="true" class="spl_text_input"><?php echo $this->fadeOut; ?></span>
</dd>
<dt>Fade in:</dt>
<dd id="spl_fade_in_<?php echo $this->pos; ?>"><span contenteditable="true" class="spl_text_input"><?php echo $this->fadeIn; ?></span></dd>
<dd id="spl_fade_in_<?php echo $this->pos + 1; ?>" class="spl_fade_in">
<span contenteditable="true" class="spl_text_input"><?php echo $this->fadeIn; ?></span>
</dd>
</dl>

View file

@ -1,21 +0,0 @@
<?php if($this->partialCounter-1 > 0): ?>
<!--<li id="crossfade_<?php echo $this->partialCounter-2 ?>-<?php echo $this->partialCounter-1 ?>" class="crossfade" style="display: none"></li>-->
<?php endif; ?>
<li class="ui-state-default" id="spl_<?php echo $this->partialCounter-1 ?>">
<a href="javascript:void(0);" class="big_play" onclick="audioPreview('<?php echo $this->CcFiles["gunid"].".".pathinfo($this->CcFiles["name"], PATHINFO_EXTENSION);?>', 'spl_<?php echo $this->partialCounter-1 ?>')"><span class="ui-icon ui-icon-play"></span></a>
<div class="text-row top">
<span class="spl_playlength"><?php echo $this->cliplength ?></span>
<span class="spl_title"><?php echo $this->CcFiles['track_title'] ?></span>
</div>
<div class="text-row">
<span class="spl_artist"><?php echo $this->CcFiles['artist_name'] ?></span>
</div>
<?php if($this->partialCounter-1 > 0): ?>
<div id="fade_<?php echo $this->partialCounter-1 ?>" class="spl_fade_control ui-state-default"></div>
<?php endif; ?>
<span class="ui-icon ui-icon-closethick"></span>
</li>
<!-- <li id="cues_<?php echo $this->partialCounter-1 ?>" class="crossfade" style="display: none"></li> -->

View file

@ -1,5 +1,36 @@
<?php if (count($this->pl->getContents())) : ?>
<?php echo $this->partialLoop('playlist/sidebarcontent.phtml', $this->pl->getContents()); ?>
<?php $i = 0; ?>
<?php foreach($this->pl->getContents() as $item) : ?>
<li class="ui-state-default" id="spl_<?php echo $i ?>">
<div class="list-item-container">
<a href="javascript:void(0);" class="big_play"
onclick="audioPreview('<?php echo $item["CcFiles"]["gunid"].".".pathinfo($item["CcFiles"]["name"], PATHINFO_EXTENSION);?>',
'spl_<?php echo $i ?>')"><span class="ui-icon ui-icon-play"></span></a>
<div class="text-row top">
<span class="spl_playlength"><?php echo $item["cliplength"] ?></span>
<span class="spl_title"><?php echo $item["CcFiles"]['track_title'] ?></span>
</div>
<div class="text-row">
<span class="spl_artist"><?php echo $item["CcFiles"]['artist_name'] ?></span>
</div>
<?php if($i < count($this->pl->getContents()) -1): ?>
<div id="fade_<?php echo $i ?>" class="spl_fade_control ui-state-default"></div>
<?php endif; ?>
<span class="ui-icon ui-icon-closethick"></span>
</div>
<div id="cues_<?php echo $i ?>" class="cue-edit clearfix" style="display: none"></div>
<?php if($i < count($this->pl->getContents()) -1): ?>
<div id="crossfade_<?php echo $i ?>-<?php echo $i+1 ?>" class="crossfade clearfix" style="display: none"></div>
<?php endif; ?>
</li>
<?php $i = $i+1; ?>
<?php endforeach; ?>
<?php else : ?>
<li class="pl_empty">Empty playlist</li>
<li class="spl_empty">Empty playlist</li>
<?php endif; ?>