Created
February 21, 2013 10:50
-
-
Save coma/5003885 to your computer and use it in GitHub Desktop.
Update position event for https://github.com/TooTallNate/node-lame
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
if (ret == MPG123_NEW_FORMAT) { | |
var format = binding.mpg123_getformat(mh); | |
debug('new format!', format); | |
self.emit('format', format); | |
var positionTimeIntervalID = setInterval(function() { | |
var current = binding.mpg123_tellframe(mh); | |
var total = binding.mpg123_length(mh); | |
self.emit('update', current, total); | |
}, 0); | |
return read(); | |
} |
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
Handle<Value> node_mpg123_length (const Arguments& args) { | |
UNWRAP_MH; | |
return scope.Close(Number::New(mpg123_length(mh))); | |
} | |
NODE_SET_METHOD(target, "mpg123_length", node_mpg123_length); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment