Helge Posted March 20, 2004 Posted March 20, 2004 This was just something I made recently so that I could control my Winamp when I was playing games.. (I'm currently playing Action Supercross ) I've only tested it on Winamp version 2.91, but it should at least work on any 2.x versions... And yeah, I know the code is messy... expandcollapse popupOpt("WinTitleMatchMode", 2) $PLAYPAUSE_TOGGLE = "b" HotKeySet("^{HOME}", "PLAYPAUSE") HotKeySet("^{END}", "Stop") HotKeySet("^{PGUP}", "NextSong") HotKeySet("^{PGDN}", "PrevSong") HotKeySet("^{INS}", "VolUp") HotKeySet("^{DEL}", "VolDown") MsgBox(64, "Winamp Control", "Ctrl + Home : Play/Pause" & @LF & "Ctrl + End : Stop" & @LF & @LF & "Ctrl + PageUp : Next song" & @LF & "Ctrl + PageDown : Previous song" & @LF & @LF & "Ctrl + Insert : Volume up" & @LF & "Ctrl + Delete : Volume down") While 1 Sleep(50) WEnd ;================================================== Func PLAYPAUSE() Sleep(50) If $PLAYPAUSE_TOGGLE = "c" Then $PLAYPAUSE_TOGGLE = "x" Else $PLAYPAUSE_TOGGLE = "c" EndIf $TITLE = WinGetTitle("- Winamp", "") If $TITLE = 0 Then Else ControlSend ($TITLE, "", "", $PLAYPAUSE_TOGGLE, 1) EndIf EndFunc ;================================================== Func STOP() Sleep(50) $TITLE = WinGetTitle("- Winamp", "") If $TITLE = 0 Then Else ControlSend ($TITLE, "", "", "v", 1) EndIf EndFunc ;================================================== Func NEXTSONG() Sleep(50) $TITLE = WinGetTitle("- Winamp", "") If $TITLE = 0 Then Else ControlSend ($TITLE, "", "", "b", 1) EndIf EndFunc ;================================================== Func PREVSONG() Sleep(50) $TITLE = WinGetTitle("- Winamp", "") If $TITLE = 0 Then Else ControlSend ($TITLE, "", "", "z", 1) EndIf EndFunc ;================================================== Func VOLUP() Sleep(50) $TITLE = WinGetTitle("- Winamp", "") If $TITLE = 0 Then Else ControlSend ($TITLE, "", "", "{UP}", 0) EndIf EndFunc ;================================================== Func VOLDOWN() Sleep(50) $TITLE = WinGetTitle("- Winamp", "") If $TITLE = 0 Then Else ControlSend ($TITLE, "", "", "{DOWN}", 0) EndIf EndFunc ;==================================================
insanepyrokid Posted March 21, 2004 Posted March 21, 2004 Ok, this is actually the first functional code I've bothered working on with AI3 (clap clap). I tried using the code but i run WinAmp3, so some of the functions were a little screwy with my computer, and i wanted to change the programs functionality a little. Here is my working script for WinAmp3 with some changes from Helge's -End closes winamp instead of stopping it -volume up and down have no delay -hot keys are different -cleaned up a little -annoying credits thing (just disable it, but when i change other peoples' codes i always add thier name and mine somewhere) expandcollapse popupOpt("WinTitleMatchMode", 2) HotKeySet("^{PGDN}", "PLAYPAUSE") HotKeySet("^{END}", "STOP") HotKeySet("^{RIGHT}", "NEXTSONG") HotKeySet("^{LEFT}", "PREVSONG") HotKeySet("^{UP}", "VOLUP") HotKeySet("^{DOWN}", "VOLDOWN") ToolTip ( "Original code by Helge .~^~. Updated for WinAmp3 by Insanepyrokid" , 330, 250 ) MsgBox(64, "Winamp3 Control", "Ctrl + PageDown : Play/Pause" & @LF & "Ctrl + End : Closes WinAmp and ends program" & @LF & "Ctrl + Right : Next song" & @LF & "Ctrl + Left : Previous song" & @LF & "Ctrl + Up : Volume up" & @LF & "Ctrl + Down : Volume down") ToolTip ( "" ,0,0) ;Clears first ToolTip While 1 Sleep(50) WEnd ;==================================================PAUSE SETTINGS Func PLAYPAUSE() Sleep(50) $TITLE = WinGetTitle("(playing)", "") If $TITLE = "0" Then $TITLE = WinGetTitle("(paused)", "") ControlSend ($TITLE, "", "", "c", 1) else ControlSend ($TITLE, "", "", "c", 1) endif EndFunc ;==================================================STOP SETTINGS Func STOP() Sleep(50) $TITLE = WinGetTitle("(playing)", "") winclose($TITLE,) Exit 0 EndFunc ;==================================================NEXT SONG SETTINGS Func NEXTSONG() Sleep(50) $TITLE = WinGetTitle("(playing)", "") ControlSend ($TITLE, "", "", "b", 1) EndFunc ;==================================================PREVIOUS SONG SETTINGS Func PREVSONG() Sleep(50) $TITLE = WinGetTitle("(playing)", "") ControlSend ($TITLE, "", "", "z", 1) EndFunc ;==================================================VOLUME UP SETTINGS Func VOLUP() $TITLE = WinGetTitle("(playing)", "") ControlSend ($TITLE, "", "", "{UP}", 0) EndFunc ;==================================================VOLUME DOWN SETTINGS Func VOLDOWN() $TITLE = WinGetTitle("(playing)", "") ControlSend ($TITLE, "", "", "{DOWN}", 0) EndFunc Well tell me how it works and all, my first piece of code i worked on with AI3. For those of you with WinAmp3 Thanks for the original code Helge!
insanepyrokid Posted March 21, 2004 Posted March 21, 2004 Oh and i didnt bother adding the If's that check if it found the window, i assume if your running this program you're going to know if winamp is open or not and the reason Helge's code doesnt work on WinAmp3 is that after the first song change, "- WinAmp" is no longer in the window title, so the script stops working. if anybody is going to change the script any further, look for "(playing)" in the window title
insanepyrokid Posted March 21, 2004 Posted March 21, 2004 doesnt seem to work with the winamp window active, so just minimize it (this prog is mostly for gaming purposes only, so who cares)
Josbe Posted March 21, 2004 Posted March 21, 2004 (edited) Interesting. But, Winamp5 already supports this, with the Global Hotkeys.Not for this, stops being an alternative for versions previous to this. Edited March 21, 2004 by josbe AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Helge Posted March 21, 2004 Author Posted March 21, 2004 doesnt seem to work with the winamp window activeWhy use this script when Winamp is active ?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now