"Fossies" - the Fresh Open Source Software Archive 
Member "namefix.pl/libs/cli/print.pm" (12 Sep 2009, 2439 Bytes) of package /linux/privat/old/namefix.pl_4.0.2.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "print.pm" see the
Fossies "Dox" file reference documentation.
1 use strict;
2 use warnings;
3
4 #--------------------------------------------------------------------------------------------------------------
5 # cli print
6 #--------------------------------------------------------------------------------------------------------------
7
8 sub cli_print
9 {
10 my $s1 = shift;
11 my $s2 = shift;
12
13 if(!$s2) { $s2 = $s1; }
14
15 my $art = "";
16 my $tit = "";
17 my $tra = "";
18 my $alb = "";
19 my $com = "";
20 my $gen = "";
21 my $year = "";
22
23 my $newart = "";
24 my $newtit = "";
25 my $newtra = "";
26 my $newalb = "";
27 my $newcom = "";
28 my $newgen = "";
29 my $newyear = "";
30
31 my $tmp = "";
32
33 &plog(3, "sub cli_print: \"$s1\", \"$s2\"");
34
35 if($s2 eq "<MSG>")
36 {
37 for(split(/\n/, $s1))
38 {
39 print "*** $_\n";
40 }
41 &html("<TR><TD colspan=4>$s1</TD></TR>");
42 return 1;
43 }
44
45 if($main::id3_mode == 1)
46 {
47 $art = shift;
48 $tit = shift;
49 $tra = shift;
50 $alb = shift;
51 $com = shift;
52 $gen = shift;
53 $year = shift;
54 }
55
56 # When renaming or previewing in id3 mode we will be sent the "after" id3 tags
57 if($main::id3_mode == 1 && $main::LISTING == 0)
58 {
59 $newart = shift;
60 $newtit = shift;
61 $newtra = shift;
62 $newalb = shift;
63 $newcom = shift;
64 $newgen = shift;
65 $newyear = shift;
66 }
67
68 # normal listing
69
70 if(!$main::id3_mode)
71 {
72 print "old> $s1\nnew> $s2\n\n";
73 &html("<TR><TD colspan=2 nowrap>$s1</TD><TD colspan=2 nowrap>$s2</TD></TR>");
74 return 1;
75 }
76 else
77 {
78 print "old>\"$s1\"\nnew>\"$s2\"\n",
79 "\told-artist>$art\n\tnew-artist>$newart\n",
80 "\told-title>$tit\n\tnew-title>$newtit\n",
81 "\told-track>$tra\n\tnew-track>$newtra\n",
82 "\told-album>$alb\n\tnew-album>$newalb\n",
83 "\told-comment>$com\n\tnew-comment>$newcom\n",
84 "\told-genre>$gen\n\tnew-genre>$newgen\n",
85 "\told-year>$year\n\tnew-year>$newyear\n\n";
86
87 $tmp="
88 <TR>
89 <TD colspan=2 nowrap>$s1</TD>
90 <TD colspan=2 nowrap>$s2</TD></TR>
91 <TR>
92 <TD>Artist</TD><TD>$art</TD>
93 <TD colspan=2>$newart</TD>
94 </TR>
95 <TR>
96 <TD>Title</TD><TD>$tit</TD>
97 <TD colspan=2>$newtit</TD>
98 </TR>
99 <TR>
100 <TD>Track</TD><TD>$tra</TD>
101 <TD colspan=2>$newtra</TD>
102 </TR>
103 <TR>
104 <TD>Album</TD><TD>$alb</TD>
105 <TD colspan=2>$newalb</TD>
106 </TR>
107 <TR>
108 <TD>Comment</TD><TD>$com</TD>
109 <TD colspan=2>$newcom</TD>
110 </TR>
111 <TR>
112 <TD>Genre</TD><TD>$gen</TD>
113 <TD colspan=2>$newgen</TD>
114 </TR>
115 <TR>
116 <TD>Year</TD><TD>$year</TD>
117 <TD colspan=2>$newyear</TD>
118 </TR>
119 <TR>
120 <TD colspan=4 align=center>***********</TD>
121 </tr>
122 ";
123
124 &html($tmp);
125
126 return 1;
127 }
128 return;
129
130 }
131
132 1;