]>
Commit | Line | Data |
---|---|---|
a28fdc01 CS |
1 | #!/usr/bin/perl |
2 | # | |
3 | # IPFire CGIs | |
4 | # | |
5 | # This code is distributed under the terms of the GPL | |
6 | # | |
7 | # (c) The IPFire Team | |
8 | ||
9 | use strict; | |
10 | # enable only the following on debugging purpose | |
11 | use warnings; | |
12 | use CGI::Carp 'fatalsToBrowser'; | |
13 | ||
14 | require '/var/ipfire/general-functions.pl'; | |
15 | require "${General::swroot}/lang.pl"; | |
16 | require "${General::swroot}/header.pl"; | |
17 | ||
18 | my %color = (); | |
19 | my %mainsettings = (); | |
20 | my %mpfiresettings = (); | |
21 | my %checked = (); | |
8871b9f2 | 22 | my $message = '0'; |
a28fdc01 CS |
23 | my $errormessage = ""; |
24 | ||
25 | open(DATEI, "<${General::swroot}/mpfire/db/songs.db") || die "No Database found"; | |
26 | my @songdb = <DATEI>; | |
27 | close(DATEI); | |
28 | @songdb = sort(@songdb); | |
29 | ||
30 | &General::readhash("${General::swroot}/main/settings", \%mainsettings); | |
31 | &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); | |
32 | ||
33 | &Header::showhttpheaders(); | |
a28fdc01 | 34 | |
bac7231b | 35 | 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();} |
69addbb8 | 36 | |
8871b9f2 CS |
37 | $mpfiresettings{'PAGE'} = "1"; |
38 | ||
69addbb8 | 39 | &Header::getcgihash(\%mpfiresettings); |
bac7231b | 40 | &Header::openpage($Lang::tr{'mpfire'}, 1, "<meta http-equiv='refresh' content='120' />"); |
a28fdc01 CS |
41 | &Header::openbigbox('100%', 'left', '', $errormessage); |
42 | ||
a28fdc01 CS |
43 | ############################################################################################################################ |
44 | ######################################## Scanne Verzeichnisse nach Mp3 Dateien ############################################# | |
45 | ||
46 | if ( $mpfiresettings{'ACTION'} eq "scan" ) | |
47 | { | |
8871b9f2 | 48 | delete $mpfiresettings{'__CGI__'};delete $mpfiresettings{'x'};delete $mpfiresettings{'y'};delete $mpfiresettings{'PAGE'}; |
a28fdc01 | 49 | &General::writehash("${General::swroot}/mpfire/settings", \%mpfiresettings); |
8871b9f2 | 50 | $message=system("/usr/local/bin/mpfirectrl scan $mpfiresettings{'SCANDIR'} $mpfiresettings{'SCANDIRDEPS'}"); |
69addbb8 | 51 | refreshpage(); |
a28fdc01 | 52 | } |
8871b9f2 CS |
53 | elsif ( $mpfiresettings{'ACTION'} eq ">" ){$message=system("/usr/local/bin/mpfirectrl","play","\"$mpfiresettings{'FILE'}\"");} |
54 | elsif ( $mpfiresettings{'ACTION'} eq "x" ){$message=system("/usr/local/bin/mpfirectrl stop");} | |
55 | elsif ( $mpfiresettings{'ACTION'} eq "||" ){$message=system("/usr/local/bin/mpfirectrl pause");} | |
56 | elsif ( $mpfiresettings{'ACTION'} eq "|>" ){$message=system("/usr/local/bin/mpfirectrl resume");} | |
57 | elsif ( $mpfiresettings{'ACTION'} eq ">>" ){$message=system("/usr/local/bin/mpfirectrl next");} | |
58 | elsif ( $mpfiresettings{'ACTION'} eq "playweb" ){$message=system("/usr/local/bin/mpfirectrl","playweb","\"$mpfiresettings{'FILE'}\"");} | |
59 | elsif ( $mpfiresettings{'ACTION'} eq "+" ){$message=system("/usr/local/bin/mpfirectrl volup 5");} | |
60 | elsif ( $mpfiresettings{'ACTION'} eq "-" ){$message=system("/usr/local/bin/mpfirectrl voldown 5");} | |
61 | elsif ( $mpfiresettings{'ACTION'} eq "++" ){$message=system("/usr/local/bin/mpfirectrl volup 10");} | |
62 | elsif ( $mpfiresettings{'ACTION'} eq "--" ){$message=system("/usr/local/bin/mpfirectrl voldown 10");} | |
63 | elsif ( $mpfiresettings{'ACTION'} eq "playlist" ){$message=system("/usr/local/bin/mpfirectrl playall");} | |
64 | elsif ( $mpfiresettings{'ACTION'} eq "emptyplaylist" ){$message=system("unlink ${General::swroot}/mpfire/playlist && touch ${General::swroot}/mpfire/playlist");} | |
65 | elsif ( $mpfiresettings{'ACTION'} eq "addtoplaylist" ){ | |
66 | open(DATEI, ">>${General::swroot}/mpfire/playlist") || die "Could not add playlist"; | |
67 | print DATEI $mpfiresettings{'FILE'}."\n"; | |
68 | close(DATEI); | |
69 | } | |
bac7231b | 70 | elsif ( $mpfiresettings{'ACTION'} eq "playalbum" ) |
32ab16de CS |
71 | { |
72 | my @temp = ""; | |
73 | my @album = split(/\|/,$mpfiresettings{'album'}); | |
74 | my %hash = map{ $_, 1 }@album; | |
75 | ||
76 | foreach (@songdb){ | |
77 | my @song = split(/\|/,$_); | |
78 | chomp($song[0]); | |
79 | push(@temp,$song[0]."\n") if exists $hash{$song[4]}; | |
80 | } | |
81 | open(DATEI, ">${General::swroot}/mpfire/playlist") || die "Could not add playlist"; | |
82 | print DATEI @temp; | |
83 | close(DATEI); | |
8871b9f2 | 84 | $message=system("/usr/local/bin/mpfirectrl playall"); |
32ab16de | 85 | } |
bac7231b | 86 | elsif ( $mpfiresettings{'ACTION'} eq "playartist" ) |
32ab16de CS |
87 | { |
88 | my @temp = ""; | |
89 | my @artist = split(/\|/,$mpfiresettings{'artist'}); | |
90 | my %hash = map{ $_, 1 }@artist; | |
91 | ||
92 | foreach (@songdb){ | |
93 | my @song = split(/\|/,$_); | |
94 | chomp($song[0]); | |
95 | push(@temp,$song[0]."\n") if exists $hash{$song[1]}; | |
96 | } | |
97 | open(DATEI, ">${General::swroot}/mpfire/playlist") || die "Could not add playlist"; | |
98 | print DATEI @temp; | |
99 | close(DATEI); | |
8871b9f2 | 100 | $message=system("/usr/local/bin/mpfirectrl playall"); |
32ab16de | 101 | } |
8050f37b CS |
102 | elsif ( $mpfiresettings{'ACTION'} eq "playyear" ) |
103 | { | |
104 | my @temp = ""; | |
105 | my @year = split(/\|/,$mpfiresettings{'year'}); | |
106 | my %hash = map{ $_, 1 }@year; | |
107 | ||
108 | foreach (@songdb){ | |
109 | my @song = split(/\|/,$_); | |
110 | chomp($song[0]); | |
111 | push(@temp,$song[0]."\n") if exists $hash{$song[5]}; | |
112 | } | |
113 | open(DATEI, ">${General::swroot}/mpfire/playlist") || die "Could not add playlist"; | |
114 | print DATEI @temp; | |
115 | close(DATEI); | |
116 | $message=system("/usr/local/bin/mpfirectrl playall"); | |
117 | } | |
118 | elsif ( $mpfiresettings{'ACTION'} eq "playgenre" ) | |
119 | { | |
120 | my @temp = ""; | |
121 | my @genre = split(/\|/,$mpfiresettings{'genre'}); | |
122 | my %hash = map{ $_, 1 }@genre; | |
123 | ||
124 | foreach (@songdb){ | |
125 | my @song = split(/\|/,$_); | |
126 | chomp($song[0]); | |
127 | push(@temp,$song[0]."\n") if exists $hash{$song[6]}; | |
128 | } | |
129 | open(DATEI, ">${General::swroot}/mpfire/playlist") || die "Could not add playlist"; | |
130 | print DATEI @temp; | |
131 | close(DATEI); | |
132 | $message=system("/usr/local/bin/mpfirectrl playall"); | |
133 | } | |
bac7231b | 134 | elsif ( $mpfiresettings{'ACTION'} eq "playall" ) |
a28fdc01 CS |
135 | { |
136 | my @temp = ""; | |
137 | foreach (@songdb){ | |
138 | my @song = split(/\|/,$_); | |
139 | chomp($song[0]); | |
140 | push(@temp,$song[0]."\n"); | |
141 | } | |
142 | open(DATEI, ">${General::swroot}/mpfire/playlist") || die "Could not add playlist"; | |
143 | print DATEI @temp; | |
144 | close(DATEI); | |
8871b9f2 | 145 | $message=system("/usr/local/bin/mpfirectrl playall"); |
a28fdc01 | 146 | } |
8050f37b | 147 | elsif ( $mpfiresettings{'SHOWLIST'} ){delete $mpfiresettings{'__CGI__'};delete $mpfiresettings{'x'};delete $mpfiresettings{'y'};delete $mpfiresettings{'PAGE'};&General::writehash("${General::swroot}/mpfire/settings", \%mpfiresettings);refreshpage();} |
a28fdc01 CS |
148 | |
149 | ############################################################################################################################ | |
150 | ################################### Aufbau der HTML Seite fr globale Sambaeinstellungen #################################### | |
151 | ||
152 | $mpfiresettings{'SCANDIR'} = "/"; | |
153 | $mpfiresettings{'SHOWLIST'} = "off"; | |
154 | ||
155 | &General::readhash("${General::swroot}/mpfire/settings", \%mpfiresettings); | |
156 | ||
157 | ############################################################################################################################ | |
158 | ########################################### rekursiv nach neuen Mp3s Scannen ##############################################รค | |
159 | ||
8871b9f2 CS |
160 | if ( $message ne '0' ) { print "<font color='red'>An Error occured while launching the command</font>"; } |
161 | elsif ( $message ne "" && $message ne '0' ) { print "<font color='red'>$message</font>"; } | |
a28fdc01 CS |
162 | |
163 | &Header::openbox('100%', 'center', $Lang::tr{'mpfire scanning'}); | |
a2d5130f | 164 | |
a28fdc01 CS |
165 | print <<END |
166 | <form method='post' action='$ENV{'SCRIPT_NAME'}'> | |
167 | <table width='95%' cellspacing='0'> | |
168 | <tr bgcolor='$color{'color20'}'><td colspan='2' align='left'><b>$Lang::tr{'Scan for Files'}</b></td></tr> | |
169 | <tr><td align='left' width='40%'>$Lang::tr{'Scan from Directory'}</td><td align='left'><input type='text' name='SCANDIR' value='$mpfiresettings{'SCANDIR'}' size="30" /></td></tr> | |
170 | <tr><td align='left' width='40%'>$Lang::tr{'deep scan directories'}</td><td align='left'>on <input type='radio' name='SCANDIRDEPS' value='on' checked='checked'/>/ | |
171 | <input type='radio' name='SCANDIRDEPS' value='off'/> off</td></tr> | |
172 | <tr><td align='center' colspan='2'><input type='hidden' name='ACTION' value='scan' /> | |
173 | <input type='image' alt='$Lang::tr{'Scan for Files'}' title='$Lang::tr{'Scan for Files'}' src='/images/edit-find.png' /></td></tr> | |
174 | </table> | |
175 | </form> | |
176 | END | |
177 | ; | |
178 | &Header::closebox(); | |
179 | ||
a2d5130f CS |
180 | my $song = qx(/usr/local/bin/mpfirectrl song); |
181 | if ( $song eq "" ){$song = "None";} | |
182 | ||
8050f37b CS |
183 | my $Volume = `/usr/local/bin/mpfirectrl volume`; |
184 | $Volume=~s/<break>/<br \/>/g; | |
185 | ||
a28fdc01 | 186 | &Header::openbox('100%', 'center', $Lang::tr{'mpfire controls'}); |
a28fdc01 | 187 | print <<END |
69addbb8 CS |
188 | |
189 | <table width='95%' cellspacing='0'> | |
190 | <tr bgcolor='$color{'color20'}'> <td colspan='5' align='center'><marquee behavior='alternate' scrollamount='1' scrolldelay='5'><font color=red>-= $song =-</font></marquee></td></tr> | |
8050f37b | 191 | <tr><td colspan='5' align='center'><br/><b>total $#songdb songs</b><br/><br/></td></tr> |
69addbb8 | 192 | <tr> |
a28fdc01 CS |
193 | <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> |
194 | <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='||' /><input type='image' alt='$Lang::tr{'pause'}' title='$Lang::tr{'pause'}' src='/images/media-playback-pause.png' /></form></td> | |
195 | <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='|>' /><input type='image' alt='$Lang::tr{'resume'}' title='$Lang::tr{'resume'}' src='/images/media-resume.png' /></form></td> | |
196 | <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> | |
197 | <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> | |
198 | </tr> | |
199 | END | |
200 | ; | |
201 | 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>";} | |
202 | 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>";} | |
203 | print <<END | |
204 | <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> | |
205 | <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> | |
206 | <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> | |
207 | <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> | |
208 | </tr> | |
8050f37b | 209 | <tr><td colspan='5' align='center'>$Volume</td></tr> |
a28fdc01 CS |
210 | </table> |
211 | END | |
212 | ; | |
213 | &Header::closebox(); | |
214 | ||
8050f37b | 215 | if ( $#songdb ne '0' ){ |
32ab16de CS |
216 | &Header::openbox('100%', 'center', $Lang::tr{'quick playlist'}); |
217 | ||
8050f37b | 218 | my @artist; my @album; my @genre; my @year; |
32ab16de CS |
219 | foreach (@songdb){ |
220 | my @song = split(/\|/,$_); | |
8050f37b | 221 | push(@artist,$song[1]); push(@album,$song[4]); push(@year,$song[5]); push(@genre,$song[6]);} |
32ab16de CS |
222 | my %hash = map{ $_, 1 }@artist; |
223 | @artist = sort keys %hash; | |
224 | my %hash = map{ $_, 1 }@album; | |
225 | @album = sort keys %hash; | |
8050f37b CS |
226 | my %hash = map{ $_, 1 }@year; |
227 | @year = sort keys %hash; | |
228 | my %hash = map{ $_, 1 }@genre; | |
229 | @genre = sort keys %hash; | |
32ab16de CS |
230 | print <<END |
231 | <table width='95%' cellspacing='0'> | |
69addbb8 | 232 | <tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'artist'} - $#artist</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'album'} - $#album</b></td></tr> |
32ab16de CS |
233 | <tr><td align='center'> |
234 | <form method='post' action='$ENV{'SCRIPT_NAME'}'> | |
69addbb8 | 235 | <select name='artist' size='8' multiple='multiple' style='width:300px;'> |
32ab16de CS |
236 | END |
237 | ; | |
8050f37b | 238 | foreach (@artist){if ( $_ ne '' ){print "<option>$_</option>";}} |
32ab16de CS |
239 | print <<END |
240 | </select><br/> | |
241 | <input type='hidden' name='ACTION' value='playartist' /> | |
242 | <input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' /> | |
243 | </form></td> | |
244 | <td align='center'> | |
245 | <form method='post' action='$ENV{'SCRIPT_NAME'}'> | |
69addbb8 | 246 | <select name='album' size='8' multiple='multiple' style='width:300px;'> |
32ab16de CS |
247 | END |
248 | ; | |
8050f37b | 249 | foreach (@album){if ( $_ ne '' ){print "<option>$_</option>";}} |
32ab16de CS |
250 | print <<END |
251 | </select><br/> | |
252 | <input type='hidden' name='ACTION' value='playalbum' /> | |
253 | <input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' /> | |
254 | </form></td> | |
8050f37b CS |
255 | </tr> |
256 | <tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'year'} - $#year</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'genre'} - $#genre</b></td></tr> | |
257 | <tr><td align='center'> | |
258 | <form method='post' action='$ENV{'SCRIPT_NAME'}'> | |
259 | <select name='year' size='8' multiple='multiple' style='width:300px;'> | |
260 | END | |
261 | ; | |
262 | foreach (@year){if ( $_ ne '' ){print "<option>$_</option>";}} | |
263 | print <<END | |
264 | </select><br/> | |
265 | <input type='hidden' name='ACTION' value='playyear' /> | |
266 | <input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' /> | |
267 | </form></td> | |
268 | <td align='center'> | |
269 | <form method='post' action='$ENV{'SCRIPT_NAME'}'> | |
270 | <select name='genre' size='8' multiple='multiple' style='width:300px;'> | |
271 | END | |
272 | ; | |
273 | foreach (@genre){if ( $_ ne '' ){print "<option>$_</option>";}} | |
274 | print <<END | |
275 | </select><br/> | |
276 | <input type='hidden' name='ACTION' value='playgenre' /> | |
277 | <input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' /> | |
278 | </form></td> | |
32ab16de CS |
279 | </tr></table> |
280 | END | |
281 | ; | |
282 | &Header::closebox(); | |
8871b9f2 CS |
283 | } |
284 | ||
32ab16de | 285 | |
a28fdc01 CS |
286 | if ( $mpfiresettings{'SHOWLIST'} eq "on" ){ |
287 | ||
288 | &Header::openbox('100%', 'center', $Lang::tr{'mpfire songs'}); | |
289 | print <<END | |
290 | ||
32ab16de | 291 | <table width='95%' cellspacing='5'> |
a28fdc01 | 292 | <tr bgcolor='$color{'color20'}'><td colspan='9' align='left'><b>$Lang::tr{'Existing Files'}</b></td></tr> |
8871b9f2 CS |
293 | <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/> |
294 | END | |
295 | ; | |
296 | my $pages =(int($#songdb/100)+1); | |
297 | for(my $i = 1; $i <= $pages; $i++) { | |
298 | print "<input type='submit' name='PAGE' value='$i' />"; | |
299 | if (!($i % 205)){print"<br/>";} | |
300 | } | |
301 | print <<END | |
302 | </form></td></tr> | |
a28fdc01 CS |
303 | <tr><td align='center'></td> |
304 | <td align='center'><b>$Lang::tr{'artist'}<br/>$Lang::tr{'title'}</b></td> | |
305 | <td align='center'><b>$Lang::tr{'number'}</b></td> | |
306 | <td align='center'><b>$Lang::tr{'album'}</b></td> | |
307 | <td align='center'><b>$Lang::tr{'year'}</b></td> | |
308 | <td align='center'><b>$Lang::tr{'genre'}</b></td> | |
309 | <td align='center'><b>$Lang::tr{'length'}<br/>$Lang::tr{'bitrate'} - $Lang::tr{'frequency'}</b></td> | |
310 | <td align='center'><b>$Lang::tr{'mode'}</b></td></tr> | |
311 | END | |
312 | ; | |
8871b9f2 CS |
313 | my $lines=0;my $i=0;my $begin;my $end; |
314 | if ( $mpfiresettings{'PAGE'} eq 'all' ){ | |
315 | $begin=0; | |
316 | $end=$#songdb; | |
317 | } | |
318 | else{ | |
319 | $begin=(($mpfiresettings{'PAGE'}-1) * 100); | |
320 | $end=(($mpfiresettings{'PAGE'} * 100)-1); | |
321 | } | |
a28fdc01 | 322 | foreach (@songdb){ |
8871b9f2 CS |
323 | if (!($i >= $begin && $i <= $end)){ |
324 | #print $begin."->".$i."<-".$end."\n"; | |
325 | $i++;next;} | |
a28fdc01 CS |
326 | my @song = split(/\|/,$_); |
327 | ||
328 | if ($lines % 2) {print "<tr bgcolor='$color{'color20'}'>";} else {print "<tr bgcolor='$color{'color22'}'>";} | |
329 | $song[0]=~s/\/\//\//g; | |
330 | print <<END | |
8871b9f2 | 331 | <td align='center' style="white-space:nowrap;"><form method='post' action='$ENV{'SCRIPT_NAME'}'><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> |
a28fdc01 CS |
332 | <td align='center'>$song[1]<br/>$song[2]</td> |
333 | <td align='center'>$song[3]</td> | |
334 | <td align='center'>$song[4]</td> | |
335 | <td align='center'>$song[5]</td> | |
336 | <td align='center'>$song[6]</td> | |
337 | <td align='center'>$song[7]:$song[8]<br/>$song[9] - $song[10]</td> | |
338 | END | |
339 | ; | |
340 | if ( $song[11] eq "0\n" ) {print "<td align='center'>Stereo</td></tr>"; } | |
341 | elsif ( $song[11] eq "1\n" ) {print "<td align='center'>Joint<br/>Stereo</td></tr>"; } | |
342 | elsif ( $song[11] eq "2\n" ) {print "<td align='center'>Dual<br/>Channel</td></tr>"; } | |
343 | elsif ( $song[11] eq "3\n" ) {print "<td align='center'>Single<br/>Channel</td></tr>"; } | |
344 | else {print "<td align='center'></td></tr>"; } | |
8871b9f2 CS |
345 | $lines++; |
346 | $i++; | |
a28fdc01 | 347 | } |
8871b9f2 | 348 | print "</table>"; |
a28fdc01 CS |
349 | &Header::closebox(); |
350 | } | |
351 | ||
32ab16de CS |
352 | &Header::openbox('100%', 'center', $Lang::tr{'mpfire playlist'}); |
353 | ||
32ab16de CS |
354 | open(DATEI, "<${General::swroot}/mpfire/playlist") || die "Could not open playlist"; |
355 | my @playlist = <DATEI>; | |
356 | close(DATEI); | |
357 | ||
bac7231b CS |
358 | my %hash; |
359 | foreach (@songdb){ | |
360 | my @song = split(/\|/,$_); | |
361 | chomp($song[0]); | |
362 | $hash{$song[0]}=$song[1]." - ".$song[2]." - ".$song[7].":".$song[8]; | |
363 | } | |
364 | ||
32ab16de CS |
365 | print <<END |
366 | <table width='95%' cellspacing='0'> | |
8871b9f2 CS |
367 | <tr bgcolor='$color{'color20'}'><td colspan='2' align='left'><b>$Lang::tr{'current playlist'}</b></td></tr> |
368 | <tr><td align='center' colspan='2' ><textarea cols='100' rows='10' name='playlist' style='font-size:11px;width:650px;' readonly='readonly'> | |
bac7231b CS |
369 | END |
370 | ; | |
371 | foreach (@playlist){chomp($_);print $hash{$_}."\n";} | |
372 | print <<END | |
8871b9f2 CS |
373 | </textarea></td></tr><tr> |
374 | <td align='right'> | |
375 | <form method='post' action='$ENV{'SCRIPT_NAME'}'> | |
376 | <input type='hidden' name='ACTION' value='emptyplaylist' /> | |
377 | <input type='image' alt='$Lang::tr{'clear playlist'}' title='$Lang::tr{'clear playlist'}' src='/images/user-trash.png' /> | |
378 | </form> | |
379 | </td> | |
380 | <td align='left'> | |
381 | <form method='post' action='$ENV{'SCRIPT_NAME'}'> | |
382 | <input type='hidden' name='ACTION' value='playlist' /> | |
383 | <input type='image' alt='$Lang::tr{'play'}' title='$Lang::tr{'play'}' src='/images/media-playback-start.png' /> | |
384 | </form> | |
385 | </td></tr> | |
32ab16de CS |
386 | </table> |
387 | END | |
388 | ; | |
389 | &Header::closebox(); | |
390 | ||
a2d5130f CS |
391 | &Header::openbox('100%', 'center', $Lang::tr{'mpfire webradio'}); |
392 | ||
393 | open(DATEI, "<${General::swroot}/mpfire/webradio") || die "Could not open playlist"; | |
394 | my @webradio = <DATEI>; | |
395 | close(DATEI); | |
396 | ||
397 | print <<END | |
398 | <table width='95%' cellspacing='0'> | |
399 | <tr bgcolor='$color{'color20'}'><td colspan='9' align='left'><b>$Lang::tr{'webradio playlist'}</b></td></tr> | |
400 | <tr><td>Stream</td><td colspan='2'></td></tr> | |
401 | END | |
402 | ; | |
403 | foreach (@webradio){ | |
404 | my @stream = split(/\|/,$_); | |
405 | print <<END | |
406 | <tr><td>$stream[1]</td> | |
a2d5130f CS |
407 | <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' /></form></td> |
408 | </tr> | |
409 | END | |
410 | ; | |
411 | } | |
412 | print "</table>"; | |
413 | &Header::closebox(); | |
414 | ||
a28fdc01 CS |
415 | &Header::closebigbox(); |
416 | &Header::closepage(); |