UNPKG

@joergmittaglawo/dmvconfig

Version:

DMV Configuration scripts for Lawo V__matrix Distributed Multiviewers.

118 lines (116 loc) 6.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Enums = exports.All = exports.LTCGeneratorAsNamedTableRow = exports.LTCGenerator = exports.GPSReceiverAsTableRow = exports.GPSReceiver = exports.lower = exports.lift = void 0; const VScript = require("vscript"); const _Audio = require("./Audio"); const _Time = require("./Time"); const _PTP = require("./PTP"); exports.lift = { LTCGenerator: (kwl, socket) => kwl ? (new LTCGenerator(new VScript.Subtree(socket, kwl))) : null, TimezoneOffset: (x, _) => { return x ? { hours: x[0], minutes: x[1] } : null; }, GPSReceiver: (kwl, socket) => kwl ? (new GPSReceiver(new VScript.Subtree(socket, kwl))) : null, GPSReceiverTimeOfDay: (x, _) => { return x ? { hours: x[0], minutes: x[1], seconds: x[2] } : null; }, GPSReceiverDate: (x, _) => { return x ? { year: x[0], month: x[1], day: x[2] } : null; } }; exports.lower = { LTCGenerator: (ref) => ref ? ref.raw.kwl : null, TimezoneOffset: (x) => x ? [x.hours, x.minutes] : null, GPSReceiver: (ref) => ref ? ref.raw.kwl : null, GPSReceiverTimeOfDay: (x) => x ? [x.hours, x.minutes, x.seconds] : null, GPSReceiverDate: (x) => x ? [x.year, x.month, x.day] : null }; class GPSReceiver { constructor(raw) { this.raw = raw; } get date() { return new VScript.rKeyword(this, "date", { lift: exports.lift.GPSReceiverDate, lower: exports.lower.GPSReceiverDate }); } get time_of_day() { return new VScript.rKeyword(this, "time_of_day", { lift: exports.lift.GPSReceiverTimeOfDay, lower: exports.lower.GPSReceiverTimeOfDay }); } get num_satellites() { return new VScript.rKeyword(this, "num_satellites"); } get used_satellites() { return new VScript.rKeyword(this, "used_satellites"); } get removed_satellites() { return new VScript.rKeyword(this, "removed_satellites"); } get ptp_traits() { return new _PTP.Traits(this.raw.find("ptp_traits")); } get output() { return new _Time.Source(this.raw.find("output")); } } exports.GPSReceiver = GPSReceiver; class GPSReceiverAsTableRow extends GPSReceiver { 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.GPSReceiverAsTableRow = GPSReceiverAsTableRow; class LTCGenerator { constructor(raw) { this.raw = raw; } get timezone() { return new VScript.duplexKeyword(this, "timezone"); } get custom_timezone_offset() { return new VScript.duplexKeyword(this, "custom_timezone_offset", { lift: exports.lift.TimezoneOffset, lower: exports.lower.TimezoneOffset }); } get frame_rate() { return new VScript.duplexKeyword(this, "frame_rate"); } /** * `UTC` (Universal Time, Coordinated) is the standard for wall clock time. It is the standard that all timezones are based on. UTC has leap seconds to account for differences in the Earth's rotational speed. *When in doubt, always use `UTC`* * `TAI` (International Atomic Time) is the time standard used by PTP. It is a linear time standard that does not have leap seconds. TAI is currently ahead of UTC by 37 seconds. */ get time_standard() { return new VScript.duplexKeyword(this, "time_standard"); } get reset_counter() { return new VScript.rKeyword(this, "reset_counter"); } get input() { return new VScript.duplexKeyword(this, "input", { lift: _Time.lift.Source, lower: _Time.lower.Source }); } get output() { return new _Audio.Essence(this.raw.find("output")); } } exports.LTCGenerator = LTCGenerator; class LTCGeneratorAsNamedTableRow extends LTCGenerator { constructor(raw_row, enclosing_table) { super(new VScript.Subtree(raw_row.socket, raw_row.kwl)); this.raw_row = raw_row; this.enclosing_table = enclosing_table; this.index = raw_row.index; } async rename(name, opts) { await this.raw_row.rename(name, opts); } async delete(opts) { await this.raw_row.delete(opts); } } exports.LTCGeneratorAsNamedTableRow = LTCGeneratorAsNamedTableRow; class All { constructor(raw) { this.raw = raw; } get gps_receivers() { return new VScript.StronglyTypedTable(new VScript.Table(this.raw.socket, this.raw.full_kwl("gps_receivers")), (row, enclosing_table) => new GPSReceiverAsTableRow(row, enclosing_table)); } get ltc_generators() { return new VScript.StronglyTypedNamedTable(new VScript.NamedTable(this.raw.socket, this.raw.full_kwl("ltc_generators")), (row, enclosing_table) => new LTCGeneratorAsNamedTableRow(row, enclosing_table)); } get ltc_slice() { return new _Audio.SignalSourceSlice(this.raw.find("ltc_slice")); } } exports.All = All; exports.Enums = { Timezone: ["UTC", "UserDefined", "UTC_W_01_00_Azores", "UTC_W_02_00_MidAtlantic", "UTC_W_03_00_BuenosAires", "UTC_W_04_00_Halifax", "UTC_W_05_00_NewYork", "UTC_W_06_00_Chicago", "UTC_W_07_00_Denver", "UTC_W_08_00_LosAngeles", "UTC_W_09_00_Alaska", "UTC_W_10_00_Hawaii", "UTC_W_11_00_MidwayIsland", "UTC_W_12_00_Kwaialein", "UTC_E_12_00_NewZealand", "UTC_E_11_00_SolomonIslands", "UTC_E_10_00_Guam", "UTC_E_09_00_Tokyo", "UTC_E_08_00_Beijing", "UTC_E_07_00_Bangkok", "UTC_E_06_00_Dhaka", "UTC_E_05_00_Islamabad", "UTC_E_04_00_AbuDhabi", "UTC_E_03_00_Moscow", "UTC_E_02_00_EasternEurope", "UTC_E_01_00_CentralEurope", "UTC_W_00_30", "UTC_W_01_30", "UTC_W_02_30", "UTC_W_03_30_Newfoundland", "UTC_W_04_30", "UTC_W_05_30", "UTC_W_06_30", "UTC_W_07_30", "UTC_W_08_30", "UTC_W_09_30_MarquesaIslands", "UTC_W_10_30", "UTC_W_11_30", "UTC_E_11_30_NorfolkIsland", "UTC_E_10_30_LordHoweIsland", "UTC_E_09_30_Darwin", "UTC_E_08_30", "UTC_E_07_30", "UTC_E_06_30_Rangoon", "UTC_E_05_30_Bombay", "UTC_E_04_30_Kabul", "UTC_E_03_30_Tehran", "UTC_E_02_30", "UTC_E_01_30", "UTC_E_00_30", "UTC_E_12_45_ChathamIsland"], TimecodeRate: ["f24", "f25", "f29_97", "f30"] };