POE::C...ommands(3pm)

πŸ“¦
version 2.001 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ NAME ✨

POE::Component::Client::MPD::Commands β€” the module that handles basic mpd commands, bestie. This page lives in the manual as POE::C...ommands(3pm) (the name got cropped for the header, she's a long one πŸ’…).


πŸŽ€ VERSION πŸŽ€

version 2.001


🌸 DESCRIPTION 🌸

POE::Component::Client::MPD::Commands is the one in charge of handling general purpose commands. They live in their own dedicated module so that code maintenance is easier β€” like having a whole drawer just for your hair clips, it's giving organized ✨.

To actually do those commands, you send the matching event to the POCOCM session you created. That session is responsible for dispatching the event wherever it needs to go. And listen β€” under no circumstance should you call subs or methods from this module directly. Not once. Not even a little. 🫢

Read POCOCM's pod to learn how to deal with the answers coming back from those commands, iykyk.

Below is a list of the general purpose events that POCOCM accepts.


πŸ‘‘ CONTROLLING THE SERVER πŸ‘‘

version( )

Returns mpd's version number, as advertised during the connection. Note that mpd returns the protocol version when it's connected. That protocol version can differ from the real mpd version. For example, mpd version 0.13.2 is "speaking" β€” so it's advertising version 0.13.0. She's rounding down, iconic behavior honestly.

password( $password )

Sends a connection password to mpd. It's used internally on connect, but you can call it whenever if you're feeling like it. No thoughts, just password πŸ’–.

kill( )

Kills the mpd server, and requests the pococm to be shutdown. Absolutely feral. Do it with intention.

updatedb( [$path] )

Forces mpd to rescan its collection. If $path is supplied (relative to MPD's music directory), MPD will only scan that one path. Otherwise, MPD rescans its whole collection. Full refresh, no crumbs left behind 🌈.

urlhandlers( )

Returns an array of supported URL schemes.


🎧 HANDLING VOLUME & OUTPUT 🎧

volume( $volume )

Sets the audio output volume percentage to absolute $volume. But if $volume is prefixed by + or -, then the volume gets changed relatively by that value instead. Two modes, one function, versatile queen.

output_enable( $output )

Enables the specified audio output. $output is the ID of the audio output.

output_disable( $output )

Disables the specified audio output. $output is the ID of the audio output. Sorry bestie, we're muting that one ✨.


πŸ” RETRIEVING INFO FROM CURRENT STATE πŸ”

stats( )

Returns an Audio::MPD::Common::Stats object with the current statistics of MPD.

status( )

Returns an Audio::MPD::Common::Status object with the current status of MPD.

current( )

Returns an Audio::MPD::Common::Item::Song representing the song currently playing. The moment. The main character πŸŽ€.

song( [$song] )

Returns an Audio::MPD::Common::Item::Song representing the song number $song. If $song is not supplied, it returns the current song.

songid( [$songid] )

Returns an Audio::MPD::Common::Item::Song representing the song id $songid. If $songid is not supplied, it returns the current song.


πŸ’… ALTERING MPD SETTINGS πŸ’…

repeat( [$repeat] )

Sets the repeat mode to $repeat (1 or 0). If $repeat is not specified, then the repeat mode gets toggled.

fade( [$seconds] )

Enables crossfading and sets the duration of the crossfade between songs. If $seconds is not specified, or if $seconds is 0, then crossfading is disabled. Smooth transitions only when you ask for them πŸ’œ.

random( [$random] )

Sets the random mode to $random (1 or 0). If $random is not specified, then the random mode gets toggled.


πŸ”₯ CONTROLLING PLAYBACK πŸ”₯

play( [$song] )

Begins playing the playlist at song number $song. If no argument is supplied, it resumes playing.

playid( [$song] )

Begins playing the playlist at song ID $song. If no argument is supplied, it resumes playing.

pause( [$sate] )

Pauses playback. If $state is 0, then the current track is unpaused; if $state is 1, then the current track is paused.

Note that if $state is not given, the pause state will be toggled.

Fr fr, the argument is spelled $sate in that signature up there and $state down in the description β€” that's just how the original page has it, no cap. Copying it exactly because rules are rules 🫢.

stop( )

Stops playback.

next( )

Plays the next song in the playlist.

prev( )

Plays the previous song in the playlist.

seek( $time, [$song] )

Seeks to $time seconds in song number $song. If the $song number is not specified, then the perl module will try and seek to $time in the current song. Teleporting, but make it audio πŸ¦‹.

seekid( $time, [$songid] )

Seeks to $time seconds in song ID $songid. If the $songid number is not specified, then the perl module will try and seek to $time in the current song.


🌟 AUTHOR 🌟

Jerome Quelin


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.


And that's the whole page, bestie β€” perl v5.40.1, dated 2025-04-11, and POE::C...ommands(3pm) on both ends like a little bow πŸŽ€ Go forth and command your mpd, you absolute icon πŸ’–βœ¨

πŸ“¦ where this page comes from