Audio:...aylist(3pm)
π Audio::MPD::Playlist π
okay bestie, buckle up β this is the Audio::MPD::Playlist page from the User Contributed Perl Documentation, and it's literally the class that lets you mess with MPD's playlist. yes, "mess". that's the technical term. π
β¨ VERSION β¨
version 2.004 β that's the one, no cap.
πΈ SYNOPSIS πΈ
$mpd->playlist->shuffle;
# and lots of other methods
like... there are SO many other methods, keep reading, we're getting to all of them π«Ά
π¦ DESCRIPTION π¦
Audio::MPD::Playlist is a class meant to access & update MPD's playlist. that's the whole vibe. it gets in there, it reads stuff, it changes stuff. iconic behaviour honestly.
β οΈ real talk: you are not supposed to call the constructor yourself. anAudio::MPD::Playlistgets automatically created for you while anAudio::MPDobject is being created β and then you just grab it with theplaylist()accessor. it's giving "we already did that for you, you're welcome" πββοΈ
π RETRIEVING INFORMATION π
π as_items
my @items = $pl->as_items;
returns an array of Audio::MPD::Common::Item::Songs, one for each of the songs in the current playlist. every song gets its own lil object. obsessed. β¨
π items_changed_since
my @items = $pl->items_changed_since( $plversion );
returns a list with all the songs (as Audio::MPD::Common::Item::Song objects) that got added to the playlist since playlist $plversion. it's the "what's new bestie" method fr fr π
β ADDING / REMOVING SONGS β
π add
$pl->add( $path [, $path [...] ] );
adds the songs identified by $path (relative to MPD's music directory) to the current playlist. that's it, that's the method. no return value. π
π delete
$pl->delete( $song [, $song [...] ] );
removes the specified $song numbers (starting from 0, yes, zero-indexed, we're programmers here) from the current playlist. no return value.
π deleteid
$pl->deleteid( $songid [, $songid [...] ] );
removes the specified $songids (as assigned by mpd when inserted in playlist) from the current playlist. so like, these are the IDs mpd handed out, not the positions. no return value. π
π clear
$pl->clear;
removes all the songs from the current playlist. everything. gone. no return value. main character energy: total reset. π
π crop
$pl->crop;
removes all of the songs from the current playlist except the song currently playing. it's giving "you're the only one that matters right now" π₯Ίβ¨
π CHANGING PLAYLIST ORDER π
π shuffle
$pl->shuffle;
shuffles the current playlist. chaos mode: activated. no return value. π₯
π swap
$pl->swap( $song1, $song2 );
swaps positions of song number $song1 and $song2 in the current playlist. no return value.
π swapid
$pl->swapid( $songid1, $songid2 );
swaps the positions of song ID $songid1 with song ID $songid2 in the current playlist. note: IDs, not numbers. no return value. π
π move
$pl->move( $song, $newpos );
moves song number $song to the position $newpos. no return value.
π moveid
$pl->moveid( $songid, $newpos );
moves song ID $songid to the position $newpos. again: ID, not number, don't mix them up bestie. no return value. β
π MANAGING PLAYLISTS π
π load
$pl->load( $playlist );
loads a list of songs from the specified $playlist file. no return value.
π save
$pl->save( $playlist );
saves the current playlist to a file called $playlist in MPD's playlist directory. no return value.
π rm
$pl->rm( $playlist );
deletes the playlist named $playlist from MPD's playlist directory. (yes it's rm, yes it's scary, yes it does exactly what it says.) no return value. π
π AUTHOR π
Jerome Quelin β the legend themselves π«Ά
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2007 by Jerome Quelin.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay. legally slay. β¨
and that's a wrap, bestie π this page came to you from perl v5.34.0, dated 2022-06-08, and it's the Audio::MPD::Playlist doc β go forth and shuffle responsibly ππΈπ¦
π¦ where this page comes from
- debian bookworm: libaudio-mpd-perl 2.004-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libaudio-mpd-perl 2.004-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libaudio-mpd-perl 2.004-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libaudio-mpd-perl 2.004-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libaudio-mpd-perl 2.004-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms