Skip to content
Permalink
Browse files

toggle whether to display midi output selection on chunks

  • Loading branch information...
mmckegg committed Oct 15, 2018
1 parent 6b02912 commit cd497723359fcf29b3d7b4ee59e2f6689e8817d2
@@ -1,4 +1,5 @@
var h = require('lib/h')
var when = require('mutant/when')
var renderChunk = require('lib/widgets/chunk')
var renderRouting = require('lib/widgets/routing')
var renderParams = require('lib/widgets/params')
@@ -64,9 +65,11 @@ function renderExternalChromaticChunk (external) {
renderRouting(external)
])
]),
h('h1', 'Midi Output'),
h('section', [
renderMidiOutputOptions(external)
when(node.midiOutputEnabled, [
h('h1', 'Midi Output'),
h('section', [
renderMidiOutputOptions(external)
])
])
]
})
@@ -28,6 +28,7 @@ function ChromaticChunk (parentContext) {
slots: Slots(context),
inputs: Property([]),
outputs: Property(['output']),
midiOutputEnabled: Property(false),
params: KeyCollection(context),
selectedSlotId: Observ()
}, {merge: true})
@@ -38,6 +38,7 @@ function renderChromaticChunk (chunk) {
h('h1', 'Chunk Options'),
h('section.options', [
h('ParamList', [
ToggleButton(chunk.midiOutputEnabled, {title: 'Midi Output'}),
Select(nodeName, {
options: nodeOptions
}),
@@ -2,6 +2,13 @@ module.exports = {
name: 'MIDI Note',
node: 'source/midi-out',
group: 'sources',
spawn: function (context) {
// HACK: enable midi output on chunk when midi note source added
if (context.externalChunk && context.externalChunk.midiOutputEnabled) {
context.externalChunk.midiOutputEnabled.set(true)
}
return {}
},
object: require('./object'),
render: require('./view')
}
@@ -84,6 +84,7 @@ function MonoChromaticChunk (parentContext) {
slots: Slots(context),
inputs: Property([]),
outputs: Property(['output']),
midiOutputEnabled: Property(false),
params: KeyCollection(context),
selectedSlotId: Observ()
})
@@ -1,4 +1,6 @@
var h = require('lib/h')
var when = require('mutant/when')

var renderRouting = require('lib/widgets/routing')
var renderChunk = require('lib/widgets/chunk')
var renderParams = require('lib/widgets/params')
@@ -7,6 +9,7 @@ var ToggleButton = require('lib/params/toggle-button')
var FlagParam = require('lib/flag-param')

module.exports = function (external) {
var node = external.node
return renderChunk(external, {
volume: true,
external: true,
@@ -27,10 +30,11 @@ module.exports = function (external) {
renderRouting(external)
])
]),

h('h1', 'Midi Output'),
h('section', [
renderMidiOutputOptions(external)
when(node.midiOutputEnabled, [
h('h1', 'Midi Output'),
h('section', [
renderMidiOutputOptions(external)
])
])
]
})
@@ -16,6 +16,7 @@ function TriggersChunk (parentContext) {
inputs: Property([]),
outputs: Property([]),
params: KeyCollection(context),
midiOutputEnabled: Property(false),
selectedSlotId: Property()
})

@@ -23,9 +23,8 @@ function renderTriggersChunk (chunk) {
h('h1', 'Chunk Options'),
h('section.options', [
h('ParamList', [
h('div -block', [
h('div', ToggleButton(chunk.chokeAll, {title: 'Choke All'}))
])
ToggleButton(chunk.chokeAll, {title: 'Choke All'}),
ToggleButton(chunk.midiOutputEnabled, {title: 'Midi Output'})
])
]),
h('h1', 'Params'),

0 comments on commit cd49772

Please sign in to comment.
You can’t perform that action at this time.