Sign in to follow this  
Followers 0
NicoTn

Mp3 Player v3!

10 posts in this topic

#1 ·  Posted (edited)

#include <GuiConstants.au3>

global $pl1 = 0

$g1 = GuiCreate("Mp3 Player v3", 335, 125,-1, -1)
GUISetFont(12, "", "", "vrinda")

;; MAIN
GuiCtrlCreateTab(0, 0, 335, 125)
GuiCtrlCreateTabItem("Main")
GuiCtrlCreateLabel("Main", 5, 24)
$play = GUICtrlCreateButton("Play", 5, 50, 50, 20)
$stop = GUICtrlCreateButton("Stop", 5, 72, 50, 20)
$select = GUICtrlCreateButton("Select", 5, 94, 50, 20)
$e1 = GUICtrlCreateEdit("-- Chosen song --" & @CRLF, 60 , 50 , 270 , 70)


;; OPTIONS 
GuiCtrlCreateTabItem("Options")
GuiCtrlCreateLabel("Options", 5, 24)
$pl = GUICtrlCreateinput("50" , 5, 40, 100, 20)
GUICtrlCreateLabel("Play Delay", 110 , 40 , 100, 200)


GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
        SoundSetWaveVolume(100)
        sleep(1000)
        ExitLoop


    
    Case $msg = $play
        SoundSetWaveVolume(0)
        GUICtrlRead($song)
        GUICtrlRead($pl)
        sleep($pl)
        SoundPlay($song)
        SoundSetWaveVolume(100)
        
        
    Case $msg = $stop
        SoundSetWaveVolume(0)
    
    Case $msg = $select
            
            $song = FileOpenDialog("Play MP3/WAV sound",@MyDocumentsDir,"MP3 sound (*.mp3)|WAV sound (*.wav)",1 + 4)
            SoundSetWaveVolume(0)
            $mid = $song
            while 1
            $songstr = stringinstr($mid,"\")
            if $songstr = 0 then ExitLoop
            $mid = stringmid($mid,$songstr+1)
            wend
            $sk = $mid
            GUICtrlSetData($e1, $sk & @CRLF , "-- Choosed Music --")
    Case Else
        
    EndSelect
WEnd
Exit

Rate please :lmao: and maybe you got some options?

Edited by Str!ke

while 1
     If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe")
wend
[size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]

Share this post


Link to post
Share on other sites



If you are using the latest beta you might want to take a look at the _Sound Functions.

These will allow you to play, pause, stop and lots more. Setting the wave volume isn't a good idea. I personally have my wave volume rather low to allow my speakers to be less sensitive. Your program sets it to 100 every time a song is played.

Other than that it is a good attempt.


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

This is very well made. I suppose volume controls are next? Perhaps a way to save the list?

-Dw

---

Too bad stupidity isn't painful.

Share this post


Link to post
Share on other sites

:) I changed a little the MP3 PLAYER

* Added Sound Control

Share this post


Link to post
Share on other sites

:) I changed a little the MP3 PLAYER

* Added Sound Control

* Removed the play delay

* Fixed the edit box

I didn't work a lot on it at all but I think it's a good improvement :D

CODE
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.2.0

Author: myName

Script Function:

Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GuiConstants.au3>

#include <Sound.au3>

global $pl1 = 0

$g1 = GuiCreate("Mp3 Player v4", 335, 125,-1, -1)

GUISetFont(10, "", "", "vrinda")

;; MAIN

$play = GUICtrlCreateButton("Play", 5, 50, 50, 20)

$stop = GUICtrlCreateButton("Stop", 5, 72, 50, 20)

$select = GUICtrlCreateButton("Select", 5, 94, 50, 20)

$e1 = GUICtrlCreateInput("", 100, 50, 200, 20, $ES_READONLY,)

$b1 = GUICtrlCreateButton("10", 100, 80)

$b2 = GUICtrlCreateButton("25", 130, 80)

$b3 = GUICtrlCreateButton("50", 160, 80)

$b4 = GUICtrlCreateButton("100", 190, 80)

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

SoundSetWaveVolume(100)

ExitLoop

Case $msg = $play

SoundSetWaveVolume(0)

GUICtrlRead($song)

SoundPlay($song)

SoundSetWaveVolume(100)

Case $msg = $stop

SoundSetWaveVolume(0)

Case $msg = $select

$song = FileOpenDialog("Play MP3/WAV sound",@MyDocumentsDir,"MP3 sound (*.mp3)|WAV sound (*.wav)|All files (*.*)",1 + 4)

SoundSetWaveVolume(0)

$mid = $song

while 1

$songstr = stringinstr($mid,"\")

if $songstr = 0 then ExitLoop

$mid = stringmid($mid,$songstr+1)

wend

$sk = $mid

GUICtrlSetData($e1, $sk)

Case $msg = $b1

SoundSetWaveVolume(10)

Case $msg = $b2

SoundSetWaveVolume(25)

Case $msg = $b3

SoundSetWaveVolume(50)

Case $msg = $b4

SoundSetWaveVolume(100)

Case Else

EndSelect

WEnd

Exit

Share this post


Link to post
Share on other sites

Hello, on your new version, I think it would look better if you took out all the space at the top.

Also, if you push play without selecting a song it will exit, it would be better to fix that in my opinion


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Case $msg = $stop

SoundSetWaveVolume(0) ;??????

how about

Case $msg = $stop

SoundPlay("")

******** Just noted this is NOT in the help file now...Hmmm????

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

I have finally fixed it :):D:D

CODE
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.2.0

Author: myName

Script Function:

Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GuiConstants.au3>

#include <Sound.au3>

global $pl1 = 0

global $media = 0

$g1 = GuiCreate("Mp3 Player v4", 335, 125,-1, -1)

GUISetFont(10, "", "", "Times New Roman")

TraySetState(2)

;; MAIN

$play = GUICtrlCreateButton("Play", 5, 50, 50, 20)

$stop = GUICtrlCreateButton("Stop", 5, 72, 50, 20)

$select = GUICtrlCreateButton("Select", 5, 94, 50, 20)

$pause = GUICtrlCreateButton("Pause", 5, 28, 50, 20)

$e1 = GUICtrlCreateInput("", 100, 50, 200, 20, $ES_READONLY)

$sl = GUICtrlCreateSlider(100, 100, 200)

GUICtrlCreateLabel("Volume", 180, 80)

GUICtrlCreateLabel("Selected Song", 160, 20)

GUICtrlSetData($sl, 100)

Func slider()

SoundSetWaveVolume( GUICtrlRead( $sl ) )

EndFunc

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

SoundSetWaveVolume(100)

ExitLoop

Case $msg = $play

_SoundPlay($Media)

SoundSetWaveVolume(100)

Case $msg = $stop

_SoundStop($Media)

Case $msg = $pause

_SoundPause($Media)

Case $msg = $select

_SoundStop($Media)

$File=FileOpenDialog("","","Media files (*.avi;*.mp3;*.wav;*.mpg)")

$Media=_SoundOpen($File)

$mid = $File

while 1

$songstr = stringinstr($mid,"\")

if $songstr = 0 then ExitLoop

$mid = stringmid($mid,$songstr+1)

wend

$sk = $mid

GUICtrlSetData($e1, $sk)

Case $msg = $sl

Call("slider")

Case Else

EndSelect

WEnd

Exit

I also removed the tray Icon because I don't like it

AND made some other changes

*Created a slidebar for sound control

*Added some labels

*Created a pause button

Hope you'll like it :P

Share this post


Link to post
Share on other sites

nice, but "choosed music'? xD

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

update the first post with the new code.....................

but other than that, very nice!

edit:

SUGGESTIONS:

  • one of those slider bars that move as the song plays
  • Allow more than one song to be selected, and put them in a dropdown menu.
  • Don't use Call("slider") !!!!! Just use slider () !!!!!!!!!
  • Disable the Play button when no song is selected; disable the Pause/Stop buttons when no song is playing
Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

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  
Followers 0