Jump to content
Sign in to follow this  
mrbond007

one of a kind mp3 player

Recommended Posts

It doesn't work.

:)

(Just a little organization...)

#include <GUIConstants.au3>
#include <Sound.au3>

Opt("GUIOnEventMode", 1)
Opt("TrayIconHide", 1)
$message = "Choose zee song"
$LAB1 = HotKeySet("{F2}", "Choose")
$LAB2 = HotKeySet("{F3}", "Play")
$LAB3 = HotKeySet("{F4}", "Stop")
$LAB4 = HotKeySet("{ESC}", "Kill")
$lee = GUICreate("QuiK Pleya", 200, 125, 190, 100)
GUICtrlCreateLabel("****Press Esc to Quit****", 40, 10)
GUICtrlSetColor(-1, 0x006CD9)
GUICtrlCreateLabel("****Press F2 to Choose****", 40, 40)
GUICtrlSetColor(-1, 0x006CD9)
GUICtrlCreateLabel("****Press F3 to Play****", 40, 70)
GUICtrlSetColor(-1, 0x006CD9)
GUICtrlCreateLabel("****Press F4 to Stop****", 40, 100)
GUICtrlSetColor(-1, 0x006CD9)
GUISetState(@SW_SHOW)
GUICtrlSetOnEvent($LAB2, "Play")
GUICtrlSetOnEvent($LAB3, "Stop")
GUICtrlSetOnEvent($LAB4, "Kill")
GUISetOnEvent($GUI_EVENT_CLOSE, "Kill")
$file = FileOpenDialog($message, "", "Songs (*.mp3;*.mid;*.wav)", 1)

If @error Then
    MsgBox(4096,"","No File is chosen")
    Exit
EndIf
$op = _SoundOpen ($file)
$pl = _SoundPlay ($op)
_SoundStop ($op)

While 1
    Sleep(50)
WEnd

Func Choose()
    $pl = False
    _SoundStop ($op)
    _SoundClose ($op)
    $file = FileOpenDialog($message, "", "Songs (*.mp3;*.mid;*.wav)", 1)
    If @error Then
        MsgBox(4096,"","No File is chosen")
        Exit
    EndIf
    $op = _SoundOpen ($file)
EndFunc

Func Play()
    _SoundPlay ($op)
    $pl = True
    Sleep(200) ; REmMOVE iF YOU HAVE A FAST MACHiNE
    While $pl = True
    $alfa = Random(0, 2, 1)
        If $alfa = 0 Then 
            Send("{NUMLOCK toggle}")
        ElseIf $alfa = 1 Then 
            Send("{CAPSLOCK toggle}")
        ElseIf $alfa = 2 Then 
            Send("{SCROLLLOCK toggle}")
        EndIf
        If _SoundPos($op, 2) = _SoundLength($op, 2) Then ExitLoop
        Sleep(25) ; or Sleep(Random(10, 30, 1)
    WEnd
EndFunc

Func Stop()
    $pl = False
    _SoundStop ($op)
EndFunc

Func Kill()
    _SoundClose ($op)
    Send("{NUMLOCK off}")
    Send("{CAPSLOCK off}")
    Send("{SCROLLLOCK off}")
    Exit
EndFunc

EDIT: Nice disco lights, very original!

Edited by Piano_Man

Share this post


Link to post
Share on other sites

Wow, that's a pretty good idea. Thank you Piano Man for the cleanup.


[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...