From 5a1bb7ffea10894769972b876a22b120c77e2e32 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Sun, 10 May 2015 22:03:49 +1000 Subject: [PATCH] * update pod --- lib/Text/Playlist.pm | 21 +++++++++++++-------- lib/Text/Playlist/M3U.pm | 32 ++++++++++++++++++++++++++++++++ lib/Text/Playlist/PLS.pm | 31 +++++++++++++++++++++++++++++++ lib/Text/Playlist/XSPF.pm | 28 ++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+), 8 deletions(-) diff --git a/lib/Text/Playlist.pm b/lib/Text/Playlist.pm index dd603a3..9988417 100644 --- a/lib/Text/Playlist.pm +++ b/lib/Text/Playlist.pm @@ -45,25 +45,30 @@ Text::Playlist -- base class for working with various playlist formats =head1 Methods -=head2 C +=head2 C - my @items = $pls->items; # array - my $items = $pls->items; # arrayref + my @items = $pls->load('playlist.pls'); -Returns array of playlist items. +Simple helper for loading playlist from file. See also C. -=head2 C +=head2 C - $pls->load('playlist.pls'); + my @items = $pls->parse($text); -Simple helper for loading playlist from file. See also C. +Takes playlist text and returns array of hashrefs with playlist items. In scalar content returns arrayref. =head2 C - $pls->save('playlist.pls'); + $pls->save('playlist.pls', @items); Simple helper for saving playlist to file. See also C. +=head2 C + + my $text = $pls->dump(@items); + +Takes array of hashrefs with playlist items and returns constructed playlist. + =head1 AUTHORS Alex 'AdUser' Z diff --git a/lib/Text/Playlist/M3U.pm b/lib/Text/Playlist/M3U.pm index 9107437..942af46 100644 --- a/lib/Text/Playlist/M3U.pm +++ b/lib/Text/Playlist/M3U.pm @@ -98,3 +98,35 @@ sub dump { } 1; + +__END__ + +=pod + +=head1 NAME + +Text::Playlist::M3U - parser for 'm3u' format + +=head1 DESCRIPTION + +=head2 C +=head2 C +=head2 C +=head2 C + +For description of these methods see description in base class L + +=head1 Item format + +Each parsed item has the following keys in hashref: + +* file -- path or url, required +* title -- title for given item, required +* duration -- item duration in seconds, or -1 if not unknown +* attrs -- hashref with attributes for given item, optional + +=head1 AUTHORS + + Alex 'AdUser' Z + +=cut diff --git a/lib/Text/Playlist/PLS.pm b/lib/Text/Playlist/PLS.pm index a7bd925..166f3d2 100644 --- a/lib/Text/Playlist/PLS.pm +++ b/lib/Text/Playlist/PLS.pm @@ -62,3 +62,34 @@ sub dump { } 1; + +__END__ + +=pod + +=head1 NAME + +Text::Playlist::PLS - parser for 'pls' format + +=head1 DESCRIPTION + +=head2 C +=head2 C +=head2 C +=head2 C + +For description of these methods see description in base class L + +=head1 Item format + +Each parsed item has the following keys in hashref: + +* file -- path or url, required +* title -- title for given item, required +* length -- item duration in seconds, or -1 if not unknown + +=head1 AUTHORS + + Alex 'AdUser' Z + +=cut diff --git a/lib/Text/Playlist/XSPF.pm b/lib/Text/Playlist/XSPF.pm index 6a0d7ac..ebcf1ac 100644 --- a/lib/Text/Playlist/XSPF.pm +++ b/lib/Text/Playlist/XSPF.pm @@ -58,8 +58,36 @@ __END__ =pod +=head1 NAME + +Text::Playlist::XSPF - parser for 'xspf' format + +=head1 DESCRIPTION + +=head2 C +=head2 C +=head2 C +=head2 C + +For description of these methods see description in base class L + +=head1 Item format + +Each parsed item has the following keys in hashref: + +* location -- path or url, required. Following formats acceptable: + - Windows Path : file:///C:/music/foo.mp3 + - Linux Path : file:///media/music/foo.mp3 + - Relative Path : music/foo.mp3 + - External URL : http://www.example.com/music/bar.ogg +* title -- title for given item, required + =head1 LINKS L +=head1 AUTHORS + + Alex 'AdUser' Z + =cut