当前位置: 首页>>代码示例>>PHP>>正文


PHP Song::get_artist_name方法代码示例

本文整理汇总了PHP中Song::get_artist_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Song::get_artist_name方法的具体用法?PHP Song::get_artist_name怎么用?PHP Song::get_artist_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Song的用法示例。


在下文中一共展示了Song::get_artist_name方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: status

 /**
  * get_status
  * This returns bool/int values for features, loop, repeat and any other
  * features that this localplay method supports.
  */
 public function status()
 {
     $track = $this->_mpd->status['song'];
     /* Construct the Array */
     $array['state'] = $this->_mpd->status['state'];
     $array['volume'] = $this->_mpd->status['volume'];
     $array['repeat'] = $this->_mpd->status['repeat'];
     $array['random'] = $this->_mpd->status['random'];
     $array['track'] = $track + 1;
     $playlist_item = $this->_mpd->playlist[$track];
     $url_data = $this->parse_url($playlist_item['file']);
     debug_event('mdp.controller.php', 'Status result. Current song (' . $track . ') info: ' . json_encode($playlist_item), '5');
     if (count($url_data) > 0 && !empty($url_data['oid'])) {
         $song = new Song($url_data['oid']);
         $array['track_title'] = $song->title;
         $array['track_artist'] = $song->get_artist_name();
         $array['track_album'] = $song->get_album_name();
     } else {
         if (!empty($playlist_item['Title'])) {
             $array['track_title'] = $playlist_item['Title'];
         } else {
             if (!empty($playlist_item['Name'])) {
                 $array['track_title'] = $playlist_item['Name'];
             } else {
                 $array['track_title'] = $playlist_item['file'];
             }
         }
     }
     return $array;
 }
开发者ID:nioc,项目名称:ampache,代码行数:35,代码来源:mpd.controller.php

示例2: status

 /**
  * status
  * This returns bool/int values for features, loop, repeat and any other features
  * That this localplay method supports. required function
  * This works as in requesting the status.xml file from vlc.
  */
 public function status()
 {
     $arrayholder = $this->_vlc->fullstate();
     //get status.xml via parser xmltoarray
     /* Construct the Array */
     $currentstat = $arrayholder['root']['state']['value'];
     if ($currentstat == 'playing') {
         $state = 'play';
     }
     //change to something ampache understands
     if ($currentstat == 'stop') {
         $state = 'stop';
     }
     if ($currentstat == 'paused') {
         $state = 'pause';
     }
     $array['state'] = $state;
     $array['volume'] = intval(intval($arrayholder['root']['volume']['value']) / 2.6);
     $array['repeat'] = $arrayholder['root']['repeat']['value'];
     $array['random'] = $arrayholder['root']['random']['value'];
     $array['track'] = htmlspecialchars_decode($arrayholder['root']['information']['meta-information']['title']['value'], ENT_NOQUOTES);
     $url_data = $this->parse_url($array['track']);
     $song = new Song($url_data['oid']);
     if ($song->title || $song->get_artist_name() || $song->get_album_name()) {
         $array['track_title'] = $song->title;
         $array['track_artist'] = $song->get_artist_name();
         $array['track_album'] = $song->get_album_name();
     } else {
         $array['track_title'] = htmlspecialchars(substr($arrayholder['root']['information']['meta-information']['title']['value'], 0, 25));
         $array['track_artist'] = htmlspecialchars(substr($arrayholder['root']['information']['meta-information']['artist']['value'], 0, 20));
     }
     return $array;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:39,代码来源:vlc.controller.php

示例3: status

 /**
  * status
  * This returns bool/int values for features, loop, repeat and any other features
  * that this localplay method supports.
  * This works as in requesting the xbmc properties
  */
 public function status()
 {
     if (!$this->_xbmc) {
         return false;
     }
     $array = array();
     try {
         $appprop = $this->_xbmc->Application->GetProperties(array('properties' => array('volume')));
         $array['volume'] = intval($appprop['volume']);
         try {
             $currentplay = $this->_xbmc->Player->GetItem(array('playerid' => $this->_playerId, 'properties' => array('file')));
             // We assume it's playing. No pause detection support.
             $array['state'] = 'play';
             $playprop = $this->_xbmc->Player->GetProperties(array('playerid' => $this->_playerId, 'properties' => array('repeat', 'shuffled')));
             $array['repeat'] = $playprop['repeat'] != "off";
             $array['random'] = strtolower($playprop['shuffled']) == 1;
             $array['track'] = $currentplay['file'];
             $url_data = $this->parse_url($array['track']);
             $song = new Song($url_data['oid']);
             if ($song->title || $song->get_artist_name() || $song->get_album_name()) {
                 $array['track_title'] = $song->title;
                 $array['track_artist'] = $song->get_artist_name();
                 $array['track_album'] = $song->get_album_name();
             }
         } catch (XBMC_RPC_Exception $ex) {
             debug_event('xbmc', 'get current item failed, player probably stopped. ' . $ex->getMessage(), 1);
             $array['state'] = 'stop';
         }
     } catch (XBMC_RPC_Exception $ex) {
         debug_event('xbmc', 'status failed: ' . $ex->getMessage(), 1);
     }
     return $array;
 }
开发者ID:bl00m,项目名称:ampache,代码行数:39,代码来源:xbmc.controller.php

示例4: status

 /**
  * status
  * This returns bool/int values for features, loop, repeat and any other features
  * that this localplay method supports.
  * This works as in requesting the upnp properties
  */
 public function status()
 {
     debug_event('upnp', 'status', 5);
     if (!$this->_upnp) {
         return false;
     }
     $item = $this->_upnp->GetCurrentItem();
     $status = array();
     $status['state'] = $this->_upnp->GetState();
     $status['volume'] = $this->_upnp->GetVolume();
     $status['repeat'] = false;
     $status['random'] = false;
     $status['track'] = $item['link'];
     $status['track_title'] = $item['name'];
     $url_data = Stream_URL::parse($item['link']);
     if ($url_data != null) {
         $song = new Song($url_data['id']);
         if ($song != null) {
             $status['track_artist'] = $song->get_artist_name();
             $status['track_album'] = $song->get_album_name();
         }
     }
     return $status;
 }
开发者ID:bl00m,项目名称:ampache,代码行数:30,代码来源:upnp.controller.php

示例5: status

 /**
  * status
  * This returns bool/int values for features, loop, repeat and any other features
  * That this localplay method supports. required function
  */
 public function status()
 {
     /* Construct the Array */
     $array['state'] = $this->_httpq->state();
     $array['volume'] = $this->_httpq->get_volume();
     $array['repeat'] = $this->_httpq->get_repeat();
     $array['random'] = $this->_httpq->get_random();
     $array['track'] = $this->_httpq->get_now_playing();
     $url_data = $this->parse_url($array['track']);
     if (isset($url_data['oid'])) {
         $song = new Song($data['oid']);
         $array['track_title'] = $song->title;
         $array['track_artist'] = $song->get_artist_name();
         $array['track_album'] = $song->get_album_name();
     } else {
         $array['track_title'] = basename($array['track']);
     }
     return $array;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:24,代码来源:httpq.controller.php

示例6: songs

 /**
  * songs
  *
  * This returns an xml document from an array of song ids.
  * (Spiffy isn't it!)
  */
 public static function songs($songs)
 {
     if (count($songs) > self::$limit or self::$offset > 0) {
         $songs = array_slice($songs, self::$offset, self::$limit);
     }
     Song::build_cache($songs);
     Stream::set_session($_REQUEST['auth']);
     $string = "";
     // Foreach the ids!
     foreach ($songs as $song_id) {
         $song = new Song($song_id);
         // If the song id is invalid/null
         if (!$song->id) {
             continue;
         }
         $tag_string = self::tags_string(Tag::get_top_tags('song', $song_id));
         $rating = new Rating($song_id, 'song');
         $art_url = Art::url($song->album, 'album', $_REQUEST['auth']);
         $string .= "<song id=\"" . $song->id . "\">\n" . "\t<title><![CDATA[" . $song->title . "]]></title>\n" . "\t<artist id=\"" . $song->artist . '"><![CDATA[' . $song->get_artist_name() . "]]></artist>\n" . "\t<album id=\"" . $song->album . '"><![CDATA[' . $song->get_album_name() . "]]></album>\n" . $tag_string . "\t<filename><![CDATA[" . $song->file . "]]></filename>\n" . "\t<track>" . $song->track . "</track>\n" . "\t<time>" . $song->time . "</time>\n" . "\t<year>" . $song->year . "</year>\n" . "\t<bitrate>" . $song->bitrate . "</bitrate>\n" . "\t<mode>" . $song->mode . "</mode>\n" . "\t<mime>" . $song->mime . "</mime>\n" . "\t<url><![CDATA[" . Song::play_url($song->id) . "]]></url>\n" . "\t<size>" . $song->size . "</size>\n" . "\t<mbid>" . $song->mbid . "</mbid>\n" . "\t<album_mbid>" . $song->album_mbid . "</album_mbid>\n" . "\t<artist_mbid>" . $song->artist_mbid . "</artist_mbid>\n" . "\t<art><![CDATA[" . $art_url . "]]></art>\n" . "\t<preciserating>" . $rating->get_user_rating() . "</preciserating>\n" . "\t<rating>" . $rating->get_user_rating() . "</rating>\n" . "\t<averagerating>" . $rating->get_average_rating() . "</averagerating>\n" . "</song>\n";
     }
     // end foreach
     return self::_header() . $string . self::_footer();
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:29,代码来源:xml_data.class.php

示例7: play_url

 /**
  * play_url
  * This function takes all the song information and correctly formats a
  * a stream URL taking into account the downsmapling mojo and everything
  * else, this is the true function
  */
 public static function play_url($oid, $additional_params = '')
 {
     $song = new Song($oid);
     $user_id = $GLOBALS['user']->id ? scrub_out($GLOBALS['user']->id) : '-1';
     $type = $song->type;
     // Checking if the song is gonna be transcoded into another type
     // Some players doesn't allow a type streamed into another without giving the right extension
     $transcode_cfg = AmpConfig::get('transcode');
     $transcode_mode = AmpConfig::get('transcode_' . $type);
     if ($transcode_cfg == 'always' || $transcode_cfg != 'never' && $transcode_mode == 'required') {
         $transcode_settings = $song->get_transcode_settings(null);
         if ($transcode_settings) {
             debug_event("song.class.php", "Changing play url type from {" . $type . "} to {" . $transcode_settings['format'] . "} due to encoding settings...", 5);
             $type = $transcode_settings['format'];
         }
     }
     $song_name = $song->get_artist_name() . " - " . $song->title . "." . $type;
     $song_name = str_replace("/", "-", $song_name);
     $song_name = str_replace("?", "", $song_name);
     $song_name = str_replace("#", "", $song_name);
     $song_name = rawurlencode($song_name);
     $url = Stream::get_base_url() . "type=song&oid=" . $song->id . "&uid=" . $user_id . $additional_params . "&name=" . $song_name;
     return Stream_URL::format($url);
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:30,代码来源:song.class.php


注:本文中的Song::get_artist_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。