303 lines
9.2 KiB
JavaScript
303 lines
9.2 KiB
JavaScript
"use strict";
|
||||
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|||
|
|
exports.UpdatePresets = UpdatePresets;
|
|||
|
|
const base_1 = require("@companion-module/base");
|
|||
|
|
function UpdatePresets(self) {
|
|||
|
|
const presets = {};
|
|||
|
|
// Helper to reference THIS instance’s variables in button text
|
|||
|
|
// Companion variable syntax uses the instance label.
|
|||
|
|
const L = self.label;
|
|||
|
|
// ----------------------------
|
|||
|
|
// STATUS / HEALTH
|
|||
|
|
// ----------------------------
|
|||
|
|
presets['status_connected'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Status',
|
|||
|
|
name: 'Connected (green) / Error (red)',
|
|||
|
|
style: {
|
|||
|
|
text: `Resi\n$(${L}:auth_status)`,
|
|||
|
|
size: '14',
|
|||
|
|
color: (0, base_1.combineRgb)(255, 255, 255),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(40, 40, 40),
|
|||
|
|
show_topbar: true,
|
|||
|
|
},
|
|||
|
|
steps: [],
|
|||
|
|
feedbacks: [
|
|||
|
|
{
|
|||
|
|
feedbackId: 'resi_connected',
|
|||
|
|
options: {},
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
feedbackId: 'resi_error',
|
|||
|
|
options: {},
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
};
|
|||
|
|
presets['status_player_active'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Status',
|
|||
|
|
name: 'Player Active',
|
|||
|
|
style: {
|
|||
|
|
text: `Player\n$(${L}:current_position)`,
|
|||
|
|
size: '14',
|
|||
|
|
color: (0, base_1.combineRgb)(255, 255, 255),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(40, 40, 40),
|
|||
|
|
show_topbar: true,
|
|||
|
|
},
|
|||
|
|
steps: [],
|
|||
|
|
feedbacks: [
|
|||
|
|
{
|
|||
|
|
feedbackId: 'player_active',
|
|||
|
|
options: {},
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
};
|
|||
|
|
presets['status_frozen'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Status',
|
|||
|
|
name: 'Playback Frozen Warning',
|
|||
|
|
style: {
|
|||
|
|
text: `FROZEN?\n$(${L}:current_position)`,
|
|||
|
|
size: '14',
|
|||
|
|
color: (0, base_1.combineRgb)(255, 255, 255),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(40, 40, 40),
|
|||
|
|
show_topbar: true,
|
|||
|
|
},
|
|||
|
|
steps: [],
|
|||
|
|
feedbacks: [
|
|||
|
|
{
|
|||
|
|
feedbackId: 'playback_frozen',
|
|||
|
|
options: {
|
|||
|
|
staleSeconds: 6,
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
};
|
|||
|
|
// ----------------------------
|
|||
|
|
// CUE DISPLAY (NO ACTIONS)
|
|||
|
|
// ----------------------------
|
|||
|
|
presets['cue_next_display'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Cues',
|
|||
|
|
name: 'Next Cue Display',
|
|||
|
|
style: {
|
|||
|
|
text: `NEXT:\n$(${L}:next_cue_name)\nT- $(${L}:next_cue_time_in_hms)`,
|
|||
|
|
size: '14',
|
|||
|
|
color: (0, base_1.combineRgb)(255, 255, 255),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(0, 0, 0),
|
|||
|
|
show_topbar: false,
|
|||
|
|
},
|
|||
|
|
steps: [],
|
|||
|
|
feedbacks: [
|
|||
|
|
{
|
|||
|
|
feedbackId: 'approaching_next_cue',
|
|||
|
|
options: { threshold: 30 },
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
};
|
|||
|
|
presets['cue_prev_display'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Cues',
|
|||
|
|
name: 'Previous Cue Display',
|
|||
|
|
style: {
|
|||
|
|
text: `PREV:\n$(${L}:prev_cue_name)\n+ $(${L}:prev_cue_time_ago_in_hms)`,
|
|||
|
|
size: '14',
|
|||
|
|
color: (0, base_1.combineRgb)(255, 255, 255),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(0, 0, 0),
|
|||
|
|
show_topbar: false,
|
|||
|
|
},
|
|||
|
|
steps: [],
|
|||
|
|
feedbacks: [],
|
|||
|
|
};
|
|||
|
|
// ----------------------------
|
|||
|
|
// MAINTENANCE / REFRESH
|
|||
|
|
// ----------------------------
|
|||
|
|
presets['refresh_profile'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Maintenance',
|
|||
|
|
name: 'Refresh Profile',
|
|||
|
|
style: {
|
|||
|
|
text: 'Refresh\nProfile',
|
|||
|
|
size: '18',
|
|||
|
|
color: (0, base_1.combineRgb)(255, 255, 255),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(60, 60, 60),
|
|||
|
|
show_topbar: false,
|
|||
|
|
},
|
|||
|
|
steps: [
|
|||
|
|
{
|
|||
|
|
down: [
|
|||
|
|
{
|
|||
|
|
actionId: 'refresh_profile',
|
|||
|
|
options: {},
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
up: [],
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
feedbacks: [
|
|||
|
|
{ feedbackId: 'resi_connected', options: {} },
|
|||
|
|
{ feedbackId: 'resi_error', options: {} },
|
|||
|
|
],
|
|||
|
|
};
|
|||
|
|
presets['refresh_lists'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Maintenance',
|
|||
|
|
name: 'Refresh Venues/Players',
|
|||
|
|
style: {
|
|||
|
|
text: 'Refresh\nLists',
|
|||
|
|
size: '18',
|
|||
|
|
color: (0, base_1.combineRgb)(255, 255, 255),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(60, 60, 60),
|
|||
|
|
show_topbar: false,
|
|||
|
|
},
|
|||
|
|
steps: [
|
|||
|
|
{
|
|||
|
|
down: [
|
|||
|
|
{
|
|||
|
|
actionId: 'refresh_lists',
|
|||
|
|
options: {},
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
up: [],
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
feedbacks: [
|
|||
|
|
{ feedbackId: 'resi_connected', options: {} },
|
|||
|
|
{ feedbackId: 'resi_error', options: {} },
|
|||
|
|
],
|
|||
|
|
};
|
|||
|
|
// ----------------------------
|
|||
|
|
// CUE ACTIONS
|
|||
|
|
// ----------------------------
|
|||
|
|
presets['add_cue_player'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Cues',
|
|||
|
|
name: 'Add Cue @ Player Position',
|
|||
|
|
style: {
|
|||
|
|
text: 'Add Cue\n@ Player',
|
|||
|
|
size: '18',
|
|||
|
|
color: (0, base_1.combineRgb)(0, 0, 0),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(180, 180, 180),
|
|||
|
|
show_topbar: false,
|
|||
|
|
},
|
|||
|
|
steps: [
|
|||
|
|
{
|
|||
|
|
down: [
|
|||
|
|
{
|
|||
|
|
actionId: 'add_cue_at_position',
|
|||
|
|
options: {
|
|||
|
|
name: 'Web Cue',
|
|||
|
|
privateCue: false,
|
|||
|
|
positionMode: 'player',
|
|||
|
|
customPosition: '00:00:00.000',
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
up: [],
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
feedbacks: [
|
|||
|
|
{ feedbackId: 'resi_connected', options: {} },
|
|||
|
|
{ feedbackId: 'resi_error', options: {} },
|
|||
|
|
],
|
|||
|
|
};
|
|||
|
|
presets['add_cue_custom'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Cues',
|
|||
|
|
name: 'Add Cue @ Custom Time',
|
|||
|
|
style: {
|
|||
|
|
text: 'Add Cue\n@ Custom',
|
|||
|
|
size: '18',
|
|||
|
|
color: (0, base_1.combineRgb)(0, 0, 0),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(180, 180, 180),
|
|||
|
|
show_topbar: false,
|
|||
|
|
},
|
|||
|
|
steps: [
|
|||
|
|
{
|
|||
|
|
down: [
|
|||
|
|
{
|
|||
|
|
actionId: 'add_cue_at_position',
|
|||
|
|
options: {
|
|||
|
|
// user can edit this preset, OR replace with a variable
|
|||
|
|
name: 'Custom Cue',
|
|||
|
|
privateCue: false,
|
|||
|
|
positionMode: 'custom',
|
|||
|
|
customPosition: '00:10:00.000',
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
up: [],
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
feedbacks: [
|
|||
|
|
{ feedbackId: 'resi_connected', options: {} },
|
|||
|
|
{ feedbackId: 'resi_error', options: {} },
|
|||
|
|
],
|
|||
|
|
};
|
|||
|
|
presets['lookup_cue'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Cues',
|
|||
|
|
name: 'Lookup Cue (stores in lookup_* vars)',
|
|||
|
|
style: {
|
|||
|
|
text: 'Lookup\nCue',
|
|||
|
|
size: '18',
|
|||
|
|
color: (0, base_1.combineRgb)(255, 255, 255),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(0, 110, 200),
|
|||
|
|
show_topbar: false,
|
|||
|
|
},
|
|||
|
|
steps: [
|
|||
|
|
{
|
|||
|
|
down: [
|
|||
|
|
{
|
|||
|
|
actionId: 'lookup_cue_by_name',
|
|||
|
|
options: {
|
|||
|
|
// user edits this preset to their cue name or uses variables
|
|||
|
|
cueName: 'sermon start',
|
|||
|
|
matchMode: 'exact',
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
up: [],
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
feedbacks: [
|
|||
|
|
{ feedbackId: 'resi_connected', options: {} },
|
|||
|
|
{ feedbackId: 'resi_error', options: {} },
|
|||
|
|
],
|
|||
|
|
};
|
|||
|
|
presets['delete_cue'] = {
|
|||
|
|
type: 'button',
|
|||
|
|
category: 'Resi • Cues',
|
|||
|
|
name: 'Delete Cue by Name',
|
|||
|
|
style: {
|
|||
|
|
text: 'DELETE\nCue',
|
|||
|
|
size: '18',
|
|||
|
|
color: (0, base_1.combineRgb)(255, 255, 255),
|
|||
|
|
bgcolor: (0, base_1.combineRgb)(140, 0, 0),
|
|||
|
|
show_topbar: false,
|
|||
|
|
},
|
|||
|
|
steps: [
|
|||
|
|
{
|
|||
|
|
down: [
|
|||
|
|
{
|
|||
|
|
actionId: 'delete_cue_by_name',
|
|||
|
|
options: {
|
|||
|
|
// user edits this preset to the cue they want to delete
|
|||
|
|
cueName: 'Companion Test',
|
|||
|
|
matchMode: 'exact',
|
|||
|
|
deleteMode: 'first',
|
|||
|
|
onlyMine: true,
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
up: [],
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
feedbacks: [
|
|||
|
|
{ feedbackId: 'resi_connected', options: {} },
|
|||
|
|
{ feedbackId: 'resi_error', options: {} },
|
|||
|
|
],
|
|||
|
|
};
|
|||
|
|
self.setPresetDefinitions(presets);
|
|||
|
|
}
|
|||
|
|
//# sourceMappingURL=presets.js.map
|