Skip to content

Commit

Permalink
Fix 0 being interpreted as None for CC events value
Browse files Browse the repository at this point in the history
  • Loading branch information
fengalin committed Dec 21, 2021
1 parent f08a211 commit 5c98b6c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gstation_edit/jstation_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def end_bank_dump_callback(self, event):
thread = Thread(target=self.req_program_update, name="send req prg up")
thread.start()

def one_parameter_cc_callback( self, event):
def one_parameter_cc_callback(self, event):
self.default_event_callback(event)
if self.main_window is None:
print('Skipping: %s'%(event))
Expand Down
6 changes: 3 additions & 3 deletions gstation_edit/midi/cc_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ def __init__(self, channel=-1, param=-1, value=-1, seq_event=None):
if seq_event:
seq_event_data = seq_event.get_data()
value = seq_event_data.get(self.PARAM_KEY)
if value:
if not value is None:
self.param = value

value = seq_event_data.get(self.CHANNEL_KEY)
if value:
if not value is None:
self.channel = value

value = seq_event_data.get(self.VALUE_KEY)
if value:
if not value is None:
self.value = value

if self.param == -1 and self.channel == -1 and self.value == -1:
Expand Down
4 changes: 2 additions & 2 deletions gstation_edit/midi/sysex_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def __init__(self, seq_event=None, sysex_buffer=None):

self.sysex_buffer = sysex_buffer

if seq_event:
if not seq_event is None:
sysex_data = \
seq_event.get_data().get(SysexMidiEvent.SYSEX_DATA_KEY)
if sysex_data:
if not sysex_data is None:
self.sysex_buffer = SysexBuffer(sysex_data)
else:
self.has_error = True
Expand Down

0 comments on commit 5c98b6c

Please sign in to comment.