Cliff Biffle avatar Cliff Biffle committed f3258ff

Removed the old KFKinect class, which hadn't been used in some time.

Comments (0)

Files changed (3)

KFKinect.h

-/*
- * Copyright 2010 Cliff L. Biffle.  All Rights Reserved.
- * Use of this source code is governed by the Apache License 2.0,
- * which can be found in the LICENSE file.
- */
-
-#import <Cocoa/Cocoa.h>
-#import "libfreenect.h"
-#import "types.h"
-
-@protocol KFKinectDepthDelegate;
-@protocol KFKinectColorDelegate;
-
-@interface KFKinect : NSObject {
-  freenect_context *_context;
-  freenect_device *_device;
-	
-  BOOL _running;
-	
-  id<KFKinectDepthDelegate> depthDelegate;
-  id<KFKinectColorDelegate> colorDelegate;
-}
-
-- initWithDepthDelegate: (id<KFKinectDepthDelegate>)depthDelegate
-          colorDelegate: (id<KFKinectColorDelegate>)colorDelegate;
-- (void)open;
-- (void)close;
-
-@end
-
-@protocol KFKinectDepthDelegate
-- (void)depthFieldUpdated: (const depth_t *)buffer from: (KFKinect *)kinect;
-@end
-
-@protocol KFKinectColorDelegate
-- (void)colorFieldUpdated: (const colors_t *)bytes from: (KFKinect *)kinect;
-@end

KFKinect.m

-/*
- * Copyright 2010 Cliff L. Biffle.  All Rights Reserved.
- * Use of this source code is governed by the Apache License 2.0,
- * which can be found in the LICENSE file.
- */
-
-#import "KFKinect.h"
-#import "libfreenect.h"
-
-@interface KFKinect ()
-- (void)ioThread;
-- (void)depthCallback: (freenect_depth *)buffer;
-- (void)rgbCallback: (freenect_pixel *)buffer;
-@end
-
-static void depthCallback(freenect_device *dev, freenect_depth *depth, uint32_t timestamp) {
-  [(KFKinect *)freenect_get_user(dev) depthCallback:depth];
-}
-static void rgbCallback(freenect_device *dev, freenect_pixel *rgb, uint32_t timestamp) {
-  [(KFKinect *)freenect_get_user(dev) rgbCallback:rgb];
-}
-
-@implementation KFKinect
-
-- initWithDepthDelegate: (id<KFKinectDepthDelegate>)dd
-          colorDelegate: (id<KFKinectColorDelegate>)cd {
-	if (![super init]) return nil;
-	
-	_running = NO;
-	depthDelegate = dd;
-  colorDelegate = cd;
-	return self;
-}
-
-- (void)open {
-	[NSThread detachNewThreadSelector:@selector(ioThread) toTarget:self withObject:nil];
-}
-
-- (void)close {
-  _running = NO;
-}
-
-- (void)ioThread
-{
-	if(freenect_init(&_context, NULL) >= 0) {
-    if(freenect_open_device(_context, &_device, 0) >= 0) {
-      freenect_set_user(_device, self);
-      freenect_set_depth_callback(_device, depthCallback);
-      freenect_set_rgb_callback(_device, rgbCallback);
-      freenect_set_rgb_format(_device, FREENECT_FORMAT_RGB);
-      freenect_set_depth_format(_device, FREENECT_FORMAT_11_BIT);
-      if (depthDelegate) freenect_start_depth(_device);
-      if (colorDelegate) freenect_start_rgb(_device);
-      
-      NSLog(@"wheeee");
-      
-      while(!_running && freenect_process_events(_context) >= 0);
-      
-      freenect_close_device(_device);
-      _device = NULL;
-      
-      NSLog(@"Stopped");
-    } else {
-      NSLog(@"Could not open device");
-    }
-    freenect_shutdown(_context);
-    _context = NULL;
-  } else {
-		NSLog(@"Could not init device");
-	}
-}
-
-- (void)depthCallback: (freenect_depth *)buffer {
-	[depthDelegate depthFieldUpdated: (const depth_t *)buffer from: self];
-}
-
-- (void)rgbCallback: (freenect_pixel *)buffer {
-	[colorDelegate colorFieldUpdated: (const colors_t *)buffer from: self];
-}
-
-@end
-

KinectViewer.xcodeproj/project.pbxproj

 		C70E62AF129C5055004A44B3 /* KVDepthView.m in Sources */ = {isa = PBXBuildFile; fileRef = C70E62AE129C5055004A44B3 /* KVDepthView.m */; };
 		C70E62FB129C572E004A44B3 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C70E62FA129C572E004A44B3 /* OpenGL.framework */; };
 		C70E635F129C63BE004A44B3 /* trackball.c in Sources */ = {isa = PBXBuildFile; fileRef = C70E635D129C63BE004A44B3 /* trackball.c */; };
-		C70E6691129C8FD5004A44B3 /* KFKinect.m in Sources */ = {isa = PBXBuildFile; fileRef = C70E6685129C8FD5004A44B3 /* KFKinect.m */; };
 		C70E66A2129C9017004A44B3 /* freenect_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C70E668A129C8FD5004A44B3 /* freenect_internal.h */; };
 		C70E66A3129C9017004A44B3 /* libfreenect.h in Headers */ = {isa = PBXBuildFile; fileRef = C70E668C129C8FD5004A44B3 /* libfreenect.h */; };
 		C70E66A4129C9017004A44B3 /* usb_libusb10.h in Headers */ = {isa = PBXBuildFile; fileRef = C70E668E129C8FD5004A44B3 /* usb_libusb10.h */; };
 		C70E62FA129C572E004A44B3 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
 		C70E635D129C63BE004A44B3 /* trackball.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = trackball.c; sourceTree = "<group>"; };
 		C70E635E129C63BE004A44B3 /* trackball.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = trackball.h; sourceTree = "<group>"; };
-		C70E6684129C8FD5004A44B3 /* KFKinect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KFKinect.h; sourceTree = "<group>"; };
-		C70E6685129C8FD5004A44B3 /* KFKinect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KFKinect.m; sourceTree = "<group>"; };
 		C70E6687129C8FD5004A44B3 /* accelerometers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = accelerometers.c; sourceTree = "<group>"; };
 		C70E6688129C8FD5004A44B3 /* cameras.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cameras.c; sourceTree = "<group>"; };
 		C70E6689129C8FD5004A44B3 /* core.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = core.c; sourceTree = "<group>"; };
 		080E96DDFE201D6D7F000001 /* App */ = {
 			isa = PBXGroup;
 			children = (
-				C70E6684129C8FD5004A44B3 /* KFKinect.h */,
-				C70E6685129C8FD5004A44B3 /* KFKinect.m */,
 				256AC3D80F4B6AC300CF3369 /* KinectViewerAppDelegate.h */,
 				256AC3D90F4B6AC300CF3369 /* KinectViewerAppDelegate.m */,
 				C70E62AD129C5055004A44B3 /* KVDepthView.h */,
 				256AC3DA0F4B6AC300CF3369 /* KinectViewerAppDelegate.m in Sources */,
 				C70E62AF129C5055004A44B3 /* KVDepthView.m in Sources */,
 				C70E635F129C63BE004A44B3 /* trackball.c in Sources */,
-				C70E6691129C8FD5004A44B3 /* KFKinect.m in Sources */,
 				C758083412A4C46700391C33 /* KVRenderer.m in Sources */,
 				C7759B4612A8B2D3003479EF /* KVKinectHardware.m in Sources */,
 				C7759C0712A97873003479EF /* KVDepthRecorder.m in Sources */,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.