public function cancelCurrentShowAction() { $user = Application_Model_User::getCurrentUser(); if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { $id = $this->_getParam('id'); try { $scheduler = new Application_Model_Scheduler(); $scheduler->cancelShow($id); // send kick out source stream signal to pypo $data = array("sourcename" => "live_dj"); Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data); } catch (Exception $e) { $this->view->error = $e->getMessage(); Logging::info($e->getMessage()); } } }
/** * Add a media file as the last item in the show. * * @param int $file_id */ public function addFileToShow($file_id, $checkUserPerm = true) { $ts = intval($this->_showInstance->getDbLastScheduled("U")) ?: 0; $id = $this->_showInstance->getDbId(); $scheduler = new Application_Model_Scheduler(); $scheduler->setCheckUserPermissions($checkUserPerm); $scheduler->scheduleAfter(array(array("id" => 0, "instance" => $id, "timestamp" => $ts)), array(array("id" => $file_id, "type" => "audioclip"))); }
public function scheduleMoveAction() { $request = $this->getRequest(); $selectedItems = $request->getParam("selectedItem"); $afterItem = $request->getParam("afterItem"); try { $scheduler = new Application_Model_Scheduler(); $scheduler->moveItem($selectedItems, $afterItem); } catch (OutDatedScheduleException $e) { $this->view->error = $e->getMessage(); Logging::info($e->getMessage()); } catch (Exception $e) { $this->view->error = $e->getMessage(); Logging::info($e->getMessage()); } }