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

This commit is contained in:
Martin Konecny 2012-09-18 12:41:30 -04:00
commit 09bc686d99
12 changed files with 132 additions and 93 deletions

View File

@ -21,9 +21,9 @@ class AudiopreviewController extends Zend_Controller_Action
{ {
global $CC_CONFIG; global $CC_CONFIG;
$audioFileID = $this->_getParam('audioFileID'); $audioFileID = $this->_getParam('audioFileID');
$audioFileArtist = $this->_getParam('audioFileArtist'); $audioFileArtist = $this->_getParam('audioFileArtist');
$audioFileTitle = $this->_getParam('audioFileTitle'); $audioFileTitle = $this->_getParam('audioFileTitle');
$type = $this->_getParam('type'); $type = $this->_getParam('type');
$request = $this->getRequest(); $request = $this->getRequest();
@ -47,23 +47,23 @@ class AudiopreviewController extends Zend_Controller_Action
} }
if ($type == "audioclip") { if ($type == "audioclip") {
$uri = "/api/get-media/file/".$audioFileID; $uri = "/api/get-media/file/".$audioFileID;
$media = Application_Model_StoredFile::Recall($audioFileID); $media = Application_Model_StoredFile::Recall($audioFileID);
$mime = $media->getPropelOrm()->getDbMime(); $mime = $media->getPropelOrm()->getDbMime();
} elseif ($type == "stream") { } elseif ($type == "stream") {
$webstream = CcWebstreamQuery::create()->findPk($audioFileID); $webstream = CcWebstreamQuery::create()->findPk($audioFileID);
$uri = $webstream->getDbUrl(); $uri = $webstream->getDbUrl();
$mime = $webstream->getDbMime(); $mime = $webstream->getDbMime();
} else { } else {
throw new Exception("Unknown type for audio preview!"); throw new Exception("Unknown type for audio preview!.Type=$type");
} }
$this->view->uri = $uri; $this->view->uri = $uri;
$this->view->mime = $mime; $this->view->mime = $mime;
$this->view->audioFileID = $audioFileID; $this->view->audioFileID = $audioFileID;
$this->view->audioFileArtist = $audioFileArtist; $this->view->audioFileArtist = $audioFileArtist;
$this->view->audioFileTitle = $audioFileTitle; $this->view->audioFileTitle = $audioFileTitle;
$this->view->type = $type; $this->view->type = $type;
$this->_helper->viewRenderer->setRender('audio-preview'); $this->_helper->viewRenderer->setRender('audio-preview');
} }

View File

@ -825,13 +825,11 @@ class ScheduleController extends Zend_Controller_Action
$this->view->newForm = $this->view->render( $this->view->newForm = $this->view->render(
'schedule/add-show-form.phtml'); 'schedule/add-show-form.phtml');
Logging::debug("Show creation succeeded"); Logging::debug("Show creation succeeded");
Logging::debug_sparse( $data );
} else { } else {
$this->view->addNewShow = true; $this->view->addNewShow = true;
$this->view->form = $this->view->render( $this->view->form = $this->view->render(
'schedule/add-show-form.phtml'); 'schedule/add-show-form.phtml');
Logging::debug("Show creation failed"); Logging::debug("Show creation failed");
Logging::debug_sparse( $data );
} }
} }
@ -872,8 +870,6 @@ class ScheduleController extends Zend_Controller_Action
} catch (Exception $e) { } catch (Exception $e) {
$this->view->error = $e->getMessage(); $this->view->error = $e->getMessage();
Logging::info($e->getMessage()); Logging::info($e->getMessage());
Logging::info("{$e->getFile()}");
Logging::info("{$e->getLine()}");
} }
} }
} }

View File

@ -229,45 +229,42 @@ class ShowbuilderController extends Zend_Controller_Action
public function checkBuilderFeedAction() public function checkBuilderFeedAction()
{ {
$request = $this->getRequest(); $request = $this->getRequest();
$current_time = time(); $current_time = time();
$starts_epoch = $request->getParam("start", $current_time); $starts_epoch = $request->getParam("start", $current_time);
//default ends is 24 hours after starts. //default ends is 24 hours after starts.
$ends_epoch = $request->getParam("end", $current_time + (60*60*24)); $ends_epoch = $request->getParam("end", $current_time + (60*60*24));
$show_filter = intval($request->getParam("showFilter", 0)); $show_filter = intval($request->getParam("showFilter", 0));
$my_shows = intval($request->getParam("myShows", 0)); $my_shows = intval($request->getParam("myShows", 0));
$timestamp = intval($request->getParam("timestamp", -1)); $timestamp = intval($request->getParam("timestamp", -1));
$instances = $request->getParam("instances", array()); $instances = $request->getParam("instances", array());
$startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC")); $startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC"));
$endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC")); $endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC"));
$opts = array("myShows" => $my_shows, "showFilter" => $show_filter); $opts = array("myShows" => $my_shows, "showFilter" => $show_filter);
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts); $showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
//only send the schedule back if updates have been made. //only send the schedule back if updates have been made.
// -1 default will always call the schedule to be sent back if no timestamp is defined. // -1 default will always call the schedule to be sent back if no timestamp is defined.
if ($showBuilder->hasBeenUpdatedSince($timestamp, $instances)) { $this->view->update = $showBuilder->hasBeenUpdatedSince(
$this->view->update = true; $timestamp, $instances);
} else {
$this->view->update = false;
}
} }
public function builderFeedAction() public function builderFeedAction()
{ {
$request = $this->getRequest(); $request = $this->getRequest();
$current_time = time(); $current_time = time();
$starts_epoch = $request->getParam("start", $current_time); $starts_epoch = $request->getParam("start", $current_time);
//default ends is 24 hours after starts. //default ends is 24 hours after starts.
$ends_epoch = $request->getParam("end", $current_time + (60*60*24)); $ends_epoch = $request->getParam("end", $current_time + (60*60*24));
$show_filter = intval($request->getParam("showFilter", 0)); $show_filter = intval($request->getParam("showFilter", 0));
$my_shows = intval($request->getParam("myShows", 0)); $my_shows = intval($request->getParam("myShows", 0));
$startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC")); $startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC"));
$endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC")); $endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC"));
$opts = array("myShows" => $my_shows, "showFilter" => $show_filter); $opts = array("myShows" => $my_shows, "showFilter" => $show_filter);
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts); $showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
@ -290,13 +287,9 @@ class ShowbuilderController extends Zend_Controller_Action
} catch (OutDatedScheduleException $e) { } catch (OutDatedScheduleException $e) {
$this->view->error = $e->getMessage(); $this->view->error = $e->getMessage();
Logging::info($e->getMessage()); Logging::info($e->getMessage());
Logging::info("{$e->getFile()}");
Logging::info("{$e->getLine()}");
} catch (Exception $e) { } catch (Exception $e) {
$this->view->error = $e->getMessage(); $this->view->error = $e->getMessage();
Logging::info($e->getMessage()); Logging::info($e->getMessage());
Logging::info("{$e->getFile()}");
Logging::info("{$e->getLine()}");
} }
} }

View File

@ -133,7 +133,8 @@ class Application_Model_ShowBuilder
*/ */
private function getScheduledStatus($p_epochItemStart, $p_epochItemEnd, &$row) private function getScheduledStatus($p_epochItemStart, $p_epochItemEnd, &$row)
{ {
if ($row["footer"] === true && $this->epoch_now > $p_epochItemStart && $this->epoch_now > $p_epochItemEnd) { if ($row["footer"] === true && $this->epoch_now > $p_epochItemStart &&
$this->epoch_now > $p_epochItemEnd) {
$row["scheduled"] = 0; $row["scheduled"] = 0;
} elseif ($row["footer"] === true && $this->epoch_now < $p_epochItemEnd) { } elseif ($row["footer"] === true && $this->epoch_now < $p_epochItemEnd) {
$row["scheduled"] = 2; $row["scheduled"] = 2;
@ -179,7 +180,7 @@ class Application_Model_ShowBuilder
$showStartDT = new DateTime($p_item["si_starts"], new DateTimeZone("UTC")); $showStartDT = new DateTime($p_item["si_starts"], new DateTimeZone("UTC"));
$showStartDT->setTimezone(new DateTimeZone($this->timezone)); $showStartDT->setTimezone(new DateTimeZone($this->timezone));
$startsEpoch = floatval($showStartDT->format("U.u")); $startsEpoch = floatval($showStartDT->format("U.u"));
$showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC")); $showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC"));
$showEndDT->setTimezone(new DateTimeZone($this->timezone)); $showEndDT->setTimezone(new DateTimeZone($this->timezone));
$endsEpoch = floatval($showEndDT->format("U.u")); $endsEpoch = floatval($showEndDT->format("U.u"));
@ -188,8 +189,8 @@ class Application_Model_ShowBuilder
$row["rebroadcast"] = true; $row["rebroadcast"] = true;
$parentInstance = CcShowInstancesQuery::create()->findPk($p_item["parent_show"]); $parentInstance = CcShowInstancesQuery::create()->findPk($p_item["parent_show"]);
$name = $parentInstance->getCcShow()->getDbName(); $name = $parentInstance->getCcShow()->getDbName();
$dt = $parentInstance->getDbStarts(null); $dt = $parentInstance->getDbStarts(null);
$dt->setTimezone(new DateTimeZone($this->timezone)); $dt->setTimezone(new DateTimeZone($this->timezone));
$time = $dt->format("Y-m-d H:i"); $time = $dt->format("Y-m-d H:i");
@ -198,8 +199,6 @@ class Application_Model_ShowBuilder
$row["record"] = true; $row["record"] = true;
if (Application_Model_Preference::GetUploadToSoundcloudOption()) { if (Application_Model_Preference::GetUploadToSoundcloudOption()) {
Logging::info('$p_item contains:');
Logging::info($p_item);
$file = Application_Model_StoredFile::Recall( $file = Application_Model_StoredFile::Recall(
$p_item['si_file_id']); $p_item['si_file_id']);
if (isset($file)) { if (isset($file)) {
@ -242,9 +241,11 @@ class Application_Model_ShowBuilder
if (isset($p_item["sched_starts"])) { if (isset($p_item["sched_starts"])) {
$schedStartDT = new DateTime($p_item["sched_starts"], new DateTimeZone("UTC")); $schedStartDT = new DateTime($p_item["sched_starts"],
new DateTimeZone("UTC"));
$schedStartDT->setTimezone(new DateTimeZone($this->timezone)); $schedStartDT->setTimezone(new DateTimeZone($this->timezone));
$schedEndDT = new DateTime($p_item["sched_ends"], new DateTimeZone("UTC")); $schedEndDT = new DateTime($p_item["sched_ends"],
new DateTimeZone("UTC"));
$schedEndDT->setTimezone(new DateTimeZone($this->timezone)); $schedEndDT->setTimezone(new DateTimeZone($this->timezone));
$showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC")); $showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC"));
@ -314,18 +315,18 @@ class Application_Model_ShowBuilder
private function makeFooterRow($p_item) private function makeFooterRow($p_item)
{ {
$row = $this->defaultRowArray; $row = $this->defaultRowArray;
$row["footer"] = true; $row["footer"] = true;
$row["instance"] = intval($p_item["si_id"]); $row["instance"] = intval($p_item["si_id"]);
$this->getRowTimestamp($p_item, $row); $this->getRowTimestamp($p_item, $row);
$showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC")); $showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC"));
$contentDT = $this->contentDT; $contentDT = $this->contentDT;
$runtime = bcsub($contentDT->format("U.u"), $showEndDT->format("U.u"), 6); $runtime = bcsub($contentDT->format("U.u"), $showEndDT->format("U.u"), 6);
$row["runtime"] = $runtime; $row["runtime"] = $runtime;
$timeFilled = new TimeFilledFormatter($runtime); $timeFilled = new TimeFilledFormatter($runtime);
$row["fRuntime"] = $timeFilled->format(); $row["fRuntime"] = $timeFilled->format();
$showStartDT = new DateTime($p_item["si_starts"], new DateTimeZone("UTC")); $showStartDT = new DateTime($p_item["si_starts"], new DateTimeZone("UTC"));
@ -354,7 +355,8 @@ class Application_Model_ShowBuilder
/* /*
* @param int $timestamp Unix timestamp in seconds. * @param int $timestamp Unix timestamp in seconds.
* *
* @return boolean whether the schedule in the show builder's range has been updated. * @return boolean whether the schedule in the show builder's range has
* been updated.
* *
*/ */
public function hasBeenUpdatedSince($timestamp, $instances) public function hasBeenUpdatedSince($timestamp, $instances)
@ -378,23 +380,26 @@ class Application_Model_ShowBuilder
$currentInstances[] = $show["instance_id"]; $currentInstances[] = $show["instance_id"];
if (isset($show["last_scheduled"])) { if (isset($show["last_scheduled"])) {
$dt = new DateTime($show["last_scheduled"], new DateTimeZone("UTC")); $dt = new DateTime($show["last_scheduled"],
new DateTimeZone("UTC"));
} else { } else {
$dt = new DateTime($show["created"], new DateTimeZone("UTC")); $dt = new DateTime($show["created"],
new DateTimeZone("UTC"));
} }
//check if any of the shows have a more recent timestamp. //check if any of the shows have a more recent timestamp.
$showTimeStamp = intval($dt->format("U")); $showTimeStamp = intval($dt->format("U"));
if ($timestamp < $showTimeStamp) { if ($timestamp < $showTimeStamp) {
Logging::debug("timestamp is {$timestamp} show timestamp is {$showTimeStamp}");
$outdated = true; $outdated = true;
break; break;
} }
} }
} }
//see if the displayed show instances have changed. (deleted, empty schedule etc) //see if the displayed show instances have changed. (deleted,
if ($outdated === false && count($instances) !== count($currentInstances)) { //empty schedule etc)
if ($outdated === false && count($instances)
!== count($currentInstances)) {
Logging::debug("show instances have changed."); Logging::debug("show instances have changed.");
$outdated = true; $outdated = true;
} }
@ -415,14 +420,17 @@ class Application_Model_ShowBuilder
$shows[] = $this->opts["showFilter"]; $shows[] = $this->opts["showFilter"];
} }
$scheduled_items = Application_Model_Schedule::GetScheduleDetailItems($this->startDT->format("Y-m-d H:i:s"), $this->endDT->format("Y-m-d H:i:s"), $shows); $scheduled_items = Application_Model_Schedule::GetScheduleDetailItems(
$this->startDT->format("Y-m-d H:i:s"), $this->endDT->format(
"Y-m-d H:i:s"), $shows);
for ($i = 0, $rows = count($scheduled_items); $i < $rows; $i++) { for ($i = 0, $rows = count($scheduled_items); $i < $rows; $i++) {
$item = $scheduled_items[$i]; $item = $scheduled_items[$i];
//don't send back data for filler rows. //don't send back data for filler rows.
if (isset($item["playout_status"]) && $item["playout_status"] < 0) { if (isset($item["playout_status"]) &&
$item["playout_status"] < 0) {
continue; continue;
} }
@ -431,8 +439,10 @@ class Application_Model_ShowBuilder
//make a footer row. //make a footer row.
if ($current_id !== -1) { if ($current_id !== -1) {
//pass in the previous row as it's the last row for the previous show. // pass in the previous row as it's the last row for
$display_items[] = $this->makeFooterRow($scheduled_items[$i-1]); // the previous show.
$display_items[] = $this->makeFooterRow(
$scheduled_items[$i-1]);
} }
$display_items[] = $this->makeHeaderRow($item); $display_items[] = $this->makeHeaderRow($item);
@ -449,7 +459,8 @@ class Application_Model_ShowBuilder
$display_items[] = $row; $display_items[] = $row;
} }
if ($current_id !== -1 && !in_array($current_id, $this->showInstances)) { if ($current_id !== -1 &&
!in_array($current_id, $this->showInstances)) {
$this->showInstances[] = $current_id; $this->showInstances[] = $current_id;
} }
} }

View File

@ -590,9 +590,7 @@ SQL;
$rebroad = new Application_Model_ShowInstance($rebroadcast->getDbId()); $rebroad = new Application_Model_ShowInstance($rebroadcast->getDbId());
$rebroad->addFileToShow($file_id, false); $rebroad->addFileToShow($file_id, false);
} catch (Exception $e) { } catch (Exception $e) {
Logging::info("{$e->getFile()}"); Logging::info($e->getMessage());
Logging::info("{$e->getLine()}");
Logging::info("{$e->getMessage()}");
} }
} }
} }

View File

@ -399,6 +399,17 @@ SQL;
$this->_file->save(); $this->_file->save();
} }
public function getRealFileExtension() {
$path = $this->_file->getDbFilepath();
$path_elements = explode('.', $path);
if (count($path_elements) < 2) {
return "";
} else {
return $path_elements[count($path_elements) - 1];
}
}
/** /**
* Return suitable extension. * Return suitable extension.
* *
@ -407,9 +418,15 @@ SQL;
*/ */
public function getFileExtension() public function getFileExtension()
{ {
return ""; $possible_ext = $this->getRealFileExtension();
// TODO : what's the point of having this function? Can we not just use if ($possible_ext !== "") {
// the extension from the file_path column from cc_files? return $possible_ext;
}
// We fallback to guessing the extension from the mimetype if we
// cannot extract it from the file name
$mime = $this->_file->getDbMime(); $mime = $this->_file->getDbMime();
if ($mime == "audio/ogg" || $mime == "application/ogg") { if ($mime == "audio/ogg" || $mime == "application/ogg") {

View File

@ -6,8 +6,11 @@ var AIRTIME = (function(AIRTIME) {
} }
mod = AIRTIME.button; mod = AIRTIME.button;
mod.isDisabled = function(c) { mod.isDisabled = function(c, useParent) {
var button = $("." + c); var button = $("." + c);
if (useParent) {
button = button.parent();
}
if (button.hasClass(DISABLED_CLASS)) { if (button.hasClass(DISABLED_CLASS)) {
return true; return true;
@ -25,6 +28,7 @@ var AIRTIME = (function(AIRTIME) {
if (button.hasClass(DISABLED_CLASS)) { if (button.hasClass(DISABLED_CLASS)) {
button.removeClass(DISABLED_CLASS); button.removeClass(DISABLED_CLASS);
button.removeAttr('disabled');
} }
}; };
@ -37,6 +41,7 @@ var AIRTIME = (function(AIRTIME) {
if (!button.hasClass(DISABLED_CLASS)) { if (!button.hasClass(DISABLED_CLASS)) {
button.addClass(DISABLED_CLASS); button.addClass(DISABLED_CLASS);
button.attr('disabled', 'disabled');
} }
}; };

View File

@ -16,10 +16,21 @@ var AIRTIME = (function(AIRTIME) {
} }
if (check === true) { if (check === true) {
AIRTIME.button.enableButton("btn-group #library-plus", true); AIRTIME.button.enableButton("btn-group #library-plus", false);
} else { } else {
AIRTIME.button.disableButton("btn-group #library-plus", true); AIRTIME.button.disableButton("btn-group #library-plus", false);
} }
var objType = $('#obj_type').val(),
btnText;
if (objType === 'playlist') {
btnText = ' Add to current playlist';
} else if (objType === 'block') {
btnText = ' Add to current smart block';
} else {
btnText = ' Add to current playlist';
}
AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), btnText);
}; };
mod.fnRowCallback = function(nRow, aData, iDisplayIndex, iDisplayIndexFull) { mod.fnRowCallback = function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {

View File

@ -16,10 +16,12 @@ var AIRTIME = (function(AIRTIME) {
} }
if (check === true) { if (check === true) {
AIRTIME.button.enableButton("btn-group #library-plus", true); AIRTIME.button.enableButton("btn-group #library-plus", false);
} else { } else {
AIRTIME.button.disableButton("btn-group #library-plus", true); AIRTIME.button.disableButton("btn-group #library-plus", false);
} }
AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), ' Add to selected show');
}; };
mod.fnRowCallback = function(nRow, aData, iDisplayIndex, iDisplayIndexFull) { mod.fnRowCallback = function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {

View File

@ -98,6 +98,10 @@ var AIRTIME = (function(AIRTIME) {
return count; return count;
}; };
mod.changeAddButtonText = function($button, btnText) {
$button.text(btnText);
}
mod.createToolbarButtons = function() { mod.createToolbarButtons = function() {
$menu = $("<div class='btn-toolbar' />"); $menu = $("<div class='btn-toolbar' />");
$menu $menu
@ -113,7 +117,8 @@ var AIRTIME = (function(AIRTIME) {
"</div>") "</div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button class='btn btn-small' id='library-plus'>" + "<button class='btn btn-small' id='library-plus'>" +
"<i class='icon-white icon-plus'></i> Add to current playlist" + "<i class='icon-white icon-plus'></i>" +
"<span id='lib-plus-text'></span>" +
"</button>" + "</button>" +
"</div>") "</div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
@ -138,10 +143,10 @@ var AIRTIME = (function(AIRTIME) {
} }
if (check === true) { if (check === true) {
AIRTIME.button.enableButton("btn-group #sb-trash", true); AIRTIME.button.enableButton("btn-group #sb-trash", false);
} }
else { else {
AIRTIME.button.disableButton("btn-group #sb-trash", true); AIRTIME.button.disableButton("btn-group #sb-trash", false);
} }
}; };

View File

@ -66,10 +66,10 @@ var AIRTIME = (function(AIRTIME){
var $selectable = $sbTable.find("tbody").find("input:checkbox"); var $selectable = $sbTable.find("tbody").find("input:checkbox");
if ($selectable.length !== 0) { if ($selectable.length !== 0) {
AIRTIME.button.enableButton("btn-group #timeline-select", true); AIRTIME.button.enableButton("btn-group #timeline-select", false);
} }
else { else {
AIRTIME.button.disableButton("btn-group #timeline-select", true); AIRTIME.button.disableButton("btn-group #timeline-select", false);
} }
//need to check if the 'Select' button is disabled //need to check if the 'Select' button is disabled
@ -962,16 +962,16 @@ var AIRTIME = (function(AIRTIME){
"</ul>" + "</ul>" +
"</div>") "</div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Remove overbooked tracks' class='ui-state-disabled btn btn-small'>" + "<button title='Remove overbooked tracks' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-cut'></i></button></div>") "<i class='icon-white icon-cut'></i></button></div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Remove selected scheduled items' class='ui-state-disabled btn btn-small'>" + "<button title='Remove selected scheduled items' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-trash'></i></button></div>") "<i class='icon-white icon-trash'></i></button></div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Jump to the current playing track' class='ui-state-disabled btn btn-small'>" + "<button title='Jump to the current playing track' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-step-forward'></i></button></div>") "<i class='icon-white icon-step-forward'></i></button></div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Cancel current show' class='ui-state-disabled btn btn-small btn-danger'>" + "<button title='Cancel current show' class='ui-state-disabled btn btn-small btn-danger' disabled='disabled'>" +
"<i class='icon-white icon-ban-circle'></i></button></div>"); "<i class='icon-white icon-ban-circle'></i></button></div>");
$toolbar.append($menu); $toolbar.append($menu);
@ -987,7 +987,7 @@ var AIRTIME = (function(AIRTIME){
data, data,
msg = 'Cancel Current Show?'; msg = 'Cancel Current Show?';
if (AIRTIME.button.isDisabled('icon-ban-circle') === true) { if (AIRTIME.button.isDisabled('icon-ban-circle', true) === true) {
return; return;
} }
@ -1018,7 +1018,7 @@ var AIRTIME = (function(AIRTIME){
$toolbar.find('.icon-step-forward').parent() $toolbar.find('.icon-step-forward').parent()
.click(function() { .click(function() {
if (AIRTIME.button.isDisabled('icon-step-forward') === true) { if (AIRTIME.button.isDisabled('icon-step-forward', true) === true) {
return; return;
} }
@ -1032,10 +1032,10 @@ var AIRTIME = (function(AIRTIME){
}); });
//delete overbooked tracks. //delete overbooked tracks.
$toolbar.find('.icon-cut').parent() $toolbar.find('.icon-cut', true).parent()
.click(function() { .click(function() {
if (AIRTIME.button.isDisabled('icon-cut') === true) { if (AIRTIME.button.isDisabled('icon-cut', true) === true) {
return; return;
} }
@ -1055,7 +1055,7 @@ var AIRTIME = (function(AIRTIME){
$toolbar.find('.icon-trash').parent() $toolbar.find('.icon-trash').parent()
.click(function() { .click(function() {
if (AIRTIME.button.isDisabled('icon-trash') === true) { if (AIRTIME.button.isDisabled('icon-trash', true) === true) {
return; return;
} }
@ -1083,17 +1083,18 @@ var AIRTIME = (function(AIRTIME){
}); });
/* /*
* Icon hover states in the toolbar. * Select button dropdown state in the toolbar.
* The button has to be disabled to prevent the dropdown
* from opening
*/ */
$sbContent.on("mouseenter", ".btn-group #timeline-select", function(ev) { $sbContent.on("mouseenter", ".btn-group #timeline-select", function(ev) {
$el = $(this).parent(), $el = $(this);
$ch = $el.children('#timeline-select');
if ($el.hasClass("ui-state-disabled")) { if ($el.hasClass("ui-state-disabled")) {
$ch.attr("disabled", "disabled"); $el.attr("disabled", "disabled");
} }
else { else {
$ch.removeAttr("disabled"); $el.removeAttr("disabled");
} }
}); });

View File

@ -32,7 +32,7 @@ airtime2mutagen = {
"MDATA_KEY_MOOD" : "mood", "MDATA_KEY_MOOD" : "mood",
"MDATA_KEY_TRACKNUMBER" : "tracknumber", "MDATA_KEY_TRACKNUMBER" : "tracknumber",
"MDATA_KEY_BPM" : "bpm", "MDATA_KEY_BPM" : "bpm",
"MDATA_KEY_LABEL" : "organization", "MDATA_KEY_LABEL" : "label",
"MDATA_KEY_COMPOSER" : "composer", "MDATA_KEY_COMPOSER" : "composer",
"MDATA_KEY_ENCODER" : "encodedby", "MDATA_KEY_ENCODER" : "encodedby",
"MDATA_KEY_CONDUCTOR" : "conductor", "MDATA_KEY_CONDUCTOR" : "conductor",