* wip
This commit is contained in:
parent
52524c774d
commit
f7267d38c6
|
|
@ -214,6 +214,9 @@
|
|||
|
||||
function afterShow() {
|
||||
sessionUtils.SessionPageEnter();
|
||||
|
||||
context.ConfigureTracksActions.vstScan();
|
||||
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
|
|
|
|||
|
|
@ -1052,6 +1052,10 @@
|
|||
function GetAutoStart() { return true; }
|
||||
function SaveSettings() {}
|
||||
|
||||
|
||||
function VSTScan(callback) {setTimeout(eval(callback+ "()"), 1000)}
|
||||
function hasVstHost() { return false;}
|
||||
|
||||
// Javascript Bridge seems to camel-case
|
||||
// Set the instance functions:
|
||||
this.AbortRecording = AbortRecording;
|
||||
|
|
@ -1315,6 +1319,8 @@
|
|||
this.StopNetworkTest = StopNetworkTest;
|
||||
this.log = log;
|
||||
this.getOperatingMode = getOperatingMode;
|
||||
this.VSTScan = VSTSCan;
|
||||
this.hasVstHost = hasVstHost;
|
||||
this.clientID = "devtester";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
context = window
|
||||
ConfigureTracksStore = @ConfigureTracksStore
|
||||
@ConfigureLiveTracksDialog = React.createClass({
|
||||
|
||||
mixins: [Reflux.listenTo(@ConfigureTracksStore,"onConfigureTracksChanged")]
|
||||
|
||||
onConfigureTracksChanged:(configureTracks) ->
|
||||
@setState({configureTracks: configureTracks})
|
||||
|
||||
getInitialState: () ->
|
||||
{configureTracks: null}
|
||||
|
||||
render: () ->
|
||||
|
||||
inputOneOptions = []
|
||||
inputTwoOptions = []
|
||||
|
||||
defaultSelectionOne = `<option value="">Select an input port for this track (required)</option>`
|
||||
defaultSelectionTwo = `<option value="">Select an input port for this track (optional)</option>`
|
||||
|
||||
inputOneOptions.push(defaultSelectionOne)
|
||||
inputTwoOptions.push(defaultSelectionTwo)
|
||||
|
||||
instruments = []
|
||||
for displayName, value of context.JK.server_to_client_instrument_map
|
||||
instruments.push(`<option value={value.server_id}>{displayName}</option>`)
|
||||
|
||||
if @state.configureTracks?
|
||||
for input in @state.configureTracks.musicPorts.inputs
|
||||
item = `<option value={input.id}>{input.name}</option>`
|
||||
inputOneOptions.push(item)
|
||||
inputTwoOptions.push(item)
|
||||
|
||||
`<div>
|
||||
<div className="track-type">
|
||||
<h3>Track Type</h3>
|
||||
<input type="checkbox" value="audio" name="track-type" />
|
||||
<input type="checkbox" value="midi" name="track-type"/>
|
||||
</div>
|
||||
|
||||
<div className="audio-input-ports">
|
||||
<h3>Audio Input Ports</h3>
|
||||
<p>Select one or two inputs ports to assign to this track. Note that if you assign a single input port, the app will automatically duplicate this port into a stereo track.</p>
|
||||
<select name="input-one">
|
||||
{inputOneOptions}
|
||||
</select>
|
||||
<select name="input-two">
|
||||
{inputTwoOptions}
|
||||
</select>
|
||||
</div>
|
||||
<div className="instrument-selection">
|
||||
<h3>Instrument</h3>
|
||||
<select name="instrument">
|
||||
{instruments}
|
||||
</select>
|
||||
</div>
|
||||
<div className="audio-effects">
|
||||
<h3>Audio Effects (optional)</h3>
|
||||
<select name="">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
componentDidMount: () ->
|
||||
$root = $(@getDOMNode())
|
||||
context.JK.checkbox($root.find('input[type="checkbox"]'))
|
||||
})
|
||||
|
|
@ -22,21 +22,78 @@ gearUtils = context.JK.GearUtils
|
|||
console.log("@state.configureTracks", @state.configureTracks)
|
||||
|
||||
liveTracks = []
|
||||
outputs = []
|
||||
|
||||
trackAssignments = @state.configureTracks?.trackAssignments
|
||||
|
||||
if trackAssignments
|
||||
|
||||
for track in trackAssignments.inputs.assigned
|
||||
for inputsForTrack in trackAssignments.inputs.assigned
|
||||
candidate = inputsForTrack[0]
|
||||
|
||||
inputs = []
|
||||
for input in inputsForTrack
|
||||
inputs.push(`<div className="live-input">{input.name}</div>`)
|
||||
|
||||
if !inputsForTrack.instrument_id?
|
||||
instrument = `<span className="none">?</span>`
|
||||
else
|
||||
instrument = `<span><img src={context.JK.getInstrumentIconMap24()[inputsForTrack.instrument_id].asset} /></span>`
|
||||
|
||||
liveTracks.push(
|
||||
`<div key={candidate.assignment} className="live-track">
|
||||
<div className="input-track-info"><span className="assignment">{candidate.assignment}:</span>{inputs}</div>
|
||||
<div className="plugin-info">None</div>
|
||||
<div className="plugin-instrument">{instrument}</div>
|
||||
<div className="live-track-actions">
|
||||
<a className="update-live-track" onClick={this.onUpdateLiveTrack.bind(this, inputsForTrack)}>update</a>
|
||||
<a className="delete-live-track" onClick={this.onDeleteLiveTrack.bind(this, inputsForTrack)}>delete</a>
|
||||
</div>
|
||||
</div>`)
|
||||
|
||||
`<div>
|
||||
for output, i in trackAssignments.outputs.assigned
|
||||
outputs.push(
|
||||
`<div key={output.id} className="output-track">
|
||||
<div className="output-track-info"><span className="assignment">{i + 1}:</span><div className="output">{output.name}</div></div>
|
||||
</div>`)
|
||||
|
||||
`<div className="ConfigureTracks">
|
||||
<select className="certified-audio-profile" style={{display:'none'}}></select>
|
||||
<h3>Session Audio Inputs (Live Performance Tracks)</h3>
|
||||
{liveTracks}
|
||||
|
||||
|
||||
<div className="inputs-view">
|
||||
<div>
|
||||
<h3 className="session-audio-inputs-header">Session Audio Inputs (Live Performance Tracks)</h3>
|
||||
<h3 className="plugin-header">Plugin</h3>
|
||||
<h3 className="instrument-header">Instrument</h3>
|
||||
</div>
|
||||
<div className="live-tracks">
|
||||
{liveTracks}
|
||||
</div>
|
||||
<a onClick={this.openLiveTrackDialog} className="button-orange">ADD A LIVE TRACK . . . </a>
|
||||
</div>
|
||||
<div className="outputs-view">
|
||||
<div>
|
||||
<h3 className="session-audio-outputs-header">Session Audio Outputs (Requires 2 Ports)</h3>
|
||||
<div className="output-tracks">
|
||||
{outputs}
|
||||
</div>
|
||||
<a onClick={this.openOutputTrackDialog} className="button-orange">UPDATE OUTPUTS . . . </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
onUpdateLiveTrack:(liveTrack, e) ->
|
||||
e.preventDefault()
|
||||
|
||||
onDeleteLiveTrack:(liveTrack, e) ->
|
||||
e.preventDefault()
|
||||
|
||||
openLiveTrackDialog: (e) ->
|
||||
e.preventDefault()
|
||||
|
||||
context.JK.app.layout.showDialog('configure-live-tracks-dialog')
|
||||
|
||||
openOutputTrackDialog: (e) ->
|
||||
e.preventDefault()
|
||||
|
||||
context.JK.app.layout.app.showDialog('configure-output-tracks-dialog')
|
||||
})
|
||||
|
|
@ -3,4 +3,6 @@ context = window
|
|||
@ConfigureTracksActions = Reflux.createActions({
|
||||
reset: {}
|
||||
trySave: {}
|
||||
vstScan: {}
|
||||
vstScanComplete: {}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -12,9 +12,11 @@ gearUtils = context.JK.GearUtils
|
|||
listenables: ConfigureTracksActions
|
||||
|
||||
musicPorts: {inputs:[], outputs:[]}
|
||||
trackNumber: null
|
||||
editingTrack: null
|
||||
|
||||
|
||||
init: () ->
|
||||
this.listenTo(context.AppStore, this.onAppInit);
|
||||
|
||||
onAppInit: (@app) ->
|
||||
|
||||
|
|
@ -29,8 +31,19 @@ gearUtils = context.JK.GearUtils
|
|||
|
||||
trySave: () ->
|
||||
|
||||
onVstScan: () ->
|
||||
hasVst = context.jamClient.hasVstHost()
|
||||
logger.debug("hasVst", hasVst)
|
||||
if hasVst
|
||||
logger.debug("vstScan starting")
|
||||
result = context.jamClient.VSTScan()
|
||||
logger.debug("vstScan completed", result)
|
||||
|
||||
|
||||
onVstScanComplete:() ->
|
||||
|
||||
changed: () ->
|
||||
@item = {musicPorts: @musicPorts, trackAssignments: @trackAssignments}
|
||||
@item = {musicPorts: @musicPorts, trackAssignments: @trackAssignments, trackNumber: @trackNumber, editingTrack: @editingTrack}
|
||||
|
||||
@trigger(@item)
|
||||
|
||||
|
|
@ -39,9 +52,11 @@ gearUtils = context.JK.GearUtils
|
|||
# basically, if an input channel isn't in there, it's not going to be displayed
|
||||
@musicPorts = context.jamClient.FTUEGetChannels()
|
||||
|
||||
# let's populate this bad boy
|
||||
@trackAssignments = {inputs: {unassigned:[], assigned:[], chat:[]}, outputs: {unassigned:[], assigned: []}}
|
||||
|
||||
for input in @musicPorts.inputs
|
||||
if input.assigment == ASSIGNMENT.UNASSIGNED
|
||||
if input.assignment == ASSIGNMENT.UNASSIGNED
|
||||
@trackAssignments.inputs.unassigned.push(input)
|
||||
else if input.assignment == ASSIGNMENT.CHAT
|
||||
@trackAssignments.inputs.chat.push(input)
|
||||
|
|
@ -49,18 +64,42 @@ gearUtils = context.JK.GearUtils
|
|||
# make sure this assignment isn't already preset (you can have multiple inputs per 'track slot')
|
||||
found = false
|
||||
for assigned in @trackAssignments.inputs.assigned
|
||||
if assigned[0].assignment == input.assignment
|
||||
if assigned.assignment == input.assignment
|
||||
assigned.push(input)
|
||||
found = true
|
||||
|
||||
if !found
|
||||
@trackAssignments.inputs.assigned.push([input])
|
||||
for output in @musiPorts.outputs
|
||||
initial = [input]
|
||||
initial.assignment = input.assignment # store the assignment on the array itself, so we don't have to check inside the array for an input's assignment (which will all be the same)
|
||||
@trackAssignments.inputs.assigned.push(initial)
|
||||
for output in @musicPorts.outputs
|
||||
if output.assignment == ASSIGNMENT.OUTPUT
|
||||
@trackAssignments.outputs.assigned.push(output)
|
||||
else
|
||||
@trackAssignments.outputs.unassigned.push(output)
|
||||
|
||||
@loadTrackInstruments(forceInputsToUnassign)
|
||||
@changed()
|
||||
|
||||
loadTrackInstruments: (forceInputsToUnassign) ->
|
||||
for inputsForTrack in @trackAssignments.inputs.assigned
|
||||
clientInstrument = context.jamClient.TrackGetInstrument(inputsForTrack[0].assignment)
|
||||
|
||||
instrument = context.JK.client_to_server_instrument_map[clientInstrument];
|
||||
|
||||
inputsForTrack.instrument_id = instrument?.server_id
|
||||
|
||||
openLiveTrackDialog: (trackNumber) ->
|
||||
@trackNumber = trackNumber
|
||||
|
||||
@editingTrack = null
|
||||
for inputsForTrack in @trackAssignments.inputs.assigned
|
||||
if inputsForTrack.assignment == trackNumber
|
||||
@editingTrack = inputsForTrack
|
||||
break
|
||||
|
||||
@changed()
|
||||
|
||||
@app.layout.showDialog('configure-live-tracks-dialog')
|
||||
}
|
||||
)
|
||||
|
|
@ -733,6 +733,10 @@
|
|||
return date.toLocaleTimeString();
|
||||
}
|
||||
|
||||
context.JK.iconMapBase = function() {
|
||||
return icon_map_base
|
||||
}
|
||||
|
||||
context.JK.formatUtcTime = function(date, change) {
|
||||
if (change) {
|
||||
date.setMinutes(Math.ceil(date.getMinutes() / 30) * 30);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,126 @@
|
|||
@import "client/common";
|
||||
|
||||
.ConfigureTracks {
|
||||
|
||||
.inputs-view {
|
||||
border-width:1px 0;
|
||||
border-color:$ColorText;
|
||||
border-style:solid;
|
||||
padding:20px 0;
|
||||
height:220px;
|
||||
|
||||
.live-tracks {
|
||||
height:150px;
|
||||
overflow:auto;
|
||||
a {
|
||||
margin-left:3px;
|
||||
}
|
||||
}
|
||||
|
||||
.live-input {
|
||||
display:inline-block;
|
||||
}
|
||||
.live-track {
|
||||
margin-bottom:20px;
|
||||
}
|
||||
|
||||
a.delete-live-track {
|
||||
margin-left:20px;
|
||||
}
|
||||
.assignment {
|
||||
display:inline-block;
|
||||
width:20px;
|
||||
}
|
||||
|
||||
.input-track-info {
|
||||
@include border_box_sizing;
|
||||
width:60%;
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
.plugin-info {
|
||||
@include border_box_sizing;
|
||||
width:30%;
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
.plugin-instrument {
|
||||
@include border_box_sizing;
|
||||
width:10%;
|
||||
display:inline-block;
|
||||
text-align:center;
|
||||
|
||||
img {
|
||||
vertical-align:middle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.outputs-view {
|
||||
border-width:0 0 1px;
|
||||
border-color:$ColorText;
|
||||
border-style:solid;
|
||||
padding:20px 0;
|
||||
|
||||
.assignment {
|
||||
display:inline-block;
|
||||
width:20px;
|
||||
}
|
||||
|
||||
|
||||
.output-tracks {
|
||||
height:73px;
|
||||
overflow:auto;
|
||||
a {
|
||||
margin-left:3px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.output-track {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.output-track-info {
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
.output {
|
||||
display:inline-block;
|
||||
margin-bottom:0 !important;
|
||||
}
|
||||
}
|
||||
h3 {
|
||||
display:inline-block;
|
||||
font-size:14px;
|
||||
margin:0 0 20px;
|
||||
@include border_box_sizing;
|
||||
&.session-audio-inputs-header {
|
||||
color:white;
|
||||
font-weight:bold;
|
||||
width:60%;
|
||||
}
|
||||
|
||||
&.session-audio-outputs-header {
|
||||
color:white;
|
||||
font-weight:bold;
|
||||
width:60%;
|
||||
}
|
||||
|
||||
&.plugin-header {
|
||||
width:30%;
|
||||
}
|
||||
&.instrument-header {
|
||||
width:10%;
|
||||
text-align:center;
|
||||
}
|
||||
}
|
||||
.live-track-actions {
|
||||
display:block;
|
||||
padding-left:30px;
|
||||
margin-top:10px;
|
||||
a {
|
||||
font-size:12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
@import "client/common";
|
||||
|
||||
#configure-live-tracks-dialog {
|
||||
width: 800px;
|
||||
|
||||
.track-type {
|
||||
width:100%;
|
||||
@include border_box_sizing;
|
||||
}
|
||||
.audio-input-ports {
|
||||
width:50%;
|
||||
@include border_box_sizing;
|
||||
float:left;
|
||||
}
|
||||
.instrument-selection {
|
||||
width:50%;
|
||||
@include border_box_sizing;
|
||||
float:left;
|
||||
}
|
||||
.audio-effects {
|
||||
width:50%;
|
||||
@include border_box_sizing;
|
||||
float:left;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
.dialog.dialog-overlay-sm.top-parent layout='dialog' layout-id='configure-live-tracks-dialog' id='configure-live-tracks-dialog'
|
||||
.content-head
|
||||
= image_tag "content/icon_add.png", {:height => 19, :width => 19, :class => 'content-icon'}
|
||||
h1 add live track
|
||||
.dialog-inner
|
||||
= react_component 'ConfigureLiveTracksDialog', {}
|
||||
|
|
@ -44,3 +44,4 @@
|
|||
= render 'dialogs/recordingSelectorDialog'
|
||||
= render 'dialogs/soundCloudPlayerDialog'
|
||||
= render 'dialogs/deleteVideoConfirmDialog'
|
||||
= render 'dialogs/configureLiveTracksDialog'
|
||||
Loading…
Reference in New Issue