Old 19th February 2002, 15:41   #1
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
Info File General Component (with source!)

Right, after three days on-and-off fiddling with the SDK, I've managed to produce a vaguely useful component, which writes the currently playing song info to a file for use with mIRC (a better solution than DDE IMHO), or other things. I'm also releasing it with source, so people don't have to spend hours playing around with the SDK like I did .

This component shows new component developers how to create a simple windowless plugin with callbacks, and config file attributes, and I try to illustrate the pitfalls I found.

The information the plugin gets can be a bit intermittent at times, and I blame the metadb functions for not supplying me with the info .

Lastly, thanks to schweitn, pokefreak325, and soundsys for helping me on this one.
Attached Files
File Type: zip wainfo1.zip (46.6 KB, 228 views)

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 22nd February 2002, 10:57   #2
Peter_Berre
Senior Member
 
Peter_Berre's Avatar
 
Join Date: Jan 2001
Posts: 150
hmm.. i can't get the mirc alias to work.. i can't get it to read the file.
in your example you don't have a path to the txt file. In that case where should winamp save the file?
i've tried changeing $read(playing.txt,1) to $read("full path"\playing.txt,1) but that doesn't work.
Peter_Berre is offline  
Old 22nd February 2002, 11:01   #3
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
I set the info file as playing.txt in my mIRC directory (i.e. C:\mirc\playing.txt) - I'm not sure how $read works outside of there.

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 22nd February 2002, 11:02   #4
Peter_Berre
Senior Member
 
Peter_Berre's Avatar
 
Join Date: Jan 2001
Posts: 150
hmm seems as though the $read syntax is wrong .... it's as if you can't specify a line... i've never tried mirc script before, so i'm not sure though..
Found out what the default dir is, mirc's (system) directory
Peter_Berre is offline  
Old 22nd February 2002, 11:05   #5
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
Hmm... $read(file.txt,linenum) is valid syntax on mirc 6.

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 22nd February 2002, 11:06   #6
Peter_Berre
Senior Member
 
Peter_Berre's Avatar
 
Join Date: Jan 2001
Posts: 150
ahh i'm not useing mirc 6.. that might be it... i'll continue playing with my alias
Peter_Berre is offline  
Old 22nd February 2002, 11:12   #7
Peter_Berre
Senior Member
 
Peter_Berre's Avatar
 
Join Date: Jan 2001
Posts: 150
seems that the sytax in the older mirc's is: $read -l# playing.txt
# is the line number
Peter_Berre is offline  
Old 22nd February 2002, 22:52   #8
BlindSeer
Junior Member
 
Join Date: Jan 2001
Posts: 18
Hey, thanks so much for this plug-in. I've been using a similar one for Winamp2 and was wishing there was one for Winamp3. One question: how do you get it to display "Nothing" when you're not listening to anything? For me, it just keeps the last played song title there.

Also, would you happen to know how I could use server side includes to include only part of the file that Winamp outputs? I only know how to include the whole file, and I'd like to be able to separate artist, title, and album.

Thanks.

Last edited by BlindSeer; 22nd February 2002 at 23:10.
BlindSeer is offline  
Old 23rd February 2002, 08:55   #9
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
Yeh, that's actually in the PHP script I wrote to generate the image. The newer version of my component (at http://russ.garrett.co.uk/wa3) saves a UNIX-style timestamp to the last line of the file, and I do a simple check to see if it's more than 20mins old, which covers most songs. If it is, I output "Nothing".

I suppose I could clear the file at the end of each track as well, but this solution is pretty acceptable (to me anyway ). See the source of my script at http://russ.garrett.co.uk/playing.txt.

I'm pretty sure you can't just use SSI, at least not for this file format. Give me 10mins and I'll knock up one which just outputs artist - title .

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 23rd February 2002, 09:21   #10
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
As promised, my new Info File Lite component. This outputs a single-line file with "Artist - Title", which is changed to "Nothing" when the song stops.

Get it here: http://russ.garrett.co.uk/wa3/infofilelite1.wac.

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 23rd February 2002, 12:35   #11
BlindSeer
Junior Member
 
Join Date: Jan 2001
Posts: 18
Perfect, thank you.
BlindSeer is offline  
Old 23rd February 2002, 14:27   #12
BlindSeer
Junior Member
 
Join Date: Jan 2001
Posts: 18
Ahhh... one more request. *bows down*
I've got the whole PHP deal figured out now... could you possibly add the "nothing" functionality to the non-lite version? Thanks again.
BlindSeer is offline  
Old 23rd February 2002, 20:11   #13
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
Right, I've modified the info file plugin to clear the file when the playback stops: http://russ.garrett.co.uk/wa3/waInfoFile1.5.zip

It's easy enough to get the recieving script to output "Nothing" - I didn't want to hard-code it in though. The updated php script I use in my sig is at http://russ.garrett.co.uk/playing.txt.

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 23rd February 2002, 20:30   #14
BlindSeer
Junior Member
 
Join Date: Jan 2001
Posts: 18
Excellent, now it's perfect.
BlindSeer is offline  
Old 24th February 2002, 03:19   #15
knole_z
Senior Member
 
Join Date: Oct 2001
Posts: 146
russ
i had a look at your source, the reason MT_SIZE and MT_LENGTH aren't coming thruogh properly is that they are int types not strings. plug in MDT_INT as your last argument and you should get usable numbers. all the types and fields are defined in common/metatags.h
knole_z is offline  
Old 24th February 2002, 07:45   #16
Rocker
Hiding in plain sight (mod)
 
Join Date: Jun 2000
Location: Melbourne, Australia
Posts: 9,910
Russ check your PM's
Rocker is offline  
Old 24th February 2002, 09:48   #17
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
knole_z: I did try MDT_INT I seem to remember - might try again later.

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 25th February 2002, 00:58   #18
knole_z
Senior Member
 
Join Date: Oct 2001
Posts: 146
sorry, i had a bit of a better look at it last night, i didnt realise data was always a char*. my guess is it either returns a numeric string or it returns a 4 char string equivilant to an int. i didnt get to compile anything though - im still trying to get attribute callbacks to work. apologies for talking out of my ass
knole_z is offline  
 
Go Back   Winamp & Shoutcast Forums > Winamp3 > Wasabi Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump