ScriptTree/JsLibs hier beschreiben...
Jslibs
Created Montag 13 Juli 2009
standalone JavaScript development runtime environment with general purpose native libraries http://code.google.com/p/jslibs/
pro:
- lots of bindings
- generic dll/so loader
con:
- source dev on win32: dos file format
- no autoconf: wants u to manual download/unpack js and nspr (and libpng ...)
- needs xulrunner-1.9.1 (fixable)
still does not compile !VA_ARGS macro probs
- many bindings incomplete
- bindings too low level, e.g.
http://code.google.com/p/jslibs/wiki/jsaudio ("example 1" at very bottom) "A simple ogg player"
LoadModule('jsio'); LoadModule('jsstd'); LoadModule('jssound'); LoadModule('jsaudio'); var decoder = new OggVorbisDecoder(new File('41_30secOgg-q0.ogg').Open(File.RDONLY)); var sourceId = Oal.GenSource(); var pcm; while ( pcm = decoder.Read(10000) ) { var bufferId = Oal.Buffer(pcm); Oal.SourceQueueBuffers(sourceId, bufferId); if ( Oal.GetSourceInteger(sourceId, Oal.SOURCE_STATE) == Oal.INITIAL ) Oal.PlaySource(sourceId); }; var totalTime = decoder.frames/decoder.rate; var currentTimeOffset = Oal.GetSourceReal(sourceId, Oal.SEC_OFFSET); Sleep( 1000 * (totalTime - currentTimeOffset) );
what to do with it?
- steal code from src/common
- steal jsio bindings
- their macros looks quite usable for us