Skip to content

Commit 9a8c6db

Browse files
committed
This is probably not the right way to move the clip position...
1 parent 597b965 commit 9a8c6db

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

xone.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@ def handle_encoder_turn(self, value):
329329
self.song.view.selected_scene = self.song.scenes[scene_index]
330330

331331

332-
333-
334-
335332
class BrowserScroller(DynamicEncoder):
336333
HORIZONTAL = 0
337334
VERTICAL = 1
@@ -374,6 +371,17 @@ def handle_encoder_turn(self, value):
374371
# zoom out yuckily
375372
os.system("osascript -e 'tell application \"System Events\" to tell process \"Live\" to key code 27'")
376373

374+
class PositionScroller(DynamicEncoder):
375+
def __init__(self, application, song):
376+
super(PositionScroller, self).__init__(None, None)
377+
self._application = application
378+
self._song = song
379+
380+
def handle_encoder_turn(self, value):
381+
if value < 64:
382+
self._song.view.detail_clip.position = self._song.view.detail_clip.position + 32
383+
else:
384+
self._song.view.detail_clip.position = self._song.view.detail_clip.position - 32
377385

378386
class GlobalStopButton(ButtonElement):
379387
def __init__(self, button_cc, song):
@@ -684,7 +692,8 @@ def init_session(self):
684692
[
685693
SceneSelector(self.song()),
686694
DynamicEncoder(None, self.song().master_track.mixer_device.volume),
687-
BrowserScroller(self.browser_repr, BrowserScroller.VERTICAL)
695+
BrowserScroller(self.browser_repr, BrowserScroller.VERTICAL),
696+
PositionScroller(self.application(), self.song())
688697
],
689698
self.shift_button, ENCODER_LR, PUSH_ENCODER_LR)
690699

0 commit comments

Comments
 (0)