mmontag / chip-player-js

Web-based music player for a variety of video game and chiptune music formats.
https://chiptune.app
GNU General Public License v3.0
324 stars 17 forks source link

Repeat one not working for local files #148

Closed whc2001 closed 1 month ago

whc2001 commented 4 months ago

The repeat one function works fine for the built-in online library. However when I open a local file by drag-and-drop, the file is closed instead of rewinded after playing once. Is this designed behaviour?

whc2001 commented 4 months ago

It seems like repeat one function is based on the directory context:

https://github.com/mmontag/chip-player-js/blob/ca5ff5d0d835d8a428f5f2d08d8b842153f6ab20/src/Sequencer.js#L134-L137

https://github.com/mmontag/chip-player-js/blob/ca5ff5d0d835d8a428f5f2d08d8b842153f6ab20/src/Sequencer.js#L116-L118

However, when opening local file, there is no context to say:

https://github.com/mmontag/chip-player-js/blob/ca5ff5d0d835d8a428f5f2d08d8b842153f6ab20/src/Sequencer.js#L235-L238

I'd like to try to fix, but I can't figure out how to run this project locally.

zaphod77 commented 3 months ago

the issue here is that with drag and drop files they literally vanish when they reach the end, and thus they can't repeat.

mmontag commented 1 month ago

I added a persistent Local Files tab and rewrote this in the process - now dropped files get their own play context, so repeat-one should work!