PDA

View Full Version : Get winamp's currently playing title



Ron
October 13th, 2002, 04:55 PM
Try two &&'s

Ron
October 13th, 2002, 04:55 PM
fixed in next release.

Ron
October 13th, 2002, 04:55 PM
upgrade to girder 3.2.5pre2, i think the gvms crash bug was fixed there.

worldrave
October 13th, 2002, 04:55 PM
Stupid me, i just tried the say plugin and type in [songname] and it actually worked just fine!!! Never thought it would work that way. I thought for sure it would actually try to pronounce the '[' and say songname and then ']' but it didn't . It actually said the songname using it as the programmed variable. Hell ya!!!

worldrave
October 13th, 2002, 04:55 PM
That looked VERY strange, however, worked like a charm neverless.
I don't care to start using DVDSpy anyway, so this is actually pretty cool!!
I wondered about any ways of using say command to announce the name of winamp song as i have a Jukebox type setup hooked up to my Stereo system/Threatre. Or maybe a LCD system might be better? Hmmm...

vynce
October 13th, 2002, 04:55 PM
Here is my implementation of track info for Winamp: New and Improved *Winamp Track Info* (http://www.vynce.kicks-ass.net/Girder/WinampTrackInfo.gml). Requires XP OSD.

vynce
October 13th, 2002, 04:55 PM
Get Caption is a fairly new addition to Girder, so make sure that you have the latest version. Then, you should be able to find it right at the bottom of the list on the Window tab. Put the name of the variable that you want to store the caption in, in the box next to X/Timeout.

vynce
October 13th, 2002, 04:55 PM
I think that this was fixed fairly recently. Make sure that you're running Girder 3.2.4. If you are already running the latest version, look for an updated gvms.zip file somewhere here in the forum.

LiLRiceBoi
October 13th, 2002, 04:55 PM
What's a "wait state action"?

Do you need version 3.2 to impliment this?

LiLRiceBoi
October 13th, 2002, 04:55 PM
Got it

LiLRiceBoi
October 13th, 2002, 04:55 PM
BTW, is there any benefit from doing this rather than using a plugin, such as DVDSpy?

LiLRiceBoi
October 13th, 2002, 04:55 PM
One more question... I got it all figured out except, where is "Get Caption"??

I looked in Window and its not in there.

LiLRiceBoi
October 13th, 2002, 04:55 PM
Thanks for the quick reply. Looks like I'm stuck with DVDSpy for a while, at least until I can find a driver that works for my PCTV Pro remote in Girder 3.2.

I'm currently using 3.1.3c.

Quail
October 13th, 2002, 04:55 PM
I managed to find a way to get the title of the currntly playing song in winamp without the use of any plugins. It's done using the following command (I use it after play, next song, prev song so I get a cool stereo system like effect):
Window->Wait "200" (Wait for winamp title to update)
Window->Get Caption "songname" (Target winamp's window, include invisible tasks)
Girder->Variable Manipulation Script "songname=cut(songname, substr(songname,". ",0)+2, substr(songname, "Winamp",0)-6)" (cut the song title out of winamp's title)
Girder->Simple OSD "[songname]" (display the song title)

Hope you find it usefull.

Marsupial
October 13th, 2002, 04:55 PM
If you can get DVD SPY to work, it's WAY better than having this script.
This is a tip for non-dvd-spy users to get the currently playing title


Works fine!

I had trouble to install spyDVD, so I had to find another way to get winamp's playing song, and windows media player's one as well...

it works fine with winamp (make sure you have the wait state on - girder FAILS if you don't have the crop text (calling a substr would return 0, 0-6 is not good at all... maybe we should be verifying the highest of (0 and our total) but I don't know how to do this...) )

I made another version for WMP, works great as well. (I made it with a longer wait time for the "next" and "previous" as it can take longer to load a full movie than a small mp3...)


Window->Wait "2500" (Wait for mpeg to load)

Window->Get Caption "moviename" (Target wmp window, include invisible tasks - caption will return the title of the window "moviename - windows media player" (in opposition to winamp's "1. songname - winamp"))

Girder->Variable Manipulation Script "moviename=cut(moviename, 0, substr(moviename, "Windows Media...",0)-6)" (cut the movie title - this have to be different to what I have written here - my WMP is in french with a french title, so check the name on your titlebar and do some tuning) (from 0 to where wmp txt start, in opposition to winamp which starts after the song number ("12. " in "12. songname - winamp" in oppotition to "moviename - windows media player")

Girder->Simple OSD "now playing: [moviename]" (display the title)

hope it might be usefull and help those who didn't know they could modify this quite usefull trick.

Marsupial
October 13th, 2002, 04:55 PM
Ok, it's quite easy once you made it, but turn out tricky to make first.

you must make a multigroup for you action (play, next...)
in the multigroup, you first have the action

then you add a wait state action

Window->Wait "200"

then it's time for another action to get the text from the titlebar of winamp

Window->Get Caption "songname"

Target the winamp window, unmark all useless information for the target screen... just winamp.exe should be OK. CHECK THE INCLUDE INVISIBLE TASK as winamp might not be in the action bar of windows

(this will make our variable named songname)

then comes the tricky part - another action to CROP THE NAME OF THE SONG

Girder->Variable Manipulation Script "songname=cut(songname, substr(songname,". ",0)+2, substr(songname, "Winamp",0)-6)"

cut takes (string, start, end) and return a string
substr takes (mainstring, substring, positionstart) and return a number

the first number is finding the number (e.g. "12. " in "12. artist - songname - winamp") and ading the 2 caracters ". "
the second number is finding the winamp text and getting back all the way to the end of the title.

If you have trouble with the GVMS reduce the -6 factor to 0 first, it might help. tweak it afterward. obviously there is no protection in GVMS string manipulation and it can fail, making girder to crash.

final step is the displayal...

Girder->Simple OSD "[songname]"

You can replace the OSD by OSD PopUp, or the Say plugIn, or whatever you feel like using the title into.

NOTA: NEVER PUT THE QUOTES ""
theese go into the field of the appropriate submenu.




---
Hope this helps.

Marsupial
October 13th, 2002, 04:55 PM
er... nope, under windows, select wait

place value in.

it just makes girder wait (your value) miliseconds before going to the next action.

Can you find it?

Marsupial
October 13th, 2002, 04:55 PM
Yes, a big one!

NOT installing the plug-in.

ifever you don't want to, or cannot, install the plug-in: this does work.

And the plug-in does take processing time and sends information regularily that this one doesn't do.

AND if you use a software that doesn't have plug-in to DVD SPY and still want to get info from it, if the title bar does show your info, you have what you need.

Except for that, if you only use WinAmp and have DVD-SPY, then there is no big deal.

hope to help.

Marsupial
October 13th, 2002, 04:55 PM
Er... well... it was already advised that it could crash... always make sure you have what you want before making a string modification, else you end up having negative numbers... any programmers or mathematician would tell you a division by zero crashes most simple software ;)


...If you have trouble with the GVMS reduce the -6 factor to 0 first, it might help. tweak it afterward. obviously there is no protection in GVMS string manipulation and it can fail, making girder to crash...

anyhow, nice to enforce those reports!

any suggested tweaks for the "newly runned winamp" problems? I mainly avoid reading the song title before it is a song title... something like getting the title after pressing play always seams nice.

- the trouble is not GVMS, it does report 0... but we do substract out probable number from this error (0) giving negatives, here goes the fail : we impose a modification outside the string, at a negative value. This could be trapped, but can be avoided my intelligent scripts as well. -

hope it helps or at least gives clues.

PuckStar
October 13th, 2002, 04:55 PM
I managed to find a way to get the title of the currntly playing song in winamp without the use of any plugins. It's done using the following command (I use it after play, next song, prev song so I get a cool stereo system like effect):
Window->Wait "200" (Wait for winamp title to update)
Window->Get Caption "songname" (Target winamp's window, include invisible tasks)
Girder->Variable Manipulation Script "songname=cut(songname, substr(songname,". ",0)+2, substr(songname, "Winamp",0)-6)" (cut the song title out of winamp's title)
Girder->Simple OSD "[songname]" (display the song title)

Hope you find it usefull.

can you send me the gml file u use?
or give me more details about how to do this.
i can't seem to get it working :(

PuckStar
October 13th, 2002, 04:55 PM
thanks both for your replies.
i have both your options working and choose to work with the first.
is easier for me to understand what is happening.

anyway i notice that the character "&" is not shown in the OSD.
it changes in "_"
anyone knows a solution?

PuckStar
October 13th, 2002, 04:55 PM
Try two &&'s

it might help. but i'm not gonna change all the id3-tags from my mp3's.
so this is not a solution.

PuckStar
October 13th, 2002, 04:55 PM
fixed in next release.

YaY thnkx :)

anonim
October 13th, 2002, 04:55 PM
i entered the code just like it is written like this:

songname=cut(songname, substr(songname,". ",0)+2, substr(songname," - Winamp",0)-6);

it worked great for a while, but then all of a sudden it stopped working. everytime it came across this action inside my multigroup, girder crashes and i don't know why. i make sure that winamp is open. i also tested each one of the actions in the multigroup separately and they all work fine except for this action. i actually discovered that i need to have this code to display the song title properly:

songname=cut(songname, substr(songname,". ",0)+2, substr(songname," - Winamp",0)-3);

the difference is that it subtracts 3 chars from the end instead of 6. but either way, girder is crashing on me. i am using windows xp. any ideas? it's driving me nuts. i am going to break the code down and try it to see if i can tell exactly which part of the code is crashing girder, but it used to work and i didn't change anything so... any ideas would be greatly appreciated. thanx.

anonim
October 13th, 2002, 04:55 PM
well i found out what the problem was. i don't know if nobody else has noticed this, or they just didn't think it was worth posting.. if you read my previous post, you will see that girder sometimes crashes when trying to execute the given gvms code. i discovered that the reason this happens is because 99% of the time, when you "Get Caption" (for the song title), you get something in the form of ##. Artist - Title - Winamp [Stopped] or something along the lines of that. The GVMS code works great when this is the case. The ONLY time this is not the case is when Winamp is first opened. If you use "Get Caption" right after you open Winamp before you start playing any songs or have any type of intervention with Winamp. I have Winamp version 2.80 and using "Get Caption" upon first executing Winamp returns "Winamp 2.80". Of course, when the GVMS script executes, it looks for two strings ". " and " - Winamp", neither of which can be found within "Winamp 2.80", so Girder crashes. I think that GVMS should not crash just because string X cannot be found within String Y. A simple Parse Error or some other error would be much more helpful. Awaiting any comments/suggestions...

lukatmyshu
October 13th, 2002, 04:55 PM
Instead of getting the desired effect (i.e. the songname) I get random numbers (that increase every time I invoke the multigroup). Using Girder 3.2 and Winamp 2.80. The strange thing is no matter what Target I select I always get strange numbers. Thanks .
Vijay

tuLiO
November 7th, 2002, 11:33 AM
im trying to add this for a hour now...

does it work with winamp3?

Marsupial
November 7th, 2002, 05:48 PM
if you can get DVD spy and run it with Winamp 2.80, its a charme, and its supposed to work fine under winamp3, but I didn'T try it out.

DVD Spy would get you title as per ID3 tag and elapsed/total time, status, etc.

Or there's twist from the ID3 plugin that can work.

I personally stopped using this script for I need reducing my GVMS to port to LUA, and I made it to use DVD SPY.

- just a suggestion.

vithya
December 2nd, 2002, 08:34 AM
anyone can send a sample file...

Paxtez
December 8th, 2002, 06:55 PM
w00t first post =)

songname=strsub(songname,strfind(songname,". ",1)+2,strfind(songname,"Winamp",1)-4)

Fixed for Lua

sibix
December 23rd, 2002, 03:05 AM
I should have read this thread earlier. :-?
But then I wouldn't have learned some LUA.
This is what I used: songname=strsub(songname,strfind(songname,".",1,1)+2,-10)

As "Winamp" is the last part in songname I just cut of 10 chars at the end. But that's almost the only difference.

H8tred
January 20th, 2003, 03:18 AM
I keep getting a parse error. I'm copying and pasting the code: songname=strsub(songname,strfind(songname,".",1,1)+2,-10)
What am I doing wrong?

mattwire
January 20th, 2003, 06:02 AM
Have you defined the songname variable previously? It will cause a parse error is it is blank/doesnt contain a "."

H8tred
January 20th, 2003, 11:30 AM
Have you defined the songname variable previously? It will cause a parse error is it is blank/doesnt contain a "."


Yeah I played around with it for a while lastnight and I found out what I was doing wrong... I left out the [ ]. Silly huh? Thanks for the help though.

anonim
March 13th, 2003, 07:36 PM
here is what i came up with for winamp3..


songname = strsub(songname, strfind(songname, '.')+3, strfind(songname, ':')-4)

this version 3 of winamp doesn't put the "Winamp" text at the end of the song title, so instead, i am using the colon in the song length and subtracting 4 from it as the cut off portion. i prefer not to see the song length included in the song name. subtracting 4 characters takes everything including the space between the end of the song title and the opening parenthesis to the song length. i've done this intentionally, in the case that i may listen to an mp3 that has two digits in the minutes section of the length. if you only subtract 3, then the opening parenthesis would show in the song name if you had 9<minutes<100. i hope this makes sense.

Rampe
April 2nd, 2003, 01:24 AM
Hello everyone.
I found out about Girder yesterday and trying to get something working. I've done everything pretty much as described here, but for some reason the OSD displays "DDE Server Window" when it's supposed to display the song title. I'm pretty clueless atm. Using WinAmp 2.81.

Rampe
April 2nd, 2003, 11:58 PM
Well, I fixed it. Don't ask how, I don't have a clue.

pilot
August 15th, 2003, 09:44 AM
I used XPOSD plugin for OSD

Create a text file named "WriteTitle for Winamp 2.91.GML" and past in it the following code then import group in ginger

<?xml version="1.0" encoding="UTF-8"?>
<Girder><Group Name="WriteTitle for Winamp 2.91" Identifier="13310" Enabled="TRUE"><MultiGroup Name="WriteTitle" Identifier="13311" Enabled="TRUE"><StateCount>1</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurrent><StateInvert>FALSE</StateInvert><Command Name="Wait" Identifier="13312" Enabled="TRUE"><StateCount>1</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurrent><StateInvert>FALSE</StateInvert><OSD>FALSE</OSD><Submatch>FALSE</Submatch><Topmost>TRUE</Topmost><OneMatch>FALSE</OneMatch><UseVar>FALSE</UseVar><MatchHidden>FALSE</MatchHidden><MatchNum>1</MatchNum><ActionType>1</ActionType><ActionSubType>7</ActionSubType><iValue1>200</iValue1><bValue1>FALSE</bValue1><bValue2>FALSE</bValue2><bValue3>FALSE</bValue3></Command><Command Name="GetCaption" Identifier="13313" Enabled="TRUE"><StateCount>1</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurrent><StateInvert>FALSE</StateInvert><OSD>FALSE</OSD><Target_name>867. Oğuz Yılmaz - Topal - Winamp</Target_name><Target_class>Winamp v1.x</Target_class><Target_exe>winamp.exe</Target_exe><Submatch>FALSE</Submatch><Topmost>FALSE</Topmost><MatchBy>6</MatchBy><OneMatch>FALSE</OneMatch><UseVar>TRUE</UseVar><MatchHidden>TRUE</MatchHidden><MatchNum>1</MatchNum><ActionType>1</ActionType><ActionSubType>16</ActionSubType><sValue1>songname</sValue1><bValue1>FALSE</bValue1><bValue2>FALSE</bValue2><bValue3>FALSE</bValue3></Command><Command Name="Manupulate" Identifier="13314" Enabled="TRUE"><StateCount>1</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurrent><StateInvert>FALSE</StateInvert><Binary Encoding="Base64">G0x1YUABBAQEIAYJCBLmW6GwubJBCAAAAD0obm9uZSkAAAAAAA AAAAAABgAAAAAAAAAAAAAABQAA&#xD;
AAkAAABzb25nbmFtZQAHAAAAc3Ryc3ViAAgAAABzdHJmaW5kAA MAAAAuIAAJAAAALSBXaW5hbXAA&#xD;
AAAAAAAAAAAPAAAATAAAAAwAAACMAAAADAAAAMcAAABCAAEAWA AAgIwAAAAMAAAABwEAAEKAAQBY&#xD;
//9/QgAAABMAAAAAAAAA</Binary><OSD>FALSE</OSD><Submatch>FALSE</Submatch><Topmost>TRUE</Topmost><OneMatch>FALSE</OneMatch><UseVar>FALSE</UseVar><MatchHidden>FALSE</MatchHidden><MatchNum>1</MatchNum><ActionType>4</ActionType><ActionSubType>34</ActionSubType><sValue1>songname = strsub&#40;songname, strfind&#40;songname, '. '&#41;+2, strfind&#40;songname, '- Winamp'&#41;-2&#41;
</sValue1><bValue1>FALSE</bValue1><bValue2>FALSE</bValue2><bValue3>FALSE</bValue3></Command><Command Name="OSD" Identifier="13315" Enabled="TRUE"><StateCount>1</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurrent><StateInvert>FALSE</StateInvert><OSD>FALSE</OSD><Submatch>FALSE</Submatch><Topmost>TRUE</Topmost><OneMatch>FALSE</OneMatch><UseVar>FALSE</UseVar><MatchHidden>FALSE</MatchHidden><MatchNum>1</MatchNum><ActionType>48</ActionType><ActionSubType>9</ActionSubType><sValue1>&#91;songname&#93;</sValue1><sValue3>Times New Roman|-48|400|162|0|0|0|0|65280|0|0|0|0|0|64|128|4|4|8421 504</sValue3><iValue1>549486920</iValue1><iValue3>9764874</iValue3><bValue1>FALSE</bValue1><bValue2>FALSE</bValue2><bValue3>FALSE</bValue3></Command></MultiGroup></Group></Girder>

Stev
February 16th, 2004, 12:34 AM
Just wanted to put out a big thanks to everyone who contributed to this thread.

I'm using the Code posted by Pilot and it works great.

Thanks

keych
April 24th, 2004, 07:10 AM
i've got some parts working, but with girder 3.3.0 and wmp 9, i cant get the caption to come up as the title of the video at all... i just get "now playing: Windows Media Player"

Any ideas?

Promixis
April 24th, 2004, 07:28 AM
You can use DVD Spy to get the title of the current song from WMP.