Skip to content

Commit

Permalink
Add a 'none' action for references
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Boberg <git@axelboberg.se>
  • Loading branch information
axelboberg committed Apr 18, 2024
1 parent d69c68b commit cd457e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions plugins/types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const PLAY_HANDLERS = {
}

switch (parseInt(item?.data?.playAction)) {
case types.REFERENCE_ACTION.none:
break
case types.REFERENCE_ACTION.stop:
bridge.items.stopItem(item?.data?.targetId)
break
Expand Down Expand Up @@ -71,6 +73,8 @@ const STOP_HANDLERS = {
}

switch (parseInt(item?.data?.stopAction)) {
case types.REFERENCE_ACTION.none:
break
case types.REFERENCE_ACTION.play:
bridge.items.playItem(item?.data?.targetId)
break
Expand Down
7 changes: 4 additions & 3 deletions plugins/types/lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const bridge = require('bridge')

const REFERENCE_ACTION = {
play: 0,
stop: 1
stop: 1,
none: 2
}
exports.REFERENCE_ACTION = REFERENCE_ACTION

Expand All @@ -19,14 +20,14 @@ function init (htmlPath) {
playAction: {
name: 'Play action',
type: 'enum',
enum: ['Play', 'Stop'],
enum: ['Play', 'Stop', 'None'],
default: REFERENCE_ACTION.play,
'ui.group': 'Reference'
},
stopAction: {
name: 'Stop action',
type: 'enum',
enum: ['Play', 'Stop'],
enum: ['Play', 'Stop', 'None'],
default: REFERENCE_ACTION.stop,
'ui.group': 'Reference'
},
Expand Down

0 comments on commit cd457e3

Please sign in to comment.