;Creator: Eedis
;Email: Killerbender53@yahoo.com
IfNotExist, %A_ProgramFiles%\Pleyer\Pleyerpath.ini
iniwrite, Path, %A_ProgramFiles%\Pleyer\Pleyerpath.ini, Settings, Path
Menu, MyMenu, Add, Play, Play
Menu, MyMenu, Add
Menu, MyMenu, Add, Up, Up
Menu, MyMenu, Add
Menu, MyMenu, Add, Exit, Exit

iniread, path, %A_ProgramFiles%\Pleyer\Pleyerpath.ini, Settings, Path
Gui, Color, FF8040
Gui, Font, S44 CGreen Bold, Papyrus
Gui, Add, Text, x86 y0 w170 h90 +BackgroundTrans, Pleyer
Gui, Font, S12 CGreen Bold, Arial
Gui, Add, Text, x-108 y70 w560 h30 +BackgroundTrans, ___________________________________________________
Gui, Font, S12 CGreen, Arial
Gui, Add, Edit, x6 y100 w220 h20 veditpath, %path%
Gui, Add, Button, x236 y100 w90 h20 , Browse
Gui, Add, ListView, x6 y130 w330 h440 gPleyer, Name|Path
Gui, Show, w345 h582, Pleyer
a:
Loop, %path%\*.*, 2
LV_Add("", A_LoopFileName, A_LoopFileLongPath)
Loop, %path%\*.mp3
LV_Add("", A_LoopFileName, A_LoopFileLongPath)
Loop, %path%\*.wma
LV_Add("", A_LoopFileName, A_LoopFileLongPath)
Loop, %path%\*.wav
LV_Add("", A_LoopFileName, A_LoopFileLongPath)

LV_ModifyCol(1, 200)
LV_ModifyCol(2)

Gui, Show
return

buttonbrowse:
{
LV_Delete()
FileSelectFolder, path
if errorlevel
{
iniread, path, %A_ProgramFiles%\Pleyer\Pleyerpath.ini, Settings, Path
goto, a
}
GuiControl,, Edit1, %path%
LV_Delete()
goto, a
}
Return

Pleyer:
if A_GuiEvent = DoubleClick
{
gui, submit, nohide
LV_GetText(RowText, A_EventInfo, 2)
IfInString, rowtext, .mp3
{
run, %rowtext%
Return
}
IfInString, rowtext, .wav
{
run, %rowtext%
Return
}
IfInString, rowtext, .wma
{
run, %rowtext%
Return
}

LV_GetText(RowText, A_EventInfo, 2)
LV_Delete()

gui, submit, NoHide
path:=editpath
GuiControl,, Edit1, %RowText%

Loop, %RowText%\*.*, 2
LV_Add("", A_LoopFileName, A_LoopFileLongPath)
Loop, %RowText%\*.mp3
LV_Add("", A_LoopFileName, A_LoopFileLongPath)
Loop, %RowText%\*.wma
LV_Add("", A_LoopFileName, A_LoopFileLongPath)
Loop, %RowText%\*.wav
LV_Add("", A_LoopFileName, A_LoopFileLongPath)

LV_ModifyCol(1, 200)
LV_ModifyCol(2)
Gui, Show
}
return

GuiContextMenu:
if A_GuiControl <> Pleyer
Menu, MyMenu, Show, %A_GuiX%, %A_GuiY%
return

up:
gui, submit, nohide
stringsplit, splitpath, editpath, \
Loop, %SplitPath0%
stringnum:=A_index
StringLen, length, splitpath%stringnum%
length+=1
StringTrimRight, path, editpath, %length%
lv_delete()
GuiControl,, Edit1, %path%
goto, a
Return

Play:
RowNumber = 0
Loop
{
RowNumber := LV_GetNext(RowNumber)
if not RowNumber
break
LV_GetText(Text, RowNumber)
gui, submit, nohide
run, %editpath%\%text%
Return
}
Return

^m::
{
if (var = 0)
{
gui, show
var = 1
}
else
{
gui, hide
var = 0
}
}
Return

Exit:
GuiClose:
gui, submit, NoHide
iniwrite, %editpath%, %A_ProgramFiles%\Pleyer\Pleyerpath.ini, Settings, Path
ExitApp