示例#1
0
文件: Overlay.php 项目: cwcw/cms
 /**
  * Disarm the internal timer
  *
  * @return boolean
  */
 protected function _disarmTimer()
 {
     if ($this->_timer->isArmed()) {
         return $this->_timer->disarm();
     }
     return true;
 }
示例#2
0
文件: Reader.php 项目: cwcw/cms
 /**
  * Rearm the timer
  *
  * @return boolean
  */
 protected function _rearmTimer()
 {
     $delay = $this->_options[self::OPT_INTER_DIGIT_TIMEOUT];
     $this->_timer->setContextParams(array('timeoutType' => self::TIMEOUT_INTERDIGIT));
     if ($this->_timer->isArmed()) {
         return $this->_timer->rearm($delay);
     } else {
         $this->_timer->setOptions(array(Streamwide_Engine_Timer_Timeout::OPT_DELAY => $delay));
         $this->_timer->addEventListener(Streamwide_Engine_Events_Event::TIMEOUT, array('callback' => array($this, 'onTimeout'), 'options' => array('autoRemove' => 'before')));
         return $this->_timer->arm();
     }
 }
示例#3
0
文件: Menu.php 项目: cwcw/cms
 /**
  * Handles a key press
  *
  * @param string|null $promptType
  * @return void
  */
 protected function _handleKeyPress($promptType = null)
 {
     if (null === $promptType) {
         if ($this->_timer->isArmed()) {
             $this->_timer->disarm();
         }
     } else {
         switch ($promptType) {
             case self::PROMPT_NO_KEY:
             case self::PROMPT_WRONG_KEY:
                 $this->_mediaPlayer->stop();
                 break;
             case self::PROMPT_INVITE:
                 if ($this->_shouldStopPromptingOnDtmf()) {
                     $this->_mediaPlayer->stop();
                 }
                 break;
         }
     }
 }