Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-08-13 14:58:20 -04:00
commit c3862d69e5
7 changed files with 73 additions and 40 deletions

View File

@ -270,7 +270,7 @@ class LibraryController extends Zend_Controller_Action
Logging::log($data['MDATA_KEY_FILEPATH']);
Application_Model_RabbitMq::SendMessageToMediaMonitor("md_update", $data);
$this->_redirect('playlist/index');
$this->_redirect('Playlist');
}
}

View File

@ -42,7 +42,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
"album_title" => "s",
"artist_name" => "s",
"bit_rate" => "n",
"bpm" => "n",
"bpm" => "s",
"comments" => "s",
"composer" => "s",
"conductor" => "s",

View File

@ -275,12 +275,24 @@ EOT;
if ($modifier == "items") {
$length = $value." ".$modifier;
} else {
$value = str_pad($value, 2, "0", STR_PAD_LEFT);
$hour = "00";
if ($modifier == "minutes") {
$length = "00:".$value.":00";
if ($value >59) {
$hour = intval($value/60);
$value = $value%60;
}
} else if ($modifier == "hours") {
$length = $value.":00:00";
$mins = $value * 60;
if ($mins >59) {
$hour = intval($mins/60);
$hour = str_pad($hour, 2, "0", STR_PAD_LEFT);
$value = $mins%60;
}
}
$hour = str_pad($hour, 2, "0", STR_PAD_LEFT);
$value = str_pad($value, 2, "0", STR_PAD_LEFT);
$length = $hour.":".$value.":00";
}
return $length;
}
@ -1301,9 +1313,20 @@ EOT;
foreach ($crit as $criteria) {
$spCriteriaPhpName = self::$criteria2PeerMap[$criteria['criteria']];
$spCriteria = $criteria['criteria'];
$spCriteriaModifier = $criteria['modifier'];
$spCriteriaValue = $criteria['value'];
$column = CcFilesPeer::getTableMap()->getColumnByPhpName(self::$criteria2PeerMap[$spCriteria]);
// if the column is timestamp, convert it into UTC
if ($column->getType() == PropelColumnTypes::TIMESTAMP) {
$spCriteriaValue = Application_Common_DateHelper::ConvertToUtcDateTimeString($criteria['value']);
} else if($spCriteria == "bit_rate") {
// multiply 1000 because we store only number value
// e.g 192kps is stored as 192000
$spCriteriaValue = $criteria['value']*1000;
} else {
$spCriteriaValue = $criteria['value'];
}
if ($spCriteriaModifier == "starts with") {
$spCriteriaValue = "$spCriteriaValue%";
} else if ($spCriteriaModifier == "ends with") {

View File

@ -38,7 +38,7 @@ if (isset($this->obj)) {
<?php //echo $this->form; ?>
<div id="crossfade_main" class="crossfade-main clearfix" style="display:none;">
<span class="ui-icon ui-icon-closethick"></span>
<span class="ui-icon ui-icon-closethick sp-closethick-center"></span>
<dl id="spl_editor-main" class="inline-list">
<dt>Fade in (s):</dt>
<dd><span contenteditable="true" class="spl_text_input spl_main_fade_in">00</span></dd>

View File

@ -67,6 +67,10 @@
margin-top: 7px;
}
.sp-closethick-center {
margin-top: auto !important;
}
.spl_title {
font-size:14px;
}

View File

@ -61,18 +61,15 @@ var AIRTIME = (function(AIRTIME){
.hide();
}
function changeCueIn(event) {
event.stopPropagation();
var span = $(this),
id = span.parent().attr("id").split("_").pop(),
url = "/Playlist/set-cue",
cueIn = $.trim(span.text()),
li = span.parents("li"),
unqid = li.attr("unqid"),
lastMod = getModified(),
type = $('#obj_type').val();
function changeCueIn(span) {
var id = span.parent().attr("id").split("_").pop(),
url = "/Playlist/set-cue",
cueIn = $.trim(span.text()),
li = span.parents("li"),
unqid = li.attr("unqid"),
lastMod = getModified(),
type = $('#obj_type').val();
if (!isTimeValid(cueIn)){
showError(span, "please put in a time '00:00:00 (.000000)'");
return;
@ -100,16 +97,13 @@ var AIRTIME = (function(AIRTIME){
});
}
function changeCueOut(event) {
event.stopPropagation();
var span = $(this),
id = span.parent().attr("id").split("_").pop(),
url = "/Playlist/set-cue",
cueOut = $.trim(span.text()),
li = span.parents("li"),
unqid = li.attr("unqid"),
lastMod = getModified(),
function changeCueOut(span) {
var id = span.parent().attr("id").split("_").pop(),
url = "/Playlist/set-cue",
cueOut = $.trim(span.text()),
li = span.parents("li"),
unqid = li.attr("unqid"),
lastMod = getModified(),
type = $('#obj_type').val();
if (!isTimeValid(cueOut)){
@ -140,7 +134,7 @@ var AIRTIME = (function(AIRTIME){
}
function changeFadeIn(event) {
event.stopPropagation();
event.preventDefault();
var span = $(this),
id = span.parent().attr("id").split("_").pop(),
@ -406,14 +400,26 @@ var AIRTIME = (function(AIRTIME){
//sets events dynamically for the cue editor.
function setCueEvents() {
$pl.delegate(".spl_cue_in span",
{"focusout": changeCueIn,
"keydown": submitOnEnter});
$pl.delegate(".spl_cue_out span",
{"focusout": changeCueOut,
"keydown": submitOnEnter});
$('.spl_cue_in span').blur(function(e){
e.stopPropagation();
changeCueIn($(this));
});
$('.spl_cue_in span').keydown(function(e){
e.stopPropagation();
submitOnEnter(e);
});
$('.spl_cue_out span').blur(function(e){
e.stopPropagation();
changeCueOut($(this));
});
$('.spl_cue_out span').keydown(function(e){
e.stopPropagation();
submitOnEnter(e);
});
}
//sets events dynamically for the fade editor.

View File

@ -568,7 +568,7 @@ var criteriaTypes = {
"album_title" : "s",
"artist_name" : "s",
"bit_rate" : "n",
"bpm" : "n",
"bpm" : "s",
"comments" : "s",
"composer" : "s",
"conductor" : "s",