Apache-MP3
view release on metacpan or search on metacpan
} elsif ($self->path_style eq 'slashes') {
$links = $self->generate_navpath_slashes($title);
}
print a({-href=>'./playlist.m3u?Play+All+Recursive=1'},
img({-src => $self->cd_icon($dir), $self->aleft, -alt=>
$self->x('Stream All'),
-border=>0})),
$links,
a({-href=>'./playlist.m3u?Shuffle+All+Recursive=1'},
font({-class=>'directory'}, '[',
$self->x('Shuffle All'),
']'
))
.' '.
a({-href=>'./playlist.m3u?Play+All+Recursive=1'},
font({-class=>'directory'}, '[',
$self->x('Stream All'),
']'
)),
br({-clear=>'ALL'}),;
if (my $t = $self->stream_timeout) {
print p(strong(
$self->x('Note:')
),' ',
$self->x("In this demo, streaming is limited to approximately [quant,_1,second,seconds].", $t),
# staircase style path
sub generate_navpath_staircase {
my $self = shift;
my $uri = shift;
my $home = $self->home_label;
my $indent = 3.0;
my @components = split '/',$uri;
unshift @components,'' unless @components;
my ($path,$links) = ('',br());
my $current_style = "line-height: 1.2; font-weight: bold; color: red;";
my $parent_style = "line-height: 1.2; font-weight: bold;";
for (my $c=0; $c < @components-1; $c++) {
$path .= escape($components[$c]) ."/";
my $idt = $c * $indent;
my $l = a({-href=>$path},$components[$c] || ($home.br({-clear=>'all'})));
$links .= div({-style=>"text-indent: ${idt}em; $parent_style"},
font({-size=>'+1'},$l))."\n";
}
my $idt = (@components-1) * $indent;
$links .= div({-style=>"text-indent: ${idt}em; $current_style"},
font({-size=>'+1'},$components[-1] || $home))."\n";
return $links;
}
# alternative display on one line using arrows
sub generate_navpath_slashes {
my $self = shift;
my $uri = shift;
my $home = $self->home_label;
my @components = split '/',$uri;
unshift @components,'' unless @components;
my $path;
my $links = br . ' ' ; #start_h1();
for (my $c=0; $c < @components-1; $c++) {
$links .= ' / ' if $path;
$path .= escape($components[$c]) . "/";
$links .= a({-href=>$path},font({-size=>'+1'},$components[$c] || $home));
}
$links .= ' / ' if $path;
$links .= font({-size=>'+1',-style=>'color: red'},($components[-1] || $home));
$links .= br;
return $links;
}
# alternative display on one line using arrows
sub generate_navpath_arrows {
my $self = shift;
my $uri = shift;
my $home = $self->home_label;
my @components = split '/',$uri;
}
if($self->subdir_columns == 1){
$result = td(
a({-href=>$uri.'/playlist.m3u?Play+All+Recursive=1'},
img({-src=>$self->cd_list_icon($subdir),
-align=>'ABSMIDDLE',
-class=>'subdir',
-alt=>$self->x('Stream'),
-border=>0})),
a({-href=>$uri.'/'},font({-class=>'subdirectory'},$title))
)
.td(
a({-class=>'subdirbuttons',
-href=>$uri.'/playlist.m3u?Shuffle+All+Recursive=1'},
'[' .
$self->x('Shuffle')
.']')
.$nb.
a({-class=>'subdirbuttons',
-href=>$uri.'/playlist.m3u?Play+All+Recursive=1'},
} else {
$result = start_table({-border=>0,-alight=>'LEFT'}).start_TR().td(
a({-href=>$uri.'/playlist.m3u?Play+All+Recursive=1'},
img({-src=>$self->cd_list_icon($subdir),
-align=>'LEFT',
-class=>'subdir',
-alt=>$self->x('Stream'),
-border=>0}))
).td({-valign => 'CENTER', -align => 'LEFT'},
a({-href=>$uri.'/'},font({-class=>'subdirectory'},$title)).
br."\n".
a({-class=>'subdirbuttons',
-href=>$uri.'/playlist.m3u?Shuffle+All+Recursive=1'},
'['.$self->x('Shuffle').']')
.$nb.
a({-class=>'subdirbuttons',
-href=>$uri.'/playlist.m3u?Play+All+Recursive=1'},
'['.$self->x('Stream').']')."\n"
).end_TR().end_table();
}
return p(a({-href => $url},
img({-src => $self->playlist_icon,
-align => 'ABSMIDDLE',
-class => 'subdir',
-alt =>
$self->x('Playlist'),
-border => 0}))
. $nb .
a({-href => $url},
font({-class => 'subdirectory'},
$title)));
}
# This generates the link for help
sub get_help {
my $self = shift;
return a({-href => "?help_screen=1",}, $self->x('Quick Help Summary'));
}
sub txtfile_list_top {
my $url = escape($txtfile);
return p(a({-href => $url},
img({-src => "/icons/text.gif", # $self->playlist_icon,
-align => 'ABSMIDDLE',
-class => 'subdir',
-alt => 'Text File',
-border => 0}))
. $nb .
a({-href => $url},
font({-class => 'subdirectory'},
$title)));
}
# this is called to display the subdirs (subdirectories) within the current directory
sub list_subdirs {
my $self = shift;
my $subdirs = shift; # arrayref
$self->subdir_list_top($subdirs);
$self->subdir_list($subdirs);
$self->subdir_list_bottom($subdirs);
MP3/Playlist.pm view on Meta::CPAN
}
return \%d;
}
sub directory_top {
my $self = shift;
$self->SUPER::directory_top(@_);
my @p = $self->playlist;
print div({-align=>'CENTER'},
a({-href=>'#playlist',-class=>'playlist'},$self->x('Playlist contains [quant,_1,song,songs].', scalar(@p))),br,
$self->{possibly_truncated} ? font({-color=>'red'},
strong($self->x('Your playlist is now full. No more songs can be added.'))) : '')
if @p;
}
sub playlist {
my $self = shift;
my @p = $self->{playlist} ? @{$self->{playlist}} : ();
$self->{playlist} = shift if @_;
return unless @p;
return wantarray ? @p : \@p;
apache_mp3/apache_mp3.css view on Meta::CPAN
BODY {
background-color: white;
}
/* Sans-serifness turned off, because it often very aggressively */
/* interferes with font choice in international encodings. */
/* Italic style disabled because it just doesn't work right */
/* for many scripts or fonts. */
H1 {
/* font-family: sans-serif; */
font-size: 16pt;
/* font-style: italic; */
color: red;
}
H2 {
/* font-family: sans-serif; */
/* font-style: italic; */
}
TR.title {
/* font-family: sans-serif; */
background-color: #FFE89B;
}
TR.odd {
background-color: white;
padding: 0;
margin: 0;
}
TR.even {
background-color: lightcyan;
padding: 0;
margin: 0;
}
TD {
align: left;
}
.directory {
/* font-family: sans-serif; */
font-weight: bold;
}
.subdirectory {
/* font-family: sans-serif; */
font-size: 12pt;
font-weight: bold;
}
.subdirbuttons {
/* font-family: sans-serif; */
font-size: 10pt;
}
IMG.subdir {
vertical-align: middle;
}
P {
/* font-family: sans-serif; */
background-color: transparent;
}
A {
/* font-family: sans-serif; */
background-color: transparent;
}
INPUT {
/* font-family: sans-serif; */
background-color: white;
}
DIV {
/* font-family: sans-serif; */
background-color: white;
}
ADDRESS {
/* font-family: sans-serif; */
}
.playlist {
background-color: #FFE89B;
}
A.playlist {
/* font-style: italic; */
background-color: transparent;
}
( run in 0.894 second using v1.01-cache-2.11-cpan-5735350b133 )