PDA

View Full Version : help about default player


macko
08-07-2007, 10:29 AM
i have created an audio player in ams but i want it to automatically play songs i double click. this audio player is my default player for mp3 files etc... is this posibble in autoplay?

SiNisTer
08-08-2007, 10:40 AM
Yeah it is very possible...

This goes for the On Double-Click event of the ListBox (ListBox1)
cSelected = ListBox.GetSelected("ListBox1");
if cSelected then
cPath = ListBox.GetItemData("ListBox1", cSelected[1]);
Audio.Load(CHANNEL_NARRATION, cPath, true, false);
end

This should go on the On Show event
CurPlaying = 0

If you want to play a list of file in sequence, when the currant track is done, then put this code in the On Audio event:

if (e_State == "Play") then
CurPlaying = ListBox.FindItem("ListBox1", -1, LB_BYTEXT, String.SplitPath(Audio.GetFilename(CHANNEL_NARRATI ON)).Filename);
elseif (e_State == "Finish") then
cSelected = ListBox.GetSelected("ListBox1");
cTotal = Table.Concat(cSelected , "", 1, TABLE_ALL);
cFile = String.ToNumber(cTotal);
ListBox.SelectItem("ListBox1", cFile + 1);
cPath = ListBox.GetItemData("ListBox1", cFile + 1);
Audio.Load(CHANNEL_NARRATION, cPath , true, false);
elseif (e_State == "Stop" or e_State == "Pause") then
CurPlaying = 0
end

Hope that helps:yes

mz241508
08-08-2007, 11:05 AM
I think he's trying to say when you double click on a file.

Check out this file extension project of RizlaUK's:
http://www.indigorose.com/forums/showthread.php?t=19358&highlight=file+extension