Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
Added OnDeInit() to reset the device.
Browse files Browse the repository at this point in the history
  • Loading branch information
nfxbeats committed Jul 21, 2022
1 parent 972fb05 commit 7667927
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
23 changes: 21 additions & 2 deletions device_FIRE-NFX.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ def OnInit():
SendCC(IDBankL, SingleColorOff)
SendCC(IDBankR, SingleColorOff)
SendCC(IDBrowser, SingleColorOff)
SendCC(IDKnob1, SingleColorFull)

InititalizePadModes()

Expand All @@ -177,6 +176,23 @@ def OnInit():
RefreshAll()
_ScrollTo = False

_shuttingDown = False
def OnDeInit():

global _shuttingDown
_shuttingDown = True

DisplayTextAll(' ', ' ', ' ')
DeInitDisplay()

# turn of the lights and go to bed...
ClearAllPads()
SendCC(IDKnobModeLEDArray, 16)
for ctrlID in getNonPadLightCtrls():
SendCC(ctrlID, 0)



def ClearAllPads():
# clear the Pads
for pad in range(0,64):
Expand Down Expand Up @@ -1923,7 +1939,7 @@ def RefreshFPCSelector():

def RefreshKnobMode():
LEDVal = IDKnobModeLEDVals[_KnobMode] | 16
#prn(lvlA, 'RefreshKnobMode. knob mode is', _KnobMode, 'led bit', IDKnobModeLEDVals[_KnobMode], 'val', LEDVal)
print(lvlA, 'RefreshKnobMode. knob mode is', _KnobMode, 'led bit', IDKnobModeLEDVals[_KnobMode], 'val', LEDVal)
SendCC(IDKnobModeLEDArray, LEDVal)

def RefreshPlaylist():
Expand Down Expand Up @@ -2162,6 +2178,9 @@ def RefreshPatternStrip(scrollToChannel = False):
def RefreshDisplay():
global _menuItemSelected

if _shuttingDown:
return

prn(lvlA, "RefreshDisplay()")
_menuItemSelected = _selectedItem # reset this for the next menu
chanIdx = getCurrChanIdx() #
Expand Down
13 changes: 12 additions & 1 deletion fireNFX_Defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
PadModeCtrls = [IDStepSeq, IDNote, IDDrum, IDPerform]
PadModeNames = ['Pattern', 'Note', 'Drum', 'Perform']
PadModeShortNames = ['PTN', 'NOTE', 'DRM', 'PERF']
NavCtrls = [IDUp, IDDown, IDLeft, IDRight]
KnobCtrls = [IDKnob1, IDKnob2, IDKnob3, IDKnob4]
SelectWheelCtrls = [IDSelect, IDSelectDown]
PadCtrls = list()
Expand All @@ -127,6 +126,18 @@

BeatIndicators = [IDTrackSel1, IDTrackSel2, IDTrackSel3, IDTrackSel4]

def getNonPadLightCtrls():
NonPadLightCtrls = []
NonPadLightCtrls.extend(PattUpDnCtrls)
NonPadLightCtrls.append(IDBrowser)
NonPadLightCtrls.extend(GridLRCtrls)
NonPadLightCtrls.extend(PageCtrls)
NonPadLightCtrls.extend(BeatIndicators)
NonPadLightCtrls.extend(PadModeCtrls)
NonPadLightCtrls.extend(ShiftAltCtrls)
NonPadLightCtrls.extend(TransportCtrls)
return NonPadLightCtrls



IdxStepSeq = 14
Expand Down
8 changes: 7 additions & 1 deletion fireNFX_Display.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ def InitDisplay():
screen.fillRect(0, 0, DisplayWidth, DisplayHeight, 0)

def DeInitDisplay():
screen.deInit()
DisplayTextTop(' ')
DisplayTextMiddle(' ')
DisplayTextBottom(' ')
#screen.update()

#screen.deInit()
#screen.update()

# Helpers

Expand Down

0 comments on commit 7667927

Please sign in to comment.