Forgotten half of the files :D
authorChristian Schmidt <maniacikarus@ipfire.org>
Mon, 12 May 2008 14:02:23 +0000 (16:02 +0200)
committerChristian Schmidt <maniacikarus@ipfire.org>
Mon, 12 May 2008 14:02:23 +0000 (16:02 +0200)
config/rootfiles/core/13/update.sh
config/rootfiles/core/14/files
config/rootfiles/core/14/update.sh
config/rootfiles/packages/mpfire
config/urlfilter/redirect_wrapper
html/cgi-bin/mpfire.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/mpfire
src/paks/mpfire/install.sh
src/paks/mpfire/uninstall.sh

index 943ece3ec7814a57c55af2a462768f0fbd6e1d23..35cbba98ee38a67776d4fc7e36a1d0d7f410728d 100644 (file)
@@ -3,3 +3,4 @@
 /usr/local/bin/backupctrl exclude >/dev/null 2>&1
 extract_files
 /var/ipfire/urlfilter/bin/prebuild.pl
+/etc/init.d/squid restart
index bfced96b62122def00a41f237b576160747b3513..d82d48dc8fd534c30a8f3afdcd7fbea3d881016e 100644 (file)
@@ -258,9 +258,27 @@ lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/media/video/saa7115.ko
 lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/media/video/tda7432.ko
 lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/media/video/bt8xx/bttv.ko
 lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/media/video/tveeprom.ko
+var/ipfire/langs
 etc/squid
 usr/lib/squid
 usr/sbin/squid
 srv/web/ipfire/cgi-bin/updatexlrator.cgi
 srv/web/ipfire/html/images/updxl-src-avg.gif
 usr/sbin/updxlrator
+srv/web/ipfire/html/images/audio-volume-high.png
+srv/web/ipfire/html/images/audio-volume-low.png
+srv/web/ipfire/html/images/audio-x-generic.png
+srv/web/ipfire/html/images/audio-volume-high-red.png
+srv/web/ipfire/html/images/audio-volume-low-red.png
+srv/web/ipfire/html/images/audio-x-generic-red.png
+srv/web/ipfire/html/images/media-flash.png
+srv/web/ipfire/html/images/media-playback-start-all.png
+srv/web/ipfire/html/images/media-repeat.png
+srv/web/ipfire/html/images/media-skip-backward.png
+srv/web/ipfire/html/images/media-floppy.png
+srv/web/ipfire/html/images/media-playback-start.png
+srv/web/ipfire/html/images/media-resume.png
+srv/web/ipfire/html/images/media-skip-forward.png
+srv/web/ipfire/html/images/media-optical.png
+srv/web/ipfire/html/images/media-playback-stop.png
+srv/web/ipfire/html/images/media-shuffle.png
index 9cce251427557deb8f8aa8de4187d4822204caae..dafea5700b1383d239ada8cbe7a373a625ac1bf7 100644 (file)
@@ -7,6 +7,7 @@ rm /lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/media/video/video-buf.ko
 rm /lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/media/dvb/frontends/dib3000-common.ko
 /etc/init.d/squid stop
 extract_files
+perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
 /etc/init.d/squid start
 depmod -a 2.6.16.57-ipfire
 depmod -a 2.6.16.57-ipfire-smp
index 7c6f01bf72549adb97af096e92e91ae4be18a010..4a66212601e51015a667f6b62293b3a90ae080b9 100644 (file)
@@ -1,5 +1,11 @@
+usr/lib/perl5/site_perl/5.8.8/Audio/MPD
+usr/lib/perl5/site_perl/5.8.8/Audio/MPD.pm
+usr/lib/perl5/5.8.8/Readonly.pm
+usr/lib/perl5/5.8.8/Class/Accessor
+usr/lib/perl5/5.8.8/Class/Accessor.pm
 usr/local/bin/mpfirectrl
 srv/web/ipfire/cgi-bin/mpfire.cgi
+srv/web/ipfire/html/images/mpfire
 var/ipfire/backup/addons/includes/mpfire
 var/ipfire/menu.d/EX-mpfire.menu
 var/ipfire/mpfire
index aee7015b5b32b49a4ca2068126af8bcee5bdaf55..7f66cd89dc4ca6c51dd69dcb7b5f85674b9fc39b 100644 (file)
@@ -31,6 +31,9 @@ my $redirectors = [ '/usr/bin/squidGuard', '/usr/sbin/updxlrator' ];
 require '/var/ipfire/general-functions.pl';
 
 my %proxysettings=();
+$proxysettings{'ENABLE_FILTER'} = 'off';
+$proxysettings{'ENABLE_CLAMAV'} = 'off';
+$proxysettings{'ENABLE_UPDXLRATOR'} = 'off';
 &General::readhash("${General::swroot}/proxy/settings", \%proxysettings);
 
 # define here your redirectors (use a comma sperated list)
index 7d75f0b4510662aa5891741870a9e8f9f09ca067..2f883a910ed1743501abb372f9ec219b7a7be9c5 100644 (file)
 ###############################################################################
 
 use strict;
+
 # enable only the following on debugging purpose
 #use warnings;
 #use CGI::Carp 'fatalsToBrowser';
 
+# use the special mpd POD and the encode POD to handle the utf8 scalars
+use Audio::MPD;
+use Encode;
+
+# initiate the connector for the mpd POD, mpd must be running on locahost
+# port 6600 without authentication
+my $mpd = Audio::MPD->new('localhost',6600,'','$REUSE');
+my $work = $mpd->status()->updating_db();
+
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
@@ -34,70 +44,158 @@ my %mpfiresettings = ();
 my %checked = ();
 my $message = '0';
 my $errormessage = "";
+my @songs;
 
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
 &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
 
-if ( $ENV{'QUERY_STRING'} =~ /title/){
-my $song = `/usr/local/bin/mpfirectrl song 2>/dev/null`;
-if ( $song eq "" ){$song = "None";}
 &Header::showhttpheaders();
-print <<END
+
+if ( $ENV{'QUERY_STRING'} =~ /title/){
+
+################################################################################
+# $ENV{'QUERY_STRING'} =~ /title/ is used to handle the inline iframe used to
+# display the current song playing ( artist - title - album aso )
+# the cgi call´s itself with a parameter and the iframe refreshes itself without
+# reloading the whole page
+################################################################################
+
+       my $number = $mpd->status()->song()+1;
+       my $volume = $mpd->status()->volume();
+       my $random = $mpd->status()->random();
+
+       if ($random eq "0" ){
+               $random="off";
+       }else{
+               $random="on";
+       }
+
+       my $repeat = $mpd->status()->repeat();
+       if ($repeat eq "0" ){
+               $repeat="off";
+       }else{
+               $repeat="on";
+       }
+
+       my $song = "";
+       if ( $mpd->current() )
+       {
+               $song = substr("-= ".$mpd->current()->Artist()." | ".$mpd->current()->Title(),0,90)." =-<br /> ";
+               if ( $song eq "-=  |  =-<br /> " ){
+                       $song = "None<br />"
+               };
+               $song .= $mpd->current()->Track()."# ".substr($mpd->current()->Album(),0,90)."<br />";
+       }else{
+               $song = "None<br /><br />";
+       }
+
+       if ( $song eq "None<br /># <br />" ){
+               $song = "None<br />".substr($mpd->current()->file(),0,90)."<br />"
+       };
+       $song .= "Playlist: ".$number."-".$mpd->status()->playlistlength()." Time: ".$mpd->status()->time()->sofar."/";
+       $song .= $mpd->status()->time()->total." (".$mpd->status()->time()->percent()."%) Status: ";
+       $song .= $mpd->status()->state()." Volume: ".$volume." % Repeat: ".$repeat." Random: ".$random;
+
+       print <<END
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <meta http-equiv='refresh' content='5'>
-<head><title>Song</title></head>
+<title></title>
 <body>
-<table width='95%' cellspacing='0' align='center'>
-<tr bgcolor='$color{'color20'}'><td align='center'><font color='red' face='Verdana' size='2'>-= $song =-</font></td></tr>
-</table>
-</body>
+<table width='100%' cellspacing='0' align='center' style="background-image:url(/images/mpfire/box.png)">
 END
 ;
-}
-else{
-&Header::showhttpheaders();
+       print"<tr ><td align='center'><font color='red' face='Verdana' size='2'><br />".encode('utf-8', $song)."<br /><br /></font></td></tr></table></body>";
+       exit;
+}elsif ( $ENV{'QUERY_STRING'} =~ /control/){
 
-sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;' />" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'pagerefresh'}</font></center>";&Header::closebox();}
+################################################################################
+# $ENV{'QUERY_STRING'} =~ /control/ is used to handle the inline iframe used to
+# display the control button ( prev play skip stop toggle aso )
+# the cgi call´s itself with a parameter and only the iframe is reloaded on click
+################################################################################
 
-$mpfiresettings{'PAGE'} = "1";
-
-open(DATEI, "<${General::swroot}/mpfire/db/mpd.db") || die "No Database found";
-my @songdb = <DATEI>;
-close(DATEI);
-
-my @artist; my @album;  my @genre;  my @year; my $linecount = 0; my %songs;
-my $key;my $file;my $Time;my $Artist;my $Title;my $Album;my $Track;my $Date;my $Genre;
-foreach (@songdb){
-       if ( $_ =~ /mtime: / ){
-               $songs{$key}="$file|$Time|$Artist|$Title|$Album|$Track|$Date|$Genre";
-               push(@artist,$Artist);push(@album,$Album);push(@year,$Date);push(@genre,$Genre);
-               $key="";$file="";$Time="";$Artist="";$Title="";$Album="";$Track="";$Date="";$Genre="";
+       &Header::getcgihash(\%mpfiresettings);
+       if ( $mpfiresettings{'ACTION'} eq "playall" ){
+               $mpd->playlist->clear();
+               foreach ($mpd->collection->all_pathes){
+                       $mpd->playlist->add($_);
                }
-       elsif ( $_ =~ /key: / ){my @temp = split(/: /,$_);$key=$temp[1];}
-       elsif ( $_ =~ /file: / ){my @temp = split(/: /,$_);$file=$temp[1];}
-       elsif ( $_ =~ /Time: / ){my @temp = split(/: /,$_);$Time=$temp[1];}
-       elsif ( $_ =~ /Artist: / ){my @temp = split(/: /,$_);$Artist=$temp[1];}
-       elsif ( $_ =~ /Title: / ){my @temp = split(/: /,$_);$Title=$temp[1];}
-       elsif ( $_ =~ /Album: / ){my @temp = split(/: /,$_);$Album=$temp[1];}
-       elsif ( $_ =~ /Track: / ){my @temp = split(/: /,$_);$Track=$temp[1];}
-       elsif ( $_ =~ /Date: / ){my @temp = split(/: /,$_);$Date=$temp[1];}
-       elsif ( $_ =~ /Genre: / ){my @temp = split(/: /,$_);$Genre=$temp[1];}
-       else {next;}
+               $mpd->play();
+       }elsif ($mpfiresettings{'ACTION'} eq "x" ){
+               $mpd->stop();
+       }elsif ( $mpfiresettings{'ACTION'} eq "|>" ){
+               $mpd->pause();
+       }elsif ( $mpfiresettings{'ACTION'} eq "<<" ){
+               $mpd->prev();
+       }elsif ( $mpfiresettings{'ACTION'} eq ">>" ){
+               $mpd->next();
+       }elsif ( $mpfiresettings{'ACTION'} eq "+" ){
+               $mpd->volume('+5');
+       }elsif ( $mpfiresettings{'ACTION'} eq "-" ){
+               $mpd->volume('-5');
+       }elsif ( $mpfiresettings{'ACTION'} eq "++" ){
+               $mpd->volume('+10');
+       }elsif ( $mpfiresettings{'ACTION'} eq "--" ){
+               $mpd->volume('-10');
+       }elsif ( $mpfiresettings{'ACTION'} eq ">" ){
+               $mpd->play();
+       }elsif ( $mpfiresettings{'ACTION'} eq "repeat" ){
+               $mpd->repeat();
+       }elsif ( $mpfiresettings{'ACTION'} eq "shuffle" ){
+               $mpd->random();
        }
+       print <<END
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<title></title>
+<body>
+<table width='95%' cellspacing='0'>
+<tr>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='<<' /><input type='image' alt='$Lang::tr{'prev'}' title='$Lang::tr{'prev'}' src='/images/media-skip-backward.png' /></form></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='x' /><input type='image' alt='$Lang::tr{'stop'}' title='$Lang::tr{'stop'}' src='/images/media-playback-stop.png' /></form></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='|>' /><input type='image' alt='$Lang::tr{'toggle'}' title='$Lang::tr{'toggle'}' src='/images/media-resume.png' /></form></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='>' /><input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' /></form></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='playall' /><input type='image' alt='$Lang::tr{'play'} all' title='$Lang::tr{'play'} all' src='/images/media-playback-start-all.png' /></form></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='>>' /><input type='image' alt='$Lang::tr{'next'}' title='$Lang::tr{'next'}' src='/images/media-skip-forward.png' /></form></td>
+</tr>
+END
+;
+       print <<END
+<tr>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='repeat' /><input type='image' alt='$Lang::tr{'repeat'}' title='$Lang::tr{'repeat'}' src='/images/media-repeat.png' /></form></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='--' /><input type='image' alt='$Lang::tr{'voldown10'}' title='$Lang::tr{'voldown10'}' src='/images/audio-volume-low-red.png' /></form></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='-' /><input type='image' alt='$Lang::tr{'voldown5'}' title='$Lang::tr{'voldown5'}' src='/images/audio-volume-low.png' /></form></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='+' /><input type='image' alt='$Lang::tr{'volup5'}' title='$Lang::tr{'volup5'}' src='/images/audio-volume-high.png' /></form></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='++' /><input type='image' alt='$Lang::tr{'volup10'}' title='$Lang::tr{'volup10'}' src='/images/audio-volume-high-red.png' /></form></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}?control'><input type='hidden' name='ACTION' value='shuffle' /><input type='image' alt='$Lang::tr{'shuffle'}' title='$Lang::tr{'shuffle'}' src='/images/media-shuffle.png' /></form></td>
+</tr>
+</table>
+</body>
+END
+;
+       exit;
+}
 
-       my %hash = map{ $_, 1 }@artist;
-       @artist = sort keys %hash;
-       my %hash = map{ $_, 1 }@album;
-       @album = sort keys %hash;
-       my %hash = map{ $_, 1 }@year;
-       @year = sort keys %hash;
-       my %hash = map{ $_, 1 }@genre;
-       @genre = sort keys %hash;
+# just a little subpage to handle automatic page refresh on demand ( 1 sec )
+sub refreshpage{
+       &Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;' />" );
+       print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'pagerefresh'}</font></center>";
+       &Header::closebox();
+}
+
+# if the mpd is updating his database because of user interaction then the cgi
+# should display that the mpd is unavailable, and refresh the status every 5 seconds
+if ($work ne ""){
+       &Header::openpage($Lang::tr{'mpfire'}, 1,);
+       &Header::openbigbox('100%', 'left', '', $errormessage);
+       &Header::openbox( 'Waiting', 5, "<meta http-equiv='refresh' content='5;' />" );
+       print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>Database is updating, please be patient.</font></center>";
+       &Header::closebox();
+       &Header::closebigbox();
+       &Header::closepage();
+       exit;
+}
 
-       my $artistcount = $#artist+1;
-       my $albumcount = $#album+1;
-       my $yearcount = $#year+1;
-       my $genrecount = $#genre+1;
+if ( $mpfiresettings{'PAGE'} eq "" ){$mpfiresettings{'PAGE'} = "1";}
 
 &Header::getcgihash(\%mpfiresettings);
 &Header::openpage($Lang::tr{'mpfire'}, 1,);
@@ -106,131 +204,116 @@ foreach (@songdb){
 ############################################################################################################################
 ######################################## Scanne Verzeichnisse nach Mp3 Dateien #############################################
 
-if ( $mpfiresettings{'ACTION'} eq "scan" )
-{
-&General::readhash("${General::swroot}/mpfire/settings", \%mpfiresettings);
-&Header::getcgihash(\%mpfiresettings);
-delete $mpfiresettings{'__CGI__'};delete $mpfiresettings{'x'};delete $mpfiresettings{'y'};delete $mpfiresettings{'PAGE'};
-&General::writehash("${General::swroot}/mpfire/settings", \%mpfiresettings);
-open(DATEI, "<${General::swroot}/mpfire/mpd.conf") || die "Datei nicht gefunden";
-my @Zeilen = <DATEI>;
-close(DATEI);
-open(DATEI, ">${General::swroot}/mpfire/mpd.conf") || die "Datei nicht gefunden";
-foreach (@Zeilen){
-if ( $_ =~ /music_directory/){print DATEI "music_directory \"".$mpfiresettings{'MUSICDIR'}."\"\n";}
-else {print DATEI $_;}
-}
-close(DATEI);
+if ( $mpfiresettings{'ACTION'} eq "scan" ){
 
-$message=system("/usr/local/bin/mpfirectrl scan 2>/dev/null");
-refreshpage();
-}
-elsif ( $mpfiresettings{'ACTION'} eq ">" ){$message=system("/usr/local/bin/mpfirectrl","play","\"$mpfiresettings{'FILE'}\"","2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "x" ){$message=system("/usr/local/bin/mpfirectrl stop 2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "|>" ){$message=system("/usr/local/bin/mpfirectrl toggle 2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "<<" ){$message=system("/usr/local/bin/mpfirectrl prev 2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq ">>" ){$message=system("/usr/local/bin/mpfirectrl next 2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "+" ){$message=system("/usr/local/bin/mpfirectrl volup 5 2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "-" ){$message=system("/usr/local/bin/mpfirectrl voldown 5 2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "++" ){$message=system("/usr/local/bin/mpfirectrl volup 10 2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "--" ){$message=system("/usr/local/bin/mpfirectrl voldown 10 2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "playweb" ){$message=system("/usr/local/bin/mpfirectrl","playweb","\"$mpfiresettings{'FILE'}\"","2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "playlist" ){$message=system("/usr/local/bin/mpfirectrl playlist 2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "emptyplaylist" ){$message=system("/usr/local/bin/mpfirectrl clearplaylist 2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "addtoplaylist" ){$message=system("/usr/local/bin/mpfirectrl","playadd","\"$mpfiresettings{'FILE'}\"","2>/dev/null");}
-elsif ( $mpfiresettings{'ACTION'} eq "playall" ){
-my @temp = ""; my @song = "";
-
-foreach (keys(%songs)){
-       @song = split(/\|/,$songs{$_});push(@temp,$song[0])
+# on keypress scan the given directory and store the path to the mpd config
+       &General::readhash("${General::swroot}/mpfire/settings", \%mpfiresettings);
+       &Header::getcgihash(\%mpfiresettings);
+       delete $mpfiresettings{'__CGI__'};delete $mpfiresettings{'x'};delete $mpfiresettings{'y'};
+       &General::writehash("${General::swroot}/mpfire/settings", \%mpfiresettings);
+
+       open(DATEI, "<${General::swroot}/mpfire/mpd.conf") || die "Datei nicht gefunden";
+       my @Zeilen = <DATEI>;
+       close(DATEI);
+
+       open(DATEI, ">${General::swroot}/mpfire/mpd.conf") || die "Datei nicht gefunden";
+       foreach (@Zeilen){
+               if ( $_ =~ /music_directory/){
+                       print DATEI "music_directory \"".$mpfiresettings{'MUSICDIR'}."\"\n";
+               }else {
+                       print DATEI $_;
+               }
        }
-open(DATEI, ">${General::swroot}/mpfire/playlist.m3u") || die "Could not add playlist";
-print DATEI @temp;
-close(DATEI);
-
-$message=system("/usr/local/bin/mpfirectrl playlist 2>/dev/null");
-}
-elsif ( $mpfiresettings{'ACTION'} eq "playalbum" )
-{
-my @temp = ""; my @song = ""; my @select = split(/\|/,$mpfiresettings{'album'});
-
-foreach (keys(%songs)){
-       @song = split(/\|/,$songs{$_});$song[4] =~ s/\W/ /g;
-
+       close(DATEI);
+
+       $mpd->updatedb();
+       refreshpage();
+}elsif ( $mpfiresettings{'ACTION'} eq "playweb" ){
+       $message=system("/usr/local/bin/mpfirectrl","playweb","\"$mpfiresettings{'FILE'}\"","2>/dev/null");
+}elsif ( $mpfiresettings{'ACTION'} eq "playlist" ){
+# on keypress play the playlist
+       $message=system("/usr/local/bin/mpfirectrl playlist 2>/dev/null");
+}elsif ( $mpfiresettings{'ACTION'} eq "emptyplaylist" ){
+# on keypress clear the playlist
+       $mpd->playlist->clear();
+}elsif ( $mpfiresettings{'ACTION'} eq "addtoplaylist" ){
+       $mpd->playlist->add($mpfiresettings{'FILE'});
+}elsif ( $mpfiresettings{'ACTION'} eq "playalbum" ){
+# on keypress play the selected albums
+       my @select = split(/\|/,$mpfiresettings{'album'});
+       $mpd->playlist->clear();
        foreach (@select){
-               $_ =~ s/\W/ /g;
-               if ( $song[4] =~ /$_/ ){push(@temp,$song[0]);}
+               foreach ($mpd->collection->filenames_by_album($_)){
+                       if ( $_ ne "" ){
+                               $mpd->playlist->add($_);
+                       }
+               }
        }
-}
-
-open(DATEI, ">${General::swroot}/mpfire/playlist.m3u") || die "Could not add playlist";
-print DATEI @temp;
-close(DATEI);
-$message=system("/usr/local/bin/mpfirectrl playlist 2>/dev/null");
-}
-elsif ( $mpfiresettings{'ACTION'} eq "playartist" )
-{
-my @temp = ""; my @song = ""; my @select = split(/\|/,$mpfiresettings{'artist'});
-
-foreach (keys(%songs)){
-       @song = split(/\|/,$songs{$_});$song[2] =~ s/\W/ /g;
-
+       $mpd->play();
+}elsif ( $mpfiresettings{'ACTION'} eq "playartist" ){
+# on keypress play the selected artist
+       my @select = split(/\|/,$mpfiresettings{'artist'});
+       $mpd->playlist->clear();
        foreach (@select){
-               $_ =~ s/\W/ /g;
-               if ( $song[2] =~ /$_/ ){push(@temp,$song[0]);}
+               foreach ($mpd->collection->filenames_by_artist($_)){
+                       if ( $_ ne "" ){
+                               $mpd->playlist->add($_);
+                       }
+               }
        }
-}
-
-open(DATEI, ">${General::swroot}/mpfire/playlist.m3u") || die "Could not add playlist";
-print DATEI @temp;
-close(DATEI);
-$message=system("/usr/local/bin/mpfirectrl playlist 2>/dev/null");
-}
-elsif ( $mpfiresettings{'ACTION'} eq "playyear" )
-{
-my @temp = ""; my @song = ""; my @select = split(/\|/,$mpfiresettings{'year'});
-
-foreach (keys(%songs)){
-       @song = split(/\|/,$songs{$_});$song[6] =~ s/\W/ /g;
-
+       $mpd->play();
+}elsif ( $mpfiresettings{'ACTION'} eq "playyear" ){
+# on keypress play the selected year
+       my @select = split(/\|/,$mpfiresettings{'year'});
+       $mpd->playlist->clear();
        foreach (@select){
-               $_ =~ s/\W/ /g;
-               if ( $song[6] =~ /$_/ ){push(@temp,$song[0]);}
+               foreach ($mpd->collection->filenames_by_year($_)){
+                       if ( $_ ne "" ){
+                               $mpd->playlist->add($_);
+                       }
+               }
        }
+       $mpd->play();
+}elsif ( $mpfiresettings{'ACTION'} eq "playgenre" ){
+# on keypress play the selected genre
+       my @select = split(/\|/,$mpfiresettings{'genre'});
+       $mpd->playlist->clear();
+       foreach (@select){
+               foreach ($mpd->collection->filenames_by_genre($_)){
+                       if ( $_ ne "" ){
+                               $mpd->playlist->add($_);
+                       }
+               }
+       }
+       $mpd->play();
+}elsif ( $mpfiresettings{'ACTION'} eq ">" ){
+               $mpd->playlist->clear();
+               $mpd->playlist->add($mpfiresettings{'FILE'});
+               $mpd->play();
 }
 
-open(DATEI, ">${General::swroot}/mpfire/playlist.m3u") || die "Could not add playlist";
-print DATEI @temp;
-close(DATEI);
-$message=system("/usr/local/bin/mpfirectrl playlist 2>/dev/null");
-}
-elsif ( $mpfiresettings{'ACTION'} eq "playgenre" )
-{
-my @temp = ""; my @song = ""; my @select = split(/\|/,$mpfiresettings{'genre'});
-
-foreach (keys(%songs)){
-  @song = split(/\|/,$songs{$_});$song[7] =~ s/\W/ /g;
-
-  foreach (@select){
-    $_ =~ s/\W/ /g;
-    if ( $song[7] =~ /$_/ ){push(@temp,$song[0]);}
-  }
-}
-
-open(DATEI, ">${General::swroot}/mpfire/playlist.m3u") || die "Could not add playlist";
-print DATEI @temp;
-close(DATEI);
-$message=system("/usr/local/bin/mpfirectrl playlist 2>/dev/null");
-}
-elsif ( $mpfiresettings{'SHOWLIST'} ){
-       &General::readhash("${General::swroot}/mpfire/settings", \%mpfiresettings);
-       &Header::getcgihash(\%mpfiresettings);
-       delete $mpfiresettings{'__CGI__'};
-       delete $mpfiresettings{'x'};
-       delete $mpfiresettings{'y'};
-       delete $mpfiresettings{'PAGE'};
-       &General::writehash("${General::swroot}/mpfire/settings", \%mpfiresettings);refreshpage();
-}
+       if ( $mpfiresettings{'SEARCH'} eq "artist" && $mpfiresettings{'SEARCHITEM'} ne "" ){
+               foreach ($mpd->collection->songs_with_artist_partial_filename($mpfiresettings{'SEARCHITEM'})){
+                       if ( $_ ne "" ){
+                               push(@songs,$_);
+                       }
+               }
+       }elsif ( $mpfiresettings{'SEARCH'} eq "title" && $mpfiresettings{'SEARCHITEM'} ne "" ){
+               foreach ($mpd->collection->songs_with_title_partial_filename($mpfiresettings{'SEARCHITEM'})){
+                       if ( $_ ne "" ){
+                               push(@songs,$_);
+                       }
+               }
+       }elsif ( $mpfiresettings{'SEARCH'} eq "album" && $mpfiresettings{'SEARCHITEM'} ne "" ){
+               foreach ($mpd->collection->songs_with_album_partial_filename($mpfiresettings{'SEARCHITEM'})){
+                       if ( $_ ne "" ){
+                               push(@songs,$_);
+                       }
+               }
+       }else{
+       @songs = $mpd->collection->all_items_simple();
+       shift(@songs);
+       }
 
 ############################################################################################################################
 ################################### Aufbau der HTML Seite fr globale Sambaeinstellungen ####################################
@@ -241,186 +324,227 @@ $mpfiresettings{'MUSICDIR'} = "/";
 ############################################################################################################################
 ########################################### rekursiv nach neuen Mp3s Scannen ##############################################ä
 
-if ( $message ne '0' ) {       print "<font color='red'>An Error occured while launching the command</font>"; }
-elsif ( $message ne "" && $message ne '0' )    {       print "<font color='red'>$message</font>"; }
+if ( $message ne '0' ){
+       print "<font color='red'>An Error occured while launching the command</font>";
+}elsif ( $message ne "" && $message ne '0' ){
+       print "<font color='red'>$message</font>";
+}
 
 &Header::openbox('100%', 'center', $Lang::tr{'mpfire scanning'});
-
+# box to enter the music directory and initiate the scan process
 print <<END
 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
 <table width='95%' cellspacing='0'>
 <tr bgcolor='$color{'color20'}'><td colspan='2' align='left'><b>$Lang::tr{'Scan for Files'}</b></td></tr>
 <tr><td align='left' width='40%'>$Lang::tr{'Scan from Directory'}</td><td align='left'><input type='text' name='MUSICDIR' value='$mpfiresettings{'MUSICDIR'}' size="50" /></td></tr>
-<tr><td align='center' colspan='2'><input type='hidden' name='ACTION' value='scan' />
-                                                                                                                                               <input type='image' alt='$Lang::tr{'Scan for Files'}' title='$Lang::tr{'Scan for Files'}' src='/images/edit-find.png' /></td></tr>
+<tr><td align='center' colspan='2'><input type='hidden' name='ACTION' value='scan' /><input type='image' alt='$Lang::tr{'Scan for Files'}' title='$Lang::tr{'Scan for Files'}' src='/images/edit-find.png' /></td></tr>
 </table>
 </form>
 END
 ;
 &Header::closebox();
 
-my $Volume = `/usr/local/bin/mpfirectrl volume 2>/dev/null`;
-$Volume=~s/<break>/<br \/>/g;
-my $stats = `mpc stats | tail -4 2>/dev/null`;
-$stats=~s/\\/<br \/>/g
-
 &Header::openbox('100%', 'center', $Lang::tr{'mpfire controls'});
+# box for the two iframes showing the current playbar and the control buttons
 print <<END
-       <iframe height='35' width='100%' src='/cgi-bin/mpfire.cgi?title' scrolling='no' frameborder='no' marginheight='0'></iframe>
-       <table width='95%' cellspacing='0'>
-END
-;
-my $countsongs=`/usr/local/bin/mpfirectrl stats 2>/dev/null`;
-print "<tr><td colspan='5' align='center'><b>".$countsongs."</b></td></tr>";
-print <<END
-       <tr>
-       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='x' /><input type='image' alt='$Lang::tr{'stop'}' title='$Lang::tr{'stop'}' src='/images/media-playback-stop.png' /></form></td>
-       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='<<' /><input type='image' alt='$Lang::tr{'prev'}' title='$Lang::tr{'prev'}' src='/images/media-skip-backward.png' /></form></td>
-       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='|>' /><input type='image' alt='$Lang::tr{'toggle'}' title='$Lang::tr{'toggle'}' src='/images/media-resume.png' /></form></td>
-       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='playall' /><input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' /></form></td>
-       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='>>' /><input type='image' alt='$Lang::tr{'next'}' title='$Lang::tr{'next'}' src='/images/media-skip-forward.png' /></form></td>
-       </tr>
-END
-;
-if ( $mpfiresettings{'SHOWLIST'} eq "on" ){print"<tr><td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='SHOWLIST' value='off' /><input type='image' alt='$Lang::tr{'off'}' title='$Lang::tr{'off'}' src='/images/audio-x-generic.png' /></form></td>";}
-else { print"<tr><td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='SHOWLIST' value='on' /><input type='image' alt='$Lang::tr{'on'}' title='$Lang::tr{'on'}' src='/images/audio-x-generic-red.png' /></form></td>";}
-print <<END
-       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='--' /><input type='image' alt='$Lang::tr{'voldown10'}' title='$Lang::tr{'voldown10'}' src='/images/audio-volume-low-red.png' /></form></td>
-       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='-' /><input type='image' alt='$Lang::tr{'voldown5'}' title='$Lang::tr{'voldown5'}' src='/images/audio-volume-low.png' /></form></td>
-       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='+' /><input type='image' alt='$Lang::tr{'volup5'}' title='$Lang::tr{'volup5'}' src='/images/audio-volume-high.png' /></form></td>
-       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='++' /><input type='image' alt='$Lang::tr{'volup10'}' title='$Lang::tr{'volup10'}' src='/images/audio-volume-high-red.png' /></form></td>
-       </tr>
-<tr><td colspan='5' align='center'>$Volume</td></tr>
-<tr><td colspan='5' align='center'><br />$stats</td></tr>
-</table>
+<iframe height='85' width='685' src='/cgi-bin/mpfire.cgi?title' scrolling='no' frameborder='no' marginheight='0'></iframe>
+<iframe height='50' width='685' src='/cgi-bin/mpfire.cgi?control' scrolling='no' frameborder='no' marginheight='0'></iframe>
 END
 ;
+print "<b>Songs:".$mpd->stats()->songs()."</b><br />";
+
 &Header::closebox();
 
 &Header::openbox('100%', 'center', $Lang::tr{'quick playlist'});
-
+# box to quickly select artist, album, year or genre and play the selection
 print "<table width='95%' cellspacing='0'>";
-if ( $#songdb eq '-1' ) {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'artist'}</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'album'}</b></td></tr>";}
-else {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'artist'} - ".$artistcount."</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'album'} - ".$albumcount."</b></td></tr>";}
+print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'artist'} - ".$mpd->stats()->artists()."</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'album'} - ".$mpd->stats()->albums()."</b></td></tr>";
+
 print <<END
-       <tr><td align='center'>
-       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-       <select name='artist' size='8' multiple='multiple' style='width:300px;'>
+<tr><td align='center'>
+<form method='post' action='$ENV{'SCRIPT_NAME'}'>
+<select name='artist' size='8' multiple='multiple' style='width:300px;'>
 END
 ;
-foreach (@artist){if ( $_ ne '' ){print "<option>$_</option>";}}
+
+foreach ($mpd->collection->all_artists()){
+       if ( $_ ne '' ){
+               print "<option>".encode('utf-8', $_)."</option>\n";
+       }
+}
+
 print <<END
-       </select><br/>
-       <input type='hidden' name='ACTION' value='playartist' />
-       <input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
-       </form></td>
-       <td align='center'>
-       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-       <select name='album' size='8' multiple='multiple' style='width:300px;'>
+</select><br/>
+<input type='hidden' name='ACTION' value='playartist' />
+<input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
+</form></td>
+<td align='center'>
+<form method='post' action='$ENV{'SCRIPT_NAME'}'>
+<select name='album' size='8' multiple='multiple' style='width:300px;'>
 END
 ;
-  foreach (@album){if ( $_ ne '' ){print "<option>$_</option>";}}
+
+foreach ($mpd->collection->all_albums()){
+       if ( $_ ne '' ){
+               print "<option>".encode('utf-8', $_)."</option>\n";
+       }
+}
+
 print <<END
-       </select><br/>
-       <input type='hidden' name='ACTION' value='playalbum' />
-       <input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
-       </form></td>
-       </tr>
+</select><br/>
+<input type='hidden' name='ACTION' value='playalbum' />
+<input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
+</form></td>
+</tr>
+<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'year'}</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'genre'}</b></td></tr>
+<tr><td align='center'>
+<form method='post' action='$ENV{'SCRIPT_NAME'}'>
+<select name='year' size='8' multiple='multiple' style='width:300px;'>
 END
 ;
-if ( $#songdb eq '-1' ) {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'year'}</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'genre'}</b></td></tr>";}
-else {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'year'} - ".$yearcount."</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'genre'} - ".$genrecount."</b></td></tr>";}
+
+foreach ($mpd->collection->all_years()){
+       if ( $_ ne '' ){
+               print "<option>$_</option>\n";
+       }
+}
+
 print <<END
-  <tr><td align='center'>
-      <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-      <select name='year' size='8' multiple='multiple' style='width:300px;'>
+</select><br/>
+<input type='hidden' name='ACTION' value='playyear' />
+<input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
+</form></td>
+<td align='center'>
+<form method='post' action='$ENV{'SCRIPT_NAME'}'>
+<select name='genre' size='8' multiple='multiple' style='width:300px;'>
 END
 ;
-  foreach (@year){if ( $_ ne '' ){print "<option>$_</option>";}}
+
+foreach ($mpd->collection->all_genre()){
+       if ( $_ ne '' ){
+               print "<option>$_</option>\n";
+       }
+}
+
 print <<END
-       </select><br/>
-       <input type='hidden' name='ACTION' value='playyear' />
-       <input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
-       </form></td>
-       <td align='center'>
-       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-       <select name='genre' size='8' multiple='multiple' style='width:300px;'>
+</select><br/>
+<input type='hidden' name='ACTION' value='playgenre' />
+<input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
+</form></td>
+</tr></table>
 END
 ;
-  foreach (@genre){if ( $_ ne '' ){print "<option>$_</option>";}}
+
+&Header::closebox();
+
+&Header::openbox('100%', 'center', $Lang::tr{'mpfire search'});
+# box to quickly search artist, album or title
 print <<END
-       </select><br/>
-       <input type='hidden' name='ACTION' value='playgenre' />
-       <input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
-       </form></td>
-       </tr></table>
+<form method='post' action='$ENV{'SCRIPT_NAME'}'>
+<table width='95%' cellspacing='0'>
+<tr>
+<td align='right' width='33%'>$Lang::tr{'artist'}</td>
+<td align='center' width='33%'>$Lang::tr{'title'}</td>
+<td align='left' width='33%'>$Lang::tr{'album'}</td>
+</tr>
+<tr>
+<td align='right' width='33%'><input type='radio' name='SEARCH' value='artist' /></td>
+<td align='center' width='33%'><input type='radio' name='SEARCH' value='title' checked='checked' /></td>
+<td align='left' width='33%'><input type='radio' name='SEARCH' value='album' /></td>
+</tr>
+<tr>
+<td align='center' colspan='3'><input type='text' name='SEARCHITEM' value='$mpfiresettings{'SEARCHITEM'}' size="50" /></td>
+</tr>
+<tr>
+<td align='center' colspan='3'><input type='hidden' name='ACTION' value='search' /><input type='image' alt='$Lang::tr{'Scan for Songs'}' title='$Lang::tr{'Scan for Songs'}' src='/images/edit-find.png' /></td>
+</tr>
+</table>
+</form>
 END
 ;
 &Header::closebox();
 
-if ( $mpfiresettings{'SHOWLIST'} eq "on" ){
-
 &Header::openbox('100%', 'center', $Lang::tr{'mpfire songs'});
 print <<END
-<a name="$Lang::tr{'mpfire songs'}"</a>
-<table width='95%' cellspacing='5'>
-<tr bgcolor='$color{'color20'}'><td colspan='9' align='left'><b>$Lang::tr{'Existing Files'}</b></td></tr>
-<tr><td align='center' colspan='9'><br/>$Lang::tr{'Pages'}<br/><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='submit' name='PAGE' value='all' /><br/>
+<a id='$Lang::tr{'mpfire songs'}' name='$Lang::tr{'mpfire songs'}'></a>
+<table width='95%' cellspacing='3'>
+<tr bgcolor='$color{'color20'}'><td colspan='4' align='left'><b>$Lang::tr{'Existing Files'}</b></td></tr>
 END
 ;
-my $pages =(int(keys(%songs)/100)+1);
-for(my $i = 1; $i <= $pages; $i++) {
-print "<input type='submit' name='PAGE' value='$i' />";
-if (!($i % 205)){print"<br/>";}
+if ( $#songs > 100 ){
+       print "<tr><td align='center' colspan='4'><br/>$Lang::tr{'Pages'}<br/><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='submit' name='PAGE' value='all' /><br/>";
+       my $pages =(int($#songs/100)+1);
+       for(my $i = 1; $i <= $pages; $i++){
+               print "<input type='submit' name='PAGE' value='$i' />";
+               if (!($i % 205)){
+                       print"<br/>";
+               }
+       }
+
+       print "</form></td></tr>";
 }
 print <<END
-</form></td></tr>
 <tr><td align='center'></td>
-       <td align='center'><b>$Lang::tr{'artist'}<br/>$Lang::tr{'title'}</b></td>
-       <td align='center'><b>$Lang::tr{'number'}</b></td>
-       <td align='center'><b>$Lang::tr{'album'}</b></td>
-       <td align='center'><b>$Lang::tr{'year'}</b></td>
-       <td align='center'><b>$Lang::tr{'genre'}</b></td>
-       <td align='center'><b>$Lang::tr{'length'}</b></td></tr>
+<td align='center'><b>$Lang::tr{'artist'}<br/>$Lang::tr{'title'}</b></td>
+<td align='center'><b>$Lang::tr{'number'}</b></td>
+<td align='center'><b>$Lang::tr{'album'}</b></td>
 END
 ;
+
 my $lines=0;my $i=0;my $begin;my $end;
 if ( $mpfiresettings{'PAGE'} eq 'all' ){
        $begin=0;
-       $end=keys(%songs);
-}
-else{
+       $end=$#songs;
+}else{
        $begin=(($mpfiresettings{'PAGE'}-1) * 100);
        $end=(($mpfiresettings{'PAGE'} * 100)-1);
 }
-foreach (sort(keys(%songs))){
+       foreach (@songs){
        if (!($i >= $begin && $i <= $end)){
-print $begin."->".$i."<-".$end."\n";
-       $i++;next;}
-       my @song = split(/\|/,$songs{$_});
-       my $minutes = sprintf ("%.0f", $song[1] / 60 );
-       my $seconds = sprintf("%02d", ($song[1] % 60) );
+               #print $begin."->".$i."<-".$end."\n";
+               $i++;next;
+       }
+       my @song = split(/\=/,$mpd->collection->song($_));
+       @song = reverse @song;
 
-       if ($lines % 2) {print "<tr bgcolor='$color{'color20'}'>";} else {print "<tr bgcolor='$color{'color22'}'>";}
+       if ($lines % 2) {
+               print "<tr bgcolor='$color{'color20'}'>";
+       }else{
+               print "<tr bgcolor='$color{'color22'}'>";
+       }
        print <<END
-       <td align='center' style="white-space:nowrap;"><form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'mpfire songs'}'><input type='hidden' name='ACTION' value='addtoplaylist' /><input type='hidden' name='FILE' value="$song[0]" /><input type='image' alt='$Lang::tr{'add'}' title='$Lang::tr{'add'}' src='/images/list-add.png' /></form><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='>' /><input type='hidden' name='FILE' value="$song[0]" /><input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' /></form></td>
-       <td align='center'>$song[2]<br/>$song[3]</td>
-       <td align='center'>$song[5]</td>
-       <td align='center'>$song[4]</td>
-       <td align='center'>$song[6]</td>
-       <td align='center'>$song[7]</td>
-       <td align='center'>$minutes:$seconds</td></tr>
+<td align='center' style="white-space:nowrap;">
+<form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'mpfire songs'}'>
+<input type='hidden' name='ACTION' value='addtoplaylist' />
+<input type='hidden' name='FILE' value="$_" />
+<input type='hidden' name='PAGE' value='$mpfiresettings{'PAGE'}' />
+<input type='hidden' name='SEARCH' value='$mpfiresettings{'SEARCH'}' />
+<input type='hidden' name='SEARCHITEM' value='$mpfiresettings{'SEARCHITEM'}' />
+<input type='image' alt='$Lang::tr{'add'}' title='$Lang::tr{'add'}' src='/images/list-add.png' />
+</form>
+<form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'mpfire songs'}'>
+<input type='hidden' name='ACTION' value='>' />
+<input type='hidden' name='FILE' value="$_" />
+<input type='hidden' name='PAGE' value='$mpfiresettings{'PAGE'}' />
+<input type='hidden' name='SEARCH' value='$mpfiresettings{'SEARCH'}' />
+<input type='hidden' name='SEARCHITEM' value='$mpfiresettings{'SEARCHITEM'}' />
+<input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
+</form>
+</td>
 END
 ;
+       print "<td align='center'>".encode('utf-8', $song[0])."<br/>".encode('utf-8', $song[1])."</td>";
+       print "<td align='center'>".encode('utf-8', $song[2])."</td>";
+       print "<td align='center'>".encode('utf-8', $song[3])."</td>";
        $lines++;
        $i++;
-       }
+}
+
 print "</table>";
 &Header::closebox();
-}
 
 &Header::openbox('100%', 'center', $Lang::tr{'mpfire playlist'});
-
+# box to show the current playlist given from mpc system command
 my @playlist = `mpc playlist 2>/dev/null`;
 
 print <<END
@@ -429,28 +553,33 @@ print <<END
 <tr><td align='center' colspan='2' ><textarea cols='100' rows='10' name='playlist' style='font-size:11px;width:650px;' readonly='readonly'>
 END
 ;
-foreach (@playlist){$_=~s/&/&amp\;/g;;print $_;}
+
+foreach (@playlist){
+       $_=~s/&/&amp\;/g;;print $_;
+}
+
 print <<END
 </textarea></td></tr><tr>
 <td align='right'>
-       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-       <input type='hidden' name='ACTION' value='emptyplaylist' />
-       <input type='image' alt='$Lang::tr{'clear playlist'}' title='$Lang::tr{'clear playlist'}' src='/images/user-trash.png' />
-       </form>
+<form method='post' action='$ENV{'SCRIPT_NAME'}'>
+<input type='hidden' name='ACTION' value='emptyplaylist' />
+<input type='image' alt='$Lang::tr{'clear playlist'}' title='$Lang::tr{'clear playlist'}' src='/images/user-trash.png' />
+</form>
 </td>
 <td align='left'>
-       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-       <input type='hidden' name='ACTION' value='playlist' />
-       <input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
-       </form>
+<form method='post' action='$ENV{'SCRIPT_NAME'}'>
+<input type='hidden' name='ACTION' value='playlist' />
+<input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' />
+</form>
 </td></tr>
 </table>
 END
 ;
+
 &Header::closebox();
 
 &Header::openbox('100%', 'center', $Lang::tr{'mpfire webradio'});
-
+# box to select some webradio´s to be played by one click
 open(DATEI, "<${General::swroot}/mpfire/webradio") || die "Could not open playlist";
 my @webradio = <DATEI>;
 close(DATEI);
@@ -461,30 +590,40 @@ print <<END
 <tr><td align='left'>Stream</td><td colspan='2'></td></tr>
 END
 ;
+
 my $lines=0;
 foreach (@webradio){
        my @stream = split(/\|/,$_);
        $lines++;
        chomp($stream[2]);
-       if ($lines % 2) {print "<tr bgcolor='$color{'color22'}'>";} else {print "<tr>";}
-print <<END
-       <td align='left'><a href="$stream[2]" target="_blank">$stream[1]</a></td>
-       <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='FILE' value='$stream[0]' /><input type='hidden' name='ACTION' value='playweb' /><input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' align='middle' /></form></td>
+       if ($lines % 2) {
+               print "<tr bgcolor='$color{'color22'}'>";
+       }else{
+               print "<tr>";
+       }
+       chomp $stream[1];chop $stream[2];
+       print <<END
+<td align='left'><a href='$stream[2]' target='_blank'>$stream[1]</a></td>
+<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='FILE' value='$stream[0]' /><input type='hidden' name='ACTION' value='playweb' /><input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' align='middle' /></form></td>
 </tr>
 END
 ;
-       }
-       $lines++;
-       if ($lines % 2) {print "<tr bgcolor='$color{'color22'}'>";} else {print "<tr>";}
+}
+
+$lines++;
+if ($lines % 2){
+       print "<tr bgcolor='$color{'color22'}'>";
+}else{
+       print "<tr>";
+}
+
 print <<END
-       <td align='center' colspan='2'><form method='post' action='$ENV{'SCRIPT_NAME'}'><br />http://<input type=text name='FILE' value='www.meineradiourl:1234' size='75' />
-       <input type='hidden' name='ACTION' value='playweb' /><input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' align='top' /></form></td>
+<td align='center' colspan='2'><form method='post' action='$ENV{'SCRIPT_NAME'}'><br />http://<input type=text name='FILE' value='www.meineradiourl:1234' size='75' />
+<input type='hidden' name='ACTION' value='playweb' /><input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' align='top' /></form></td>
 </tr>
 END
 ;
 print "</table>";
 &Header::closebox();
-
 &Header::closebigbox();
 &Header::closepage();
-}
index afbae1e8dd66a1139c6845c76c3899205916ace6..b7cdc80c0082bbf9d63e3503a14c4c0c92da0cc1 100644 (file)
 'mpfire playlist' => 'MPFire Playlist',
 'mpfire scanning' => 'Nach neuen Dateien suchen',
 'mpfire songs' => 'MPFire Songliste',
+'mpfire search' => 'MPFire Suche',
+'repeat' => 'Wiederholen',
+'shuffle' => 'Zufall',
 'mpfire webradio' => 'MPFire Webradio',
 'mtu QoS' => 'Diese Einstellung aendert die MTU nicht global sondern nur fuer das QoS.',
 'my new share' => 'Meine neue Freigabe',
index b99b0c3e141661b0f8c7467bab505dd14289e56b..b5708d8e82dc725d7b1f9def7c5f1e726e31a6f2 100644 (file)
@@ -37,6 +37,9 @@
 'OpenVPN' => 'OpenVPN',
 'Pages' => 'Pages',
 'Ping' => 'Ping :',
+'mpfire search' => 'MPFire Search',
+'repeat' => 'Repeat',
+'shuffle' => 'Shuffle',
 'Port Rule' => 'Port-Rule',
 'QoS not enabled' => 'QoS is not enabled!',
 'Queuelenght' => 'Queuelenght',
index 316b8acd61a702113fc428ca2fc68bb01d0ef92c..54d0ae037d00aca7e2ebc22b9d5aa1ab5822e50f 100644 (file)
@@ -30,7 +30,7 @@ THISAPP    = mpfire-$(VER)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = mpfire
-PAK_VER    = 2
+PAK_VER    = 3
 
 DEPS       = "mpd mpc alsa libshout libogg libmad libid3tag libvorbis"
 
@@ -67,5 +67,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        chown nobody.nobody /var/ipfire/mpfire/{settings,webradio}
        chown root.nobody /var/ipfire/mpfire/db/mpd.db
        chmod 664 /var/ipfire/mpfire/playlist.m3u
+       chmod 755 /srv/web/ipfire/html/images/mpfire
        install -v -m 644 $(DIR_SRC)/config/backup/includes/mpfire /var/ipfire/backup/addons/includes/mpfire
+       -mkdir -p /usr/lib/perl5/site_perl/5.8.8/Audio/
+       -mkdir -p /usr/lib/perl5/site_perl/5.8.8/Audio/
+       cp -vrf $(DIR_SRC)/config/mpfire/perl/Audio/MPD* /usr/lib/perl5/site_perl/5.8.8/Audio/
+       cp -vrf $(DIR_SRC)/config/mpfire/perl/Accessor* /usr/lib/perl5/5.8.8/Class/
+       cp -vrf $(DIR_SRC)/config/mpfire/perl/Readonly.pm /usr/lib/perl5/5.8.8/Readonly.pm
        @$(POSTBUILD)
index 5bc12ba733895977b680da310b3bdf18622b7873..e09fca42542a90dc8420a8cc49f23e3fde630bac 100644 (file)
@@ -27,7 +27,8 @@ ln -svf  /etc/init.d/mpd /etc/rc.d/rc3.d/S65mpd
 ln -svf  /etc/init.d/mpd /etc/rc.d/rc0.d/K35mpd
 ln -svf  /etc/init.d/mpd /etc/rc.d/rc6.d/K35mpd
 ln -svf  /var/ipfire/mpfire/mpd.conf /etc/mpd.conf
+chmod 755 /srv/web/ipfire/html/images/mpfire
 touch /var/log/mpd.error.log
 touch /var/log/mpd.log
 restore_backup ${NAME}
-start_service --delay 60 --background ${NAME}
+/etc/init.d/mpd start
index 242b822a143894d3338b3c789a70f2e1d9eeba41..e729cb1ff24a0a7891c9f7d8fd02278f6e035ee8 100644 (file)
@@ -22,7 +22,7 @@
 ############################################################################
 #
 . /opt/pakfire/lib/functions.sh
-stop_service ${NAME}
+/etc/init.d/mpd stop
 make_backup ${NAME}
 remove_files
 rm -f /etc/rc.d/rc*.d/*mpd /var/log/mpd.error.log /var/log/mpd.log /etc/mpd.conf