CC-2065: Fade times longer than Airtime supports can be set in Playlist Builder and Preferences
- didn't change much fixed two bugs and changed formating. - I introduced a but in Playlist.changeFadeInfo because for the general playlist fade in and out I didn't realize that these values are being set to the first and last elements. So I added a guard. - I also updated the logic for Playlist.moveAudioClip so if new and old position are the same we just return
This commit is contained in:
parent
7317b1d5af
commit
d6bf95500c
|
@ -165,6 +165,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$oldPos = $this->_getParam('oldPos');
|
$oldPos = $this->_getParam('oldPos');
|
||||||
$newPos = $this->_getParam('newPos');
|
$newPos = $this->_getParam('newPos');
|
||||||
|
|
||||||
|
|
||||||
$pl = $this->getPlaylist();
|
$pl = $this->getPlaylist();
|
||||||
if($pl === false){
|
if($pl === false){
|
||||||
$this->view->playlist_error = true;
|
$this->view->playlist_error = true;
|
||||||
|
@ -296,6 +297,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
$pos = $this->_getParam('pos');
|
$pos = $this->_getParam('pos');
|
||||||
$pl = $this->getPlaylist();
|
$pl = $this->getPlaylist();
|
||||||
|
|
||||||
if($pl === false){
|
if($pl === false){
|
||||||
$this->view->playlist_error = true;
|
$this->view->playlist_error = true;
|
||||||
return false;
|
return false;
|
||||||
|
@ -305,7 +307,6 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$fadeOut = $this->_getParam('fadeOut', null);
|
$fadeOut = $this->_getParam('fadeOut', null);
|
||||||
|
|
||||||
$response = $pl->changeFadeInfo($pos, $fadeIn, $fadeOut);
|
$response = $pl->changeFadeInfo($pos, $fadeIn, $fadeOut);
|
||||||
|
|
||||||
$this->view->response = $response;
|
$this->view->response = $response;
|
||||||
|
|
||||||
if(!isset($response["error"])) {
|
if(!isset($response["error"])) {
|
||||||
|
@ -369,6 +370,11 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The playlist fades are stored in the elements themselves.
|
||||||
|
* The fade in is set to the first elements fade in and
|
||||||
|
* the fade out is set to the last elments fade out.
|
||||||
|
**/
|
||||||
public function setPlaylistFadesAction()
|
public function setPlaylistFadesAction()
|
||||||
{
|
{
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
@ -388,6 +394,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$response = $pl->changeFadeInfo($pl->getSize(), $fadeIn, $fadeOut);
|
$response = $pl->changeFadeInfo($pl->getSize(), $fadeIn, $fadeOut);
|
||||||
|
|
||||||
$this->view->response = $response;
|
$this->view->response = $response;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,6 @@ class Application_Model_Playlist {
|
||||||
|
|
||||||
if($pl === NULL)
|
if($pl === NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
$pl->setDbDescription($p_description);
|
$pl->setDbDescription($p_description);
|
||||||
$pl->setDbMtime(new DateTime("now"), new DateTimeZone("UTC"));
|
$pl->setDbMtime(new DateTime("now"), new DateTimeZone("UTC"));
|
||||||
$pl->save();
|
$pl->save();
|
||||||
|
@ -428,6 +427,7 @@ class Application_Model_Playlist {
|
||||||
* will normalize the fade so that it looks like 00.000000 to the user.
|
* will normalize the fade so that it looks like 00.000000 to the user.
|
||||||
**/
|
**/
|
||||||
public function normalizeFade($fade) {
|
public function normalizeFade($fade) {
|
||||||
|
|
||||||
//First get rid of the first six characters 00:00: which will be added back later for db update
|
//First get rid of the first six characters 00:00: which will be added back later for db update
|
||||||
$fade = substr($fade, 6);
|
$fade = substr($fade, 6);
|
||||||
|
|
||||||
|
@ -438,6 +438,7 @@ class Application_Model_Playlist {
|
||||||
else
|
else
|
||||||
while( strlen( $fade ) < 9 )
|
while( strlen( $fade ) < 9 )
|
||||||
$fade .= '0';
|
$fade .= '0';
|
||||||
|
|
||||||
//done, just need to set back the formated values
|
//done, just need to set back the formated values
|
||||||
return $fade;
|
return $fade;
|
||||||
}
|
}
|
||||||
|
@ -610,7 +611,7 @@ class Application_Model_Playlist {
|
||||||
*/
|
*/
|
||||||
public function moveAudioClip($oldPos, $newPos)
|
public function moveAudioClip($oldPos, $newPos)
|
||||||
{
|
{
|
||||||
if($newPos < 0 || $newPos >= $this->getNextPos() || $oldPos < 0 || $oldPos >= $this->getNextPos())
|
if($newPos < 0 || $newPos >= $this->getNextPos() || $oldPos < 0 || $oldPos >= $this->getNextPos() || $oldPos === $newPos)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
$row = $this->delAudioClip($oldPos);
|
$row = $this->delAudioClip($oldPos);
|
||||||
|
@ -636,15 +637,11 @@ class Application_Model_Playlist {
|
||||||
->filterByDbPosition($pos)
|
->filterByDbPosition($pos)
|
||||||
->findOne();
|
->findOne();
|
||||||
|
|
||||||
$fadeIn = $row->getDbFadein();
|
|
||||||
$fadeOut = $row->getDbFadeout();
|
|
||||||
|
|
||||||
#For issue CC-2065, fade in and out values are for the Playlist itself and must be
|
#For issue CC-2065, fade in and out values are for the Playlist itself and must be
|
||||||
#modified from the db default format of 00:00:00 to the more practical
|
#modified from the db default format of 00:00:00 to the more practical
|
||||||
#00.000000 format which is for only seconds.
|
#00.000000 format which is for only seconds.
|
||||||
$fadeIn = $this->normalizeFade($fadeIn);
|
$fadeIn = $this->normalizeFade($row->getDbFadein());
|
||||||
$fadeOut = $this->normalizeFade($fadeOut);
|
$fadeOut = $this->normalizeFade($row->getDbFadeout());
|
||||||
|
|
||||||
return array($fadeIn, $fadeOut);
|
return array($fadeIn, $fadeOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -661,9 +658,11 @@ class Application_Model_Playlist {
|
||||||
*/
|
*/
|
||||||
public function changeFadeInfo($pos, $fadeIn, $fadeOut)
|
public function changeFadeInfo($pos, $fadeIn, $fadeOut)
|
||||||
{
|
{
|
||||||
#See issue CC-2065, pad the fadeIn and fadeOut so that it is TIME compatable with the DB schema
|
//See issue CC-2065, pad the fadeIn and fadeOut so that it is TIME compatable with the DB schema
|
||||||
$fadeIn = '00:00:'.$fadeIn;
|
//For the top level PlayList either fadeIn or fadeOut will sometimes be Null so need a gaurd against
|
||||||
$fadeOut = '00:00:'.$fadeOut;
|
//setting it to nonNull for checks down below
|
||||||
|
$fadeIn = $fadeIn?'00:00:'.$fadeIn:$fadeIn;
|
||||||
|
$fadeOut = $fadeOut?'00:00:'.$fadeOut:$fadeOut;
|
||||||
|
|
||||||
$errArray= array();
|
$errArray= array();
|
||||||
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME);
|
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME);
|
||||||
|
|
Loading…
Reference in New Issue