From: maniacikarus Date: Tue, 11 Sep 2007 16:18:48 +0000 (+0000) Subject: Anpassungen am MPFire X-Git-Tag: v2.3-beta1~388 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=85cedd09d4a348afdb2bc00e19ccd4e02ae7dd26 Anpassungen am MPFire git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@884 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- diff --git a/config/mpfire/mpd.conf b/config/mpfire/mpd.conf index b5ab704e72..685b33bcd6 100644 --- a/config/mpfire/mpd.conf +++ b/config/mpfire/mpd.conf @@ -57,36 +57,36 @@ mixer_control "PCM" audio_output { type "alsa" name "alsa" - device "hw:0,0" # optional - format "44100:16:2" # optional +# device "hw:0,0" # optional +# format "44100:16:2" # optional } # # An example of an OSS output: # -audio_output { - type "oss" - name "My OSS Device" - device "/dev/dsp" # optional - format "44100:16:2" # optional -} +#audio_output { +# type "oss" +# name "My OSS Device" +# device "/dev/dsp" # optional +# format "44100:16:2" # optional +#} # # An example of a shout output (for streaming to Icecast): # -audio_output { - type "shout" - name "My Shout Stream" - host "localhost" - port "8000" - mount "/mpd.ogg" - password "hackme" +#audio_output { +# type "shout" +# name "My Shout Stream" +# host "localhost" +# port "8000" +# mount "/mpd.ogg" +# password "hackme" # quality "5.0" - bitrate "128" - format "44100:16:1" +# bitrate "128" +# format "44100:16:1" # user "source" # optional # description "My Stream Description" # optional # genre "jazz" # optional # public "no" # optional -} +#} # # Set this if you have problems # playing audio files. diff --git a/config/mpfire/mpfire.pl b/config/mpfire/mpfire.pl index e386ecdd3f..6c9b4c11b5 100644 --- a/config/mpfire/mpfire.pl +++ b/config/mpfire/mpfire.pl @@ -10,6 +10,7 @@ my $debug = 0; if ($ARGV[0] eq 'scan') { if ($debug){print "Creating Database\n";} system("mpd --create-db >/dev/null"); + system("/etc/init.d/mpd restart"); } elsif ($ARGV[0] eq 'play') { &checkmute(); @@ -23,6 +24,7 @@ elsif ($ARGV[0] eq 'playadd') { } elsif ($ARGV[0] eq 'playlist') { &checkmute(); + &shuffle(); &clearplaylist(); if ($debug){print "Yes we are called and we will play your Playlist\n";} system("mpc load playlist >/dev/null && mpc play >/dev/null"); @@ -46,10 +48,6 @@ elsif ($ARGV[0] eq 'voldown') { system("/usr/bin/amixer set Master $ARGV[1]%- 2>/dev/null >/dev/null"); system("/usr/bin/amixer set PCM $ARGV[1]%- 2>/dev/null >/dev/null"); } -elsif ($ARGV[0] eq 'playall') { - if ($debug){print "Playing everything\n";} - system("mpc play >/dev/null"); - } elsif ($ARGV[0] eq 'toggle') { system("mpc toggle >/dev/null"); } @@ -71,10 +69,9 @@ elsif ($ARGV[0] eq 'stats') { } elsif ($ARGV[0] eq 'playweb') { &checkmute(); - &stop(); &clearplaylist(); if ($debug){print "Playing webstream $ARGV[1] \n";} - system("mpc add \"http://$ARGV[1]\" >/dev/null && mpc play >/dev/null && sleep 1"); + system("mpc add http://$ARGV[1] >/dev/null && mpc play >/dev/null && sleep 1"); } elsif ($ARGV[0] eq 'volume') { $temp = "Master - "; @@ -88,8 +85,8 @@ sub clearplaylist(){ system("mpc clear >/dev/null"); } -sub stop(){ - system("mpc stop >/dev/null"); +sub shuffle(){ + system("mpc shuffle >/dev/null"); } sub checkplaylist(){ diff --git a/html/cgi-bin/mpfire.cgi b/html/cgi-bin/mpfire.cgi index b6e4b8e140..f0a989479c 100644 --- a/html/cgi-bin/mpfire.cgi +++ b/html/cgi-bin/mpfire.cgi @@ -120,7 +120,18 @@ elsif ( $mpfiresettings{'ACTION'} eq "playweb" ){$message=system("/usr/local/bin elsif ( $mpfiresettings{'ACTION'} eq "playlist" ){$message=system("/usr/local/bin/mpfirectrl playlist");} elsif ( $mpfiresettings{'ACTION'} eq "emptyplaylist" ){$message=system("/usr/local/bin/mpfirectrl clearplaylist");} elsif ( $mpfiresettings{'ACTION'} eq "addtoplaylist" ){$message=system("/usr/local/bin/mpfirectrl","playadd","\"$mpfiresettings{'FILE'}\"");} -elsif ( $mpfiresettings{'ACTION'} eq "playall" ){$message=system("/usr/local/bin/mpfirectrl playall");} +elsif ( $mpfiresettings{'ACTION'} eq "playall" ){ +my @temp = ""; my @song = ""; + +foreach (keys(%songs)){ + @song = split(/\|/,$songs{$_});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"); +} elsif ( $mpfiresettings{'ACTION'} eq "playalbum" ) { my @temp = ""; my @song = ""; my @select = split(/\|/,$mpfiresettings{'album'});