Initial commit
[audio-opusfile.git] / lib / Audio / Opusfile / Tags.pm
1 package Audio::Opusfile::Tags;
2 # Don't load this module directly, load Audio::Opusfile instead
3
4 use 5.014000;
5 use strict;
6 use warnings;
7 use subs qw/query query_count/;
8
9 sub query_all {
10 my ($tags, $tag) = @_;
11 my $count = $tags->query_count($tag);
12 map { $tags->query($tag, $_ - 1) } 1 .. $count
13 }
14
15 1;
16 __END__
17
18 =encoding utf-8
19
20 =head1 NAME
21
22 Audio::Opusfile::Tags - The tags of an Ogg Opus file
23
24 =head1 SYNOPSIS
25
26 use Audio::Opusfile;
27 my $of = Audio::Opusfile->new_from_file('file.opus');
28 my $tags = $of->tags;
29 say $tags->query("COMPOSER"); # Composer 1
30 say $tags->query_count("COMPOSER"); # 3
31 say join ", ", $tags->query_all("COMPOSER");
32 # Composer 1, Composer 2, Composer 3
33
34 =head1 DESCRIPTION
35
36 This module represents the tags of an Ogg Opus file. See the
37 documentation of L<Audio::Opusfile> for more information.
38
39 =head1 METHODS
40
41 =over
42
43 =item $tags->B<query_count>(I<$tag>)
44
45 Returns the number of values of a tag.
46
47 =item $tags->B<query>(I<$tag>[, I<$index>])
48
49 Returns the I<$index>th value of a tag. If I<$index> is not provided,
50 the first value is returned.
51
52 =item $tags->B<query_all>(I<$tag>)
53
54 Returns a list of all values of a tag, in order.
55
56 =back
57
58 =head1 SEE ALSO
59
60 L<Audio::Opusfile>,
61 L<http://opus-codec.org/>,
62 L<http://opus-codec.org/docs/opusfile_api-0.7/index.html>
63
64 =head1 AUTHOR
65
66 Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
67
68 =head1 COPYRIGHT AND LICENSE
69
70 Copyright (C) 2016 by Marius Gavrilescu
71
72 This library is free software; you can redistribute it and/or modify
73 it under the same terms as Perl itself, either Perl version 5.24.0 or,
74 at your option, any later version of Perl 5 you may have available.
75
76
77 =cut
This page took 0.022696 seconds and 4 git commands to generate.