AutoHotkey Community

It is currently May 26th, 2012, 10:22 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: October 24th, 2009, 12:26 am 
Hi,

With this code i can press button d to play a sample (d.mp3), thats works fine, and when the sample has finish, after -7000, the music on my mediaplayer is back on the speakers. But when i press key d, and fast after that the upper key D, he plays _d.mp3, that working also fine, but when the d.mp3 has finish, the music is back again, also when upper D (_d.mp3) is playing, thats not what i want.

What i want is, when i press the last button, and play the latest sample, he must muting / holding the mediaplayer for the sound i press as latest. Not so that the music come back from the sound i press before.

So press key d and play d.mp3 & mute mediaplayer (works) but when i pres a other button, Upper D (_d.mp3) he must stop the action from d and start new action D (_d.mp3)

I hope some get understand me.

Thanks


Code:
PostMessage, 0x111, 18817, 0, , Windows Media Player
return
d::
Caps := GetKeyState("CapsLock","T")
IfEqual, Caps, 1
goto UpperD
else
SoundPlay, %A_ScriptDir%\sounds\d.mp3
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
SoundSet, 1, Microphone, mute
soundset, 1, Line, mute
soundset, 1, Cd, mute
soundset, 1, Aux, mute
SetTimer, d_continue, -7000 ; run d_continue once, in 4 seconds.
return
d_continue:
SoundSet, 0, Microphone, mute
soundset, 0, Line, mute
soundset, 0, Cd, mute
soundset, 0, Aux, mute
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
return
UpperD:
SoundPlay, %A_ScriptDir%\sounds\_d.mp3
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
SoundSet, 1, Microphone, mute
soundset, 1, Line, mute
soundset, 1, Cd, mute
soundset, 1, Aux, mute
SetTimer, cd_continue, -1900 ; run cd_continue once, in 4 seconds.
return
cd_continue:
SoundSet, 0, Microphone, mute
soundset, 0, Line, mute
soundset, 0, Cd, mute
soundset, 0, Aux, mute
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2009, 6:28 pm 
What do you mean exactly?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2009, 10:17 am 
Offline

Joined: May 18th, 2009, 7:52 am
Posts: 11
Location: Amsterdam Holand
Okey that’s good.

If I press button a, it wil be play a sample a.mp3 for 10 seconds, also he mute the mediaplayer for 10 seconds and after 10 seconds, a.mp3 stops playing and the music from the mediaplayer is back. And that’s also with button s, if I press s, s.mp wil be playing for 20 seconds and the mediaplayer mute the music for 20 seconds, after 20 seconds, the music is back again.

But now the problem. If I press a and after 2 seconds I press s, he will play s.mp3, that’s oke, because I press s as latest, but in the background, the 10 seconds from button a is running also, so the unmute from a will be back and bring the music back on the mediaplayer while s.mp3 is playing.

So when I press a, and heys planning a.mp3, oke, after 2 seconds when I press s (s.mp3) he must stop the actions from a, including mute. So stop all actions from a and go further with the latest s action.

I hope someone can help me.

Thanks allot

X Natascha

See here the code i have now:

Code:
PostMessage, 0x111, 18817, 0, , Windows Media Player
return
a::
SoundPlay, %A_ScriptDir%\sounds\a.mp3
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
SoundSet, 1, Microphone, mute
soundset, 1, Line, mute
soundset, 1, Cd, mute
soundset, 1, Aux, mute
SetTimer, a_continue, 1000 ; run a_continue once, in 10 seconds.
Return
a_continue:
SoundSet, 0, Microphone, mute
soundset, 0, Line, mute
soundset, 0, Cd, mute
soundset, 0, Aux, mute
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
return



s:
SoundPlay, %A_ScriptDir%\sounds\s.mp3
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
PostMessage, 0x111, 18816, 50, , Windows Media Player
SoundSet, 1, Microphone, mute
soundset, 1, Line, mute
soundset, 1, Cd, mute
soundset, 1, Aux, mute
SetTimer, s_continue, -2000 ; run s_continue once, in 20 seconds.
return
s_continue:
SoundSet, 0, Microphone, mute
soundset, 0, Line, mute
soundset, 0, Cd, mute
soundset, 0, Aux, mute
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
PostMessage, 0x111, 18815, 50, , Windows Media Player
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2009, 1:58 pm 
I might have lost you, but why not run/identify the instance of a song separately and kill that beast once needed?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2009, 2:25 pm 
Offline

Joined: May 18th, 2009, 7:52 am
Posts: 11
Location: Amsterdam Holand
okay, if thats works why not.
Can u hel me with this? I have try many things and know where i must start, maybe there is a exampler or somehting


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2009, 10:32 pm 
Offline

Joined: May 18th, 2009, 7:52 am
Posts: 11
Location: Amsterdam Holand
Maybe there is a commando to stop the unmute function from a:: (play a.mp3) when i press the next button, or any other button?


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: AndyJenk, Google [Bot], JSLover, Leef_me, patgenn123, rbrtryn, XstatyK, Yahoo [Bot] and 70 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