Sign in to follow this  
Followers 0
Evil_Has_Survived

Gui

9 posts in this topic

#include <GuiConstants.au3>
Opt("GUIoneventmode",1)
Opt("OnExitFunc","_write")
Global $songname[500]
Global $song[500]
Global $songGUI[500]
Global $number
;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000
GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$Input = GuiCtrlCreateInput("Drag And Drop Media files here.", -1, 130, 110, 20)
GUICtrlSetState(-1,$GUI_ACCEPTFILES)
$Date_1 = GuiCtrlCreateDate("Date1", 200, 0, 190, 20)
$Slider_1 = GuiCtrlCreateSlider(0, 90, 200, 40)
$Listname = GUICtrlCreateListView ( "Playlist|path",0,150,90,136)
_Loadplay()
$Button_1 = GuiCtrlCreateButton("previous", 0, 0, 60, 20)
$Edit_1 = GuiCtrlCreateEdit("Edit6", 150, 240, 1, 1)
$Button_2 = GuiCtrlCreateButton("play/pause", 60, 0, 60, 20)
$Edit_2 = GuiCtrlCreateEdit("Edit8", 130, 230, 1, 1)
$Button_3 = GuiCtrlCreateButton("next", 120, 0, 60, 20)
$Button_4 = GuiCtrlCreateButton("stop", 0, 20, 60, 20)
$Checkbox_1 = GuiCtrlCreateCheckbox("Mute", 70, 20, 90, 20)
$Radio_1 = GuiCtrlCreateRadio("Hit Kast", 10, 50, 60, 20)
GUICtrlSetData($Slider,100)
GUICtrlSetLimit ($Slider,100,0)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GuiCtrlSetOnEvent($Button_2, "_Play")
GuiCtrlSetOnEvent($Button_4, "_Stop")
GuiCtrlSetOnEvent($Button_1, "_MEDIA_PREV")
GuiCtrlSetOnEvent($Button_3, "_MEDIA_NEXT")
GuiSetState()
While 1
    SoundSetWaveVolume (GUICtrlRead($slider))
WEnd
Func _Exit()
    Exit
EndFunc
Func _play()
    $song = StringSplit (GUICtrlRead($input), "|")
    if $song[0] = 1 Then
    SoundPlay($song[1])
Else
    SoundPlay($song[2])
EndIf
EndFunc
Func _Stop()
    SoundPlay ("")
EndFunc
Func _loadplay()
    $number = IniRead ( "playlist.ini", "NUMBER", "number", "0" )
    If $number > 0 Then
        For $num=1 to $number
            $songname[$num] = IniRead ( "playlist.ini", "NAME", "name"&$num, "Not found" )
            $song[$num] = IniRead ( "playlist.ini", "PATH", "path"&$num, "Not found" )
            $songGUI[$num] = GUICtrlCreateListViewItem ($songname[$num]&"|"&$song[$num],$listname)
        Next
    EndIf
EndFunc

Func _Add()
    $adder = GUICtrlRead($input)
    $check = Stringsplit($adder,"|")
    If $check[0] = 1 Then
        $name = InputBox("Name","What is the songs name? (***.mp3/***.wma..)")
        $number=$number+1
        GUICtrlCreateListViewItem ($name&"|"&$adder,$listname)
        IniWrite ( "playlist.ini", "NUMBER", "number",$number)
        IniWrite ( "playlist.ini", "NAME", "name"&$number,$name)
        IniWrite ( "playlist.ini", "PATH", "path"&$number,$adder)
    Else
        GUICtrlCreateListViewItem ($adder,$listname)
    EndIf
EndFunc

I think I went wrong on slider or botton please help.


Thanks in advance

Share this post


Link to post
Share on other sites



maybe

Global $number, $Slider

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

maybe

Global $number, $Slider

8)

ok thanks one error completed :think:, hmm now the _MEDIA_PREV error popsup]

is there a program that can fix a script like find the errors and fix them atuomatic,

_MEDIA_PREV oh this is a send("") key but how can I make it still work

Edited by Evil_Has_Survived

Thanks in advance

Share this post


Link to post
Share on other sites

there are no functions with the names in this

GuiCtrlSetOnEvent($Button_1, "_MEDIA_PREV")
GuiCtrlSetOnEvent($Button_3, "_MEDIA_NEXT")

if you put in those functions it wont error... or

do this

;GuiCtrlSetOnEvent($Button_1, "_MEDIA_PREV")
;GuiCtrlSetOnEvent($Button_3, "_MEDIA_NEXT")

i used ";"

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

there are no functions with the names in this

GuiCtrlSetOnEvent($Button_1, "_MEDIA_PREV")
GuiCtrlSetOnEvent($Button_3, "_MEDIA_NEXT")

if you put in those functions it wont error... or

do this

;GuiCtrlSetOnEvent($Button_1, "_MEDIA_PREV")
;GuiCtrlSetOnEvent($Button_3, "_MEDIA_NEXT")

i used ";"

8)

If you don't mind can you edit it lol for me, if you could it would be Great, but if you don't want to I understand, it's just that im new to GUI, well I tryed my best to get it working like two hours :think:

im pretty sure the only things need be fixed is "prev" and "next" since they are send keys and not GUI commands,

well this is my script

#include <GuiConstants.au3>
Opt("GUIoneventmode",1)
Opt("OnExitFunc","_write")
Global $songname[500]
Global $song[500]
Global $songGUI[500]
Global $number, $Slider
;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000
GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$Input = GuiCtrlCreateInput("Drag And Drop Media files here.", -1, 130, 110, 20)
GUICtrlSetState(-1,$GUI_ACCEPTFILES)
$Date_1 = GuiCtrlCreateDate("Date1", 200, 0, 190, 20)
$Slider_1 = GuiCtrlCreateSlider(0, 90, 200, 40)
$Listname = GUICtrlCreateListView ( "Playlist|path",0,150,90,136)
_Loadplay()
$Button_1 = GuiCtrlCreateButton("previous", 0, 0, 60, 20)
$Edit_1 = GuiCtrlCreateEdit("Edit6", 150, 240, 1, 1)
$Button_2 = GuiCtrlCreateButton("play/pause", 60, 0, 60, 20)
$Edit_2 = GuiCtrlCreateEdit("Edit8", 130, 230, 1, 1)
$Button_3 = GuiCtrlCreateButton("next", 120, 0, 60, 20)
$Button_4 = GuiCtrlCreateButton("stop", 0, 20, 60, 20)
$Checkbox_1 = GuiCtrlCreateCheckbox("Mute", 70, 20, 90, 20)
$Radio_1 = GuiCtrlCreateRadio("Hit Kast", 10, 50, 60, 20)
GUICtrlSetData($Slider,100)
GUICtrlSetLimit ($Slider,100,0)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GuiCtrlSetOnEvent($Button_2, "_Play")
GuiCtrlSetOnEvent($Button_4, "_Stop")
;GuiCtrlSetOnEvent($Button_1, "_MEDIA_PREV")
;GuiCtrlSetOnEvent($Button_3, "_MEDIA_NEXT")
GuiSetState()
While 1
    SoundSetWaveVolume (GUICtrlRead($slider))
WEnd
Func _Exit()
    Exit
EndFunc
Func _play()
    $song = StringSplit (GUICtrlRead($input), "|")
    if $song[0] = 1 Then
    SoundPlay($song[1])
Else
    SoundPlay($song[2])
EndIf
EndFunc
Func _Stop()
    SoundPlay ("")
EndFunc
Func _loadplay()
    $number = IniRead ( "playlist.ini", "NUMBER", "number", "0" )
    If $number > 0 Then
        For $num=1 to $number
            $songname[$num] = IniRead ( "playlist.ini", "NAME", "name"&$num, "Not found" )
            $song[$num] = IniRead ( "playlist.ini", "PATH", "path"&$num, "Not found" )
            $songGUI[$num] = GUICtrlCreateListViewItem ($songname[$num]&"|"&$song[$num],$listname)
        Next
    EndIf
EndFunc

Func _Add()
    $adder = GUICtrlRead($input)
    $check = Stringsplit($adder,"|")
    If $check[0] = 1 Then
        $name = InputBox("Name","What is the songs name? (***.mp3/***.wma..)")
        $number=$number+1
        GUICtrlCreateListViewItem ($name&"|"&$adder,$listname)
        IniWrite ( "playlist.ini", "NUMBER", "number",$number)
        IniWrite ( "playlist.ini", "NAME", "name"&$number,$name)
        IniWrite ( "playlist.ini", "PATH", "path"&$number,$adder)
    Else
        GUICtrlCreateListViewItem ($adder,$listname)
    EndIf
EndFunc

and heres a code im trying to edit

#include <GuiConstants.au3>
Opt("GUIoneventmode",1)
Opt("OnExitFunc","_write")
Global $songname[500]
Global $song[500]
Global $songGUI[500]
Global $number
;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000
GuiCreate("Media Player", 336, 168,(@DesktopWidth-336)/2, (@DesktopHeight-168)/2,-1,0x00000018)
$Input = GuiCtrlCreateInput("Drag And Drop Media files here.", 120, 10, 210, 20)
GUICtrlSetState(-1,$GUI_ACCEPTFILES)
$Listname = GUICtrlCreateListView ( "Playlist|path",10,10,100,149)
_Loadplay()
$Slider = GuiCtrlCreateSlider(110, 130, 190, 40)
$Buttonplay = GuiCtrlCreateButton("Play", 120, 30, 70, 30)
$Buttonstop = GuiCtrlCreateButton("Stop", 120, 60, 30, 30)
$Buttonadd = GuiCtrlCreateButton("Add", 150, 60, 30, 30)
GUICtrlSetData($Slider,100)
GUICtrlSetLimit ($Slider,100,0)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GuiCtrlSetOnEvent($ButtonPlay, "_Play")
GuiCtrlSetOnEvent($Buttonstop, "_Stop")
GuiCtrlSetOnEvent($Buttonadd, "_Add")
GuiSetState()

While 1
    SoundSetWaveVolume (GUICtrlRead($slider))
WEnd

Func _Exit()
    Exit
EndFunc
Func _play()
    $song = StringSplit (GUICtrlRead($input), "|")
    if $song[0] = 1 Then
    SoundPlay($song[1])
Else
    SoundPlay($song[2])
EndIf
EndFunc
Func _Stop()
    SoundPlay ("")
EndFunc
Func _loadplay()
    $number = IniRead ( "playlist.ini", "NUMBER", "number", "0" )
    If $number > 0 Then
        For $num=1 to $number
            $songname[$num] = IniRead ( "playlist.ini", "NAME", "name"&$num, "Not found" )
            $song[$num] = IniRead ( "playlist.ini", "PATH", "path"&$num, "Not found" )
            $songGUI[$num] = GUICtrlCreateListViewItem ($songname[$num]&"|"&$song[$num],$listname)
        Next
    EndIf
EndFunc

Func _Add()
    $adder = GUICtrlRead($input)
    $check = Stringsplit($adder,"|")
    If $check[0] = 1 Then
        $name = InputBox("Name","What is the songs name? (***.mp3/***.wma..)")
        $number=$number+1
        GUICtrlCreateListViewItem ($name&"|"&$adder,$listname)
        IniWrite ( "playlist.ini", "NUMBER", "number",$number)
        IniWrite ( "playlist.ini", "NAME", "name"&$number,$name)
        IniWrite ( "playlist.ini", "PATH", "path"&$number,$adder)
    Else
        GUICtrlCreateListViewItem ($adder,$listname)
    EndIf
EndFunc
Edited by Evil_Has_Survived

Thanks in advance

Share this post


Link to post
Share on other sites

no more errors.... however not tested for functionality

#include <GuiConstants.au3>
Opt("GUIoneventmode",1)
Opt("OnExitFunc","_write")
Global $songname[500]
Global $song[500]
Global $songGUI[500]
Global $number, $Slider
;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000
GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$Input = GuiCtrlCreateInput("Drag And Drop Media files here.", -1, 130, 110, 20)
GUICtrlSetState(-1,$GUI_ACCEPTFILES)
$Date_1 = GuiCtrlCreateDate("Date1", 200, 0, 190, 20)
$Slider_1 = GuiCtrlCreateSlider(0, 90, 200, 40)
$Listname = GUICtrlCreateListView ( "Playlist|path",0,150,90,136)
_Loadplay()
$Button_1 = GuiCtrlCreateButton("previous", 0, 0, 60, 20)
$Edit_1 = GuiCtrlCreateEdit("Edit6", 150, 240, 1, 1)
$Button_2 = GuiCtrlCreateButton("play/pause", 60, 0, 60, 20)
$Edit_2 = GuiCtrlCreateEdit("Edit8", 130, 230, 1, 1)
$Button_3 = GuiCtrlCreateButton("next", 120, 0, 60, 20)
$Button_4 = GuiCtrlCreateButton("stop", 0, 20, 60, 20)
$Checkbox_1 = GuiCtrlCreateCheckbox("Mute", 70, 20, 90, 20)
$Radio_1 = GuiCtrlCreateRadio("Hit Kast", 10, 50, 60, 20)
GUICtrlSetData($Slider,100)
GUICtrlSetLimit ($Slider,100,0)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GuiCtrlSetOnEvent($Button_2, "_Play")
GuiCtrlSetOnEvent($Button_4, "_Stop")
GuiCtrlSetOnEvent($Button_1, "_MEDIA_PREV")
GuiCtrlSetOnEvent($Button_3, "_MEDIA_NEXT")
GuiSetState()
While 1
    SoundSetWaveVolume (GUICtrlRead($slider))
WEnd
Func _Exit()
    Exit
EndFunc
Func _play()
    $song = StringSplit (GUICtrlRead($input), "|")
    if $song[0] = 1 Then
    SoundPlay($song[1])
Else
    SoundPlay($song[2])
EndIf
EndFunc
Func _Stop()
    SoundPlay ("")
EndFunc
Func _loadplay()
    $number = IniRead ( "playlist.ini", "NUMBER", "number", "0" )
    If $number > 0 Then
        For $num=1 to $number
            $songname[$num] = IniRead ( "playlist.ini", "NAME", "name"&$num, "Not found" )
            $song[$num] = IniRead ( "playlist.ini", "PATH", "path"&$num, "Not found" )
            $songGUI[$num] = GUICtrlCreateListViewItem ($songname[$num]&"|"&$song[$num],$listname)
        Next
    EndIf
EndFunc

Func _Add()
    $adder = GUICtrlRead($input)
    $check = Stringsplit($adder,"|")
    If $check[0] = 1 Then
        $name = InputBox("Name","What is the songs name? (***.mp3/***.wma..)")
        $number=$number+1
        GUICtrlCreateListViewItem ($name&"|"&$adder,$listname)
        IniWrite ( "playlist.ini", "NUMBER", "number",$number)
        IniWrite ( "playlist.ini", "NAME", "name"&$number,$name)
        IniWrite ( "playlist.ini", "PATH", "path"&$number,$adder)
    Else
        GUICtrlCreateListViewItem ($adder,$listname)
    EndIf
EndFunc  

Func _MEDIA_PREV()
    Send("_MEDIA_PREV")
EndFunc

Func _MEDIA_NEXT()
    Send("_MEDIA_NEXT")
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

if you look at the top of your post you'll see what im trying to do.I edited it, and yes the script you made had no errors, but were you drop the music, that doesn't work.

no more errors.... however not tested for functionality

if you tested you'll get what im saying.

thanks for helping also :think:

Edited by Evil_Has_Survived

Thanks in advance

Share this post


Link to post
Share on other sites
:think:

Thanks in advance

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

:think:

Typo!!

Change your while loop to :

While 1

Sleep( 100 )

SoundSetWaveVolume (GUICtrlRead($Slider_1))

WEnd

Edit: You used $Slider instead of $Slider_1

And added a sleep to make your life better :(

Edit: If you want add a hotkey for the function _add()

Edited by rbhkamal

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

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