AutoHotkey Community

It is currently May 27th, 2012, 9:32 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: August 29th, 2006, 9:24 am 
Offline

Joined: March 31st, 2006, 3:39 pm
Posts: 144
Location: New York
LOL it's twisted and it works.
:twisted:
This is for selecting tracks in Winamp using digits. There might have been better ways of doing this, but I couldn't come up with any others that would let it work the way I wanted. You could probably make this global as well if you cared by using #IfWinExist instead of #IfWinActive. More software players should have this feature. Many hardware players do. Don't complain if it doesn't look pretty. I'm not a programmer. I just hack at it until it does what I want it to. You can either use extended 1 through 0 or the numeric keypad in which case NumLock has to be on. The number of digits you have to enter is based on how many tracks are currently loaded. I.E. 1 if there are less than 10 tracks, 2 if there are 10 to 99 tracks etc up to a maximum of 4 digits.

Add this part to the Auto-Execute section
Code:
GroupAdd Winamp, ahk_class Winamp v1.x
GroupAdd Winamp, ahk_class Winamp PE
GroupAdd Winamp, ahk_class Winamp Video
GroupAdd Winamp, ahk_class Winamp Gen

You can put this part where ever you like
Code:
;Select Tracks Using Keypad In Winamp
#IfWinActive ahk_group Winamp
0::
Numpad0::
1::
Numpad1::
2::
Numpad2::
3::
Numpad3::
4::
Numpad4::
5::
Numpad5::
6::
Numpad6::
7::
Numpad7::
8::
Numpad8::
9::
Numpad9::
SendMessage 1024, 0, 124,, ahk_class Winamp v1.x
TrackCount = %ErrorLevel%
StringLen DigitCount, TrackCount
If DigitCount = 1
StringRight DGT1, A_ThisHotkey, 1
If (A_TimeSincePriorHotkey > 2000 || A_TimeSincePriorHotkey = -1)
If DigitCount > 1
{
StringRight DGT1, A_ThisHotkey, 1
KeyCount = 1
Return
}
If A_TimeSincePriorHotkey < 2000
{
If DigitCount > 1
{
If A_PriorHotkey Not In 0,Numpad0,1,Numpad1,2,Numpad2,3,Numpad3,4,Numpad4,5,Numpad5,6,Numpad6,7,Numpad7,8,Numpad8,9,Numpad9
{
StringRight DGT1, A_ThisHotkey, 1
KeyCount = 1
Return
}
If (KeyCount = DigitCount)
{
StringRight DGT1, A_ThisHotkey, 1
KeyCount = 1
Return
}
}
If (DigitCount = 2 && KeyCount = 1)
{
StringRight DGT2, A_ThisHotkey, 1
KeyCount = 2
}
If DigitCount = 3
{
If KeyCount = 1
{
StringRight DGT2, A_ThisHotkey, 1
KeyCount = 2
Return
}
Else
{
StringRight DGT3, A_ThisHotkey, 1
KeyCount = 3
}
}
If DigitCount = 4
{
If KeyCount = 1
{
StringRight DGT2, A_ThisHotkey, 1
KeyCount = 2
Return
}
Else
If KeyCount = 2
{
StringRight DGT3, A_ThisHotkey, 1
KeyCount = 3
Return
}
Else
{
StringRight DGT4, A_ThisHotkey, 1
KeyCount = 4
}
}
}
Track = %DGT1%%DGT2%%DGT3%%DGT4%
DGT1 =
DGT2 =
DGT3 =
DGT4 =
DigitCount =
Track -= 1
TrackCount -= 1
If (Track > TrackCount || Track = -1)
{
Track =
TrackCount =
Return
}
SendMessage 1024, %Track%, 121,, ahk_class Winamp v1.x
PostMessage 273, 40045, 0,, ahk_class Winamp v1.x
Track =
TrackCount =
Return
#IfWinActive


Last edited by Diamond on May 31st, 2007, 2:34 am, edited 12 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2006, 12:26 am 
Offline

Joined: June 22nd, 2006, 8:36 pm
Posts: 27
Or you can just use the global hotkeys in winamp.
Like Alt+Ctrl+1,2,3,4...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2006, 12:35 am 
Offline

Joined: March 31st, 2006, 3:39 pm
Posts: 144
Location: New York
T-nm wrote:
Or you can just use the global hotkeys in winamp.
Like Alt+Ctrl+1,2,3,4...


I don't know what version of Winamp you're using, but the 2.x series doesn't have that feature. Also, while this could be made global, it's meant more for use while Winamp is active and it doesn't require the use of modifier keys.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2006, 11:41 pm 
Offline

Joined: August 30th, 2006, 11:39 pm
Posts: 5
Diamond wrote:
T-nm wrote:
Or you can just use the global hotkeys in winamp.
Like Alt+Ctrl+1,2,3,4...


I don't know what version of Winamp you're using, but the 2.x series doesn't have that feature.

But Winamp 5.x which came out over a year ago does.
http://winamp.com/player/


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2006, 11:49 pm 
Offline

Joined: March 31st, 2006, 3:39 pm
Posts: 144
Location: New York
Yes, but many people still prefer the 2.x series and like I said this is not for global control.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2007, 6:07 pm 
Offline

Joined: March 31st, 2006, 3:39 pm
Posts: 144
Location: New York
Doesn't look any prettier, but perhaps slightly optimized.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Google Feedfetcher, nomissenrojb, SKAN, Stigg and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group