Recent Tracks

Recent Tracks

About the Widget

The Recent Tracks widget shows a list of the tracks that your stream played most recently. For each track, the list shows the album cover, the time at which the track started, the title, the artist and the album. If the track has an album URL, the list also shows a Buy this album link. If a track has no album cover, the list shows a placeholder image.

The first track of the list is the current track. If the current track started less than one hour ago, the list shows Now playing in place of its start time. The widget adds each new track to the top of the list in real time, and removes the oldest track from the bottom.

If no track information is available, the widget shows No recent tracks are available.

If the widget code names no mount point, the widget shows the tracks of the default mount point of your stream.

This widget is available only if Enable recent tracks widget is set to Yes. For more information, see the Widgets section of the configuration settings.

Widget Code

The anchor code is a <div> element with the class cc_recenttracks_list. Before the widget loads, the element shows the text Loading ....

Below the code, the widget box shows the Also available as links. These links give the list of recent tracks as an RSS feed, an Atom feed, an OPML document, an HTML page or a JSON feed. You can give the feed links to your listeners, or use them in other programs.

Advanced Customization

Configurable Options

The advanced code sets these options:

  • unstyled
    Controls whether the widget applies its own styles. If true, the widget applies no styles, and your own CSS controls the appearance. The default is false.

  • track_limit
    Specifies the maximum number of tracks in the list. If the value is 0, the list shows the number of tracks that the Number of recent tracks setting specifies. This setting is on the Widgets tab of the Configuration Settings page. For more information, see the Widgets section of the configuration settings. The default is 0.

  • show_current
    Controls whether the list includes the current track. If 0 and the newest track started less than one hour ago, the list starts with the previous track. The default is 1.

  • show_covers
    Controls whether the list shows the album covers. If 0, the covers are hidden. The default is 1.

  • scale_covers
    Controls whether the widget sets the size of the covers to cover_width and cover_height. This option has an effect only if both of those options are more than -1. If 0, the covers keep the size that your CSS gives them. The default is 1.

  • cover_width
    Specifies the width of the covers, in pixels. If the value is -1, your CSS controls the width. The default is -1.

  • cover_height
    Specifies the height of the covers, in pixels. If the value is -1, your CSS controls the height. The default is -1.

  • buy_target
    Specifies the link target of the Buy this album links. The default is _blank, which opens the link in a new browser tab or window.

Example: to show 10 tracks with covers of 64 by 64 pixels, and no current track, use these values:

<script type="text/javascript">
(function(){ (window.$CC||(window.$CC={})).recenttracks = {

    unstyled: false,
    track_limit: 10,
    show_current: 0,
    show_covers: 1,
    scale_covers: 1,
    cover_width: 64,
    cover_height: 64,
    buy_target: '_blank',

};})();
</script>

CSS

The widget uses these CSS classes:

/* container for the default styles; not present if unstyled is true */
.cc_recenttracks_basic_style {
}
/* container for the message that shows when no tracks are available */
.cc_recenttracks_content .cc_recenttracks_error {
}
/* container for the track list */
.cc_recenttracks_entries {
}
/* one track in the list */
.cc_recenttracks_track {
}
/* container for the album cover of a track */
.cc_recenttracks_track_image {
}
/* the album cover */
.cc_recenttracks_track_image img {
}
/* the start time of the track, or "Now playing" */
.cc_recenttracks_track_localtime {
}
/* the title of the track */
.cc_recenttracks_track_title {
}
/* the artist of the track */
.cc_recenttracks_track_artist {
}
/* the album of the track */
.cc_recenttracks_track_album {
}
/* container for the "Buy this album" link */
.cc_recenttracks_track_buyurl {
}

Previous: Stream Details
Section: Widgets
Next: Listener Map