Skip to content

Commit

Permalink
Add methods to enable displaying progress (deskjet#44)
Browse files Browse the repository at this point in the history
* current time

* add getTotalOrder and getTotalPatterns
  • Loading branch information
raurir authored Sep 19, 2022
1 parent 05349a0 commit 94b4c84
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions chiptune2.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ ChiptuneJsPlayer.prototype.getCurrentOrder = function() {
return libopenmpt._openmpt_module_get_current_order(this.currentPlayingNode.modulePtr);
}

ChiptuneJsPlayer.prototype.getCurrentTime = function () {
return libopenmpt._openmpt_module_get_position_seconds(this.currentPlayingNode.modulePtr);
};

ChiptuneJsPlayer.prototype.getTotalOrder = function () {
return libopenmpt._openmpt_module_get_num_orders(this.currentPlayingNode.modulePtr);
};

ChiptuneJsPlayer.prototype.getTotalPatterns = function () {
return libopenmpt._openmpt_module_get_num_patterns(this.currentPlayingNode.modulePtr);
};

ChiptuneJsPlayer.prototype.metadata = function() {
var data = {};
var keys = UTF8ToString(libopenmpt._openmpt_module_get_metadata_keys(this.currentPlayingNode.modulePtr)).split(';');
Expand Down

0 comments on commit 94b4c84

Please sign in to comment.