|
Kaputchnik |
Posted: Wed Mar 10, 2004 1:31 am
Controlling Winamp from zMUD anyone? |
|
Kaputchnik Beginner
Joined: 06 Jan 2002 Posts: 28 Location: Sweden
|
Posted: Sun Jun 20, 2004 11:21 pm |
quote: Originally posted by turian
quote: Originally posted by Kaputchnik
Found CurrentSongLength which returns length of song in seconds, so I added a gauge to the previous script. Voila your own Progress bar in zMUD.
Can you show use the code for that progress bar, by chace? I fiddled with it and couldn't get it.
The progress bar is only a simple gauge that uses two variables, one that is the current position in the song, and another that is the total length of the song. In order to update the current position, I use an alarm to catch it every second, I also catch the song length in that alarm in case the song changed.
Code: |
#alarm {1} {#var songtime @Winamp.CurrentPos;#var songlength @Winamp.CurrentSongLength}
|
That will update the variables songtime & songlength each second, provided that the COM object is in the Winamp variable.
Code: |
#alias connectwinamp {#var Winamp %comcreate("WinampCOM.Application")}
|
Then it's just a normal gauge.
Code: |
#GAUGE winampbar "Winamp progressbar" @songtime @songlength 0 "" "grey" ""
|
quote: Originally posted by Dumas
For all those getting that 'Error Parsing Command' when hitting F1, you are supposed to have winamp running already before doing this. This script is only a winamp controller, it doesn't open winamp itself.
Actually with %comcreate it does start the winamp program. With %comconnect it only connects to it. At least it works that way on my computer.
Kaputchnik |
|
|
|
turian Novice
Joined: 05 Jun 2004 Posts: 37 Location: USA
|
Posted: Sun Jun 27, 2004 2:22 am |
Hrm @Winamp.CurrentSongLength isn't returning song length in seconds for me. #show @Winamp.CurrentSongLength returns 253 for a song that is 4:13. Divide 253 by 60 and you get 4.216667. So I tried this statement for the status bar and it worked out perfectly.
@song %concat(%eval((@songtime/1000)/60),":",%mod(%eval(@songtime/1000),60)) %concat(%eval(@songlength/61),":",%mod(@songlength,60)
@song is the song title. The first concat statement is the current position. The second is total length of the song. Hope that works for everyone else! |
|
|
|
Kaputchnik Beginner
Joined: 06 Jan 2002 Posts: 28 Location: Sweden
|
Posted: Tue Jun 29, 2004 10:46 am |
quote: Originally posted by turian
Hrm @Winamp.CurrentSongLength isn't returning song length in seconds for me. #show @Winamp.CurrentSongLength returns 253 for a song that is 4:13. Divide 253 by 60 and you get 4.216667. So I tried this statement for the status bar and it worked out perfectly.
@song %concat(%eval((@songtime/1000)/60),":",%mod(%eval(@songtime/1000),60)) %concat(%eval(@songlength/61),":",%mod(@songlength,60)
@song is the song title. The first concat statement is the current position. The second is total length of the song. Hope that works for everyone else!
Yes, obviously 253/60 = 4.216667 but that isn't a problem since that isn't the way it works.
253/60 = 4 whole integers
253%60( %mod(253,60) in zmud) = 13
concatenate these two and you get 4.13, 4 minutes 13 seconds.
4.216667 is the number of minutes of the song, thus 0.21667 times 60(60 seconds in a minte :) ) equals 13(not exactly but).
Hope that helped. |
|
|
|
turian Novice
Joined: 05 Jun 2004 Posts: 37 Location: USA
|
Posted: Tue Jun 29, 2004 4:02 pm |
quote: Originally posted by Dharkael
if you use Oleview and look at the type library,you'll find an enum with all the Winamp Command codes just call SendCommand() with the desired number
Where is the type library? I looked around for it but couldn't find it. |
|
|
|
turian Novice
Joined: 05 Jun 2004 Posts: 37 Location: USA
|
Posted: Wed Jun 30, 2004 3:48 pm |
I found a list of what I was wanting on the Winamp site in a forum sticky. Sad this is I searched for it just yesterday and the key words I used didn't pull up the thread.
|
|
|
|
Darkwytch Novice
Joined: 20 Feb 2004 Posts: 41 Location: USA
|
Posted: Mon Jan 03, 2005 1:46 am |
hi
I am sorry to bring up this old post.. but im haveing a problem with this... i can get it to work fine it plays songs.. i can fast forward... rewind play stop pause and all that... but when i go to see whats playing in the status window..... i find two variables .... both are called @song only thing is it puts part of the band as a new folder in my settings and a new variable with the first word or letter of the song... and doesnt show up on the status window but the first part of it.... below is the script im using
#CLASS {Winamp}
#VARIABLE status {Playing}
#VARIABLE song {a perfect circle- mer de noms-04 -judith}
#VARIABLE songtime {224699}
#VARIABLE songstatus {Paused}
#VARIABLE currentsong {a perfect circle- mer de noms-01- the hollow}
#VARIABLE Winamp {<OLE object: WinampCOM.Application>}
#VARIABLE songlength {288}
#ALARM {1} {#VARIABLE song a perfect circle- mer de noms-05- orestes
#VARIABLE songtime 224699
#VARIABLE songlength 288
#VARIABLE status Playing}
#KEY CTRL-KEY1 {#VARIABLE Winamp %comcreate( "WinampCOM.Application")}
#KEY CTRL-KEY2 {#CALL @Winamp.Stop
#VARIABLE song @Winamp.CurrentSongTitle
#VARIABLE songtime @Winamp.CurrentPos
#VARIABLE songstatus %case( @Winamp.Status+1, "Stopped", "Playing", "Unkown", "Paused")}
#KEY CTRL-KEY3 {#VARIABLE Winamp}
#KEY CTRL-KEY5 {#IF (@songstatus="Playing") {#CALL @Winamp.Pause} {#CALL @Winamp.Play}
#VARIABLE song @Winamp.CurrentSongTitle
#VARIABLE songtime @winamp.CurrentPos
#VARIABLE songstatus %case( @Winamp.Status+1, "Stopped", "Playing", "Unkown", "Paused")}
#KEY CTRL-KEY7 {#CALL @Winamp.Rewind
#VARIABLE currentsong @Winamp.CurrentSongTitle
#VARIABLE songtime @Winamp.CurrentPos
#VARIABLE songstatus %case( @Winamp.Status+1, "Stopped", "Playing", "Unkown", "Paused")}
#KEY CTRL-KEY9 {#CALL @Winamp.FastForward
#VARIABLE song @Winamp.CurrentSongTitle
#VARIABLE songtime @Winamp.CurrentPos
#VARIABLE songstatus %case( @Winamp.Status+1, "Stopped", "Playing", "Unkown", "Paused")}
#BUTTON 39 {Winamp progress bar} {} {} {} {@songtime} {} {} {} {} {} {} {} {} {112} {} {Gauge||12|@songlength|0|7} {} "" {Explore|Inset} {} {winampbar} {2}
#CLASS 0
this is what the status window looks like
a:Paused
Position:3:44
CTRL+KEY7: - Track
CTRL+KEY9: + Track
CTRL+KEY5: Play/Pause
CTRL+KEY2: Stop
the a:paused is supposed to be a perfect circle song name isnt it? well thats whats happening... thought maybe someone could help me please |
|
|
|
Firey Wanderer
Joined: 30 Dec 2003 Posts: 61 Location: Norway
|
Posted: Sat Jan 08, 2005 6:53 pm |
I have my winamp running, but I still get the "Parsing Error" thing saying:
#var Winamp %comcreate( "WinampCOM.Application")
what should I do? *g* |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Jan 09, 2005 6:03 pm |
Firey, I believe there was a plugin for WinAmp that is required to make it COM enabled. Please check the original post of this topic.
Darkwytch, the problem is in the alarm that updates the info. You didn't seem to supply the original code for this, so you will have to dig around in your actual script to make the proper changes. The change is a simple addition of braces shown in bold.
#ALARM {1} {#VARIABLE song {a perfect circle- mer de noms-05- orestes}
#VARIABLE songtime 224699
#VARIABLE songlength 288
#VARIABLE status Playing} |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Darkwytch Novice
Joined: 20 Feb 2004 Posts: 41 Location: USA
|
Posted: Tue Jan 25, 2005 3:51 pm |
i have another question.... what are the uh..... settings or commands to make the volume go up and down?
|
|
|
|
Jitteron Newbie
Joined: 11 Mar 2005 Posts: 9
|
Posted: Fri Mar 11, 2005 1:13 pm |
#call @Winamp.SetVolume(i)
thats all you need
where i = 0 - 255
or
#call @Winamp.Sendcommand(40058)
#call @winamp.Sendcommand(40059)
making volume go up and down respectively |
|
Last edited by Jitteron on Fri Mar 11, 2005 5:22 pm; edited 1 time in total |
|
|
|
Jitteron Newbie
Joined: 11 Mar 2005 Posts: 9
|
Posted: Fri Mar 11, 2005 1:14 pm |
oh plus the com to be running and all that of course, but you would have read the rest of the forum of course :)
|
|
|
|
Jitteron Newbie
Joined: 11 Mar 2005 Posts: 9
|
Posted: Fri Mar 11, 2005 5:47 pm |
a quick question for myself, how do I get the return values of ToggleShufflePlay and A return value for Volume?
there is nothing in the methods that I can get to work for these, but there must be a way!?! |
|
|
|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Fri Mar 11, 2005 9:13 pm |
If you have question about this script, please email them directly instead of asking question on this forum. This is only for posting the finished script. NOT asking them how to use it.
|
|
_________________ Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian) |
|
|
|
Jitteron Newbie
Joined: 11 Mar 2005 Posts: 9
|
Posted: Sat Mar 12, 2005 3:29 am |
Fine I will start my own topic under Unfinished winamp controller, because the script is HARDLY finished. I don't exactly call a play/pause, back, stop, forward a finished script.
|
|
|
|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Wed Sep 14, 2005 6:31 am Gauge |
Everything in this script worked okay for me except for the gauge, but I found a way around that. Change the max from @songlength to @songlength*1000 and it works fine. Something I wonder though. The time displays as 2:3 if it's 2:03. Any way to change that so it shows as 2:03?
|
|
|
|
Petrograd Novice
Joined: 08 Dec 2005 Posts: 35 Location: Sweden
|
Posted: Thu Dec 08, 2005 3:14 am |
#KEY F10 {#call @Winamp.FastForward;#var song @Winamp.CurrentSongTitle;#var songtime @Winamp.CurrentPos;#var songstatus #var songstatus %case(@Winamp.Status+1,"Stopped","Playing","Unkown","Paused")}
Should probably just be one #var songstatus, so
#call @Winamp.FastForward
#var song @Winamp.CurrentSongTitle
#var songtime @Winamp.CurrentPos
#var songstatus %case( @Winamp.Status+1, "Stopped", "Playing", "Unkown", "Paused") |
|
|
|
Baram Novice
Joined: 23 Apr 2006 Posts: 33 Location: Seoul, Korea
|
Posted: Mon Jun 12, 2006 5:57 pm |
Can someone port this to cMud? I love this script, but frankly don't understand how it works well enough(I've been trying) to make it work. Thanks!
|
|
_________________ Joseph Monk
Working on yet unannounced MUD. |
|
|
|
Ziah Novice
Joined: 11 Mar 2005 Posts: 40
|
Posted: Sat Oct 28, 2006 1:26 am |
the scripts seem to be working and all, and i get the little window thing, but when i use the macros, though they change on that little window that you get, it doesn't affect winamp at all. i've got the com plugin, by the way
... any suggestions? |
|
|
|
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Sun Nov 15, 2009 7:19 pm |
for any of you who want it for cmud i have ported it, look for hadar under the package library, you will need the file and my common file to get the colors to work
|
|
|
|
|
|