Debian Codegraph @

plyer/platforms/ios/spatialorientation.py

raw symbols SCIP
1 '''
2 iOS Spatial Orientation
3 -----------------------
4
5 '''
6
7 from plyer.facades import SpatialOrientation
8 from pyobjus import autoclass
9
10
11 class iOSSpatialOrientation(SpatialOrientation):
12
13 def __init__(self):
14 self.bridge = autoclass('bridge').alloc().init()
15 self.bridge.motionManager.setDeviceMotionUpdateInterval_(0.1)
16
17 def _enable_listener(self):
18 self.bridge.startDeviceMotion()
19
20 def _disable_listener(self):
21 self.bridge.stopDeviceMotion()
22
23 def _get_orientation(self):
24 return (
25 self.bridge.sp_yaw,
26 self.bridge.sp_pitch,
27 self.bridge.sp_roll)
28
29
30 def instance():
31 return iOSSpatialOrientation()