-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
3 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
// ... verovio-proxy.js preceed | ||
|
||
//console.log(Module.getMemory()); | ||
|
||
// Check what to return - an instance, or the contructor method | ||
if (createInstance) { | ||
return new verovio.toolkit(); | ||
} | ||
else { | ||
return { toolkit:verovio.toolkit }; | ||
} | ||
} | ||
|
||
// Minimal function | ||
verovio.toolkit = function() { | ||
return init(0, true); | ||
} | ||
|
||
// Both exports | ||
module.exports = { toolkit:verovio.toolkit }; | ||
module.exports.init = init; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,2 @@ | ||
|
||
var verovio = verovio || {}; | ||
|
||
/* beginning of the init function that adjsut the memory (if required) and load the module */ | ||
|
||
init = function (memory, createInstance = false) { | ||
|
||
// If we ask for creating an instance are already have one, just call the contructor | ||
if (createInstance && verovio.ptr != undefined) { | ||
return new verovio.toolkit(); | ||
} | ||
|
||
var Module;if(typeof Module==="undefined")Module={}; | ||
if (memory > 0) { | ||
if (memory < 256) { | ||
console.warn("Memory setting ignore because it should be at least 256"); | ||
} | ||
else if (memory >= 1024) { | ||
console.warn("Memory setting ignored because it should be less than 1024"); | ||
} | ||
else { | ||
Module.TOTAL_MEMORY = 2*memory*1024*1024; | ||
Module.TOTAL_STACK = memory*1024*1024; | ||
console.info("Maxmimum memory increased to " + memory + "MB"); | ||
} | ||
} | ||
|
||
// The verovio-proxy.js follows... | ||
|