diff --git a/web/app/assets/javascripts/dialog/configureTrackDialog.js b/web/app/assets/javascripts/dialog/configureTrackDialog.js index 17989b205..47435f87e 100644 --- a/web/app/assets/javascripts/dialog/configureTrackDialog.js +++ b/web/app/assets/javascripts/dialog/configureTrackDialog.js @@ -25,6 +25,7 @@ var voiceChatHelper = null; var profiles = null; var currentProfile = null; + var enableVstTimeout = null; var configure_audio_instructions = { @@ -208,10 +209,34 @@ } window.ConfigureTracksActions.reset(false); + if(!window.SessionStore.inSession()) { + delayEnableVst() + } + else { + logger.debug("in a session, so no delayEnableVst()"); + } voiceChatHelper.reset(); voiceChatHelper.beforeShow(); } + function delayEnableVst() { + if (enableVstTimeout) { + clearTimeout(enableVstTimeout) + } + enableVstTimeout = setTimeout(function() { enableVst() }, 5000) + } + + function enableVst () { + enableVstTimeout = null + + if (app.layout.isDialogShowing('configure-tracks')) { + ConfigureTracksActions.enableVst() + } + else { + logger.debug("no longer in configure tracks dialog; not enabling VSTs at this time") + } + } + function afterShow() { sessionUtils.SessionPageEnter(); diff --git a/web/app/assets/javascripts/fakeJamClient.js b/web/app/assets/javascripts/fakeJamClient.js index 8b1b8477a..7acd44450 100644 --- a/web/app/assets/javascripts/fakeJamClient.js +++ b/web/app/assets/javascripts/fakeJamClient.js @@ -1053,6 +1053,7 @@ function SaveSettings() {} + function VSTLoad() {} function VSTScan(callback) {setTimeout(eval(callback+ "()"), 1000)} function hasVstHost() { return false;} function getPluginList() { return {vsts:[]} } @@ -1325,6 +1326,7 @@ this.StopNetworkTest = StopNetworkTest; this.log = log; this.getOperatingMode = getOperatingMode; + this.VSTLoad = VSTLoad; this.VSTScan = VSTScan; this.hasVstHost = hasVstHost; this.getPluginList = getPluginList; diff --git a/web/app/assets/javascripts/jquery.manageVsts.js b/web/app/assets/javascripts/jquery.manageVsts.js index a14cec2e1..6a7023cf7 100644 --- a/web/app/assets/javascripts/jquery.manageVsts.js +++ b/web/app/assets/javascripts/jquery.manageVsts.js @@ -48,7 +48,7 @@ cssClass: 'manage-vsts-popup', spikeGirth:0, spikeLength:0, - width:190, + width:250, closeWhenOthersOpen: true, offsetParent: $parent.closest('.dialog'), positions:['bottom'], diff --git a/web/app/assets/javascripts/layout.js b/web/app/assets/javascripts/layout.js index fd39f6b9f..df9772d01 100644 --- a/web/app/assets/javascripts/layout.js +++ b/web/app/assets/javascripts/layout.js @@ -618,6 +618,7 @@ // if string passed, see if dialog is showing (even if buried) of a given name function isDialogShowing() { if(arguments.length == 1) { + console.log("what?", arguments[0]) // user passed in dialog id var dialogId = arguments[0]; context._.each(openDialogs, function(dialog) { diff --git a/web/app/assets/javascripts/react-components/ConfigureLiveTracksDialog.js.jsx.coffee b/web/app/assets/javascripts/react-components/ConfigureLiveTracksDialog.js.jsx.coffee index 3329591dd..a38d9e7da 100644 --- a/web/app/assets/javascripts/react-components/ConfigureLiveTracksDialog.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/ConfigureLiveTracksDialog.js.jsx.coffee @@ -60,7 +60,10 @@ ConfigureTracksStore = @ConfigureTracksStore inputTwoValue = @state.configureTracks.editingTrack[1].id instrumentDisabled = @state.configureTracks.editingTrack.length == 0 - vstDisabled = @state.configureTracks.editingTrack.length == 0 + vstDisabled = @state.configureTracks.editingTrack.length == 0 || @state.configureTracks.unscanned + + if @state.configureTracks.unscanned + initialScan = `SCAN` for input in @state.configureTracks.musicPorts.inputs @@ -84,7 +87,7 @@ ConfigureTracksStore = @ConfigureTracksStore for plugin in @state.configureTracks.vstPluginList.vsts - if plugin.isInstrument == false && plugin.category == 'Effect' + if plugin.isInstrument == false vsts.push(``) else if plugin.category == 'NONE' vsts.push(``) @@ -112,7 +115,7 @@ ConfigureTracksStore = @ConfigureTracksStore
-

Audio Effects (optional)

+

Audio Effects (optional) {initialScan}

@@ -211,6 +214,10 @@ ConfigureTracksStore = @ConfigureTracksStore else cancelBtn = `CANCEL` + if !@state.configureTracks?.unscanned + scanHelp = `Don't see your plug-in in the list above?` + + `
@@ -253,6 +260,7 @@ ConfigureTracksStore = @ConfigureTracksStore ConfigureTracksActions.associateInputsWithTrack(audioInput1, audioInput2) + vstsChanged: (e) -> $root = $(@getDOMNode()) $select = $root.find('select.vsts') @@ -366,12 +374,22 @@ ConfigureTracksStore = @ConfigureTracksStore ConfigureTracksActions.desiredTrackType(value) #@setState({trackType: value}) + initialScan: (e) -> + e.preventDefault() + ConfigureTracksActions.vstScan() + + dontSeePlugin: (e) -> + e.preventDefault() + context.JK.popExternalLink('https://jamkazam.desk.com/customer/portal/articles/2252557-adding-a-scan-folder-path-for-plugins') + vstOperation: (e, data) -> if data.vstOperation == 'scan' ConfigureTracksActions.vstScan() else if data.vstOperation == 'clear' ConfigureTracksActions.clearVsts() + else if data.vstOperation == 'manage' + ConfigureTracksActions.manageVsts() manageAudioPlugins: (e) -> e.preventDefault() diff --git a/web/app/assets/javascripts/react-components/ConfigureTracks.js.jsx.coffee b/web/app/assets/javascripts/react-components/ConfigureTracks.js.jsx.coffee index 24cd6a140..0dc06875b 100644 --- a/web/app/assets/javascripts/react-components/ConfigureTracks.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/ConfigureTracks.js.jsx.coffee @@ -41,7 +41,7 @@ gearUtils = context.JK.GearUtils trackTypeLabel = 'AUDIO' vstName = 'None' - if inputsForTrack.vst? && inputsForTrack.vst != 'NONE' + if inputsForTrack.vst? && inputsForTrack.vst.name != 'NONE' vstName = "#{inputsForTrack.vst.name} by #{inputsForTrack.vst.manuf}" liveTracks.push( diff --git a/web/app/assets/javascripts/react-components/ManageVstsDialog.js.jsx.coffee b/web/app/assets/javascripts/react-components/ManageVstsDialog.js.jsx.coffee new file mode 100644 index 000000000..508fb203c --- /dev/null +++ b/web/app/assets/javascripts/react-components/ManageVstsDialog.js.jsx.coffee @@ -0,0 +1,88 @@ +context = window +ConfigureTracksStore = @ConfigureTracksStore +ConfigureTracksActions = @ConfigureTracksActions +@ManageVstsDialog = React.createClass({ + + mixins: [Reflux.listenTo(@ConfigureTracksStore,"onConfigureTracksChanged"), Reflux.listenTo(@AppStore, "onAppInit")] + + onConfigureTracksChanged:(configureTracks) -> + @setState({configureTracks: configureTracks}) + + onAppInit: (@app) -> + + getInitialState: () -> + {configureTracks: null} + + render: () -> + + if @state.configureTracks? + action = 'CLOSE' + + paths = [] + for path in @state.configureTracks.scanPaths.paths + if path.type == "VST" + for vstPath in path.paths + + paths.push(`
{vstPath}
delete
`) + + contents = `
+ + + + + + + + + {paths} + +
PATH
` + + `
+
+ +

manage plug-in scan folders

+
+
+

+

+ If a scan is not finding the VST or AU plugin you want to use, it’s likely that we aren’t scanning the location where the plugin is installed. Click the ADD SCAN FOLDER button below, and navigate to the folder where the plugin is installed to add that location to the scan list. +

+ + {contents} + + +
+
` + + inputChanged: (e) -> + $root = $(@getDOMNode()) + + deletePath: (path, e) -> + e.preventDefault() + + ConfigureTracksActions.removeSearchPath(path) + + selectVSTDirectory: (e) -> + e.preventDefault() + + ConfigureTracksActions.selectVSTDirectory() + + doClose: (e) -> + e.preventDefault() + + @app.layout.closeDialog('manage-vsts-dialog', false) + + componentDidMount: () -> + $root = $(@getDOMNode()) + + componentWillUpdate: () -> + @ignoreICheck = true + $root = $(@getDOMNode()) + + componentDidUpdate: () -> + $root = $(@getDOMNode()) +}) \ No newline at end of file diff --git a/web/app/assets/javascripts/react-components/actions/ConfigureTracksActions.js.coffee b/web/app/assets/javascripts/react-components/actions/ConfigureTracksActions.js.coffee index 7b5b3aa2d..15559c5d9 100644 --- a/web/app/assets/javascripts/react-components/actions/ConfigureTracksActions.js.coffee +++ b/web/app/assets/javascripts/react-components/actions/ConfigureTracksActions.js.coffee @@ -20,4 +20,9 @@ context = window associateMIDIWithTrack: {} desiredTrackType: {} vstChanged: {} + manageVsts: {} + enableVst: {} + addSearchPath: {} + removeSearchPath: {} + selectVSTDirectory: {} }) diff --git a/web/app/assets/javascripts/react-components/mixins/SessionMyTracksMixin.js.coffee b/web/app/assets/javascripts/react-components/mixins/SessionMyTracksMixin.js.coffee index 7fc97a850..73fed532f 100644 --- a/web/app/assets/javascripts/react-components/mixins/SessionMyTracksMixin.js.coffee +++ b/web/app/assets/javascripts/react-components/mixins/SessionMyTracksMixin.js.coffee @@ -62,7 +62,6 @@ context = window else trackAssignment = mixerData.oppositeMixer?.track - console.log("checking associations", @configureTracks.vstTrackAssignments.vsts, mixerData.mixer) for vst in @configureTracks.vstTrackAssignments.vsts if vst.track == trackAssignment - 1 && vst.name != 'NONE' logger.debug("found VST on track", vst, track) diff --git a/web/app/assets/javascripts/react-components/stores/ConfigureTracksStore.js.coffee b/web/app/assets/javascripts/react-components/stores/ConfigureTracksStore.js.coffee index b3c2b23a0..132ee871c 100644 --- a/web/app/assets/javascripts/react-components/stores/ConfigureTracksStore.js.coffee +++ b/web/app/assets/javascripts/react-components/stores/ConfigureTracksStore.js.coffee @@ -6,6 +6,8 @@ VOICE_CHAT = context.JK.VOICE_CHAT MAX_TRACKS = context.JK.MAX_TRACKS MAX_OUTPUTS = context.JK.MAX_OUTPUTS gearUtils = context.JK.GearUtils +AUDIO_UNIT_TYPE_ID = 0 +VST_TYPE_ID = 1 ### @@ -18,6 +20,9 @@ void VSTShowHideGui(bool show,const QString& trackId); void VST_ScanForMidiDevices(); QVariantMap VST_GetMidiDeviceList(); bool VST_EnableMidiForTrack(const QString& trackId, bool enableMidi, int midiDeviceIndex); +QVariantMap listSearchPaths(); +void addSearchPath(int typeId, QString pathToAdd); +void removeSearchPath(int typeId, QString pathToRemove); ### @ConfigureTracksStore = Reflux.createStore( @@ -31,8 +36,10 @@ bool VST_EnableMidiForTrack(const QString& trackId, bool enableMidi, int midiDev vstTrackAssignments: {vsts: []} attachedMidiDevices: {midiDevices: []} midiTrackAssignments: {tracks: []} + scanPaths: {paths:[]} scanningVsts: false trackType: 'audio' + hasVst: true init: () -> this.listenTo(context.AppStore, this.onAppInit) @@ -55,12 +62,25 @@ bool VST_EnableMidiForTrack(const QString& trackId, bool enableMidi, int midiDev @loadChannels() @loadTrackInstruments() - if force || context.jamClient.hasVstAssignment() - @performVstScan() - @performMidiScan() + #if force || context.jamClient.hasVstAssignment() + # @performVstScan() + + @listVsts() + @performMidiScan() + @listPaths() @changed() + onEnableVst: () -> + logger.debug("enabling VSTs") + context.jamClient.VSTLoad() + + setTimeout((() => + @listVsts() + + @changed() + ), 250) + onTrySave: () -> logger.debug("ConfigureTracksStore:trySave") @trySave() @@ -73,11 +93,12 @@ bool VST_EnableMidiForTrack(const QString& trackId, bool enableMidi, int midiDev @changed() performVstScan: (sendChanged) -> - @hasVst = gon.global.vst_enabled & context.jamClient.hasVstHost() + #@hasVst = gon.global.vst_enabled & context.jamClient.hasVstHost() logger.debug("hasVst", @hasVst) if @hasVst logger.debug("vstScan starting") @scanningVsts = true + @scannedBefore = true result = context.jamClient.VSTScan("window.ConfigureTracksStore.onVstScanComplete") onClearVsts: () -> @@ -89,9 +110,13 @@ bool VST_EnableMidiForTrack(const QString& trackId, bool enableMidi, int midiDev @changed() ), 250) + onManageVsts:() -> + logger.debug("manage vst selected") + @app.layout.showDialog('manage-vsts-dialog') + onVstScanComplete: () -> # XXX must wait a long time to get track assignments after scan/ - console.log("vst scan complete") + logger.debug("vst scan complete") @scanningVsts = false setTimeout((() => @listVsts() @@ -107,6 +132,34 @@ bool VST_EnableMidiForTrack(const QString& trackId, bool enableMidi, int midiDev @changed() ), 0) + listPaths: () -> + @scanPaths = context.jamClient.VSTListSearchPaths() + + onAddSearchPath: (path) -> + logger.debug("VSTAddSearchPath: " + path) + context.jamClient.VSTAddSearchPath(VST_TYPE_ID, path) + @listPaths() + @changed() + + onRemoveSearchPath: (path) -> + logger.debug("VSTRemoveSearchPath: " + path) + context.jamClient.VSTRemoveSearchPath(VST_TYPE_ID, path) + @listPaths() + @changed() + + onSelectVSTDirectory:() -> + context.jamClient.ShowSelectVSTScanDialog("window.ConfigureTracksStore.onVSTPathSelected") + + onVSTPathSelected: (result) -> + success = result.success + path = result.vstPath + + if success + logger.debug("vst path selected!", path) + @onAddSearchPath(path) + else + logger.debug("nothing selected") + listVsts: () -> @vstPluginList = context.jamClient.VSTListVsts() @@ -168,7 +221,10 @@ bool VST_EnableMidiForTrack(const QString& trackId, bool enableMidi, int midiDev logger.debug("trackAssignments:", @trackAssignments) logger.debug("editingTrack:", @editingTrack) + unscanned = !@scannedBefore && @vstPluginList.vsts.length <= 1 + console.log("@vstPluginList, unscanned", @vstPluginList.vsts.length, unscanned) @item = { + unscanned: unscanned, musicPorts: @musicPorts, trackAssignments: @trackAssignments, trackNumber: @trackNumber, @@ -180,7 +236,8 @@ bool VST_EnableMidiForTrack(const QString& trackId, bool enableMidi, int midiDev newTrack: @newTrack, midiTrackAssignments: @midiTrackAssignments, scanningVsts: @scanningVsts, - trackType: @trackType + trackType: @trackType, + scanPaths: @scanPaths } @trigger(@item) @@ -389,7 +446,7 @@ bool VST_EnableMidiForTrack(const QString& trackId, bool enableMidi, int midiDev # ensure that we always have an instrument set (50 = electric guitar context.jamClient.TrackSetInstrument(@trackNumber, 50) - @performVstScan() + #@performVstScan() @performMidiScan() @changed() diff --git a/web/app/assets/javascripts/react-components/stores/SessionStore.js.coffee b/web/app/assets/javascripts/react-components/stores/SessionStore.js.coffee index 780126b38..9b510b53f 100644 --- a/web/app/assets/javascripts/react-components/stores/SessionStore.js.coffee +++ b/web/app/assets/javascripts/react-components/stores/SessionStore.js.coffee @@ -734,7 +734,9 @@ ConfigureTracksActions = @ConfigureTracksActions @handleAutoOpenJamTrack() @watchBackendStats() + ConfigureTracksActions.reset(false) + @delayEnableVst() ) .fail((xhr) => @updateCurrentSession(null) @@ -766,6 +768,22 @@ ConfigureTracksActions = @ConfigureTracksActions @app.notifyServerError(xhr, 'Unable to Join Session'); ) + delayEnableVst: () -> + if @enableVstTimeout? + clearTimeout(@enableVstTimeout) + + @enableVstTimeout = setTimeout((() => + @enableVst() + ), 5000) + + enableVst: () -> + @enableVstTimeout = null + + if @inSession() + ConfigureTracksActions.enableVst() + else + logger.debug("no longer in session; not enabling VSTs at this time") + watchBackendStats: () -> @backendStatsInterval = window.setInterval((() => (@updateBackendStats())), 1000) diff --git a/web/app/assets/stylesheets/client/manageVsts.css.scss b/web/app/assets/stylesheets/client/manageVsts.css.scss index a7063e390..bcc6aa3b5 100644 --- a/web/app/assets/stylesheets/client/manageVsts.css.scss +++ b/web/app/assets/stylesheets/client/manageVsts.css.scss @@ -2,8 +2,8 @@ .manage-vsts-popup { .bt-content { - height:38px; - width:190px; + height:57px; + width:250px; background-color:#333; overflow:auto; border:1px solid #ED3618; diff --git a/web/app/assets/stylesheets/dialogs/configureLiveTracksDialog.css.scss b/web/app/assets/stylesheets/dialogs/configureLiveTracksDialog.css.scss index 212e6869d..a80d77fba 100644 --- a/web/app/assets/stylesheets/dialogs/configureLiveTracksDialog.css.scss +++ b/web/app/assets/stylesheets/dialogs/configureLiveTracksDialog.css.scss @@ -16,6 +16,12 @@ .manage-audio-plugins { font-size:12px; } + .dont-see-plugin { + font-size: 12px; + margin-top: 2px; + position: absolute; + right: 60px; + } .actions { clear:both; text-align:center; diff --git a/web/app/assets/stylesheets/dialogs/manageVstsDialog.css.scss b/web/app/assets/stylesheets/dialogs/manageVstsDialog.css.scss new file mode 100644 index 000000000..8e9c974f4 --- /dev/null +++ b/web/app/assets/stylesheets/dialogs/manageVstsDialog.css.scss @@ -0,0 +1,60 @@ +@import "client/common"; + +#manage-vsts-dialog { + width: 800px; + + .dialog-inner { + width: auto; + } + + h3 { + color: white; + font-weight: bold; + margin-bottom: 10px; + } + + .actions { + clear: both; + text-align: center; + } + + p { margin-bottom:20px;} + table { + max-height:400px; + margin-bottom:20px; + overflow:auto; + tbody tr { + height:20px; + line-height:20px; + } + th.manage-vst-path { + width:90%; + } + th.manage-vst-action { + width:10%; + } + td { + height:20px; + line-height:20px; + font-size:14px; + + div { + height:20px; + line-height:20px; + font-size:14px; + } + } + td.manage-vst-path { + width:90%; + } + td.manage-vst-action { + width:10%; + text-align:center; + } + } + + .add-scan-folder { + position: absolute; + right: 20px; + } +} \ No newline at end of file diff --git a/web/app/views/clients/_manageVsts.html.slim b/web/app/views/clients/_manageVsts.html.slim index d78dcc704..f58a31c06 100644 --- a/web/app/views/clients/_manageVsts.html.slim +++ b/web/app/views/clients/_manageVsts.html.slim @@ -3,5 +3,8 @@ script type='text/template' id='template-manage-vsts' li data-manage-vst-option="scan" a href='#' scan for new or updated plugins + li data-manage-vst-option="manage" + a href='#' manage folders/paths to scan for plug-ins + li data-manage-vst-option="clear" a href='#' clear plug-in list \ No newline at end of file diff --git a/web/app/views/dialogs/_dialogs.html.haml b/web/app/views/dialogs/_dialogs.html.haml index 2c45d7df2..73a6a5e75 100644 --- a/web/app/views/dialogs/_dialogs.html.haml +++ b/web/app/views/dialogs/_dialogs.html.haml @@ -45,4 +45,5 @@ = render 'dialogs/soundCloudPlayerDialog' = render 'dialogs/deleteVideoConfirmDialog' = render 'dialogs/configureLiveTracksDialog' -= render 'dialogs/configureOutputsDialog' \ No newline at end of file += render 'dialogs/configureOutputsDialog' += render 'dialogs/manageVstsDialog' \ No newline at end of file diff --git a/web/app/views/dialogs/_manageVstsDialog.html.slim b/web/app/views/dialogs/_manageVstsDialog.html.slim new file mode 100644 index 000000000..c9aaa1e09 --- /dev/null +++ b/web/app/views/dialogs/_manageVstsDialog.html.slim @@ -0,0 +1,2 @@ +.dialog.dialog-overlay-sm.top-parent layout='dialog' layout-id='manage-vsts-dialog' id='manage-vsts-dialog' + = react_component 'ManageVstsDialog', {}