Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #51 from MiguelGuthridge/stage
Browse files Browse the repository at this point in the history
Merge from Stage to Main
  • Loading branch information
MaddyGuthridge authored Feb 19, 2021
2 parents 5871d37 + aece22c commit 356a9d2
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 49 deletions.
2 changes: 1 addition & 1 deletion internal/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
SCRIPT_AUTHOR = "Miguel Guthridge"
SCRIPT_VERSION_MAJOR = 3
SCRIPT_VERSION_MINOR = 0
SCRIPT_VERSION_REVISION = 0
SCRIPT_VERSION_REVISION = 1
SCRIPT_VERSION_SUFFIX = ""
MIN_FL_SCRIPT_VERSION = 8
SCRIPT_URL = "https://github.com/MiguelGuthridge/Novation-LaunchKey-Mk2-Script"
Expand Down
6 changes: 2 additions & 4 deletions noteprocessors/processnotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ def process(command):

object_to_call.process(command)

if command.ignored: return

if command.ignored: return

if command.ignored: break

# Then check the note mode menu button
processNoteModeMenuOpener(command)

Expand Down
2 changes: 1 addition & 1 deletion noteprocessors/unassigned.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def process(command):
command.addProcessor("Unassigned processor")

if command.type is not eventconsts.TYPE_INCONTROL and command.type is not eventconsts.TYPE_TRANSPORT:
command.ignore("Ignore all events")
command.ignore("Ignore all events", True)

return

Expand Down
22 changes: 8 additions & 14 deletions otherprocessors/processdefault.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,22 @@ def process(command):
# Play-pause: only on lift
if command.id == eventconsts.TRANSPORT_PLAY and command.is_lift:
transport.start()
command.actions.appendAction("Play/Pause Transport")
command.handled = True
command.handle("Play/Pause Transport")

# Stop: only on lift
if command.id == eventconsts.TRANSPORT_STOP and command.is_lift:
transport.stop()
command.actions.appendAction("Stop Transport")
command.handled = True
command.handle("Stop Transport")

# Loop: only on lift
if command.id == eventconsts.TRANSPORT_LOOP and command.is_lift:
transport.setLoopMode()
command.actions.appendAction("Toggle Loop Mode")
command.handled = True
command.handle("Toggle Loop Mode")

# Record: only on lift
if command.id == eventconsts.TRANSPORT_RECORD and command.is_lift:
transport.record()
command.actions.appendAction("Toggle Recording")
command.handled = True
command.handle("Toggle Recording")

# Skip forward: start on press, stop on lift, faster on double press?
if command.id == eventconsts.TRANSPORT_FORWARD:
Expand All @@ -74,7 +70,7 @@ def process(command):
if command.is_lift is True:
transport.continuousMove(speed, 0)
command.actions.appendAction("Stopped")
command.handled = True
command.handle("Continuous move", True)

# Skip back: start on press, stop on lift, faster on double press?
if command.id == eventconsts.TRANSPORT_BACK:
Expand All @@ -89,18 +85,16 @@ def process(command):
if command.is_lift is True:
transport.continuousMove(speed, 0)
command.actions.appendAction("Stopped")
command.handled = True
command.handle("Continuous move", True)

# Next Track: next UI element
if command.id == eventconsts.TRANSPORT_TRACK_NEXT and command.is_lift:
ui.next()
command.actions.appendAction("Next UI Element")
command.handled = True
command.handle("Next UI Element")

# Prev Track: prev UI element
if command.id == eventconsts.TRANSPORT_TRACK_PREVIOUS and command.is_lift:
ui.previous()
command.actions.appendAction("Previous UI Element")
command.handled = True
command.handle("Previous UI Element")


35 changes: 12 additions & 23 deletions windowprocessors/processchannelrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,29 +110,24 @@ def processBitMode(command):
if coord == [4, 1]:
if command.is_double_click:
gridBits.resetScroll()
command.actions.appendAction("Grid Bits: Reset scroll")
command.handled = True
command.handle("Grid Bits: Reset scroll")
else:
gridBits.scrollLeft()
command.actions.appendAction("Grid Bits: Scroll left")
command.handled = True
command.handle("Grid Bits: Scroll left")
if coord == [5, 1]:
gridBits.scrollRight()
command.actions.appendAction("Grid Bits: Scroll right")
command.handled = True
command.handle("Grid Bits: Scroll right")
# Zoom grid bits
if coord == [6, 1]:
gridBits.zoomOut()
command.actions.appendAction("Grid Bits: Zoom out")
command.handled = True
command.handle("Grid Bits: Zoom out")
if coord == [7, 1]:
if command.is_double_click:
gridBits.resetZoom()
command.actions.appendAction("Grid Bits: Reset zoom")
command.handle("Grid Bits: Reset zoom")
else:
gridBits.zoomIn()
command.actions.appendAction("Grid Bits: Zoom in")
command.handled = True
command.handle("Grid Bits: Zoom in")

# Process when in menu
def processMenuMode(command):
Expand All @@ -142,32 +137,26 @@ def processMenuMode(command):
# Next/prev track
if coord == [0, 0]:
ui.previous()
command.actions.appendAction("Channel Rack: Previous channel")
command.handled = True
command.handle("Channel Rack: Previous channel")
elif coord == [0, 1]:
ui.next()
command.actions.appendAction("Channel Rack: Next channel")
command.handled = True
command.handle("Channel Rack: Next channel")

# Cut, Copy, Paste
elif coord == [2, 0]:
ui.cut()
command.actions.appendAction("UI: Cut")
command.handled = True
command.handle("UI: Cut")
elif coord == [3, 0]:
ui.copy()
command.actions.appendAction("UI: Copy")
command.handled = True
command.handle("UI: Copy")
elif coord == [4, 0]:
ui.paste()
command.actions.appendAction("UI: Paste")
command.handled = True
command.handle("UI: Paste")

# To piano roll
elif coord == [7, 1]:
ui.showWindow(internal.consts.WINDOW_PIANO_ROLL)
command.actions.appendAction("Sent to pianoroll")
command.handled = True
command.handle("Sent to pianoroll")

# Plugin window
elif coord == [6, 1]:
Expand Down
12 changes: 6 additions & 6 deletions windowprocessors/processplaylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ def process(command):
# Process marker jumps
if command.type == eventconsts.TYPE_TRANSPORT:
if (command.id == eventconsts.TRANSPORT_BACK or command.id == eventconsts.TRANSPORT_FORWARD):
if not internal.shifts["MAIN"].use():
if command.is_lift:
# Check that markers exist
if arrangement.getMarkerName(0) is not "":
# Only if markers exist
if arrangement.getMarkerName(0) is not "":
if not internal.shifts["MAIN"].use():
if command.is_lift:
if command.id == eventconsts.TRANSPORT_BACK:
transport.markerJumpJog(-1)
command.handle("Transport: Jump to previous marker")
if command.id == eventconsts.TRANSPORT_FORWARD:
transport.markerJumpJog(1)
command.handle("Transport: Jump to next marker")
else:
command.handle("Catch transport skips", silent=True)
else:
command.handle("Catch transport skips", silent=True)



Expand Down

0 comments on commit 356a9d2

Please sign in to comment.