53 lines
1.2 KiB
JavaScript
53 lines
1.2 KiB
JavaScript
"use-strict";
|
|
const { fromConstToPascal } = require("./util.js")
|
|
|
|
/**
|
|
* @public
|
|
* @readonly
|
|
*/
|
|
const BMiscInfo = {
|
|
"EXPLICIT": 0b1,
|
|
"SPLASH_SONG": 0b10,
|
|
"NIGGERS_SONG": 0b100,
|
|
"AMOGUS_SONG": 0b1000,
|
|
"METADATA_PREFER_ID": 0b10000,
|
|
"ALT_MEDIA": 0b100000
|
|
}
|
|
|
|
/**
|
|
* @public
|
|
* @constructor
|
|
* @params {string|undefined} title
|
|
* @params {string|undefined} artist
|
|
* @params {URL|string|undefined} [href] href
|
|
* @params {string} [extra] extra Playback effects. i.e: Pitch, speed
|
|
* @returns {RadioMetadata}
|
|
*/
|
|
const RadioMiscInfo = function (value) {
|
|
this.miscInfo = value || 0
|
|
return this
|
|
}
|
|
|
|
/**
|
|
* @public
|
|
* @params {number|undefined} value
|
|
* @returns {RadioPlaybackInfo}
|
|
*/
|
|
RadioMiscInfo.new = value => new RadioMiscInfo(value)
|
|
|
|
/**
|
|
* @public
|
|
* @returns {number|undefined}
|
|
*/
|
|
RadioMiscInfo.prototype.serialize = function () { return this.miscInfo || undefined; }
|
|
|
|
for (const key in BMiscInfo) {
|
|
RadioMiscInfo.prototype[`b${fromConstToPascal(key)}`] = function () {
|
|
//this.miscInfo = (this.miscInfo || 0) | BMiscInfo[key]
|
|
this.miscInfo |= BMiscInfo[key]
|
|
return this
|
|
}
|
|
}
|
|
|
|
module.exports = { RadioMiscInfo, BMiscInfo }
|