mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
Anpassungen am MPFire
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@884 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -57,36 +57,36 @@ mixer_control "PCM"
|
|||||||
audio_output {
|
audio_output {
|
||||||
type "alsa"
|
type "alsa"
|
||||||
name "alsa"
|
name "alsa"
|
||||||
device "hw:0,0" # optional
|
# device "hw:0,0" # optional
|
||||||
format "44100:16:2" # optional
|
# format "44100:16:2" # optional
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
# An example of an OSS output:
|
# An example of an OSS output:
|
||||||
#
|
#
|
||||||
audio_output {
|
#audio_output {
|
||||||
type "oss"
|
# type "oss"
|
||||||
name "My OSS Device"
|
# name "My OSS Device"
|
||||||
device "/dev/dsp" # optional
|
# device "/dev/dsp" # optional
|
||||||
format "44100:16:2" # optional
|
# format "44100:16:2" # optional
|
||||||
}
|
#}
|
||||||
#
|
#
|
||||||
# An example of a shout output (for streaming to Icecast):
|
# An example of a shout output (for streaming to Icecast):
|
||||||
#
|
#
|
||||||
audio_output {
|
#audio_output {
|
||||||
type "shout"
|
# type "shout"
|
||||||
name "My Shout Stream"
|
# name "My Shout Stream"
|
||||||
host "localhost"
|
# host "localhost"
|
||||||
port "8000"
|
# port "8000"
|
||||||
mount "/mpd.ogg"
|
# mount "/mpd.ogg"
|
||||||
password "hackme"
|
# password "hackme"
|
||||||
# quality "5.0"
|
# quality "5.0"
|
||||||
bitrate "128"
|
# bitrate "128"
|
||||||
format "44100:16:1"
|
# format "44100:16:1"
|
||||||
# user "source" # optional
|
# user "source" # optional
|
||||||
# description "My Stream Description" # optional
|
# description "My Stream Description" # optional
|
||||||
# genre "jazz" # optional
|
# genre "jazz" # optional
|
||||||
# public "no" # optional
|
# public "no" # optional
|
||||||
}
|
#}
|
||||||
#
|
#
|
||||||
# Set this if you have problems
|
# Set this if you have problems
|
||||||
# playing audio files.
|
# playing audio files.
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ my $debug = 0;
|
|||||||
if ($ARGV[0] eq 'scan') {
|
if ($ARGV[0] eq 'scan') {
|
||||||
if ($debug){print "Creating Database\n";}
|
if ($debug){print "Creating Database\n";}
|
||||||
system("mpd --create-db >/dev/null");
|
system("mpd --create-db >/dev/null");
|
||||||
|
system("/etc/init.d/mpd restart");
|
||||||
}
|
}
|
||||||
elsif ($ARGV[0] eq 'play') {
|
elsif ($ARGV[0] eq 'play') {
|
||||||
&checkmute();
|
&checkmute();
|
||||||
@@ -23,6 +24,7 @@ elsif ($ARGV[0] eq 'playadd') {
|
|||||||
}
|
}
|
||||||
elsif ($ARGV[0] eq 'playlist') {
|
elsif ($ARGV[0] eq 'playlist') {
|
||||||
&checkmute();
|
&checkmute();
|
||||||
|
&shuffle();
|
||||||
&clearplaylist();
|
&clearplaylist();
|
||||||
if ($debug){print "Yes we are called and we will play your Playlist\n";}
|
if ($debug){print "Yes we are called and we will play your Playlist\n";}
|
||||||
system("mpc load playlist >/dev/null && mpc play >/dev/null");
|
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 Master $ARGV[1]%- 2>/dev/null >/dev/null");
|
||||||
system("/usr/bin/amixer set PCM $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') {
|
elsif ($ARGV[0] eq 'toggle') {
|
||||||
system("mpc toggle >/dev/null");
|
system("mpc toggle >/dev/null");
|
||||||
}
|
}
|
||||||
@@ -71,10 +69,9 @@ elsif ($ARGV[0] eq 'stats') {
|
|||||||
}
|
}
|
||||||
elsif ($ARGV[0] eq 'playweb') {
|
elsif ($ARGV[0] eq 'playweb') {
|
||||||
&checkmute();
|
&checkmute();
|
||||||
&stop();
|
|
||||||
&clearplaylist();
|
&clearplaylist();
|
||||||
if ($debug){print "Playing webstream $ARGV[1] \n";}
|
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') {
|
elsif ($ARGV[0] eq 'volume') {
|
||||||
$temp = "Master - ";
|
$temp = "Master - ";
|
||||||
@@ -88,8 +85,8 @@ sub clearplaylist(){
|
|||||||
system("mpc clear >/dev/null");
|
system("mpc clear >/dev/null");
|
||||||
}
|
}
|
||||||
|
|
||||||
sub stop(){
|
sub shuffle(){
|
||||||
system("mpc stop >/dev/null");
|
system("mpc shuffle >/dev/null");
|
||||||
}
|
}
|
||||||
|
|
||||||
sub checkplaylist(){
|
sub checkplaylist(){
|
||||||
|
|||||||
@@ -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 "playlist" ){$message=system("/usr/local/bin/mpfirectrl playlist");}
|
||||||
elsif ( $mpfiresettings{'ACTION'} eq "emptyplaylist" ){$message=system("/usr/local/bin/mpfirectrl clearplaylist");}
|
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 "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" )
|
elsif ( $mpfiresettings{'ACTION'} eq "playalbum" )
|
||||||
{
|
{
|
||||||
my @temp = ""; my @song = ""; my @select = split(/\|/,$mpfiresettings{'album'});
|
my @temp = ""; my @song = ""; my @select = split(/\|/,$mpfiresettings{'album'});
|
||||||
|
|||||||
Reference in New Issue
Block a user