Skip Menu |

This queue is for tickets about the Audio-MPD CPAN distribution.

Report information
The Basics
Id: 24356
Status: resolved
Priority: 0/
Queue: Audio-MPD

People
Owner: jquelin [...] cpan.org
Requestors: davidp [...] preshweb.co.uk
Cc: jquelin [...] cpan.org
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: WISHLIST: return random/repeat settings
From the documentation, it appears that Audio::MPD provides methods to set the repeat / random modes, but not to determine their current settings. It'd be great if there were methods to do this. My suggestions would be either: a) get_repeat() and get_random(), which just return the current setting b) accessor/mutator methods repeat() and random() - given no params they would return the setting, or if given a boolean param, set it appropriately My personal preference would be option b (but obviously keeping the existing set_repeat() / set_random() methods for backwards compatibility. I can do this and provide a patch if you wish?
since i failed to join NJH, i'm into the process of taking over maintenership. one of the first tasks i'll do is to clean the module and provide proper encapsulation. i invite you to join us ("us" as me and the original author of this module) on http://groups.google.com/group/audio-mpd
trunk now has a new method status, returning an hash ref. therefore, accessing random / repeat setting can be done with: $mpd->status->{repeat} $mpd->status->{random} not yet released, since i'm reworking the entire connection with mpd server. (caution: trunk is not usable!) i'll keep this bug open as long as next mpd version isn't out on cpan...
i forgot to tell that i may end up with a better api. it's still 0.x software, you know... currently, calling $mpd->repeat without arguments will toggle repeat mode. maybe we'll make the api evolve to: $mpd->repeat($TRUE); # set repeat $mpd->repeat($FALSE); # unset repeat $mpd->repeat($TOGGLE); # pretty obvious $mpd->repeat; # get the current value we'll see later on.
Audio::MPD 0.13.1 comes with a status() method returning an Audio::MPD::Status object that can be queried to retrieve mpd server information. enjoy it, marking this bug resolved.