Please login or register.

Login with username, password and session length
 

News:

Latest updates at DangerousPrototypes.com.


Author Topic: Winamp Status on Twatch (via Python)  (Read 454 times)

andrew

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Winamp Status on Twatch (via Python)
« on: February 05, 2010, 06:38:55 PM »
Thread title is pretty self explanitory.
After not being able to find a virtual serial port to get LCD Smartie to work, I decided to have a go at writing my own code to do it.

The bulk of the program is the winamp IPC junk that I stole via google. (Link to original is in source).

It's pretty basic at the moment, but I thought people might like to see. I've got some speakers in my lounge room driven by my computer (long wires), this lets me know what's playing.

It shows artist on row 1, title on row 2, and a test string on row 3. Long stuff scrolls at a rate proportional to its length. The winamp code has hooks to add a play/pause indication, times, and a bunch more. It can also control winamp, but that's not really applicable to this application (unless there's a way to add buttons to the twatch, then it would be).


You'll proably need Python 2.6, and you will need pywin32. I'm running Python 2.6.4, pywin 214, and winamp 5.572.

{Attachment renamed to .txt for forum rules compliance, change it back to .py when you download}

TODOs:
make scrolling more robust
port to Python 3

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Winamp Status on Twatch (via Python)
« Reply #1 on: February 06, 2010, 02:18:35 AM »
Great job. Thanks! I'll add this to the SVN scripts folder, and post it up in a few day.

andrew

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Winamp Status on Twatch (via Python)
« Reply #2 on: February 06, 2010, 09:31:22 AM »
Couple of minor tweaks
- replaced a nasty magic number (20) with its constant (TWATCH_X)
- better scrolling timer method (I think. It's 2:30am, I haven't tested thoroughly)

I'll have a look at this whole SVN thing once I've had some sleep :)

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Winamp Status on Twatch (via Python)
« Reply #3 on: February 10, 2010, 01:38:12 AM »
Hi andrew - Is it possible to get a picture of your script in action? Thanks!