CC-5172 : errors from setting cues in waveform editor not handled properly
This commit is contained in:
parent
d82725cb54
commit
0bfcd32554
3 changed files with 34 additions and 2 deletions
|
@ -10,6 +10,10 @@ require_once 'formatters/LengthFormatter.php';
|
|||
*/
|
||||
class Application_Model_Playlist implements Application_Model_LibraryEditable
|
||||
{
|
||||
const CUE_ALL_ERROR = 0;
|
||||
const CUE_IN_ERROR = 1;
|
||||
const CUE_OUT_ERROR = 2;
|
||||
|
||||
/**
|
||||
* propel connection object.
|
||||
*/
|
||||
|
@ -792,6 +796,7 @@ SQL;
|
|||
try {
|
||||
if (is_null($cueIn) && is_null($cueOut)) {
|
||||
$errArray["error"] = _("Cue in and cue out are null.");
|
||||
$errArray["type"] = self::CUE_ALL_ERROR;
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
@ -822,6 +827,7 @@ SQL;
|
|||
$sql = "SELECT :cueIn::INTERVAL > :cueOut::INTERVAL";
|
||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':cueOut'=>$cueOut), 'column')) {
|
||||
$errArray["error"] = _("Can't set cue in to be larger than cue out.");
|
||||
$errArray["type"] = self::CUE_IN_ERROR;
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
@ -829,6 +835,7 @@ SQL;
|
|||
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
|
||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
|
||||
$errArray["error"] = _("Can't set cue out to be greater than file length.");
|
||||
$errArray["type"] = self::CUE_OUT_ERROR;
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
@ -845,6 +852,7 @@ SQL;
|
|||
$sql = "SELECT :cueIn::INTERVAL > :oldCueOut::INTERVAL";
|
||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':oldCueOut'=>$oldCueOut), 'column')) {
|
||||
$errArray["error"] = _("Can't set cue in to be larger than cue out.");
|
||||
$errArray["type"] = self::CUE_IN_ERROR;
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
@ -863,6 +871,7 @@ SQL;
|
|||
$sql = "SELECT :cueOut::INTERVAL < :oldCueIn::INTERVAL";
|
||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':oldCueIn'=>$oldCueIn), 'column')) {
|
||||
$errArray["error"] = _("Can't set cue out to be smaller than cue in.");
|
||||
$errArray["type"] = self::CUE_OUT_ERROR;
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
@ -870,6 +879,7 @@ SQL;
|
|||
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
|
||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
|
||||
$errArray["error"] = _("Can't set cue out to be greater than file length.");
|
||||
$errArray["type"] = self::CUE_OUT_ERROR;
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue