|
|
|
|
#1 |
|
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. 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| |
|
|
|
|
#2 |
|
Senior Member
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. |
|
|
|
|
#3 |
|
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| |
|
|
|
|
#4 |
|
Senior Member
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 |
|
|
|
|
#5 |
|
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| |
|
|
|
|
#6 |
|
Senior Member
Join Date: Jan 2001
Posts: 150
|
ahh i'm not useing mirc 6.. that might be it... i'll continue playing with my alias
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jan 2001
Posts: 150
|
seems that the sytax in the older mirc's is: $read -l# playing.txt
# is the line number |
|
|
|
|
#8 |
|
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. |
|
|
|
|
#9 |
|
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| |
|
|
|
|
#10 |
|
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| |
|
|
|
|
#11 |
|
Junior Member
Join Date: Jan 2001
Posts: 18
|
Perfect, thank you.
|
|
|
|
|
#12 |
|
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. |
|
|
|
|
#13 |
|
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| |
|
|
|
|
#14 |
|
Junior Member
Join Date: Jan 2001
Posts: 18
|
Excellent, now it's perfect.
|
|
|
|
|
#15 |
|
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 |
|
|
|
|
#16 |
|
Hiding in plain sight (mod)
Join Date: Jun 2000
Location: Melbourne, Australia
Posts: 9,910
|
Russ check your PM's
|
|
|
|
|
#17 |
|
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| |
|
|
|
|
#18 |
|
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
|
|
|
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|