Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Looping input module positioning (Read 2688 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Looping input module positioning

Hi,

I've made a fairly simple input component (for the ADPCM files used by Square/Enix in PlayOnline).  Given that these files containing looping information, I added optional looping playback - this all went easily enough.

The problem I have, however, is that when playback reaches the end of the file, and jumps back to the loop start, foobar's location slider stays at 100%, and the playtime and progress indicators happily continue to count onwards.

Is there any way I can tell foobar I'm looping so that it can reposition its location slider and/or update the time/progress indicators?  Or should I set length to 0 if looping is enabled (as it effectively amounts to streaming).

Looping input module positioning

Reply #1
Quote
Is there any way I can tell foobar I'm looping so that it can reposition its location slider and/or update the time/progress indicators?
[a href="index.php?act=findpost&pid=231616"][{POST_SNAPBACK}][/a]

Not at this time.
Quote
Or should I set length to 0 if looping is enabled (as it effectively amounts to streaming).
[a href="index.php?act=findpost&pid=231616"][{POST_SNAPBACK}][/a]

I wouldn't suggest doing that, as it would be inconsistent with other software which currently displays the correct length whether or not toe format is looping.

You might also want to take a look at the flags passed to input::open(), as they will tell your decoder instance whether it should not loop forever, ie. user is converting the file or running it through the ReplayGain scanner.

Feel free to download the source code to foo_festalon from my components page to see how its open() call combines a flag check with a configuration variable check, then performs length checking with an optional fade-out. It may not be the best example, but it works.

Looping input module positioning

Reply #2
Quote
You might also want to take a look at the flags passed to input::open(), as they will tell your decoder instance whether it should not loop forever, ie. user is converting the file or running it through the ReplayGain scanner.
[a href="index.php?act=findpost&pid=231804"][{POST_SNAPBACK}][/a]


I already do that - I have a config variable (and corresponding checkbox on a config page) to enable/disable looping, and the open flag is checked to override that variable when needed.  I'm also planning to add a configuration option to set some maximum number of loops (in which case I can compute a 'correct' total length again).  I was merely hoping there was some "clean" way of handling inifinite looping.

Which reminds me, I still need to update my seek() implementation to take looping into account ^^