Audio:...aylist(3pm)

πŸ“¦
version 2.004 Β· 2 versions
  • 2.004 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 2.004 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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. an Audio::MPD::Playlist gets automatically created for you while an Audio::MPD object is being created β€” and then you just grab it with the playlist() 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 🫢


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