@osbjs/osbjs
Version:
a minimalist osu! storyboarding framework
30 lines (29 loc) • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sample = void 0;
const Utils_1 = require("../Utils");
const Component_1 = require("./Component");
class Sample extends Component_1.Component {
/**
*
* @param startTime Time in milliseconds/timestamp that the sound should start playing.
* @param layer The layer you want the sound to be on.
* @param path Path to the audio file relative to the beatmap folder.
* @param volume Volume (1-100) of the sound file.
*/
constructor(startTime, layer, path, volume = 100) {
super();
this.name = 'Sprite';
this.startTime = typeof startTime == 'string' ? (0, Utils_1.parseOsuTimestamp)(startTime) : Math.round(startTime);
this.layer = layer;
this.path = path;
this.volume = volume;
}
getOsbString() {
return `Sample,${this.startTime},${this.layer},"${this.path}",${this.volume}\n`;
}
registerComponents() {
throw new Error('Cannot register any components to Sample.');
}
}
exports.Sample = Sample;