[][src]Module mpdpopm::ratings

Logic for rating MPD tracks.

Introduction

This module contains types implementing a basic rating functionality for `mpd'.

Discussion

Rating messages to the relevant channel take the form "RATING( TRACK)?" (the two components can be separated by any whitespace). The rating can be given by an integer between 0 & 255 (inclusive) represented in base ten, or as one-to-five asterisks (i.e. *{1,5}). In the latter case, the rating will be mapped to 1-255 as per Winamp's convention:

  • 224-255 :: 5 stars when READ with windows explorer, writes 255
  • 160-223 :: 4 stars when READ with windows explorer, writes 196
  • 096-159 :: 3 stars when READ with windows explorer, writes 128
  • 032-095 :: 2 stars when READ with windows explorer, writes 64
  • 001-031 :: 1 stars when READ with windows explorer, writes 1

NB a rating of zero means "not rated".

Everything after the first whitepace, if present, is taken to be the track to be rated (i.e. the track may contain whitespace). If omitted, the rating is taken to apply to the current track.

Structs

RatingRequest

A request from a client to rate a track.

Enums

Error

An enumeration of ratings errors

RatedTrack

The track to which a rating shall be applied.

Functions

get_rating

Retrieve the rating for a track as an unsigned int from zero to 255

set_rating

Core routine for setting the rating for a track-- will run the associated command, if present

Type Definitions

Result