PDA

View Full Version : grid mp3 playlist questions


kedipikolata
12-17-2008, 11:20 AM
hello . how can you get it to jump to the next track automaticly after the tracks on the grid playlist are finishid. track finish and automaticly jump next row ?

holtgrewe
12-17-2008, 02:09 PM
Since you know what 'track' is playing next, you can use the On Finish action of the MP plugin or Audio object to load/play the next track in sequence.

hth

kedipikolata
12-17-2008, 03:05 PM
list box sample code

Mp plugin "on finish"


piko = ListBox.GetSelected("playlistbox");

if (piko ~= nil) then
piko[1] = piko[1] + 1;

if piko[1] <= ListBox.GetCount("playlistbox") then

ListBox.SelectItem("playlistbox", piko[1]);

playmovie = ListBox.GetItemData("playlistbox", piko[1]);

MediaPlayer.Load("Video1", playmovie);

else


end
end



but how can i do this code working in a grid plugin

sory im very bad speek english

holtgrewe
12-18-2008, 09:51 AM
Upon completion of a playing track "On Finish" of the MP plugin; you can increment to the next row in the grid, then Use Grid.GetCellText() to extract the next value of the "track" in the grid; and so on, until you have depleted the rows in the grid.

Unfortunately there is not a tutorial for the grid object - but you should be able to follow the examples in the AMS help.


hth

kedipikolata
12-18-2008, 11:12 AM
what kind of code should I use in order to increment the row to 1 space above automatically? can you write me the code?

Imagine Programming
12-18-2008, 12:54 PM
can you write me the code?

Learn by trying, try to set the rownumber of the last played song, then on finish you just select the next by adding one to the last played song.

kedipikolata
12-18-2008, 03:27 PM
2 days only this idea trying but i cant get a rows number and set rows number i cant automaticly select a number :huh

holtgrewe
12-19-2008, 08:24 AM
I really don't have a lot of time to spend coding this but something like this should get you started loading the grid. This hasn't been tested but as I said should get you started.

tuneTbl={} -- set up a tune table
tuneTbl = File.Find("AutoPlay\\Audio\\tunes\\", "*.ogg", false, false) -- find and load all ogg files
for x = 1, Table.Count(tuneTbl) do
last = Grid.InsertRow("Grid1", -1, true) -- inserts at next available row
Grid.SetCellText("Grid1", last, 0, tuneTbl[x], true) -- load the tune
Grid.AutoSize("Grid1", GVS_DATA, true) -- expand the cell
Grid.Refresh("Grid1") -- refresh the grid
end

You should be able to repeat this code for *.MP3, *.Wav etc. to load the grid. I would think there should be numerous examples on the forum as to loading and manipulating grids...(maybe not)

hth