Example #1
0
 public function startNext($device)
 {
     Logger::debug(__METHOD__, self::$logfile);
     $playlist = new Playlist($device);
     $result = $playlist->next();
     $this->respond($result);
 }
Example #2
0
 public function receivedEvent($transportState)
 {
     Logger::debug('Reveived transportState event: ' . $transportState, 'event');
     if ($this->ignoreStops && $transportState == 'PLAYING') {
         Logger::debug('Finished ignoring STOPPED state', 'event');
         $this->ignoreStops = false;
         $this->saveToCache();
     }
     if ($this->ignoreStops && $transportState == 'STOPPED') {
         Logger::debug('Ignoring STOPPED state', 'event');
         return;
     }
     switch ($transportState) {
         case 'STOPPED':
             Logger::debug('Try to play next', 'event');
             $playlist = new Playlist($this->getId());
             $next = $playlist->next();
             break;
     }
 }