klesun-productions / klesun-productions.github.io

MIDI song editor in a web page + soundfont player... and 100500 other misc web apps on my server
https://klesun.github.io/
10 stars 4 forks source link

Fix hack in SoundFontAdapter.ts #59

Closed klesun closed 8 years ago

klesun commented 8 years ago
var presets: IPreset[] = null;
var drumPreset: IDrumPreset = null;
$.getJSON(soundfontDirUrl + '/presets.json', (result) => presets = result);
$.getJSON(soundfontDirUrl + '/drumPreset.json', (result) => drumPreset = result);

As you may see, we are relying on fact nobody uses SoundFontAdapter first couple of seconds after page load.

But the nobody does use the adapter instantly on page load. The nobody's name is Handler.ts::handleHashChange().

Reproducing:

klesun commented 8 years ago

The solution i need - in fetchSample() if info not loaded - request same fetchSample() call when info loaded and return null

klesun commented 8 years ago

2957e04..1ee1b93