本文整理匯總了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;
}