Permalink
Browse files

initial commit, version 1.0

  • Loading branch information...
squentin committed May 24, 2009
0 parents commit 752d7e88d9e802f1e0366b078e8a878ebd224cc4
Showing with 50,068 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +1 −0 AUTHORS
  3. +622 −0 COPYING
  4. +17 −0 INSTALL
  5. +66 −0 Makefile
  6. +481 −0 NEWS
  7. +17 −0 README
  8. +72 −0 apeheader.pm
  9. +210 −0 flacheader.pm
  10. +18 −0 gmbrc
  11. +11 −0 gmusicbrowser.desktop
  12. +173 −0 gmusicbrowser.man
  13. +8 −0 gmusicbrowser.menu
  14. +8,660 −0 gmusicbrowser.pl
  15. +82 −0 gmusicbrowser.spec
  16. +290 −0 gmusicbrowser_123.pm
  17. +146 −0 gmusicbrowser_dbus.pm
  18. +757 −0 gmusicbrowser_gstreamer-0.10.pm
  19. +7,042 −0 gmusicbrowser_list.pm
  20. +170 −0 gmusicbrowser_mplayer.pm
  21. +2,728 −0 gmusicbrowser_player.pm
  22. +74 −0 gmusicbrowser_server.pm
  23. +1,755 −0 gmusicbrowser_tags.pm
  24. +66 −0 iceserver.pl
  25. +415 −0 layout_doc.html
  26. +483 −0 layouts
  27. +1,454 −0 mp3header.pm
  28. +72 −0 mpcheader.pm
  29. +552 −0 oggheader.pm
  30. BIN pix/gmb-case_insensitive.png
  31. BIN pix/gmb-case_sensitive.png
  32. BIN pix/gmb-empty.png
  33. BIN pix/gmb-filter.png
  34. BIN pix/gmb-invert.png
  35. BIN pix/gmb-library.png
  36. BIN pix/gmb-list.png
  37. BIN pix/gmb-lock.png
  38. BIN pix/gmb-locklight.png
  39. BIN pix/gmb-picture.png
  40. BIN pix/gmb-playlist.png
  41. BIN pix/gmb-queue.png
  42. BIN pix/gmb-random.png
  43. BIN pix/gmb-shuffle.png
  44. BIN pix/gmb-turnoff.png
  45. BIN pix/gmb-vol0.png
  46. BIN pix/gmb-vol1.png
  47. BIN pix/gmb-vol2.png
  48. BIN pix/gmb-vol3.png
  49. BIN pix/gmb-volm.png
  50. BIN pix/gmb-wait.png
  51. BIN pix/gmusicbrowser.png
  52. BIN pix/gmusicbrowser32x32.png
  53. BIN pix/gnome-classic/gtk-about.png
  54. BIN pix/gnome-classic/gtk-add.png
  55. BIN pix/gnome-classic/gtk-apply.png
  56. BIN pix/gnome-classic/gtk-cancel.png
  57. BIN pix/gnome-classic/gtk-clear.png
  58. BIN pix/gnome-classic/gtk-copy.png
  59. BIN pix/gnome-classic/gtk-delete.png
  60. BIN pix/gnome-classic/gtk-dialog-error.png
  61. BIN pix/gnome-classic/gtk-dialog-info.png
  62. BIN pix/gnome-classic/gtk-dialog-question.png
  63. BIN pix/gnome-classic/gtk-dialog-warning.png
  64. BIN pix/gnome-classic/gtk-edit.png
  65. BIN pix/gnome-classic/gtk-go-down.png
  66. BIN pix/gnome-classic/gtk-go-up.png
  67. BIN pix/gnome-classic/gtk-goto-bottom.png
  68. BIN pix/gnome-classic/gtk-goto-top.png
  69. BIN pix/gnome-classic/gtk-media-next.png
  70. BIN pix/gnome-classic/gtk-media-pause.png
  71. BIN pix/gnome-classic/gtk-media-play.png
  72. BIN pix/gnome-classic/gtk-media-previous.png
  73. BIN pix/gnome-classic/gtk-media-stop.png
  74. BIN pix/gnome-classic/gtk-no.png
  75. BIN pix/gnome-classic/gtk-ok.png
  76. BIN pix/gnome-classic/gtk-open.png
  77. BIN pix/gnome-classic/gtk-preferences.png
  78. BIN pix/gnome-classic/gtk-properties.png
  79. BIN pix/gnome-classic/gtk-quit.png
  80. BIN pix/gnome-classic/gtk-refresh.png
  81. BIN pix/gnome-classic/gtk-remove.png
  82. BIN pix/gnome-classic/gtk-save-as.png
  83. BIN pix/gnome-classic/gtk-save.png
  84. BIN pix/gnome-classic/gtk-sort-ascending.png
  85. BIN pix/gnome-classic/gtk-sort-descending.png
  86. BIN pix/gnome-classic/gtk-stop.png
  87. BIN pix/gnome-classic/gtk-yes.png
  88. BIN pix/gtk-fullscreen.png
  89. BIN pix/gtk-media-next.png
  90. BIN pix/gtk-media-pause.png
  91. BIN pix/gtk-media-play.png
  92. BIN pix/gtk-media-previous.png
  93. BIN pix/gtk-media-stop.png
  94. BIN pix/plugin-rip.png
  95. BIN pix/stars0.png
  96. BIN pix/stars1.png
  97. BIN pix/stars2.png
  98. BIN pix/stars3.png
  99. BIN pix/stars4.png
  100. BIN pix/stars5.png
  101. BIN pix/tango/gmb-filter.png
  102. BIN pix/tango/gmb-library.png
  103. BIN pix/tango/gmb-list.png
  104. BIN pix/tango/gmb-lock.png
  105. BIN pix/tango/gmb-locklight.png
  106. BIN pix/tango/gmb-picture.png
  107. BIN pix/tango/gmb-playlist.png
  108. BIN pix/tango/gmb-queue.png
  109. BIN pix/tango/gmb-random.png
  110. BIN pix/tango/gmb-shuffle.png
  111. BIN pix/tango/gmb-turnoff.png
  112. BIN pix/tango/gmb-vol0.png
  113. BIN pix/tango/gmb-vol1.png
  114. BIN pix/tango/gmb-vol2.png
  115. BIN pix/tango/gmb-vol3.png
  116. BIN pix/tango/gmb-volm.png
  117. BIN pix/tango/gmb-wait.png
  118. BIN pix/tango/gtk-fullscreen.png
  119. BIN pix/tango/gtk-media-next.png
  120. BIN pix/tango/gtk-media-pause.png
  121. BIN pix/tango/gtk-media-play.png
  122. BIN pix/tango/gtk-media-previous.png
  123. BIN pix/tango/gtk-media-stop.png
  124. BIN pix/tango/plugin-rip.png
  125. BIN pix/tango/trayicon.png
  126. BIN pix/trayicon.png
  127. +250 −0 plugins/audioscrobbler.pm
  128. +43 −0 plugins/autosave.pm
  129. +170 −0 plugins/export.pm
  130. +474 −0 plugins/fetch_cover.pm
  131. +55 −0 plugins/gnome_mmkeys.pm
  132. +541 −0 plugins/lyrics.pm
  133. +312 −0 plugins/mozembed.pm
  134. +98 −0 plugins/nowplaying.pm
  135. +67 −0 plugins/rip.pm
  136. +76 −0 po/create_pot.pl
  137. +3,814 −0 po/de.po
  138. +2,964 −0 po/es.po
  139. +3,994 −0 po/fr.po
  140. +3,817 −0 po/gmusicbrowser.pot
  141. +2,779 −0 po/hu.po
  142. +3,936 −0 po/pl.po
  143. +169 −0 simple_http.pm
  144. +64 −0 wvheader.pm
@@ -0,0 +1,3 @@
*~
locale/
.*.swp
@@ -0,0 +1 @@
Quentin Sculo <squentin@free.fr>
622 COPYING

Large diffs are not rendered by default.

Oops, something went wrong.
17 INSTALL
@@ -0,0 +1,17 @@
You can run it without installation by simply running :
/PATH_TO/WHERE/YOU_UNTARRED_THE_TAR.GZ/gmusicbrowser.pl
(gmusicbrowser.pl will first look for its files in . and then in ../share/gmusicbrowser relative to where it resides)
RPM based distro
================
rpm -bb gmusicbrowser.spec
rpm -i gmusicbrowser.rpm
DEB based distro
================
sudo ./debian/rules binary
sudo dpkg -i ../gmusicbrowser.deb
other
=====
make install
@@ -0,0 +1,66 @@
PACKAGE = gmusicbrowser
VERSION = 1.0
prefix = usr
bindir = ${DESTDIR}/${prefix}/bin
appdir = ${DESTDIR}/${prefix}/share/applications
datadir = ${DESTDIR}/${prefix}/share
mandir = ${DESTDIR}/${prefix}/share/man
docdir = ${DESTDIR}/${prefix}/share/doc/$(PACKAGE)-${VERSION}
localedir = ${DESTDIR}/${prefix}/share/locale
menudir = ${DESTDIR}/${prefix}/lib/menu
iconsdir = ${DESTDIR}/${prefix}/share/icons
liconsdir = $(iconsdir)/large
miconsdir = $(iconsdir)/mini
DOCS=AUTHORS COPYING README NEWS INSTALL layout_doc.html
LINGUAS=`/bin/ls locale`
all:
clean:
distclean: clean
install: all
mkdir -p "$(bindir)"
mkdir -p "$(datadir)/gmusicbrowser/"
mkdir -p "$(docdir)"
mkdir -p "$(mandir)/man1/"
install -m 644 $(DOCS) "$(docdir)"
install -m 644 gmusicbrowser.man "$(mandir)/man1/gmusicbrowser.1"
install -d "$(datadir)/gmusicbrowser/pix/"
install -d "$(datadir)/gmusicbrowser/pix/gnome-classic/"
install -d "$(datadir)/gmusicbrowser/pix/tango/"
install -d "$(datadir)/gmusicbrowser/plugins/"
install -Dm 755 gmusicbrowser.pl "$(bindir)/gmusicbrowser"
install -m 755 iceserver.pl "$(datadir)/gmusicbrowser/iceserver.pl"
install -m 644 *.pm layouts "$(datadir)/gmusicbrowser/"
install -m 644 plugins/*.pm "$(datadir)/gmusicbrowser/plugins/"
install -m 644 pix/*.png "$(datadir)/gmusicbrowser/pix/"
install -m 644 pix/gnome-classic/* "$(datadir)/gmusicbrowser/pix/gnome-classic/"
install -m 644 pix/tango/* "$(datadir)/gmusicbrowser/pix/tango/"
install -Dm 644 gmusicbrowser.desktop "$(datadir)/applications/gmusicbrowser.desktop"
install -Dm 644 gmusicbrowser.menu "$(menudir)/gmusicbrowser"
install -Dm 644 pix/gmusicbrowser32x32.png "$(iconsdir)/gmusicbrowser.png"
install -Dm 644 pix/gmusicbrowser.png "$(liconsdir)/gmusicbrowser.png"
install -Dm 644 pix/trayicon.png "$(miconsdir)/gmusicbrowser.png"
for lang in $(LINGUAS) ; \
do \
install -d "$(localedir)/$$lang/LC_MESSAGES/"; \
install -m 644 locale/$$lang/LC_MESSAGES/gmusicbrowser.mo "$(localedir)/$$lang/LC_MESSAGES/"; \
done
postinstall:
update-menus
uninstall:
rm -f "$(bindir)/gmusicbrowser"
rm -rf "$(datadir)/gmusicbrowser/" "$(docdir)"
rm -f "$(liconsdir)/gmusicbrowser.png" "$(miconsdir)/gmusicbrowser.png" "$(iconsdir)/gmusicbrowser.png"
rm -f "$(appdir)/gmusicbrowser.desktop" "$(menudir)/gmusicbrowser"
rm -f "$(mandir)/$(MANS)"
rm -f "$(localedir)/*/LC_MESSAGES/gmusicbrowser.mo"
postuninstall:
#clean_menus
update-menus
481 NEWS

Large diffs are not rendered by default.

Oops, something went wrong.
17 README
@@ -0,0 +1,17 @@
Name: gmusicbrowser
Summary: Jukebox for large collections of mp3/ogg/flac/mpc files
URL: http://gmusicbrowser.sourceforge.net/
Jukebox for large collections of mp3/ogg/flac/mpc files
Uses gstreamer, mpg321/ogg123/flac123 or mplayer for playback
Main features :
- artist/album lock : easily restrict playlist to current artist/album
- easy access to related songs (same artist/album/title)
- fully featured tag editor
- simple mass-tagging and mass-renaming
- support multiple genres for each song
- customizable labels can be set for each song
- filter history in the browser window
- filters with unlimited nesting of conditions
- customizable weighted random mode
@@ -0,0 +1,72 @@
# Copyright (C) 2007 Quentin Sculo <squentin@free.fr>
#
# This file is part of Gmusicbrowser.
# Gmusicbrowser is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation
package Tag::APEfile;
use strict;
use warnings;
our @ISA=('Tag::MP3');
my %compression;
INIT
{%compression=
( 1000 => 'Fast',
2000 => 'Normal',
3000 => 'High',
4000 => 'Extra High',
5000 => 'Insane',
);
}
sub new
{ my ($class,$file,$findlength)=@_;
my $self=bless {}, $class;
local $_;
# check that the file exists and is readable
unless ( -e $file && -r $file )
{ warn "File '$file' does not exist or cannot be read.\n";
return undef;
}
$self->{filename} = $file;
$self->_open or return undef;
$self->_FindTags;
$self->_ReadHeader;
return undef unless $self->{info};
$self->_close;
return $self;
}
sub _ReadHeader
{ my $self=$_[0];
my %info;
my $fh=$self->{fileHandle};
my $offset=$self->{startaudio};
seek $fh,$offset,0;
my $buf;
return unless read($fh,$buf,12)==12;
return unless $buf=~m/^MAC /;
my ($v,$desc_size)=unpack 'x4Vv',$buf;
$info{version}=$v/1000;
seek $fh,$desc_size-12,1;
return unless read($fh,$buf,24)==24;
my ($compression,$blocksperframe,$finalsblocks,$nbframes,$bitpersample,$channels,$freq)=unpack 'vx2VVVvvV',$buf;
$info{compression}=$compression{$compression} || $compression;
$info{channels}=$channels;
$info{frames}=$nbframes;
$info{rate}=$freq;
if ($nbframes==0) {$info{seconds}=$info{bitrate}=0}
else
{ $info{seconds}=( ($nbframes-1)*$blocksperframe+$finalsblocks )/$freq;
#$info{seconds}=( ($nbframes-1)*$blocksperframe+$finalsblocks )*1000/$freq;
$info{bitrate}=( $self->{endaudio}-$self->{startaudio} )*8/1000/$info{seconds};
}
#warn "$_=$info{$_}\n" for keys %info;
$self->{info}=\%info;
}
1;
@@ -0,0 +1,210 @@
# Copyright (C) 2005-2007 Quentin Sculo <squentin@free.fr>
#
# This file is part of Gmusicbrowser.
# Gmusicbrowser is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation
#http://flac.sourceforge.net/format.html
package Tag::Flac;
use strict;
use warnings;
our @ISA=('Tag::OGG');
use constant
{ STREAMINFO => 0,
PADDING => 1,
APPLICATION => 2,
SEEKTABLE => 3,
VORBIS_COMMENT=> 4,
CUESHEET => 5,
PICTURE => 6,
};
sub new
{ my ($class,$file)=@_;
my $self=bless {}, $class;
local $_;
# check that the file exists and is readable
unless ( -e $file && -r $file )
{ warn "File '$file' does not exist or cannot be read.\n";
return undef;
}
$self->{filename} = $file;
$self->{startaudio}=0; #start of flac stream (in case an id3v2 tag is at the beginning of the file)
my $fh=$self->_open or return undef;
my $buffer;
{ last unless read($fh,$buffer,4)==4;
if ($buffer=~m/^ID3/)
{ my $tag=Tag::ID3v2->new_from_file($self);
$self->{startaudio}+=$tag->{size};
redo;
}
}
unless ($buffer && $buffer eq 'fLaC')
{ warn "flac: Not a flac header\n"; $self->_close; return undef; }
my $last;
while ( !$last && read($fh,$buffer,4)==4 )
{ $buffer=unpack 'N',$buffer;
my $size=$buffer & 0xffffff;
my $pos=tell $fh;
my $type=($buffer >> 24) & 0x7f;
$last=$buffer >>31;
unless (read($fh,$buffer,$size)==$size)
{ warn "flac: Premature end of file\n"; $self->_close; return undef; }
if ($type==STREAMINFO) {$self->{info}=_ReadInfo(\$buffer);}
elsif ($type==VORBIS_COMMENT) {$self->{comments}=_UnpackComments($self,\$buffer); $self->{comment_offset}=$pos-4}
elsif ($type==PICTURE) {my $pic=_ReadPicture(\$buffer); push @{$self->{pictures}},$pic if $pic;}
}
my $audiosize=(stat $fh)[7]-tell($fh);
$self->_close;
unless ($self->{info})
{ warn "error, can't read file or not a valid flac file\n";
return undef;
}
$self->{info}{bitrate}= $self->{info}{seconds} ? $audiosize*8/$self->{info}{seconds} : 0;
unless ($self->{comments})
{ $self->{vorbis_string}='gmusicbrowser'; #FIXME
$self->{CommentsOrder}=[];
$self->{comments}={};
}
return $self;
}
sub write_file # experimental
{ my $self=shift;
local $_;
my ($INfh,$OUTfh);
my $newcom_packref=_PackComments($self);
my $fh=$self->_open or return undef;
my $buffer; my $last; my $towrite='fLaC'; my $padding=0;
seek $fh,$self->{startaudio} ,0; #skip extra tags
return undef unless (read($fh,$buffer,4)==4 && $buffer eq 'fLaC');
while ( !$last && read($fh,$buffer,4)==4 )
{ $buffer=unpack 'N',$buffer;
my $size=$buffer & 0xffffff;
my $type=($buffer >> 24) & 0x7f;
$last=$buffer >>31;
if ($type!=VORBIS_COMMENT && $type!=PADDING)
{ $buffer&=0x7fffffff; #set Last-metadata-block flag to 0
$towrite.=pack 'N',$buffer;
unless (read($fh,$towrite,$size,length($towrite))==$size)
{ warn "flac: Premature end of file\n"; return undef; }
}
else {$padding+=$size+4; seek $fh,$size,1; }
}
$padding-=4+length $$newcom_packref;
my $header=VORBIS_COMMENT;
my $inplace=($padding==0 || ($padding>3 && $padding<8192) );
#if ($inplace && $padding<4)
# { $$newcom_packref.="\x00" x(4-$padding); $padding=''; $header+=0x80; }
if ($padding==0) {$header+=0x80;$padding='';}
else
{ $padding=$inplace? $padding-4 : 256;
$padding=pack "Nx$padding",((0x80+PADDING)<<24)+$padding;
}
$header=pack 'N',($header<<24)+length $$newcom_packref;
if ($inplace)
{ $self->_close;
$fh=$self->_openw or return undef;
seek $fh,$self->{startaudio} ,0;
print $fh $towrite.$header.$$newcom_packref.$padding or warn $!;
$self->_close;
return 1;
}
else
{ my $tmpfh=$self->_openw(1) or return undef;
if ($self->{startaudio})
{ seek $fh,0,0;
read($fh,$buffer,$self->{startaudio});
print $tmpfh $buffer or warn $!;
}
print $tmpfh $towrite.$header.$$newcom_packref.$padding or warn $!;
while (read($fh,$buffer,1048576))
{ print $tmpfh $buffer or warn $!; }
$self->_close;
close $tmpfh;
warn "replacing old file with new file.\n";
unlink $self->{filename} && rename $self->{filename}.'.TEMP',$self->{filename};
return 1;
}
}
sub _close
{ my $self=shift;
close delete($self->{fileHandle});
}
sub _ReadInfo
{ my $packref=$_[0];
my @v=unpack 'nn CnCn nCCN',$$packref;
#A16 B16 C8 C16 D8 D16 E16 EEEEFFFG GGGGHHHH H32 I128
#A <16> The minimum block size (in samples) used in the stream
#B <16> The maximum block size (in samples) used in the stream. (Minimum blocksize == maximum blocksize) implies a fixed-blocksize stream.
#C <24> The minimum frame size (in bytes) used in the stream. May be 0 to imply the value is not known.
#D <24> The maximum frame size (in bytes) used in the stream. May be 0 to imply the value is not known.
#E <20> Sample rate in Hz. Though 20 bits are available, the maximum sample rate is limited by the structure of frame headers to 1048570Hz. Also, a value of 0 is invalid.
#F <3> (number of channels)-1. FLAC supports from 1 to 8 channels
#G <5> (bits per sample)-1. FLAC supports from 4 to 32 bits per sample. Currently the reference encoder and decoders only support up to 24 bits per sample
#H <36> Total samples in stream. 'Samples' means inter-channel sample, i.e. one second of 44.1Khz audio will have 44100 samples regardless of the number of channels. A value of zero here means the number of total samples is unknown.
#I <128> MD5 signature of the unencoded audio data
my %info;
$info{min_block_size}=$v[0];
$info{max_block_size}=$v[1];
$info{min_frame_size}=($v[2]<<16)+$v[3];
$info{max_frame_size}=($v[4]<<16)+$v[5];
$info{rate}=($v[6]<<4)+($v[7]>>4);
$info{channels}=1+( ($v[7] & 0b1110)>>1 );
$info{bit_per_sample}=1+( ($v[7] & 0b1)<<5 )+( $v[8] >>4 );
$info{seconds}=( $v[9]+($v[8] & 0b1111)*2**32 )/$info{rate};
return \%info;
}
sub _ReadPicture
{ my $packref=$_[0];
eval
{ my ($type,$mime,$desc,undef,undef,undef,undef,$data)
=unpack 'V V/a V/a VVV V/a',$$packref;
return [$mime,$type,$desc,$data];
};
warn "invalid picture block - skipped\n";
return undef;
}
sub _UnpackComments
{ my ($self,$packref)=@_;
my ($vstring,@c);
eval { ($vstring,@c)=unpack 'V/a V/(V/a)',$$packref; };
if ($@) { warn "Comments corrupted\n"; return undef; }
$self->{vorbis_string}=$vstring;
my %comments;
for (@c)
{ unless (s/^([^=]+)=//) { warn "comment invalid - skipped\n"; next; }
my $key=lc$1;
my $val=Encode::decode('utf-8', $_);
#print "$key = $val\n";
push @{ $comments{$key} },$val;
my $nb=@{ $comments{$key} }-1;
push @{$self->{CommentsOrder}}, $key;
}
return \%comments;
}
sub _PackComments
{ my $self=$_[0];
my @comments;
my %count;
for my $key ( @{$self->{CommentsOrder}} )
{ my $nb=$count{$key}++ || 0;
my $val=$self->{comments}{$key}[$nb];
next unless defined $val;
push @comments,$key.'='.$val;
}
my $packet=pack 'V/a* V (V/a*)*',$self->{vorbis_string},scalar @comments,@comments;
#$packet.="\x01"; #framing_flag #gstreamer doesn't like it and not needed anyway
return \$packet;
}
1;
Oops, something went wrong.

0 comments on commit 752d7e8

Please sign in to comment.