Sign in to follow this  
Followers 0
NewBe

Media

17 posts in this topic

#1 ·  Posted (edited)

I am working on my biggest project ever and since there is a lot of code I get distracted and sometimes when I even attempt scripts this big I quit because I get frustrated and come up with other projects.

I hope one of you guys can help me with this.

Global $i
$i = 1

Func _MusicPlay()
    If Not FileExists(@ScriptDir & "\Play List.txt") Then
        MsgBox(0 , "" , "please create a playlist first")
    Else
        SoundPlay(FileReadLine(@ScriptDir & "\Play List.txt" , $i))
        $i = $i + 1
        $CountLines = _FileCountLines(@ScriptDir & "\Play List.txt")
        If $i = $CountLines + 1 Then $i = 0
    EndIf
EndFunc

Func _Previous()
    SoundPlay("")
    $i = $i - 1
    _MusicPlay()
EndFunc

Func _Next()
    SoundPlay("")
    $i = $i + 1
    _MusicPlay()
EndFunc

Func _MusicList()
    $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)")
    If @Error Then
        MsgBox(4096, "" , "No File chosen")
        Else
        FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF)
    EndIf
EndFunc

thats the most I can release of my code for now :D

oh and _MusicPlay() shouldn't goto the next song , it is 7am here so I can't think of a better way

Edited by NewBe

Share this post


Link to post
Share on other sites



*Bump*

I am sorry to bump but I really need to move on in script :D

Share this post


Link to post
Share on other sites

wtf is your question about it?

Share this post


Link to post
Share on other sites

wtf is your question about it?

It doesn't work proper.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

It doesn't work proper.

you don't have it DOING anything. you laid out a few functions and don't call any of them, so none of them execute. if you're having a specific issue, give specifics so that we have something to work with, and we'll be able to give you better help.

***edit***

fixed typo

Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

you don't have it DOING anything. you laid out a few functions and don't call any of them, so none of them execute. if you're having a specific issue, give specifics so that we have something to work with, and we'll be able to give you better help.

***edit***

fixed typo

I am sorry I just ripped those functions out of my main script if you create a GUI with theses as buttons and set the proper function to the button you'll see what I mean.

-play

-prev

-next

-playlist

I don't want the play button to skip to the next song when clicked, and prev and next doesn't seem to be working proper, I can't understand what I am doing wrong hard to read the autoit help file since it's not my language but people say I am a decent english typer which I don't think I am since I use google for most of the help which takes me awhile and even longer to correct it, or at least try.

Share this post


Link to post
Share on other sites

I am sorry I just ripped those functions out of my main script if you create a GUI with theses as buttons and set the proper function to the button you'll see what I mean.

-play

-prev

-next

-playlist

I don't want the play button to skip to the next song when clicked, and prev and next doesn't seem to be working proper, I can't understand what I am doing wrong hard to read the autoit help file since it's not my language but people say I am a decent english typer which I don't think I am since I use google for most of the help which takes me awhile and even longer to correct it, or at least try.

I'm actually at work right now, and don't have time to re-create code you don't feel like disclosing to find out what error you're having. In the example scrips section of the forum you should be able to find other media players that people have made that can show you the right way to do things if you are afraid of posting your code. Good luck, i genuinely hope it works out for you.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I'm actually at work right now, and don't have time to re-create code you don't feel like disclosing to find out what error you're having. In the example scrips section of the forum you should be able to find other media players that people have made that can show you the right way to do things if you are afraid of posting your code. Good luck, i genuinely hope it works out for you.

I am not scared to post my code it's that it is all not needed and I don't want to spoil the surprise, I know there are other media players must this one needs no GUI if I can get the playlist and prev and next and the play button all working I be great.

I posted the top code to give you an example of what I have tried and making it look how I sort of need the code to be all at the same times.

I have had no slept so I can not code it rights now.

I hope you can understood. :D

heres the code

#include <GuiConstants.au3>
Global $i
$i = 1
GUICreate("Mini Notepad", 200, 50, Default , Default)
$MusicMenu = GUICtrlCreateMenu("Music")
$MusicPlay = GUICtrlCreateMenuitem("Play" , $MusicMenu) 
$MusicStop = GUICtrlCreateMenuitem("Stop" , $MusicMenu)
$MusicSep = GUICtrlCreateMenuitem("" , $MusicMenu) 
$MusicPrev = GUICtrlCreateMenuitem("Prev" , $MusicMenu)
$MusicNext = GUICtrlCreateMenuitem("Next" , $MusicMenu) 
$MusicClear = GUICtrlCreateMenuitem("Clear..." , $MusicMenu) 
$MusicList = GUICtrlCreateMenuitem("Play List..." , $MusicMenu)
GUISetState(@SW_SHOW)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
    Case $GUI_EVENT_CLOSE
            Exit
    Case $MusicPlay
            _MusicPlay()
        Case $MusicStop
            SoundPlay("")
    ;   Case $MusicPrev
            ;_Previous()
    ;   Case $MusicNext
        ;   _Next()
        Case $MusicClear
            FileDelete(@ScriptDir & "\Play List.txt")
        Case $MusicList
            _MusicList()
    EndSwitch
WEnd

Func _MusicPlay()
    If Not FileExists(@ScriptDir & "\Play List.txt") Then
        MsgBox(0 , "" , "please create a playlist first")
    Else
        SoundPlay(FileReadLine(@ScriptDir & "\Play List.txt" , $i))
        $i = $i + 1
        $CountLines = _FileCountLines(@ScriptDir & "\Play List.txt")
        If $i = $CountLines + 1 Then $i = 0
    EndIf
EndFunc

Func _Previous()
    SoundPlay("")
    $i = $i - 1
    _MusicPlay()
EndFunc

Func _Next()
    SoundPlay("")
    $i = $i + 1
    _MusicPlay()
EndFunc

Func _MusicList()
    $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)")
    If @Error Then
        MsgBox(4096, "" , "No File chosen")
        Else
        FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF)
    EndIf
EndFunc

will this helps more.

Edited by NewBe

Share this post


Link to post
Share on other sites

I am not scared to post my code it's that it is all not needed and I don't want to spoil the surprise, I know there are other media players must this one needs no GUI if I can get the playlist and prev and next and the play button all working I be great.

I posted the top code to give you an example of what I have tried and making it look how I sort of need the code to be all at the same times.

I have had no slept so I can not code it rights now.

I hope you can understood. :D

heres the code

#include <GuiConstants.au3>
Global $i
$i = 1
GUICreate("Mini Notepad", 200, 50, Default , Default)
$MusicMenu = GUICtrlCreateMenu("Music")
$MusicPlay = GUICtrlCreateMenuitem("Play" , $MusicMenu) 
$MusicStop = GUICtrlCreateMenuitem("Stop" , $MusicMenu)
$MusicSep = GUICtrlCreateMenuitem("" , $MusicMenu) 
$MusicPrev = GUICtrlCreateMenuitem("Prev" , $MusicMenu)
$MusicNext = GUICtrlCreateMenuitem("Next" , $MusicMenu) 
$MusicClear = GUICtrlCreateMenuitem("Clear..." , $MusicMenu) 
$MusicList = GUICtrlCreateMenuitem("Play List..." , $MusicMenu)
GUISetState(@SW_SHOW)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
    Case $GUI_EVENT_CLOSE
            Exit
    Case $MusicPlay
            _MusicPlay()
        Case $MusicStop
            SoundPlay("")
    ;   Case $MusicPrev
            ;_Previous()
    ;   Case $MusicNext
        ;   _Next()
        Case $MusicClear
            FileDelete(@ScriptDir & "\Play List.txt")
        Case $MusicList
            _MusicList()
    EndSwitch
WEnd

Func _MusicPlay()
    If Not FileExists(@ScriptDir & "\Play List.txt") Then
        MsgBox(0 , "" , "please create a playlist first")
    Else
        SoundPlay(FileReadLine(@ScriptDir & "\Play List.txt" , $i))
        $i = $i + 1
        $CountLines = _FileCountLines(@ScriptDir & "\Play List.txt")
        If $i = $CountLines + 1 Then $i = 0
    EndIf
EndFunc

Func _Previous()
    SoundPlay("")
    $i = $i - 1
    _MusicPlay()
EndFunc

Func _Next()
    SoundPlay("")
    $i = $i + 1
    _MusicPlay()
EndFunc

Func _MusicList()
    $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)")
    If @Error Then
        MsgBox(4096, "" , "No File chosen")
        Else
        FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF)
    EndIf
EndFuncoÝ÷ Û¥Øb²¥¦É¨­ïêº^#
.×hÖ¥ÛeyØ}êÞÙr¶-­æ¦)Þù趧élzX¤zʺÚ"µÍÚ[ÛYIÙ[K]LÉÝÂÚ[ÛYH ÑÝZPÛÛÝ[Ë]LÉÝÂÛØ[    ÌÍÚBÌÍÚHHBÕRPÜX]J   ][ÝÓZ[HÝY    ][ÝË
LY][Y][
BÌÍÓ]ÚXÓY[HHÕRPÝÜX]SY[J ][ÝÓ]ÚXÉ][ÝÊBÌÍÓ]ÚXÔ^HHÕRPÝÜX]SY[Z][J ][ÝÔ^I][ÝÈ  ÌÍÓ]ÚXÓY[JBÌÍÓ]ÚXÔÝÜHÕRPÝÜX]SY[Z][J  ][ÝÔÝÜ  ][ÝÈ  ÌÍÓ]ÚXÓY[JBÌÍÓ]ÚXÔÙHÕRPÝÜX]SY[Z][J    ][ÝÉ][ÝÈ    ÌÍÓ]ÚXÓY[JBÌÍÓ]ÚXÔ]HÕRPÝÜX]SY[Z][J ][ÝÔ]][ÝÈ   ÌÍÓ]ÚXÓY[JBÌÍÓ]ÚXÓ^HÕRPÝÜX]SY[Z][J ][ÝÓ^ ][ÝÈ  ÌÍÓ]ÚXÓY[JBÌÍÓ]ÚXÐÛXHÕRPÝÜX]SY[Z][J   ][ÝÐÛX][ÝÈ ÌÍÓ]ÚXÓY[JBÌÍÓ]ÚXÓÝHÕRPÝÜX]SY[Z][J    ][ÝÔ^HÝ][ÝÈ    ÌÍÓ]ÚXÓY[JB[H  ÌÍÜ^[ÝÑ[TXYÐ^J    ][ÝÔ^HÝ  ][ÝË  ÌÍÜ^[Ý
BÕRTÙ]Ý]JÕ×ÔÒÕÊBÚ[HB  ÌÍÓÙÈHÕRQÙ]ÙÊ
BÝÚ]Ú    ÌÍÓÙÂØÙH ÌÍÑÕRWÑUSÐÓÔÑB^]ØÙH  ÌÍÓ]ÚXÔ^BÓ]ÚXÔ^J    ÌÍÚJBØÙH   ÌÍÓ]ÚXÔÝÜÛÝ[^J ][ÝÉ][ÝÊBØÙH  ÌÍÓ]ÚXÔ]Ô][ÝÊ
BØÙH  ÌÍÓ]ÚXÓ^Ó^

BØÙH  ÌÍÓ]ÚXÐÛX[Q[]JØÜ    [È ][ÝÉÌLÔ^HÝ ][ÝÊBBBIÌÍÜ^[ÝH   ][ÝÉ][ÝÂØÙH   ÌÍÓ]ÚXÓÝÓ]ÚXÓÝ

B[ÝÚ]ÚÑ[[ÈÓ]ÚXÔ^J   ÌÍÞ
BÛÝ[^J[TXY[J  ÌÍÜ^[ÝÉÌÍÞJKJBY ÌÍÖH ÌÍÜ^[ÝÌH[  ÌÍÚHHBWÛ^

B[[Â[ÈÔ][ÝÊ
BÛÝ[^J    ][ÝÉ][ÝÊB   ÌÍÚHH    ÌÍÚHHBÓ]ÚXÔ^J ÌÍÚJB[[Â[ÈÓ^

BÛÝ[^J    ][ÝÉ][ÝÊB   ÌÍÚHH    ÌÍÚH
ÈBÓ]ÚXÔ^J   ÌÍÚJB[[Â[ÈÓ]ÚXÓÝ

B   ÌÍÐY]ÚXÈH[SÜ[X[ÙÊ   ][ÝÐY]ÚXÉ][ÝÈ ][ÝÉ][ÝÈ    ][ÝÐ[YYXH

I][ÝÊBYÜ[ÙÐÞ
M   ][ÝÉ][ÝÈ    ][ÝÓÈ[HÚÜÙ[][ÝÊB[ÙB[UÜ]JØÜ  [È ][ÝÉÌLÔ^HÝ ][ÝÈ  ÌÍÐY]ÚXÈ   [ÈÔB[Y[[

does that affect the issues you're having?


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

does that affect the issues you're having?

it is not working for some reason, i go to playlist add music hit play and it errors out.

thanks

Edited by NewBe

Share this post


Link to post
Share on other sites

it is not working for some reason, i go to playlist add music hit play and it errors out.

thanks

it errors out because the playlist file is only brought in at the beginning the way i wrote it, so you're not adding music to the playlist by adding it to the file. simple enough to fix like so...

#include<file.au3>
#include <GuiConstants.au3>
Global $i
$i = 1
GUICreate("Mini Notepad", 200, 50, Default , Default)
$MusicMenu = GUICtrlCreateMenu("Music")
$MusicPlay = GUICtrlCreateMenuitem("Play" , $MusicMenu)
$MusicStop = GUICtrlCreateMenuitem("Stop" , $MusicMenu)
$MusicSep = GUICtrlCreateMenuitem("" , $MusicMenu)
$MusicPrev = GUICtrlCreateMenuitem("Prev" , $MusicMenu)
$MusicNext = GUICtrlCreateMenuitem("Next" , $MusicMenu)
$MusicClear = GUICtrlCreateMenuitem("Clear..." , $MusicMenu)
$MusicList = GUICtrlCreateMenuitem("Play List..." , $MusicMenu)
dim $playlist
LoadPlaylist()
GUISetState(@SW_SHOW)
Func LoadPlaylist()
$playlist = "";kills current playlist if there is one
_FileReadToArray("Play List.txt",$playlist);creates new one
EndFunc

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
    Case $GUI_EVENT_CLOSE
            Exit
    Case $MusicPlay
            _MusicPlay($i)
        Case $MusicStop
            SoundPlay("")
       Case $MusicPrev
            _Previous()
       Case $MusicNext
           _Next()
        Case $MusicClear
            FileDelete(@ScriptDir & "\Play List.txt")
            $playlist = ""
        Case $MusicList
            _MusicList()
    EndSwitch
WEnd

Func _MusicPlay($x)
        SoundPlay(FileReadLine($playlist[$x]),1)
        If $X = $playlist[0] Then $i = 0
        _next()
EndFunc

Func _Previous()
    SoundPlay("")
    $i = $i - 1
    _MusicPlay($i)
EndFunc

Func _Next()
    SoundPlay("")
    $i = $i + 1
    _MusicPlay($i)
EndFunc

Func _MusicList()
    $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)")
    If @Error Then
        MsgBox(4096, "" , "No File chosen")
        Else
        FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF)
        LoadPlaylist()
    EndIf
EndFunc

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

it errors out because the playlist file is only brought in at the beginning the way i wrote it, so you're not adding music to the playlist by adding it to the file. simple enough to fix like so...

#include<file.au3>
#include <GuiConstants.au3>
Global $i
$i = 1
GUICreate("Mini Notepad", 200, 50, Default , Default)
$MusicMenu = GUICtrlCreateMenu("Music")
$MusicPlay = GUICtrlCreateMenuitem("Play" , $MusicMenu)
$MusicStop = GUICtrlCreateMenuitem("Stop" , $MusicMenu)
$MusicSep = GUICtrlCreateMenuitem("" , $MusicMenu)
$MusicPrev = GUICtrlCreateMenuitem("Prev" , $MusicMenu)
$MusicNext = GUICtrlCreateMenuitem("Next" , $MusicMenu)
$MusicClear = GUICtrlCreateMenuitem("Clear..." , $MusicMenu)
$MusicList = GUICtrlCreateMenuitem("Play List..." , $MusicMenu)
dim $playlist
LoadPlaylist()
GUISetState(@SW_SHOW)
Func LoadPlaylist()
$playlist = "";kills current playlist if there is one
_FileReadToArray("Play List.txt",$playlist);creates new one
EndFunc

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
    Case $GUI_EVENT_CLOSE
            Exit
    Case $MusicPlay
            _MusicPlay($i)
        Case $MusicStop
            SoundPlay("")
       Case $MusicPrev
            _Previous()
       Case $MusicNext
           _Next()
        Case $MusicClear
            FileDelete(@ScriptDir & "\Play List.txt")
            $playlist = ""
        Case $MusicList
            _MusicList()
    EndSwitch
WEnd

Func _MusicPlay($x)
        SoundPlay(FileReadLine($playlist[$x]),1)
        If $X = $playlist[0] Then $i = 0
        _next()
EndFunc

Func _Previous()
    SoundPlay("")
    $i = $i - 1
    _MusicPlay($i)
EndFunc

Func _Next()
    SoundPlay("")
    $i = $i + 1
    _MusicPlay($i)
EndFunc

Func _MusicList()
    $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)")
    If @Error Then
        MsgBox(4096, "" , "No File chosen")
        Else
        FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF)
        LoadPlaylist()
    EndIf
EndFunc

I am sorry , I am to tired to understand whats going on I been up for a day and a half now , I will try and figure out why it's still giving me errors tomorrow.

Thanks a lot for helping me.

Share this post


Link to post
Share on other sites

I am sorry , I am to tired to understand whats going on I been up for a day and a half now , I will try and figure out why it's still giving me errors tomorrow.

Thanks a lot for helping me.

What error is it giving you?

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites
SoundPlay(FileReadLine($playlist[$x]),1) 
SoundPlay(FileReadLine($playlist^ ERRORoÝ÷ ÚØZK¢ºn¶Ø§êpØfy©Ý*h¢·§X¬ú®¢×¬¢ºòmµë-yØ­Á«!jø§+,¹ëyÆ®±êrW®)à¦V²+-mçè­êÞiاڮ¶²"­«®ìÂ+a¶¬jëh×6#include<file.au3>
#include <GuiConstants.au3>
Global $i
$i = 1
GUICreate("Mini Notepad", 200, 50, Default , Default)
$MusicMenu = GUICtrlCreateMenu("Music")
$MusicPlay = GUICtrlCreateMenuitem("Play" , $MusicMenu)
$MusicStop = GUICtrlCreateMenuitem("Stop" , $MusicMenu)
$MusicSep = GUICtrlCreateMenuitem("" , $MusicMenu)
$MusicPrev = GUICtrlCreateMenuitem("Prev" , $MusicMenu)
$MusicNext = GUICtrlCreateMenuitem("Next" , $MusicMenu)
$MusicClear = GUICtrlCreateMenuitem("Clear..." , $MusicMenu)
$MusicList = GUICtrlCreateMenuitem("Play List..." , $MusicMenu)
dim $playlist
LoadPlaylist()
GUISetState(@SW_SHOW)
Func LoadPlaylist()
_FileReadToArray("Play List.txt",$playlist);creates new one;kills current playlist if there is one 
EndFunc

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
    Case $GUI_EVENT_CLOSE
            Exit
    Case $MusicPlay
            _MusicPlay($i)
        Case $MusicStop
            SoundPlay("")
       Case $MusicPrev
            _Previous()
       Case $MusicNext
           _Next()
        Case $MusicClear
            FileDelete(@ScriptDir & "\Play List.txt")
            $playlist = ""
        Case $MusicList
            _MusicList()
    EndSwitch
WEnd

Func _MusicPlay($x)
        SoundPlay(FileReadLine($playlist[$x]))
        If $X = $playlist[0] Then $i = 0
EndFunc

Func _Previous()
    SoundPlay("")
    $i = $i - 1
    _MusicPlay($i)
EndFunc

Func _Next()
    SoundPlay("")
    $i = $i + 1
    _MusicPlay($i)
EndFunc

Func _MusicList()
    $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)")
    If @Error Then
        MsgBox(4096, "" , "No File chosen")
        Else
        FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF)
        LoadPlaylist()
    EndIf
EndFunc

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

SoundPlay(FileReadLine($playlist[$x]),1) 
SoundPlay(FileReadLine($playlist^ ERROR

thanks for putting up with me and my poor english

The _MusicPlay() func is totally messed up

Try this

Func _MusicPlay()
   If NOT IsArray($PlayList) Then
      MsgBox(0, "Error", "There is no play list loaded")
      Return
   EndIf
   For $x = 1 To Ubound($PlayList) -1
        SoundPlay($playlist[$x],1)
   Next
EndFunc

Be sure to remove the $i from the call to _MusicPlay()


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#include <File.au3>
#include <GuiConstants.au3>
Global $i , $Playlist
GUICreate("Mini Notepad", 200, 50, Default , Default)
$MusicMenu = GUICtrlCreateMenu("Music")
$MusicPlay = GUICtrlCreateMenuitem("Play" , $MusicMenu)
$MusicStop = GUICtrlCreateMenuitem("Stop" , $MusicMenu)
$MusicSep = GUICtrlCreateMenuitem("" , $MusicMenu)
$MusicPrev = GUICtrlCreateMenuitem("Prev" , $MusicMenu)
$MusicNext = GUICtrlCreateMenuitem("Next" , $MusicMenu)
$MusicClear = GUICtrlCreateMenuitem("Clear..." , $MusicMenu)
$MusicList = GUICtrlCreateMenuitem("Play List..." , $MusicMenu)
_LoadPlaylist()
GUISetState(@SW_SHOW)
$i = 1
While 1
    $Msg = GUIGetMsg()
    Switch $Msg
    Case $GUI_EVENT_CLOSE
            Exit
    Case $MusicPlay
            _MusicPlay()
        Case $MusicStop
            SoundPlay("")
       Case $MusicPrev
            _Previous()
       Case $MusicNext
           _Next()
        Case $MusicClear
            FileDelete(@ScriptDir & "\Play List.txt")
            $Playlist = ""
        Case $MusicList
            _MusicList()
    EndSwitch
WEnd

Func _MusicPlay()
   If Not IsArray($Playlist) Then
      MsgBox(0, "", "please make a playlist first")
      Return
   EndIf
   For $x = 1 To Ubound($Playlist) -1
        SoundPlay($Playlist[$x])
   Next
EndFunc

Func _Previous()
    SoundPlay("")
    $i = $i - 1
    _MusicPlay()
EndFunc

Func _Next()
    SoundPlay("")
    $i = $i + 1
    _MusicPlay()
EndFunc

Func _MusicList()
    $AddMusic = FileOpenDialog("Add Music" , "" , "All Media (*.*)")
    If @Error Then
        MsgBox(4096, "" , "No File chosen")
        Else
        FileWrite(@ScriptDir & "\Play List.txt" , $AddMusic & @CRLF)
        _LoadPlaylist()
    EndIf
EndFunc

Func _LoadPlaylist()
_FileReadToArray("Play List.txt", $Playlist);creates new one;kills current playlist if there is one
EndFuncoÝ÷ Øp¢¹,jY¨²Ú^­÷µ»­!Ú'ßÛeG¡£  ²±Êâ¦Ü(m~éܶ*'Áée¶¦ºÈÊek(§«­¢+ÙͽչÁ±ä ÅÕ½Ðíµåͽչ¹ÝØÅÕ½Ðì°Ä¤(í¡¹Ñ¼)ͽչÁ±ä ÅÕ½Ðíµåͽչ¹ÝØÅÕ½Ðì

doesn't work.

Thanks

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