AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simple Music Player (SMP) First Script ! (Playlists Workin!)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Thu Nov 01, 2007 9:10 pm    Post subject: Simple Music Player (SMP) First Script ! (Playlists Workin!) Reply with quote

PLAYLISTS ARE WORKING
So Far There Are Only Four Songs In A Play List I am working to make this larger


Simple Music Player

Simple Music Player is what it is its simple GUI controls allow you to play music files .

Features
Start
Pause
Stop
Volume Slider
HOT!!! PLAYLISTS

Need Help With
Pause

CREDITS:
Creds To Garry For Help With Volume Slider

Also To Fire Fox Tho I Edited His Code




Save As SMP.ahk
Code:
NoTrayIcon
#SingleInstance Force
; Made By Fry
SM3:=0 ;volume
soundset,0,master,mute         ;SPEAKER=MASTER ON
SoundSet,%SM3%,master          ;SPEAKER=MASTER volume
;
Gui, Add, GroupBox, x6 y0 w360 h260 , SMP Media Player
Gui, Add, Button, x16 y20 w70 h30 gMusic, Open File
Gui, Add, Button, x16 y70 w50 h20 gStart, Start
Gui, Add, Button, x16 y110 w50 h20 , Pause
Gui, Add, Button, x16 y150 w50 h20 gStop, Stop
Gui, Add, Slider, x126 y20 w100 h30 vVolume Range0-100 gVolumeX, 25
Gui, Add, Text, x126 y60 w100 h30 , Volume
Gui, Add, Button, x106 y150 w50 h30 gCreatePlay, Create A Playlist
Gui, Add, Button, x106 y190 w40 h30 gStartPlaylist, Start Playlist
Gui, Add, Button, x106 y230 w40 h20 , Pause
Gui, Add, Button, x156 y230 w40 h20 gStop, Stop
Gui, Add, Text, x236 y20 w110 h60 , Ctrl H Toggles Between Hiding Window And Showing Window
Gui, Add, CheckBox, x6 y190 w100 h30 vStartBox gAutoStart, Auto Start Music
; Generated using SmartGUI Creator 4.0
Gui, Show, x197 y94 h275 w382, SMP Music Player
return

GuiClose:
ExitApp

^h::
IfWinExist, SMP Music Player
WinHide, SMP Music Player
else
WinShow, SMP Music Player
return



Music:
Gui, +OwnDialogs
FileSelectFile, Filetoplay, 3, , Select Audio File, Audio (*.wpl; *.wav; *.mp2; *.mp3; *.wma; *.mpeg)

; set filename to blank
filename=
sleep 100
SplitPath, Filetoplay, filename
sleep 100
return

Start:
SoundPlay, %Filetoplay%, wait
return

Stop:
SoundPlay, nofiletoplay11.wav
GuiControl,, StartBox, 0
return

; Begin Volume Slider

VolumeX:
Gui, Submit, NoHide
SoundSet,%volume%,master
GuiControl,, EditText2,%volume%
Return

CreatePlay:
run, PlaylistCreator.ahk


StartPlaylist:
IniRead, PlayVar, playlist.ini, section1, play
IniRead, PlayVar2, playlist.ini, section2, play
IniRead, PlayVar3, playlist.ini, section3, play
IniRead, PlayVar3, playlist.ini, section4, play

SoundPlay, %PlayVar%, wait
sleep 20
SoundPlay, %PlayVar2%, wait
sleep 20
SoundPlay, %PlayVar3%, wait
sleep 20
SoundPlay, %PlayVar4%, wait




; End Music Player
AutoStart:
Loop
{
    Gui, Submit, Nohide
    If StartBox
   Gosub, Start
   Else
   Gosub, Blank
}
return


Blank:


















Save As PlayListcreator.ahk (EXACTLY)
Code:
Gui, Add, Edit, x6 y60 w580 h30 vPlay,
Gui, Add, Edit, x6 y10 w580 h30 vPlay2,
Gui, Add, Edit, x6 y100 w580 h30 vPlay3,
Gui, Add, Edit, x6 y140 w580 h30 vPlay4,
Gui, Add, Button, x486 y190 w100 h30 gCreate, Create Playlist
Gui, Add, Text, x6 y180 w180 h50 , Put The Directory Of ONE Music File In Each Box Then Click Play Create PlayList To Make A Playlist
Gui, Add, Button, x346 y190 w100 h30 gCurrent, View Current PlayList
; Generated using SmartGUI Creator 4.0
Gui, Show, x131 y91 h362 w642,
return

GuiClose:
ExitApp

Current:
run, playlist.ini
return

Create:
Gui, Submit, NoHide ;or guicontrolget
IniWrite, %Play%, playlist.ini, section1, play
IniWrite, %Play2%, playlist.ini, section2, play
IniWrite, %Play3%, playlist.ini, section3, play
IniWrite, %Play4%, playlist.ini, section4, play

return


Last edited by Fry on Sat Nov 03, 2007 8:36 pm; edited 10 times in total
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Thu Nov 01, 2007 9:56 pm    Post subject: Reply with quote

Hope You Like And can Help Answer my Questions
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Fri Nov 02, 2007 7:39 pm    Post subject: Reply with quote

No Replys Yet Crying or Very sad
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1249
Location: USA

PostPosted: Fri Nov 02, 2007 10:09 pm    Post subject: Reply with quote

Hey, this is cool!...What type of playlist are you thinking about? How do you think it should look?
_________________

ʞɔпɟ əɥʇ ʇɐɥʍ
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Sat Nov 03, 2007 2:29 am    Post subject: Reply with quote

Im am actually currently creating a palylist creator that iniwirtes directorys of mp3 to a file and turns it in to a variable then runs the variable one line at a time but i need soem help
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Sat Nov 03, 2007 2:30 pm    Post subject: Reply with quote

playlists are now working!!!! Exclamation Exclamation Exclamation
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Sat Nov 03, 2007 7:41 pm    Post subject: Reply with quote

auto start music checkbox added!
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Sun Nov 04, 2007 2:57 pm    Post subject: Reply with quote

Any Ideas On the pause
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Mon Nov 05, 2007 8:55 pm    Post subject: Reply with quote

does anybodyuse this or do people think its just stupid
Back to top
View user's profile Send private message
MrNooblet



Joined: 24 Oct 2007
Posts: 4

PostPosted: Mon Nov 12, 2007 2:12 pm    Post subject: Reply with quote

.m3u is the extension for an .mp3 playlist just to let you know
Back to top
View user's profile Send private message
emoyasha



Joined: 12 Nov 2007
Posts: 64

PostPosted: Tue Nov 13, 2007 3:36 am    Post subject: play lists Reply with quote

here you go, place this code at the very top of your code

Code:
IniRead, PlayVar, playlist.ini, section1, play
IniRead, PlayVar2, playlist.ini, section2, play
IniRead, PlayVar3, playlist.ini, section3, play
IniRead, PlayVar4, playlist.ini, section4, play
IniRead, PlayVar5, playlist.ini, section5, play
IniRead, PlayVar6, playlist.ini, section6, play
IniRead, PlayVar7, playlist.ini, section7, play
IniRead, PlayVar8, playlist.ini, section8, play
IniRead, PlayVar9, playlist.ini, section9, play
IniRead, PlayVar10, playlist.ini, section10, play
IniRead, PlayVar11, playlist.ini, section11, play
IniRead, PlayVar12, playlist.ini, section12, play
IniRead, PlayVar13, playlist.ini, section13, play
IniRead, PlayVar14, playlist.ini, section14, play
IniRead, PlayVar15, playlist.ini, section15, play
IniRead, PlayVar16, playlist.ini, section16, play

IniRead, PlayVar0, playlist2.ini, section1, play
IniRead, PlayVar20, playlist2.ini, section2, play
IniRead, PlayVar30, playlist2.ini, section3, play
IniRead, PlayVar40, playlist2.ini, section4, play
IniRead, PlayVar50, playlist2.ini, section5, play
IniRead, PlayVar60, playlist2.ini, section6, play
IniRead, PlayVar70, playlist2.ini, section7, play
IniRead, PlayVar80, playlist2.ini, section8, play
IniRead, PlayVar90, playlist2.ini, section9, play
IniRead, PlayVar100, playlist2.ini, section10, play
IniRead, PlayVar110, playlist2.ini, section11, play
IniRead, PlayVar120, playlist2.ini, section12, play
IniRead, PlayVar130, playlist2.ini, section13, play
IniRead, PlayVar140, playlist2.ini, section14, play
IniRead, PlayVar150, playlist2.ini, section15, play
IniRead, PlayVar160, playlist2.ini, section16, play


then overwrite the old gui, show code with this.

Code:

gui, add, edit, x 210 y0 w300 h350, Play list 1: %PlayVar% `n %PlayVar2% `n  %PlayVar3% `n  %PlayVar4% `n %PlayVar5% `n %PlayVar6% `n %PlayVar7%`n  %PlayVar8%  `n  %PlayVar9% `n %PlayVar10% `n %PlayVar11% `n %PlayVar12% `n %PlayVar13% `n %PlayVar14% `n  %PlayVar15% `n  %PlayVar16% `n Play list 2: %PlayVar0% `n %PlayVar20% `n  %PlayVar30% `n  %PlayVar40% `n %PlayVar50% `n %PlayVar60% `n %PlayVar70%`n  %PlayVar80%  `n  %PlayVar90% `n %PlayVar100% `n %PlayVar110% `n %PlayVar120% `n %PlayVar130% `n %PlayVar140% `n  %PlayVar150% `n  %PlayVar160%
Gui, Show, auto size



this makes a box that displays the play lists, nwo to make the two playlists work use these codes

Code:
CreatePlay:
run, PlaylistCreator.exe


StartPlaylist:
SoundPlay, %PlayVar%, 1
sleep, 20
SoundPlay, %PlayVar2%, 1
sleep, 20
SoundPlay, %PlayVar3%, 1
sleep, 20
SoundPlay, %PlayVar4%, 1
sleep, 20
SoundPlay, %PlayVar5%, 1
sleep, 20
SoundPlay, %PlayVar6%, 1
sleep, 20
SoundPlay, %PlayVar7%, 1
sleep, 20
SoundPlay, %PlayVar8%, 1
sleep, 20
SoundPlay, %PlayVar9%, 1
sleep, 20
SoundPlay, %PlayVar10%, 1
sleep, 20
SoundPlay, %PlayVar11%, 1
sleep, 20
SoundPlay, %PlayVar12%, 1
sleep, 20
SoundPlay, %PlayVar13%, 1
sleep, 20
SoundPlay, %PlayVar14%, 1
sleep, 20
SoundPlay, %PlayVar15%, 1
sleep, 20
SoundPlay, %PlayVar16%, 1


AutoStart:
Loop
{
    Gui, Submit, Nohide
    If StartBox
   Gosub, Start
   Else
   Gosub, Blank
}

blank:

return

return
CreatePlay2:
run, PlaylistCreator2.exe


StartPlaylist2:

SoundPlay, %PlayVar0%, 1
sleep, 20
SoundPlay, %PlayVar20%, 1
sleep, 20
SoundPlay, %PlayVar30%, 1
sleep, 20
SoundPlay, %PlayVar40%, 1
sleep, 20
SoundPlay, %PlayVar50%, 1
sleep, 20
SoundPlay, %PlayVar60%, 1
sleep, 20
SoundPlay, %PlayVar70%, 1
sleep, 20
SoundPlay, %PlayVar80%, 1
sleep, 20
SoundPlay, %PlayVar90%, 1
sleep, 20
SoundPlay, %PlayVar100%, 1
sleep, 20
SoundPlay, %PlayVar110%, 1
sleep, 20
SoundPlay, %PlayVar120%, 1
sleep, 20
SoundPlay, %PlayVar130%, 1
sleep, 20
SoundPlay, %PlayVar140%, 1
sleep, 20
SoundPlay, %PlayVar150%, 1
sleep, 20
SoundPlay, %PlayVar160%, 1


return


then make a file named

playlistcreator.ahk) (you need to compile it to an exe for it to be launched from the media player)

with the following code:

Code:
Gui, Add, Edit,  w580 h30 vPlay,
Gui, Add, Edit,  w580 h30 vPlay2,
Gui, Add, Edit,  w580 h30 vPlay3,
Gui, Add, Edit,  w580 h30 vPlay4,
Gui, Add, Edit,  w580 h30 vPlay5,
Gui, Add, Edit,  w580 h30 vPlay6,
Gui, Add, Edit,  w580 h30 vPlay7,
Gui, Add, Edit,  w580 h30 vPlay8,
Gui, Add, Edit,  w580 h30 vPlay9,
Gui, Add, Edit, ym w580 h30 vPlay10,
Gui, Add, Edit,  w580 h30 vPlay11,
Gui, Add, Edit,  w580 h30 vPlay12,
Gui, Add, Edit,  w580 h30 vPlay13,
Gui, Add, Edit,  w580 h30 vPlay14,
Gui, Add, Edit,  w580 h30 vPlay15,
Gui, Add, Edit,  w580 h30 vPlay16,
Gui, Add, Button, w100 h30 gCreate, Create Playlist
Gui, Add, Text,  w180 h50 , Put The location Of ONE Media (*.wpl; *.wav; *.mp2; *.mp3; *.wma; *.mpeg *.avi all video and media files) File In Each Box Then Click  Create PlayList To Make A Playlist  -
Gui, Add, Button,  w100 h30 gCurrent, View Current PlayList
Gui, Show,  autosize,
return

GuiClose:
ExitApp

Current:
run, playlist.ini
return

Create:
Gui, Submit, NoHide ;or guicontrolget
IniWrite, %Play%, playlist.ini, section1, play
IniWrite, %Play2%, playlist.ini, section2, play
IniWrite, %Play3%, playlist.ini, section3, play
IniWrite, %Play4%, playlist.ini, section4, play
IniWrite, %Play5%, playlist.ini, section5, play
IniWrite, %Play6%, playlist.ini, section6, play
IniWrite, %Play7%, playlist.ini, section7, play
IniWrite, %Play8%, playlist.ini, section8, play
IniWrite, %Play9%, playlist.ini, section9, play
IniWrite, %Play10%, playlist.ini, section10, play
IniWrite, %Play11%, playlist.ini, section11, play
IniWrite, %Play12%, playlist.ini, section12, play
IniWrite, %Play13%, playlist.ini, section13, play
IniWrite, %Play14%, playlist.ini, section14, play
IniWrite, %Play15%, playlist.ini, section15, play
IniWrite, %Play16%, playlist.ini, section16, play
return



now make a second file named

playlistcreator2.ahk (also needs to be compiled)

Code:

Gui, Add, Edit,  w580 h30 vPlay,
Gui, Add, Edit,  w580 h30 vPlay2,
Gui, Add, Edit,  w580 h30 vPlay3,
Gui, Add, Edit,  w580 h30 vPlay4,
Gui, Add, Edit,  w580 h30 vPlay5,
Gui, Add, Edit,  w580 h30 vPlay6,
Gui, Add, Edit,  w580 h30 vPlay7,
Gui, Add, Edit,  w580 h30 vPlay8,
Gui, Add, Edit,  w580 h30 vPlay9,
Gui, Add, Edit, ym w580 h30 vPlay10,
Gui, Add, Edit,  w580 h30 vPlay11,
Gui, Add, Edit,  w580 h30 vPlay12,
Gui, Add, Edit,  w580 h30 vPlay13,
Gui, Add, Edit,  w580 h30 vPlay14,
Gui, Add, Edit,  w580 h30 vPlay15,
Gui, Add, Edit,  w580 h30 vPlay16,
Gui, Add, Button, w100 h30 gCreate, Create Playlist 2
Gui, Add, Text,  w180 h50 , Put The location Of ONE Media (*.wpl; *.wav; *.mp2; *.mp3; *.wma; *.mpeg *.avi all video and media files) File In Each Box Then Click  Create PlayList To Make A Playlist 
Gui, Add, Button,  w100 h30 gCurrent, View Current PlayList (2)
Gui, Show,  autosize,
return

GuiClose:
ExitApp

Current:
run, playlist2.ini
return

Create:
Gui, Submit, NoHide ;or guicontrolget
IniWrite, %Play%, playlist2.ini, section1, play
IniWrite, %Play2%, playlist2.ini, section2, play
IniWrite, %Play3%, playlist2.ini, section3, play
IniWrite, %Play4%, playlist2.ini, section4, play
IniWrite, %Play5%, playlist2.ini, section5, play
IniWrite, %Play6%, playlist2.ini, section6, play
IniWrite, %Play7%, playlist2.ini, section7, play
IniWrite, %Play8%, playlist2.ini, section8, play
IniWrite, %Play9%, playlist2.ini, section9, play
IniWrite, %Play10%, playlist2.ini, section10, play
IniWrite, %Play11%, playlist2.ini, section11, play
IniWrite, %Play12%, playlist2.ini, section12, play
IniWrite, %Play13%, playlist2.ini, section13, play
IniWrite, %Play14%, playlist2.ini, section14, play
IniWrite, %Play15%, playlist2.ini, section15, play
IniWrite, %Play16%, playlist2.ini, section16, play
return


this should add advanced functionality, and make thisprogrma more usefull
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
emoyasha



Joined: 12 Nov 2007
Posts: 64

PostPosted: Tue Nov 13, 2007 3:40 am    Post subject: pause Reply with quote

the pause button will probablly take a lot of work, so keep looking for help Wink if u need any help with anything, just ask me.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
emoyasha



Joined: 12 Nov 2007
Posts: 64

PostPosted: Tue Dec 11, 2007 3:58 am    Post subject: try Reply with quote

buttonpause:
pause
return
buttonunpause:
pause, off
return
_________________
online .ini reader with encryption

[url=http://www.autohotkey.com/forum/viewtopic.php?p=164102]
advanced tetris game many features [/url]
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Dr.X
Guest





PostPosted: Wed Jan 16, 2008 5:00 pm    Post subject: Reply with quote

Toolbar player would be great.
Only music player what can do that, is WMP (AFAIK), but its colors are ugly Sad. Is there any way to change WMP minimode gui (change the look of buttons colors etc) and anybody know how to get songname to clipboard ?
Back to top
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Sun Apr 20, 2008 3:24 pm    Post subject: Reply with quote

Im thinking of restarting this. Should I ?
_________________
check out my site
www.eliteknifesquad.com
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group