-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathDeviceNavigationComponent.py
More file actions
24 lines (20 loc) · 977 Bytes
/
DeviceNavigationComponent.py
File metadata and controls
24 lines (20 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import Live
from _Framework.ControlSurfaceComponent import ControlSurfaceComponent
from _Framework.Control import ButtonControl
NavDirection = Live.Application.Application.View.NavDirection
class DeviceNavigationComponent(ControlSurfaceComponent):
device_nav_left_button = ButtonControl(color='Device.Off', pressed_color='Device.On')
device_nav_right_button = ButtonControl(color='Device.Off', pressed_color='Device.On')
@device_nav_left_button.pressed
def device_nav_left_button(self, value):
self._scroll_device_chain(NavDirection.left)
@device_nav_right_button.pressed
def device_nav_right_button(self, value):
self._scroll_device_chain(NavDirection.right)
def _scroll_device_chain(self, direction):
view = self.application().view
if not view.is_view_visible('Detail') or not view.is_view_visible('Detail/DeviceChain'):
view.show_view('Detail')
view.show_view('Detail/DeviceChain')
else:
view.scroll_view(direction, 'Detail/DeviceChain', False)