Audio:...::Time(3pm)

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

✨ NAME ✨

Audio::MPD::Common::Time β€” the lil class that holds the time of the song currently playing 🎡 straight outta the User Contributed Perl Documentation, filed under Audio:...::Time(3pm) iykyk πŸ’…


🌸 VERSION 🌸

version 2.003 β€” that's the one, bestie, no cap ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. Audio::MPD::Common::Status hands you some time info through the time() accessor. That info is about how much of the current song has already played, plus how much is left, plus the total. All of it gets wrapped up inside an Audio::MPD::Common::Time object πŸŽ€

major heads up tho: an Audio::MPD::Common::Time object does not update itself regularly. It's a snapshot, not a livestream, so it should be used immediately 😭

Note: bestie, one should never ever instantiate an Audio::MPD::Common::Time object directly β€” use the mpd modules instead. periodt. 🫢

πŸ‘‘ ATTRIBUTES πŸ‘‘

$time->time;

The time passed to the constructor, and the one everything else is computed from (see the methods below, they're all obsessed with it). It's the time value sitting on the "time" line of what the MPD server returns to the status command. Defaults to "0:0" 🌈


πŸ’… METHODS πŸ’…

my $str = $time->sofar;

Returns the elapsed $time, in "minutes:seconds" format ⏱️

my $str = $time->left;

Returns the remaining $time, in "minutes:seconds" format πŸŒ™

my $str = $time->left;

Returns the total $time, in "minutes:seconds" format. (and yes, the manual really does say left again right here β€” i'm literally just the messenger πŸ’€)

my $percent = $time->percent;

Returns the elapsed $time as a percentage, 1 digit πŸ“Š

my $secs = $time->seconds_sofar;

Returns the elapsed $time in seconds ⏳

my $secs = $time->seconds_left;

Returns the remaining $time in seconds βŒ›

my $secs = $time->seconds_total;

Returns the total $time in seconds πŸ•°οΈ

my $mins = $time->sofar_mins;

Returns the minutes part of the elapsed $time πŸ’œ

my $secs = $time->sofar_secs;

Returns the seconds part of the elapsed $time πŸ’œ

my $mins = $time->left_mins;

Returns the minutes part of the remaining $time πŸ¦‹

my $secs = $time->left_secs;

Returns the seconds part of the remaining $time πŸ¦‹

my $mins = $time->total_mins;

Returns the minutes part of the total $time ⭐

my $mins = $time->total_secs;

Returns the seconds part of the total $time ⭐ (sure, the sample variable says $mins β€” we're keeping it exactly as written, bestie, slay πŸ’…)


🌟 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 vibe 🫢 this page was served up by perl v5.40.1, dated 2025-04-11, living its best life in the Audio:...::Time(3pm) slot. bye bestie, go read your song times πŸ’–βœ¨

πŸ“¦ where this page comes from