RE: Pardon me for being the n00b here...

"Richard Smith" <[email protected]> Mon, 15 Oct 2001 19:12:06 +0100
Newsgroups gmane.music.equipment.slimp3.dev
Message-ID <[email protected]>
Ok, the diff is here...
http://www.chatbear.com/personal/changes.diff

CVS still means nothing to me, so hopefully that's right.

I don't have much time to do anything else with it (like clean up some of
the stupid things I did as I got the hang of the code) but I'm sure one of
you can make it nice. Or at least take inspiration and write your own
version. :)

The main change is the displaying of the clock and using the second line to
display other information like weather, email details etc. To make this is
as easy as possible to adapt to your own needs, these second lines are
stored in a file called secondlines.txt that goes in the same directory as
the server.pl (at the moment I'm afraid to say the path to this file,
c:\server\secondlines.txt is hardcoded for my machine in Timers.pm, so you
should probably change this). Each line can be no longer than 40 characters
(well it can, but it'll be cut off) and they cycle in five second intervals
(shows the first line of the file, waits 5 seconds, shows the second, waits
5 seconds etc).

If you download this...
http://www.chatbear.com/personal/secondline.txt

You'll see the script I'm using to generate a file of secondlines (again,
the file path of the output is hardcoded, so you should change this). It
uses a similar timer layout to Timer.pm and includes code for getting BBC
headlines, weather and mail box counts. You should find the relevant lines
in the code for the weather city it checks, the email server it connects to
etc and change them to suit yourself. Oh yea, and rename it from .txt to .pl
of course. :) It needs LWP::Simple and Weather::Underground and Net::POP3,
all of which are available from CPAN (everything apart from
Weather::Underground is really in a standard Perl install, win version
included).

Basically run this file as a daemon, just like server.pl. Or in the case of
windows, just run it and it'll stay open. The timers will fire and update
the information. I moved it into a second script (instead of just putting it
in server.pl) so that the server was hung up checking your mail while you
were trying to play music.

You'll also find in Timers.pm the code to scroll the text if it's too long
for the width of the screen. It's commented out, but it does work. It just
annoys me because it only scrolled at the same speed as the clock updated -
once a second. And without a higher resolution timer system (ie, not just
using unixtime) it's kinda hard to do better than that. So I commented it
out. If somebody wants to move it to a better timing system, they can.

Final big change in the code is that when you pause it, the word pause
flashes on and off on the top line. This stops the player shutting down
because it's always receiving from the server. This solves the problem of
crackly sound if you unpause it after the player has fallen asleep (as it no
longer falls asleep). It's a dirty hack, but many people would say all Perl
code is. :)

There's a LocalAddr setting added to the IO::Socket call in server.pl which
you want to remove or change to your server IP address. I had problems on
multihomed machines without it.

Code is now win2k compatible (previous version wasn't).

Damn this turned into a long email. Hopefully somebody finds the changes
helpful or worth fixing up and rolling in for the masses. Any code
questions, just give me a shout.


Richard Smith
[email protected]

- Free, REALLY customisable hosted messageboards
- http://www.chatbear.com/
- I wrote them, trust me, they're good... :)
- Plus, coming soon, http://www.theonewith.com/


> -----Original Message-----
> From: dean blackketter [mailto:dean-qV/[email protected]]
> Sent: 15 October 2001 17:19
> To: [email protected]
> Subject: RE: [slimp3-dev] Pardon me for being the n00b here...
>
>
> Richard,
>
> Can you post your changes as a diff?
>
> After you are updated to the most recent version (with "cvs update")
> the command to use (per Daniel Sully):
>
> cvs diff -upB
>
> this will output the differences in a way that's reasonably easy to
> read and can be automatically applied to the source by somebody with
> write access to the server.
>
> -dean
>
> >http://www.chatbear.com/personal/server.zip
> >
> >Download that. I took a dump of the CVS and zipped it up. Just unzip the
> >whole lot to a directory with pathnames, it includes all the Perl modules
> >you need.
> >
> >Trouble is - it doesn't work on win2k. This is a bug in the
> server that's on
> >the CVS right now so you'll need to edit the code to make it work.
> >
> >I'd tell you the line you need to add, but I don't have my code here at
> >work. I'll check when I get home if you can't do it yourself
> (it's a double
> >path issue, and the fix goes into fixPath in server.pl, but
> unless you know
> >Perl, you'll be screwed :)).
> >
> >And btw, I don't have a clue about CVS either (I'm a perl coder
> who's just
> >never used it), so downloading from the repository was really
> about as far
> >as my CVS skills could take me. :)
> >
> >I'll also upload the version of the server I'm now using so you can grab
> >that. As well as all the stuff in the version on the CVS, it
> also displays a
> >clock (and date) when you've haven't used the remote for 10 seconds. It
> >displays this on the first line of the screen. On the second line it
> >alternates between the weather forecast in my local city (Glasgow, but
> >easily changeable), the number of messages on my email server, news
> >headlines from the BBC and the number of users etc signed up on Chatbear
> >(the free forum service I run). It is already fixed to work with Win2K.
> >
> >I'm sure somebody familiar with CVS can take the code and merge
> it with the
> >current code base and resubmit it (all my changes are clearly marked).
> >
> >
> >Richard Smith
> >- Development Manager
> >- Traveltek
> >- [email protected]
> >
> >
> >>  -----Original Message-----
> >>  From: woo_49-/[email protected] [mailto:[email protected]]
> >>  Sent: 15 October 2001 16:40
> >>  To: [email protected]
> >>  Subject: [slimp3-dev] Pardon me for being the n00b here...
> >>
> >>
> >>  ... but I'll go ahead and risk making myself the laughing stock of
> >>  the list by admitting that I can't even spell CVS.  Nevertheless, I'd
> >>  really like to update my nearly-a-month-old 1.0 server to something
> >>  that can handle shoutcast streams, and I don't know how.
> >>
> >>  Would anyone like to educate me on mining Sourceforge for the latest
> >>  slimp3 code?  Please?  I'm running on Win2K, if that makes a
> >>  difference.
> >>
> >>  Thanks for not beating me up too badly,
> >>
> >>  Steve Wootton
> >>  happy owner of #36
> >>
> >>
> >>
> >>  To unsubscribe from this group, send an email to:
> >>  [email protected]
> >>
> >>
> >>
> >>  Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >>
> >>
> >>
> >
> >
> >
> >To unsubscribe from this group, send an email to:
> >[email protected]
> >
> >
> >
> >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
> To unsubscribe from this group, send an email to:
> [email protected]
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Pinpoint the right security solution for your company- Learn how to add 128- bit encryption and to authenticate your web site with VeriSign's FREE guide!
http://us.click.yahoo.com/yQix2C/33_CAA/yigFAA/rIp0lB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/