1 package ID3FS::AudioFile::Ogg;
5 use Ogg::Vorbis::Header;
10 my $class=ref($proto) || $proto;
15 $self->{ogg}=Ogg::Vorbis::Header->new($self->{path});
16 $self->{comments}=[ $self->{ogg}->comment_tags() ];
22 my ($self, $tag, $complain)=@_;
23 for my $commenttype (@{$self->{comments}})
25 if($commenttype =~ /$tag/i)
27 my @comments=$self->{ogg}->comment($commenttype);
30 # take first comment with actual contents
31 while(my $comment=shift @comments)
33 if(defined($comment) &&
37 $comment =~ s/\//-/g; # drop slashes
44 warn("$self->{path}: no $tag defined in Ogg comments\n") if($complain);
48 sub artist { shift->get("Artist", 1); }
49 sub album { shift->get("Album", 1); }
50 sub audiotype { return "ogg"; }
51 sub haspic { return undef; } # FIXME
52 sub v1genre { return undef; } # ID3 only
53 # We don't care if year is not set
54 sub year { shift->get("Date", 0); }
60 for my $commenttype (@{$self->{comments}})
62 if($commenttype =~ /genre/i)
64 push(@comments,$self->{ogg}->comment($commenttype));