@@ -185,6 +185,14 @@ class RawTiltState < FFI::Struct
185185 :accelerometer_z , :int16 ,
186186 :tilt_angle , :int8 ,
187187 :tilt_status , TILT_STATUS_CODES
188+ def accelerometer
189+ [ self [ :accelerometer_x ] , self [ :accelerometer_y ] , self [ :accelerometer_z ] ]
190+ end
191+ def angle ; self [ :tilt_angle ] ; end
192+ def status ; self [ :tilt_status ] ; end
193+ def to_s
194+ "#<Freenect::RawTiltState #{ status } @ #{ angle } deg, accel: (#{ accelerometer . join ( ',' ) } )>"
195+ end
188196 end
189197
190198 callback :freenect_log_cb , [ :freenect_context , LOGLEVELS , :string ] , :void
@@ -221,13 +229,13 @@ class RawTiltState < FFI::Struct
221229 attach_function :freenect_get_video_mode , [ :int ] , FrameMode . by_value
222230 attach_function :freenect_get_current_video_mode , [ :freenect_device ] , FrameMode . by_value
223231 attach_function :freenect_find_video_mode , [ RESOLUTIONS , VIDEO_FORMATS ] , FrameMode . by_value
224- attach_function :freenect_set_video_mode , [ :freenect_device , FrameMode ] , :int
232+ attach_function :freenect_set_video_mode , [ :freenect_device , FrameMode . by_value ] , :int
225233
226234 attach_function :freenect_get_depth_mode_count , [ ] , :int
227235 attach_function :freenect_get_depth_mode , [ :int ] , FrameMode . by_value
228236 attach_function :freenect_get_current_depth_mode , [ :freenect_device ] , FrameMode . by_value
229237 attach_function :freenect_find_depth_mode , [ RESOLUTIONS , DEPTH_FORMATS ] , FrameMode . by_value
230- attach_function :freenect_set_depth_mode , [ :freenect_device , FrameMode ] , :int
238+ attach_function :freenect_set_depth_mode , [ :freenect_device , FrameMode . by_value ] , :int
231239
232240 attach_function :freenect_sync_get_video , [ :pointer , :pointer , :int , VIDEO_FORMATS ] , :int
233241 attach_function :freenect_sync_get_depth , [ :pointer , :pointer , :int , DEPTH_FORMATS ] , :int
0 commit comments