PDA

View Full Version : Quick Help With "Loop ON/OFF"



SiNisTer
05-03-2007, 01:50 AM
Hey Guys,
I'm currently working on an audio player, which I'm hoping to release on the forum pretty soon as a freeware, but I've run into a little problem...Here goes:

My project doesn't use a media player plug in,but rather uses the built in audio engine. It works pretty well but for one problem:
I want to give the user the option to loop the currently playing track (As in toggle Loop on/off currant track on the click of a button)..I've spent a lot of time but have got the DESIRED result.I worked on the "On Audio" - on finish event but to no avail. I did manage to loop a track but when i turned the Loop button to "off" it still kept repeating the same track over and over - Its really frustrating. Please help me guys - As soon as possible, better if it is is the form of an example...

Thank You

RizlaUK
05-03-2007, 05:25 AM
here, try this



loop = Audio.IsLooping(CHANNEL_NARRATION);
if loop then
Audio.SetLooping(CHANNEL_NARRATION, false);
else
Audio.SetLooping(CHANNEL_NARRATION, true);
end

output enhanced with AMS Code Pretty (http://www.indigorose.com/forums/showthread.php?t=19409)

EDIT, sorry, forgot to mention, put that in your loop button

SiNisTer
05-03-2007, 11:56 PM
Thanx Riz, I'll try that and let you know...

SiNisTer
05-06-2007, 08:10 AM
Hey just want to thank you for the codes...it works fine (Phew!Finally). You wont believe the codes that i actually came up with to find a solution & all it took was 6 simple lines of code...

Haydeng
05-06-2007, 08:20 AM
Yeah I use the same thing for MusicFuse, but with a few tweaks. Mine gets it from the registry so if you start the program it will automaticly set looping on or off.

SiNisTer
05-06-2007, 09:29 AM
Hey Haydeng,
Could you share that aspect of the code pls? I'd really appreciate it...