Jump to content

SimplePlayer 1.0


Recommended Posts

Here's my first official script!

;~ Name: SimplePlayer 1.0
;~ Author: ToKico Brothers
;~         tokico.pt@gmail.com
;~ Description: This script is a very simple music player.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ###
$Form2 = GUICreate("  SimplePlayer 1.0", 226, 61, 303, 219)
$Button1 = GUICtrlCreateButton("Play", 8, 8, 65, 25, 0)
$Button2 = GUICtrlCreateButton("Stop", 152, 8, 65, 25, 0)
$Button3 = GUICtrlCreateButton("Open", 80, 24, 65, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button3
            $opendialog = FileOpenDialog ( "Open Music...", @ScriptDir, "Music (*.*)")
        Case $Button1
            SoundPlay ( $opendialog )
        Case $Button2
            SoundPlay ( "" )
    EndSwitch
WEnd

It's very simple, but I'll make more versions!

SimplePlayer.au3

My Scripts: SimplePlayer 1.0 - A very simple music player. PCInfo 1.2 - A script that displays PC information.
Link to comment
Share on other sites

I made this a while ago.

Steal some ideas from it or whatever, I don't personally care about the script at all anymore.

Have fun?

#include <GUIConstants.au3>
#Include <GuiList.au3>

Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("SimplePlayer", 424, 143, 219, 162)
$VolumeControl = GUICtrlCreateSlider(240, 88, 105, 41)
GUICtrlSetOnEvent ( $VolumeControl, "VolumeAdjust" )
$repeat = GUICtrlCreateCheckbox("Repeat?", 344, 88, 65, 17)
$Play = GUICtrlCreateCheckbox("Play/Stop", 344, 112, 73, 25)
GUICtrlSetOnEvent ( $Play, "Play" )
GUICtrlSetOnEvent ( $Repeat, "Exot" )
$PlayList = GUICtrlCreateList("", 0, 16, 233, 121)
$SongOpen = GUICtrlCreateButton("Open a Song(s)", 248, 48, 97, 33, 0)
GUICtrlSetOnEvent ( $songOpen, "OpenSong" )
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd


;---------------------GUI ^ ------ Functions v ---------------------
Func OpenSong()
$File = FileOpenDialog ( "Select Song Please", "C:", "Mp3 (*.Mp3)" , 4  )
$Text = $File
$Name = FileGetShortName ($text, 1)
GUICtrlSetData ( $playlist, "" & $name )
Play()
EndFunc

Func Play()
SOUNDPLAY ( GuiCTRLREAD ( $Playlist) , $PlayList )
Endfunc

Func volumeAdjust()
    SoundSetWaveVolume(GuiCTRLread ($VolumeControl ) )
EndFunc

Func exot()
    Exit
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...