dean blackketter
2001-12-10 06:47:47 UTC
Can you resend this as an attachment?
the funny wrapping is probably going to make the patching choke.
-dean
cvs diff -upB > diffile
then email diffile as an attachment.
Keep up the good work!
-dean
Ok here is the cvs diff -upB it's got all the patches in it, the
volume patch, the scrolling title's, and the underscore fix
Index: slimp3/server/lib/SliMP3/Animation.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/Animation.pm,v
retrieving revision 1.4
diff -u -p -B -r1.4 Animation.pm
--- slimp3/server/lib/SliMP3/Animation.pm 2001/12/01 20:30:12
1.4
+++ slimp3/server/lib/SliMP3/Animation.pm 2001/12/08 08:27:10
@@ -89,6 +89,46 @@ sub doEasterEgg {
}
+# FUNCTION: scrollText
+#
+# DESCRIPTION: Given 2 lines of text, the function will hold
+# the top line of text, and scroll the bottom line of text to
+# the left. It will pause for 3 seconds, Scroll 4 times, pause
for
+# 3 seconds.
+#
+# EXAMPLE OUTPUT: Now playing (2 of 3)
+# -- The Band - The Song
+# -- The Band - The Song
+# <---- text moving that way
+#
+# USEAGE: scrollText($client,$text1,$text2)
+sub scrollText {
+ my $client = shift;
+ my $text1 = shift || ' ' x 40;
+ my $text2 = shift || ' ' x 40;
+
+ my $now = time();
+
+ $text2 = $text2 . " -- ";
+
$text2 };
+ $now += 3;
+
+ for (my $j = 0; $j < 4; $j++) {
+ for (my $i = 0; $i < length($text2); $i++) {
+ my $t2 = substr($text2 . $text2, $i, 40);
$text1 , line2 => $t2 };
+ $now += 0.1;
+ }
+ }
+
$text2 };
+ $now +=3;
$text2 };
+}
+
# take the list of animation "frames" and queue them up
sub startAnimation {
my $client = shift;
Index: slimp3/server/lib/SliMP3/Display.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/Display.pm,v
retrieving revision 1.12
diff -u -p -B -r1.12 Display.pm
--- slimp3/server/lib/SliMP3/Display.pm 2001/12/01 20:30:12 1.12
+++ slimp3/server/lib/SliMP3/Display.pm 2001/12/08 08:27:10
@@ -56,8 +56,19 @@ sub screenSaver {
SliMP3::VFD::vfdUpdate($client, $line1, '');
} elsif ($client->epochirtime < time() - $screenSaverTimeout)
{
+ my $text1 = "";
+ my $text2 = "";
+
# otherwise wait until we haven't hit a button for a
while, then show the current song.
- SliMP3::VFD::vfdUpdate($client,
SliMP3::Buttons::Playlist::currentSongLines($client));
+ ($text1, $text2) =
SliMP3::Buttons::Playlist::currentSongLines($client);
+ if(length($text2) > 40)
+ {
+ SliMP3::Animation::scrollText($client,
$text1, $text2);
+ }
+ else
+ {
+ SliMP3::VFD::vfdUpdate($client, $text1,
$text2);
+ }
} else {
SliMP3::VFD::refresh($client);
}
@@ -80,6 +91,25 @@ sub startScreenSaver {
# start it again immediately
screenSaver($client);
+}
+
+# FUNCTION: barDisplay
+#
+# DESCRIPTION: Used to display a heading followed by a
linear
+# meter ontop of the current song playing.
+#
+# EXAMPLE OUTPUT: Louder [############### ]
+# The Band - The Song
+#
+# USEAGE: barDisplay($client,$heading,$level)
+sub barDisplay {
+ my $client = shift;
+ my $heading = shift || "Undefined";
+ my $level = shift || 100;
+ my $line1=sprintf("%-17s [%-20s]",$heading,('#' x
($level/5)));
+ my $line2 = SliMP3::Buttons::Playlist::currentSongLines
($client);
+
+ SliMP3::Animation::showBriefly($client,$line1,$line2);
}
1;
Index: slimp3/server/lib/SliMP3/IR.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/IR.pm,v
retrieving revision 1.16
diff -u -p -B -r1.16 IR.pm
--- slimp3/server/lib/SliMP3/IR.pm 2001/11/30 03:54:01 1.16
+++ slimp3/server/lib/SliMP3/IR.pm 2001/12/08 08:27:11
@@ -169,8 +169,8 @@ right 00 00 f7 cb
down 00 00 f7 8b
menu 00 00 f7 83
ok 00 00 f7 2b
-volup 00 00 f7 78
-voldown 00 00 f7 f8
+volup 00 00 c5 78
+voldown 00 00 c5 f8
chup 00 00 f7 0d
chdown 00 00 f7 8d
muting XX XX XX XX
Index: slimp3/server/lib/SliMP3/Playlist.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/Playlist.pm,v
retrieving revision 1.29
diff -u -p -B -r1.29 Playlist.pm
--- slimp3/server/lib/SliMP3/Playlist.pm 2001/12/01 20:30:12
1.29
+++ slimp3/server/lib/SliMP3/Playlist.pm 2001/12/08 08:27:12
@@ -21,6 +21,9 @@ sub openNext {
my $fullpath = '';
+ # We are starting a new song, lets kill any nimation
+ SliMP3::Animation::killAnimation($client);
+
# close the previous handle to prevent leakage.
if (defined $client->mp3filehandle()) {
$client->mp3filehandle->close();
Index: slimp3/server/lib/SliMP3/VFD.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/VFD.pm,v
retrieving revision 1.10
diff -u -p -B -r1.10 VFD.pm
--- slimp3/server/lib/SliMP3/VFD.pm 2001/11/30 03:54:01 1.10
+++ slimp3/server/lib/SliMP3/VFD.pm 2001/12/08 08:27:12
@@ -104,6 +104,10 @@ sub vfdUpdate {
my $line1 = shift || '';
my $line2 = shift || '';
+ # eliminate _'s in the text, since commands start with _
+ $line1 =~ s/_/\ /g;
+ $line2 =~ s/_/\ /g;
+
# translate iso8859-1 to vfd charset
$line1 =~tr/åäöÅÄÖüÜéÉáÁ/\x84\xe1\x87\x81\x80\x86\x8b\x8a\x65
\x54\x83\x41/;
$line2 =~tr/åäöÅÄÖüÜéÉáÁ/\x84\xe1\x87\x81\x80\x86\x8b\x8a\x65
\x54\x83\x41/;
Index: slimp3/server/lib/SliMP3/Buttons/Common.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/Buttons/Common.pm,v
retrieving revision 1.7
diff -u -p -B -r1.7 Common.pm
--- slimp3/server/lib/SliMP3/Buttons/Common.pm 2001/12/01 20:30:12
1.7
+++ slimp3/server/lib/SliMP3/Buttons/Common.pm 2001/12/08 08:27:15
@@ -113,8 +113,10 @@ sub volup {
my $client = shift;
SliMP3::Playlist::executecommand
($client, "mixer", "volume", "+1");
+ SliMP3::Display::barDisplay($client,string
('VOLUME_LOUDER'),$client->volume);
}
+
sub voldown {
my $client = shift;
@@ -119,6 +121,7 @@ sub voldown {
my $client = shift;
SliMP3::Playlist::executecommand
($client, "mixer", "volume", "-1");
+ SliMP3::Display::barDisplay($client,string
('VOLUME_SOFTER'),$client->volume);
}
sub power {
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Promise to Quit
Nicotrol will help
http://us.click.yahoo.com/5vN8tD/AqSDAA/ySSFAA/rIp0lB/TM
---------------------------------------------------------------------~->
To unsubscribe from this group, send an email to:
slimp3-dev-unsubscribe-***@public.gmane.org
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
the funny wrapping is probably going to make the patching choke.
-dean
... I'm back with more patches I guess =)
This stuff is great.cvs diff -upB > diffile
then email diffile as an attachment.
Keep up the good work!
-dean
volume patch, the scrolling title's, and the underscore fix
Index: slimp3/server/lib/SliMP3/Animation.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/Animation.pm,v
retrieving revision 1.4
diff -u -p -B -r1.4 Animation.pm
--- slimp3/server/lib/SliMP3/Animation.pm 2001/12/01 20:30:12
1.4
+++ slimp3/server/lib/SliMP3/Animation.pm 2001/12/08 08:27:10
@@ -89,6 +89,46 @@ sub doEasterEgg {
}
+# FUNCTION: scrollText
+#
+# DESCRIPTION: Given 2 lines of text, the function will hold
+# the top line of text, and scroll the bottom line of text to
+# the left. It will pause for 3 seconds, Scroll 4 times, pause
for
+# 3 seconds.
+#
+# EXAMPLE OUTPUT: Now playing (2 of 3)
+# -- The Band - The Song
+# -- The Band - The Song
+# <---- text moving that way
+#
+# USEAGE: scrollText($client,$text1,$text2)
+sub scrollText {
+ my $client = shift;
+ my $text1 = shift || ' ' x 40;
+ my $text2 = shift || ' ' x 40;
+
+ my $now = time();
+
+ $text2 = $text2 . " -- ";
+
$text2 };
+ $now += 3;
+
+ for (my $j = 0; $j < 4; $j++) {
+ for (my $i = 0; $i < length($text2); $i++) {
+ my $t2 = substr($text2 . $text2, $i, 40);
$text1 , line2 => $t2 };
+ $now += 0.1;
+ }
+ }
+
$text2 };
+ $now +=3;
$text2 };
+}
+
# take the list of animation "frames" and queue them up
sub startAnimation {
my $client = shift;
Index: slimp3/server/lib/SliMP3/Display.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/Display.pm,v
retrieving revision 1.12
diff -u -p -B -r1.12 Display.pm
--- slimp3/server/lib/SliMP3/Display.pm 2001/12/01 20:30:12 1.12
+++ slimp3/server/lib/SliMP3/Display.pm 2001/12/08 08:27:10
@@ -56,8 +56,19 @@ sub screenSaver {
SliMP3::VFD::vfdUpdate($client, $line1, '');
} elsif ($client->epochirtime < time() - $screenSaverTimeout)
{
+ my $text1 = "";
+ my $text2 = "";
+
# otherwise wait until we haven't hit a button for a
while, then show the current song.
- SliMP3::VFD::vfdUpdate($client,
SliMP3::Buttons::Playlist::currentSongLines($client));
+ ($text1, $text2) =
SliMP3::Buttons::Playlist::currentSongLines($client);
+ if(length($text2) > 40)
+ {
+ SliMP3::Animation::scrollText($client,
$text1, $text2);
+ }
+ else
+ {
+ SliMP3::VFD::vfdUpdate($client, $text1,
$text2);
+ }
} else {
SliMP3::VFD::refresh($client);
}
@@ -80,6 +91,25 @@ sub startScreenSaver {
# start it again immediately
screenSaver($client);
+}
+
+# FUNCTION: barDisplay
+#
+# DESCRIPTION: Used to display a heading followed by a
linear
+# meter ontop of the current song playing.
+#
+# EXAMPLE OUTPUT: Louder [############### ]
+# The Band - The Song
+#
+# USEAGE: barDisplay($client,$heading,$level)
+sub barDisplay {
+ my $client = shift;
+ my $heading = shift || "Undefined";
+ my $level = shift || 100;
+ my $line1=sprintf("%-17s [%-20s]",$heading,('#' x
($level/5)));
+ my $line2 = SliMP3::Buttons::Playlist::currentSongLines
($client);
+
+ SliMP3::Animation::showBriefly($client,$line1,$line2);
}
1;
Index: slimp3/server/lib/SliMP3/IR.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/IR.pm,v
retrieving revision 1.16
diff -u -p -B -r1.16 IR.pm
--- slimp3/server/lib/SliMP3/IR.pm 2001/11/30 03:54:01 1.16
+++ slimp3/server/lib/SliMP3/IR.pm 2001/12/08 08:27:11
@@ -169,8 +169,8 @@ right 00 00 f7 cb
down 00 00 f7 8b
menu 00 00 f7 83
ok 00 00 f7 2b
-volup 00 00 f7 78
-voldown 00 00 f7 f8
+volup 00 00 c5 78
+voldown 00 00 c5 f8
chup 00 00 f7 0d
chdown 00 00 f7 8d
muting XX XX XX XX
Index: slimp3/server/lib/SliMP3/Playlist.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/Playlist.pm,v
retrieving revision 1.29
diff -u -p -B -r1.29 Playlist.pm
--- slimp3/server/lib/SliMP3/Playlist.pm 2001/12/01 20:30:12
1.29
+++ slimp3/server/lib/SliMP3/Playlist.pm 2001/12/08 08:27:12
@@ -21,6 +21,9 @@ sub openNext {
my $fullpath = '';
+ # We are starting a new song, lets kill any nimation
+ SliMP3::Animation::killAnimation($client);
+
# close the previous handle to prevent leakage.
if (defined $client->mp3filehandle()) {
$client->mp3filehandle->close();
Index: slimp3/server/lib/SliMP3/VFD.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/VFD.pm,v
retrieving revision 1.10
diff -u -p -B -r1.10 VFD.pm
--- slimp3/server/lib/SliMP3/VFD.pm 2001/11/30 03:54:01 1.10
+++ slimp3/server/lib/SliMP3/VFD.pm 2001/12/08 08:27:12
@@ -104,6 +104,10 @@ sub vfdUpdate {
my $line1 = shift || '';
my $line2 = shift || '';
+ # eliminate _'s in the text, since commands start with _
+ $line1 =~ s/_/\ /g;
+ $line2 =~ s/_/\ /g;
+
# translate iso8859-1 to vfd charset
$line1 =~tr/åäöÅÄÖüÜéÉáÁ/\x84\xe1\x87\x81\x80\x86\x8b\x8a\x65
\x54\x83\x41/;
$line2 =~tr/åäöÅÄÖüÜéÉáÁ/\x84\xe1\x87\x81\x80\x86\x8b\x8a\x65
\x54\x83\x41/;
Index: slimp3/server/lib/SliMP3/Buttons/Common.pm
===================================================================
RCS file: /cvsroot/slimp3/slimp3/server/lib/SliMP3/Buttons/Common.pm,v
retrieving revision 1.7
diff -u -p -B -r1.7 Common.pm
--- slimp3/server/lib/SliMP3/Buttons/Common.pm 2001/12/01 20:30:12
1.7
+++ slimp3/server/lib/SliMP3/Buttons/Common.pm 2001/12/08 08:27:15
@@ -113,8 +113,10 @@ sub volup {
my $client = shift;
SliMP3::Playlist::executecommand
($client, "mixer", "volume", "+1");
+ SliMP3::Display::barDisplay($client,string
('VOLUME_LOUDER'),$client->volume);
}
+
sub voldown {
my $client = shift;
@@ -119,6 +121,7 @@ sub voldown {
my $client = shift;
SliMP3::Playlist::executecommand
($client, "mixer", "volume", "-1");
+ SliMP3::Display::barDisplay($client,string
('VOLUME_SOFTER'),$client->volume);
}
sub power {
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Promise to Quit
Nicotrol will help
http://us.click.yahoo.com/5vN8tD/AqSDAA/ySSFAA/rIp0lB/TM
---------------------------------------------------------------------~->
To unsubscribe from this group, send an email to:
slimp3-dev-unsubscribe-***@public.gmane.org
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/