UNPKG

@joergmittaglawo/dmvconfig

Version:

DMV Configuration scripts for Lawo V__matrix Distributed Multiviewers.

138 lines (136 loc) 5.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Enums = exports.EssenceAsTableRow = exports.EssenceAsArrayRow = exports.Essence = exports.SignalSourceSliceAsArrayRow = exports.SignalSourceSlice = exports.lower = exports.lift = void 0; const VScript = require("vscript"); const _Time = require("./Time"); exports.lift = { Essence: (kwl, socket) => kwl ? (new Essence(new VScript.Subtree(socket, kwl))) : null, EssenceSignals: (kwl, socket) => kwl ? (new EssenceSignals(new VScript.Subtree(socket, kwl))) : null, SignalSourceSlice: (kwl, socket) => kwl ? (new SignalSourceSlice(new VScript.Subtree(socket, kwl))) : null, GainLevel: (x, _) => { return x ? { gain: x[0], phase_invert: x[1] } : null; }, FadeRequest: (x, _) => { return x ? { start: x[0], downto: x[1], upfrom: x[2], end: x[3], micro_epoch_index: x[4] } : null; } }; exports.lower = { Essence: (ref) => ref ? ref.raw.kwl : null, EssenceSignals: (ref) => ref ? ref.raw.kwl : null, SignalSourceSlice: (ref) => ref ? ref.raw.kwl : null, GainLevel: (x) => x ? [x.gain, x.phase_invert] : null, FadeRequest: (x) => x ? [x.start, x.downto, x.upfrom, x.end, x.micro_epoch_index] : null }; class SignalSourceSlice { constructor(raw) { this.raw = raw; } get alert_level() { return new VScript.rKeyword(this, "alert_level"); } get frequency() { return new VScript.rKeyword(this, "frequency"); } get peak_meter() { return new VScript.rKeyword(this, "peak_meter"); } get silence_status() { return new VScript.rKeyword(this, "silence_status"); } get not_present_status() { return new VScript.rKeyword(this, "not_present_status"); } get dt_node() { return new VScript.rKeyword(this, "dt_node"); } } exports.SignalSourceSlice = SignalSourceSlice; class SignalSourceSliceAsArrayRow extends SignalSourceSlice { constructor(st, index, parent) { super(st); this.index = index; this.parent = parent; } } exports.SignalSourceSliceAsArrayRow = SignalSourceSliceAsArrayRow; class EssenceSignals { constructor(raw) { this.raw = raw; } get enclosing_slice() { return new VScript.rKeyword(this, "enclosing_slice", { lift: exports.lift.SignalSourceSlice, lower: exports.lower.SignalSourceSlice }); } get index_within_slice() { return new VScript.rKeyword(this, "index_within_slice"); } get level() { return new VScript.rKeyword(this, "level", { lift: exports.lift.GainLevel, lower: exports.lower.GainLevel }); } /** if `start` < `downto` ≤ `upfrom` < `end`, this corresponds to a V-fade request fading down from `start` to `downto` and back up from `upfrom` to `end`. If `start` = `downto` = `upfrom` < `end`, the essence should be initially set up with zero amplitude and fade to full amplitude between `upfrom` and `end`; likewise, `start` < `downto` = `upfrom` = `end` should be initialized with full amplitude, fade down to zero amplitude between `start` and `downto` and remain there indefinitely. All free-running counter values are measured with respect to micro epoch #`micro_epoch_index`. */ get fade_request() { return new VScript.rKeyword(this, "fade_request", { lift: exports.lift.FadeRequest, lower: exports.lower.FadeRequest }); } } class EssenceSignalsAsTableRow extends EssenceSignals { constructor(raw_row, enclosing_table) { super(new VScript.Subtree(raw_row.socket, raw_row.kwl)); this.enclosing_table = enclosing_table; this.index = raw_row.index; } } class Essence { constructor(raw) { this.raw = raw; } get brief() { return new VScript.rKeyword(this, "brief"); } get sop_dt_node() { return new VScript.rKeyword(this, "sop_dt_node"); } get signals() { return new VScript.StronglyTypedTable(new VScript.Table(this.raw.socket, this.raw.full_kwl("signals")), (row, enclosing_table) => new EssenceSignalsAsTableRow(row, enclosing_table)); } /** some signal sources, such as RTP audio/video streams, include a well-defined offset to the PTP epoch (as seen by the sender). During processing, these 'media clocks' may shift (e.g., as signals pass through delay elements) or broaden into finite intervals (e.g., as audio channels at different offsets to the PTP epoch are combined into a single audio essence). Using the `media_clock` keyword, such changes are tracked explicitly and forwarded to audio/video transmitters. */ get media_clock() { return new _Time.Source(this.raw.find("media_clock")); } } exports.Essence = Essence; class EssenceAsArrayRow extends Essence { constructor(st, index, parent) { super(st); this.index = index; this.parent = parent; } } exports.EssenceAsArrayRow = EssenceAsArrayRow; class EssenceAsTableRow extends Essence { constructor(raw_row, enclosing_table) { super(new VScript.Subtree(raw_row.socket, raw_row.kwl)); this.enclosing_table = enclosing_table; this.index = raw_row.index; } } exports.EssenceAsTableRow = EssenceAsTableRow; exports.Enums = { Level: ["set_6dbfs", "set_18dbfs", "set_20dbfs"], Timing: ["synchronous_or_syntonous", "asynchronous"], Frequency: ["F48000", "F96000"], Format: ["AM824", "L24", "L16"], SignalStatus: ["NO_SIGNAL", "SILENCE", "SIGNAL"] };