ID:1985998
 
Code:
    sortmusic()
var/list/L=list()
L.Add(flist("Audio/"))
var/i=0
src<<output(null,"AudioWindow.grid")
for(var/v in L)
src<<output(v,"AudioWindow.grid:1,[++i]")

//i try this too

sortmusic()
var/list/L=list()
L.Add(flist("Audio/"))
var/list/L2=list()
for(var/v in L)
var/obj/sound/o=new()
o.file=v
o.name=v
L2.Add(o)

var/i=0
src<<output(null,"AudioWindow.grid")
for(var/obj/sound/v in L2)
src<<output(v,"AudioWindow.grid:1,[++i]")

obj/sound
var/file
verb/Click2()
world<<"[src.file]"


Problem description:

Hi is posible to open file(music) in grid by click??


Also why when i chose item from list it's doesn't play?

        var/list/L=list()
L.Add(flist("Audio/"))
var/i=input(usr) in L
world<<sound(i)

Sorry for bump, but is posible to add file to list to this format?
var/list/TrackList=list('Asterisk.mid')


couse if i add this method it's wont work.

TrackList.Add(flist("Audio/"))
As far as I know, you can't click elements in a grid unless they are an obj/turf/mob/area (something with the click function). From what I've found, the issue is you need a reference to the objects you're creating, elsewise the trash collector picks them up (aka they are deleted).

Also, you're file variable needs to have the path you've searched.

mob/var/audioFiles

sortmusic()
var/list/L=list()
var/path = "Audio/"
for(var/v in flist(path))
var/obj/sound/o=new()
o.file="[path][v]"
o.name = v
L.Add(o)

var/i=0
for(var/obj/sound/v in L)
src<<output(v,"grid1:1,[++i]")
audioFiles = L

obj/sound
var/file
Click()
world << sound(file)


Be warned that doing this the way you have will not be idea if you are wanting to have pre-set songs and send them via host files.