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() ];
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
47 sub artist { shift->get("Artist"); }
48 sub album { shift->get("Album"); }
49 sub audiotype { return "ogg"; }
50 sub haspic { return undef; } # FIXME
51 sub v1genre { return undef; } # ID3 only
52 sub year { shift->get("Date"); }
58 for my $commenttype (@{$self->{comments}})
60 if($commenttype =~ /genre/i)
62 push(@comments,$self->{ogg}->comment($commenttype));