Skip to content

Commit ded5af6

Browse files
committed
Fix MIDI dictionary combobox
1 parent 0d0723e commit ded5af6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

YTPMVE_UI.pyw

+8-5
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,14 @@ def on_combo_box_event_track_select(event):
190190
dict_event_tracks[selected_event_track]['legato_audio'] = default_checkbox_legato_audio_value # Set default value for legato
191191

192192
global dict_midi_channels
193-
#try:
194-
#Set the combobox to the key in the midi channels dictionary that matches the value with an index of the event track dictionary's currently selected track's channel key's integer value in an ordered list of the midi channels dictionary
195-
combo_box_MIDI_channel.set(dict_midi_channels[list(dict_midi_channels.keys())[int(dict_event_tracks[selected_event_track]['channel'])]])
196-
#except:
197-
# return #combo_box_MIDI_channel.set(combo_values_MIDI_channel[0])
193+
194+
#Try to set the combobox value to the value specified in the event tracks dictionary, but if something invalid is set, then default to a default value
195+
try:
196+
#Set the combobox to the key in the midi channels dictionary that matches the value with an index of the event track dictionary's currently selected track's channel key's integer value in an ordered list of the midi channels dictionary
197+
#dict_midi_channels[list(dict_midi_channels.keys())[int(dict_event_tracks[selected_event_track]['channel'])]]
198+
combo_box_MIDI_channel.set(dict_midi_channels[int(dict_event_tracks[selected_event_track]['channel'])])
199+
except:
200+
combo_box_MIDI_channel.set(combo_values_MIDI_channel[0])
198201
checkbox_flip_x_value.set(dict_event_tracks[selected_event_track]['flip_x'])
199202
checkbox_flip_y_value.set(dict_event_tracks[selected_event_track]['flip_y'])
200203
checkbox_legato_video_value.set(dict_event_tracks[selected_event_track]['legato_video'])

0 commit comments

Comments
 (0)