本文整理汇总了PHP中Song::getImageData方法的典型用法代码示例。如果您正苦于以下问题:PHP Song::getImageData方法的具体用法?PHP Song::getImageData怎么用?PHP Song::getImageData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Song
的用法示例。
在下文中一共展示了Song::getImageData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Render a list page
*
* @param Song $song
* The song that is currently playing
*
* @return string
* The HTML of the rendered page
*/
public static function render($song, $previous)
{
// instantiate the template engine
$parser = new Rain\Tpl();
// get the image data for the song
$image_data = Song::getImageData($song['Artist'], $song['Album'], 320);
// assign the values to the template parser
$parser->assign(array('image' => $image_data, 'song' => $song, 'volume' => Music::getVolume(), 'previous' => $previous));
// return the HTML
return $parser->draw("now-playing-page", true);
}
示例2: updateNowPlaying
public static function updateNowPlaying()
{
// get the current status of the player
$status = static::getStatus();
$results['volume'] = $status['values']['volume'];
$results['state'] = $status['values']['state'];
// get the current song
$song = static::getCurrentSong();
$results['title'] = $song ? $song['Title'] : null;
$results['artist'] = $song ? $song['Artist'] : null;
$results['album'] = $song ? $song['Album'] : null;
// get the image data
$results['artwork'] = Song::getImageData($song['Artist'], $song['Album'], 320);
// return the data
return $results;
}