sfztools / sfizz

SFZ parser and synth c++ library, providing a JACK standalone client
https://sfz.tools/sfizz/
BSD 2-Clause "Simplified" License
418 stars 57 forks source link

Added status full loaded into FileData #1246

Closed KKQ-KKQ closed 8 months ago

KKQ-KKQ commented 9 months ago

PR 1/4 of #1236 Shared File Pool

Added FileData::Status::FullLoaded.

KKQ-KKQ commented 9 months ago

2 questions:

  • If we move to having a single background thread for loading, this logic and the atomics would get much easier, wouldn't it?

If we moved to having a single background thread for loading and having shared file pool, an instance have to wait until another instance finishes loading.

  • It seems we're so close to not needing the loadedFiles. The only issue I see is if someone calls setRamLoading(true), and then setRamLoading(false), which would erase the FullyLoaded states from before.

loadedFiles is for smaller files and for wave-oscillators and the samples in it should not be released even when preloadSize is changed. I think we needs the loadedFiles.

KKQ-KKQ commented 9 months ago

2 questions:

  • If we move to having a single background thread for loading, this logic and the atomics would get much easier, wouldn't it?

Oh do you mean finalizeSfzLoad() just queue loading? I think it might be more complex, but worth consider it.

KKQ-KKQ commented 9 months ago

I think the processes become more safe.

paulfd commented 9 months ago

Looks good, I'll try to stress test it a bit today or tomorrow thanks!

paulfd commented 8 months ago

@KKQ-KKQ I'm sorry I've been way too swamped at work. I'm merging this without extensive testing so you can proceed. I'll test out things as they come when I can...

すみません ! 🙇

KKQ-KKQ commented 8 months ago

@KKQ-KKQ I'm sorry I've been way too swamped at work. I'm merging this without extensive testing so you can proceed. I'll test out things as they come when I can...

すみません ! 🙇

No problem! Thank you!