Browse Source

* update pod

master
Alex 'AdUser' Z 10 years ago
parent
commit
5a1bb7ffea
  1. 21
      lib/Text/Playlist.pm
  2. 32
      lib/Text/Playlist/M3U.pm
  3. 31
      lib/Text/Playlist/PLS.pm
  4. 28
      lib/Text/Playlist/XSPF.pm

21
lib/Text/Playlist.pm

@ -45,25 +45,30 @@ Text::Playlist -- base class for working with various playlist formats
=head1 Methods =head1 Methods
=head2 C<items> =head2 C<load>
my @items = $pls->items; # array my @items = $pls->load('playlist.pls');
my $items = $pls->items; # arrayref
Returns array of playlist items. Simple helper for loading playlist from file. See also C<parse>.
=head2 C<load> =head2 C<parse>
$pls->load('playlist.pls'); my @items = $pls->parse($text);
Simple helper for loading playlist from file. See also C<parse>. Takes playlist text and returns array of hashrefs with playlist items. In scalar content returns arrayref.
=head2 C<save> =head2 C<save>
$pls->save('playlist.pls'); $pls->save('playlist.pls', @items);
Simple helper for saving playlist to file. See also C<dump>. Simple helper for saving playlist to file. See also C<dump>.
=head2 C<dump>
my $text = $pls->dump(@items);
Takes array of hashrefs with playlist items and returns constructed playlist.
=head1 AUTHORS =head1 AUTHORS
Alex 'AdUser' Z <ad_user@runbox.com> Alex 'AdUser' Z <ad_user@runbox.com>

32
lib/Text/Playlist/M3U.pm

@ -98,3 +98,35 @@ sub dump {
} }
1; 1;
__END__
=pod
=head1 NAME
Text::Playlist::M3U - parser for 'm3u' format
=head1 DESCRIPTION
=head2 C<load>
=head2 C<parse>
=head2 C<save>
=head2 C<dump>
For description of these methods see description in base class L<Text::Playlist>
=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 <ad_user@runbox.com>
=cut

31
lib/Text/Playlist/PLS.pm

@ -62,3 +62,34 @@ sub dump {
} }
1; 1;
__END__
=pod
=head1 NAME
Text::Playlist::PLS - parser for 'pls' format
=head1 DESCRIPTION
=head2 C<load>
=head2 C<parse>
=head2 C<save>
=head2 C<dump>
For description of these methods see description in base class L<Text::Playlist>
=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 <ad_user@runbox.com>
=cut

28
lib/Text/Playlist/XSPF.pm

@ -58,8 +58,36 @@ __END__
=pod =pod
=head1 NAME
Text::Playlist::XSPF - parser for 'xspf' format
=head1 DESCRIPTION
=head2 C<load>
=head2 C<parse>
=head2 C<save>
=head2 C<dump>
For description of these methods see description in base class L<Text::Playlist>
=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 =head1 LINKS
L<https://en.wikipedia.org/wiki/XML_Shareable_Playlist_Format> L<https://en.wikipedia.org/wiki/XML_Shareable_Playlist_Format>
=head1 AUTHORS
Alex 'AdUser' Z <ad_user@runbox.com>
=cut =cut

Loading…
Cancel
Save