prevent showing alert on audio instrument select

fix this bug due to previous introduction of alert which pops up
if midi instrument is selected without selecting midi interface and
vst plugin. The alert only applicable to the midi interface.
This commit is contained in:
Nuwan 2023-09-05 19:19:16 +05:30
parent ccee1c6805
commit 61b58eddd1
1 changed files with 11 additions and 5 deletions

View File

@ -110,7 +110,7 @@ ConfigureTracksStore = @ConfigureTracksStore
</div>
<div className="instrument-selection">
<h3>Instrument</h3>
<select className="instrument-pick" name="instrument" onChange={this.instrumentSelected} value={selectedInstrument} disabled={instrumentDisabled}>
<select className="instrument-pick" name="instrument" onChange={this.audioInstrumentSelected} value={selectedInstrument} disabled={instrumentDisabled}>
{instruments}
</select>
</div>
@ -188,7 +188,7 @@ ConfigureTracksStore = @ConfigureTracksStore
</div>
<div className="instrument-selection">
<h3>Instrument Display Name</h3>
<select className="instrument-pick" name="instrument" onChange={this.instrumentSelected} value={selectedInstrument} disabled={instrumentDisabled}>
<select className="midi-instrument-pick" name="instrument" onChange={this.midiInstrumentSelected} value={selectedInstrument} disabled={instrumentDisabled} data-ismidi="true">
{instruments}
</select>
</div>
@ -295,16 +295,21 @@ ConfigureTracksStore = @ConfigureTracksStore
@setState({midiInterface: null})
instrumentSelected: (e) ->
audioInstrumentSelected: (e) ->
$root = $(@getDOMNode())
instrumentId = $root.find('.instrument-pick').val()
ConfigureTracksActions.associateInstrumentWithTrack(instrumentId)
midiInstrumentSelected: (e) ->
$root = $(@getDOMNode())
midiInstrumentId = $root.find('.midi-instrument-pick').val()
midiSelVal = $root.find('.midi-select').val()
vstsSelVal = $root.find('.vsts').val()
if midiSelVal == "" || vstsSelVal == "NONE"
context.JK.Banner.showAlert("MIDI interface and MIDI plugin must be selected.")
else
ConfigureTracksActions.associateInstrumentWithTrack(instrumentId)
ConfigureTracksActions.associateInstrumentWithTrack(midiInstrumentId)
# instrumentSelected: `async function(e) {
# const $root = $(this.getDOMNode());
@ -391,7 +396,8 @@ ConfigureTracksStore = @ConfigureTracksStore
context.JK.dropdown($root.find('select'));
$root.find('select.input-selectors').unbind('change').change(this.inputChanged);
$root.find('select.instrument-pick').unbind('change').change(this.instrumentSelected);
$root.find('select.instrument-pick').unbind('change').change(this.audioInstrumentSelected);
$root.find('select.midi-instrument-pick').unbind('change').change(this.midiInstrumentSelected);
$root.find('select.vsts').unbind('change').change(this.vstsChanged);
$root.find('select.midi-select').unbind('change').change(this.midiInterfaceChanged);
}