本文整理汇总了C++中meta::TrackPtr::rating方法的典型用法代码示例。如果您正苦于以下问题:C++ TrackPtr::rating方法的具体用法?C++ TrackPtr::rating怎么用?C++ TrackPtr::rating使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meta::TrackPtr
的用法示例。
在下文中一共展示了TrackPtr::rating方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setAlignment
void
Amarok::OSD::show( Meta::TrackPtr track ) //slot
{
setAlignment( static_cast<OSDWidget::Alignment>( AmarokConfig::osdAlignment() ) );
setOffset( AmarokConfig::osdYOffset() );
QString text;
if( !track || track->playableUrl().isEmpty() )
{
text = i18n( "No track playing" );
setRating( 0 ); // otherwise stars from last rating change are visible
}
else
{
setRating( track->rating() );
text = track->prettyName();
if( track->artist() && !track->artist()->prettyName().isEmpty() )
text = track->artist()->prettyName() + " - " + text;
if( track->album() && !track->album()->prettyName().isEmpty() )
text += "\n (" + track->album()->prettyName() + ") ";
else
text += '\n';
if( track->length() > 0 )
text += Meta::msToPrettyTime( track->length() );
}
if( text.isEmpty() )
text = track->playableUrl().fileName();
if( text.startsWith( "- " ) ) //When we only have a title tag, _something_ prepends a fucking hyphen. Remove that.
text = text.mid( 2 );
if( text.isEmpty() ) //still
text = i18n("No information available for this track");
QImage image;
if( track && track->album() )
image = The::svgHandler()->imageWithBorder( track->album(), 100, 5 ).toImage();
OSDWidget::show( text, image );
}