Skip to content

Commit

Permalink
bugfix for colors action
Browse files Browse the repository at this point in the history
  • Loading branch information
krocheck committed Nov 18, 2020
1 parent 07d3be1 commit bfa0997
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 102 deletions.
109 changes: 102 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var log;
* Companion instance class for the Blackmagic SmartView/SmartScope Monitors.
*
* @extends instance_skel
* @version 1.1.0
* @since 1.0.0
* @author Per Roine <[email protected]>
* @author Keith Rocheck <[email protected]>
Expand Down Expand Up @@ -72,6 +71,8 @@ class instance extends instance_skel {
{ action: 'satDown', group: 'Saturation', label: 'SATURATION\\nDOWN\\n\\n$(smart:_saturation)', }
];

this.setupFields();

this.actions(); // export actions
}

Expand Down Expand Up @@ -133,7 +134,7 @@ class instance extends instance_skel {
cmd = `${opt.mon}\nIdentify: true`;
break;
case 'border':
cmd = `${opt.mon}\nBorder: ${opt.col}`;
cmd = `${opt.mon}\nBorder: ${opt.val}`;
break;
case 'scopeFunc':
cmd = `${opt.mon}\nScopeMode: ${opt.val}`;
Expand Down Expand Up @@ -457,12 +458,106 @@ class instance extends instance_skel {
this.CHOICES_MONITOR = [{ id: 'MONITOR A:', label: 'Monitor A', preset: '', variable: 'mon_a_' }];
}

this.AUDIOCHANNEL_FIELD.choices = this.CHOICES_AUDIOCHANNELS;
this.COLOR_FIELD.choices = this.CHOICES_COLORS;
this.INPUT_FIELD.choices = this.CHOICES_INPUTS;
this.LUT_FIELD.choices = this.CHOICES_LUTS;
this.MONITOR_FIELD.choices = this.CHOICES_MONITOR;
this.SCOPETYPE_FIELD.choices = this.CHOICES_SCOPETYPE;
}

/**
* Set up the fields used in actions and feedbacks
*
* @access protected
* @since 1.1.2
*/
setupFields() {

this.BG_COLOR_FIELD = function(defaultColor) {
return {
type: 'colorpicker',
label: 'Background color',
id: 'bg',
default: defaultColor
};
};
this.FG_COLOR_FIELD = function(defaultColor) {
return {
type: 'colorpicker',
label: 'Foreground color',
id: 'fg',
default: defaultColor
};
};
this.AUDIOCHANNEL_FIELD = {
type: 'dropdown',
label: 'Channels',
id: 'val',
choices: this.CHOICES_AUDIOCHANNELS,
default: '0'
};
this.COLOR_FIELD = {
type: 'dropdown',
label: 'Color',
id: 'val',
choices: this.CHOICES_COLORS
};
this.DECREMENT_FIELD = {
type: 'number',
label: 'Decrement Amount (1-255)',
id: 'val',
min: 1,
max: 255,
default: 5,
required: true,
range: false
};
this.INCREMENT_FIELD = {
type: 'number',
label: 'Increment Amount (1-255)',
id: 'val',
min: 1,
max: 255,
default: 5,
required: true,
range: false
};
this.INPUT_FIELD = {
type: 'dropdown',
label: 'Input',
id: 'val',
choices: this.CHOICES_INPUTS,
default: 'SDI A'
};
this.LEVEL_FIELD = function(defaultLevel) {
return {
type: 'number',
label: 'Set the level 0-255',
id: 'val',
min: 0,
max: 255,
default: defaultLevel,
required: true,
range: true
};
};
this.LUT_FIELD = {
type: 'dropdown',
label: 'LUT',
id: 'val',
choices: this.CHOICES_LUTS,
default: 'NONE'
};
this.MONITOR_FIELD = {
type: 'dropdown',
label: 'Select Monitor',
id: 'mon',
choices: this.CHOICES_MONITOR,
default: 'MONITOR A:'
};
this.SCOPETYPE_FIELD = {
type: 'dropdown',
label: 'Function',
id: 'val',
choices: this.CHOICES_SCOPETYPE,
default: 'Picture'
};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bmd-smartview",
"version": "1.1.1",
"version": "1.1.2",
"api_version": "1.0.0",
"keywords": [
"Scope",
Expand Down
95 changes: 1 addition & 94 deletions setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ module.exports = {
{ id: '1', label: 'LUT 2' },
{ id: 'NONE', label: 'DISABLE' }
],
CHOICES_MONITOR: [
{ id: 'MONITOR A:', label: 'Monitor A', preset: 'MONITOR: A\\n', variable: 'mon_a_' },
{ id: 'MONITOR B:', label: 'Monitor B', preset: 'MONITOR: B\\n', variable: 'mon_b_' }
],
CHOICES_SCOPETYPE: [
{ id: 'Picture', label: 'Picture' },
{ id: 'WaveformLuma', label: 'Waveform' },
Expand All @@ -47,94 +43,5 @@ module.exports = {
{ id: 'Histogram', label: 'Histogram' },
{ id: 'AudioDbfs', label: 'Audio dBFS' },
{ id: 'AudioDbvu', label: 'Audio dBVU' }
],
BG_COLOR_FIELD: function(defaultColor) {
return {
type: 'colorpicker',
label: 'Background color',
id: 'bg',
default: defaultColor
};
},
FG_COLOR_FIELD: function(defaultColor) {
return {
type: 'colorpicker',
label: 'Foreground color',
id: 'fg',
default: defaultColor
};
},
AUDIOCHANNEL_FIELD: {
type: 'dropdown',
label: 'Channels',
id: 'val',
choices: this.CHOICES_AUDIOCHANNELS,
default: '0'
},
COLOR_FIELD: {
type: 'dropdown',
label: 'Color',
id: 'val',
choices: this.CHOICES_COLORS
},
DECREMENT_FIELD: {
type: 'number',
label: 'Decrement Amount (1-255)',
id: 'val',
min: 1,
max: 255,
default: 5,
required: true,
range: false
},
INCREMENT_FIELD: {
type: 'number',
label: 'Increment Amount (1-255)',
id: 'val',
min: 1,
max: 255,
default: 5,
required: true,
range: false
},
INPUT_FIELD: {
type: 'dropdown',
label: 'Input',
id: 'val',
choices: this.CHOICES_INPUTS,
default: 'SDI A'
},
LEVEL_FIELD: function(defaultLevel) {
return {
type: 'number',
label: 'Set the level 0-255',
id: 'val',
min: 0,
max: 255,
default: defaultLevel,
required: true,
range: true
};
},
LUT_FIELD: {
type: 'dropdown',
label: 'LUT',
id: 'val',
choices: this.CHOICES_LUTS,
default: 'NONE'
},
MONITOR_FIELD: {
type: 'dropdown',
label: 'Select Monitor',
id: 'mon',
choices: this.CHOICES_MONITOR,
default: 'MONITOR A:'
},
SCOPETYPE_FIELD: {
type: 'dropdown',
label: 'Function',
id: 'val',
choices: this.CHOICES_SCOPETYPE,
default: 'Picture'
}
]
}

0 comments on commit bfa0997

Please sign in to comment.