Jump to content

My media player


rambo3889
 Share

Recommended Posts

hi i have just maked this media player and i know it isnt the best and im also just a n00b to autoit Anyway here is the code..

Ps. can you please rate it from 1 to 10

#Notrayicon

#include <GUIconstants.au3>

;script below the line
;===================================================================================================

=====================
HotKeySet("{INSERT}","play",)
HotKeySet("{Pause}", "stop",)

;stops the playing song
Func stop()
soundplay("C:\stop.mp3")
endfunc

;plays the choosen song
func play()
soundplay($songs)
endfunc

GUICreate("Nikolajs musicplayer", 200, 125); Making guiVindue
GUISetState (@SW_SHOW);viser gui vinduet
$play = GUICtrlCreateButton ( "play", 0, 0 , 50 , 25);Playing choosing song
$seek = GUICtrlCreateButton ( "Seek", 50,  0, 50 , 25);seek for music
$stop = GUICtrlCreateButton ( "Stop", 100,  0, 50 , 25);stop the playing song
$exit = GUICtrlCreateButton ( "exit", 150,  0, 50 , 25);exiter music player
$mute=GUICtrlCreateButton("Mute", 0 , 25, 100,25,)
$unmute=GUICtrlCreateButton("unmute", 100 , 25, 100,25,)
GUICtrlCreateInput ( "shortcut to start song:Insert", 0,  50 ,200, 25, $ES_READONLY)
GUICtrlCreateInput ( "shortcut to stop song", 0,  75 ,200, 25, $ES_READONLY)
GUICtrlCreateInput ( "Created by rambo3889 alias Nikolaj", 0,  100 ,200, 25, $ES_READONLY)
Do
  $msg = GUIGetMsg ()

   Select
      Case $msg = $play
SoundPlay ($songs)

Case $msg = $mute
Send("{VOLUME_MUTE}")

Case $msg = $unmute
Send("{VOLUME_UP}")

Case $msg = $stop
soundplay("C:\stop.mp3",)

     Case $msg = $seek
$songs=FileOpenDialog ("choose music", "", "musicfiles(*.mp3;*.wma;*.wav;*.wave;*.mid;*)",4)
soundplay($songs)

      Case $msg = $exit
         exit 0

         exit
   EndSelect
Until $msg = $GUI_EVENT_CLOSE
My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!
Link to comment
Share on other sites

Hey Rambo! I think this is a cool little script! It worked quite well, except the 'unmute' button didn't work, no big deal, I just clicked & reclicked the 'Mute' button for mute on/off. Also the 'shortcut to stop song' didn't show, again, no big deal, looked at the script to find it was 'Pause'. This is better than anything I've cobbled together... although, that's not saying much! If you are indeed a n00b, I'd have to give you an 8 out of 10. Keep up the good work! B)

Link to comment
Share on other sites

Thank you very much and im a n00b like you said but any WAY thank YOU

You should try running it through Scite and that will showup some syntax errors. This is not a critisism merly an observation. Good work for a first attempt.

BTW

The stop button does not stop the music.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

ya its pretty nice, if you every wish to go further with this, i really advice ya to search for MCI on this forum. there are some nice examples here, also MINE mediaplayer is here with MCI the source SHOULD be somewhere in this dark hole B).

good luck man :o

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

@zeroZshadow:

Thanks for your "MEDIA PLAYER, yes, another one!" . I have used parts of it to make an audio player and a video player. But I have a problem keeping the full screen video window open. I have been trying to find out where I can get info on the winmm.dll calls. Can you suggest a source? rambo3889 and others might be interested too.

Edited by peter1234
Link to comment
Share on other sites

Here is a updated version.. And i know it is still not good...

Please rate the new version

#include <GUIConstants.au3>

Opt("GUICloseOnESC", 0)

HotKeySet("{Pause}", "stop",)

;stopper sangen
Func stop()
soundplay("C:\stop.mp3")
endfunc


;starter den valgte sang



GUICreate("Nikolajs musicplayer", 200, 215);makin a gui window
GUISetState (@SW_SHOW);showing gui window
$Play = GUICtrlCreateButton ( "Play", 0, 0 , 50 , 25);Playing choosed song
$Seek = GUICtrlCreateButton ( "Seek", 50,  0, 50 , 25);seeking for music
$stop = GUICtrlCreateButton ( "Stop", 100,  0, 50 , 25);stop playin music
$exit = GUICtrlCreateButton ( "exit", 150,  0, 50 , 25);exiter program

GUICtrlCreatelabel ( "Shortcut to stop song=Pause button", 0,  25 ,200, 25,)

GUICtrlCreatelabel ("Volume up" , 0,  50 ,200, 25,)
$25=GuiCtrlCreateButton("25%", 0, 75, 50, 25)
$50=GUiCtrlCreateButton("50%", 50, 75, 50, 25)
$75=GuiCtrlCreateButton("75%", 100, 75, 50, 25)
$100=GuiCtrlCreateButton("100%", 150, 75, 50, 25)

GuiCtrlCreateLabel("Volume Down", 0, 110, 200,25)
$25d=GuiCtrlCreateButton("25%", 0, 135, 50, 25)
$50d=GUiCtrlCreateButton("50%", 50, 135, 50, 25)
$75d=GuiCtrlCreateButton("75%", 100, 135, 50, 25)
$100d=GuiCtrlCreateButton("100%", 150, 135, 50, 25)

$mute=GUICtrlCreateButton("Mute-Unmute", 0 , 165, 200,25,)
GuiCtrlCreateLabel("Maked by rambo3889 Alias Nikolaj", 0, 190 , 200 , 25)




Do
  $msg = GUIGetMsg ()

   Select
      Case $msg = $Play
SoundPlay ($sange)

Case $msg = $mute
Send("{VOLUME_MUTE}")

Opt("GUICloseOnESC", 0)


Case $msg =$25
$i = 0
Do
send("{VOLUME_UP}")
    $i = $i + 1
Until $i = 6


Case $msg =$50
$i = 0
Do
send("{VOLUME_UP}")
    $i = $i + 1
Until $i = 13


Case $msg =$75
$i = 0
Do
send("{VOLUME_UP}")
    $i = $i + 1
Until $i = 19


Case $msg =$100
$i = 0
Do
send("{VOLUME_UP}")
    $i = $i + 1
Until $i = 25

Case $msg = $25d

$i = 0
Do
send("{VOLUME_DOWN}")
    $i = $i + 1
Until $i = 6


Case $msg =$50d

$i = 0
Do
send("{VOLUME_DOWN}")
    $i = $i + 1
Until $i = 13


Case $msg =$75d

$i = 0
Do
send("{VOLUME_DOWN}")
    $i = $i + 1
Until $i = 19


Case $msg =$100d


$i = 0
Do
send("{VOLUME_DOWN}")
    $i = $i + 1
Until $i = 25



Case $msg = $stop
soundplay("C:\stop.mp3",)


     Case $msg = $seek
$sange=FileOpenDialog ("Choose music", "", "Musicfiles(*.mp3;*.wma;*.wav;*.wave;*.mid;*)")
soundplay($sange)


      Case $msg = $exit
         exit 0

         exit
   EndSelect
Until $msg = $GUI_EVENT_CLOSE
My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!
Link to comment
Share on other sites

When it is run from Scite it comes up with syntax errors and complains that $sange is used before declaration.

The syntax problem is extra ,

You should Dim $sange at the begining.

Other than that it is good, keep it up.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

@BigDod i have removed the syntax errors and maked $sange declared like u sayed in my scite

#include <GUIConstants.au3>

Opt("GUICloseOnESC", 0)

HotKeySet("{Pause}", "stop")

;stopper sangen
Func stop()
soundplay("C:\stop.mp3")
endfunc


;starter den valgte sang



GUICreate("Nikolajs musicplayer", 200, 215);makin a gui window
GUISetState (@SW_SHOW);showing gui window
$Play = GUICtrlCreateButton ( "Play", 0, 0 , 50 , 25);Playing choosed song
$Seek = GUICtrlCreateButton ( "Seek", 50,  0, 50 , 25);seeking for music
$stop = GUICtrlCreateButton ( "Stop", 100,  0, 50 , 25);stop playin music
$exit = GUICtrlCreateButton ( "exit", 150,  0, 50 , 25);exiter program

GUICtrlCreatelabel ( "Shortcut to stop song=Pause button", 0,  25 ,200, 25)

GUICtrlCreatelabel ("Volume up" , 0,  50 ,200, 25)
$25=GuiCtrlCreateButton("25%", 0, 75, 50, 25)
$50=GUiCtrlCreateButton("50%", 50, 75, 50, 25)
$75=GuiCtrlCreateButton("75%", 100, 75, 50, 25)
$100=GuiCtrlCreateButton("100%", 150, 75, 50, 25)

GuiCtrlCreateLabel("Volume Down", 0, 110, 200,25)
$25d=GuiCtrlCreateButton("25%", 0, 135, 50, 25)
$50d=GUiCtrlCreateButton("50%", 50, 135, 50, 25)
$75d=GuiCtrlCreateButton("75%", 100, 135, 50, 25)
$100d=GuiCtrlCreateButton("100%", 150, 135, 50, 25)

$mute=GUICtrlCreateButton("Mute-Unmute", 0 , 165, 200,25)
GuiCtrlCreateLabel("Maked by rambo3889 Alias Nikolaj", 0, 190 , 200 , 25)




Do
  $msg = GUIGetMsg ()

   Select

Case $msg = $mute
Send("{VOLUME_MUTE}")

Opt("GUICloseOnESC", 0)


Case $msg =$25
$i = 0
Do
send("{VOLUME_UP}")
    $i = $i + 1
Until $i = 6


Case $msg =$50
$i = 0
Do
send("{VOLUME_UP}")
    $i = $i + 1
Until $i = 13


Case $msg =$75
$i = 0
Do
send("{VOLUME_UP}")
    $i = $i + 1
Until $i = 19


Case $msg =$100
$i = 0
Do
send("{VOLUME_UP}")
    $i = $i + 1
Until $i = 25

Case $msg = $25d

$i = 0
Do
send("{VOLUME_DOWN}")
    $i = $i + 1
Until $i = 6


Case $msg =$50d

$i = 0
Do
send("{VOLUME_DOWN}")
    $i = $i + 1
Until $i = 13


Case $msg =$75d

$i = 0
Do
send("{VOLUME_DOWN}")
    $i = $i + 1
Until $i = 19


Case $msg =$100d


$i = 0
Do
send("{VOLUME_DOWN}")
    $i = $i + 1
Until $i = 25



Case $msg = $stop
soundplay("C:\stop.mp3")

     Case $msg = $seek
$sange=FileOpenDialog ("Choose music", "", "Musicfiles(*.mp3;*.wma;*.wav;*.wave;*.mid;*)")
soundplay($sange)

      Case $msg = $Play
SoundPlay ($sange)



      Case $msg = $exit
         exit 0

         exit
   EndSelect
Until $msg = $GUI_EVENT_CLOSE
My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!
Link to comment
Share on other sites

Cool, now I will give some stars.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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...