Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.

Commit b593915

Browse files
committed
support 10.10(maybe also support 10.9)
1 parent e42ec9f commit b593915

File tree

6 files changed

+145
-32
lines changed

6 files changed

+145
-32
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Release*/
1818
*.mode2v3
1919
#XCode 4
2020
*.xcworkspace
21+
*.xcuserd
2122

2223
# OS-specific ignore patterns
2324
#OSX

Kinect2Scratch4Mac.xcodeproj/project.pbxproj

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
21C22E1B15C286400075A106 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424610CC5A17004149E2 /* IOKit.framework */; };
6868
21C22E2C15C286400075A106 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; };
6969
21C22E2E15C286400075A106 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 216AAA5D156FBF90002E7A62 /* icon.icns */; };
70+
37A020361B5B629100E4BF38 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37A020351B5B629100E4BF38 /* CoreVideo.framework */; };
7071
/* End PBXBuildFile section */
7172

7273
/* Begin PBXContainerItemProxy section */
@@ -306,6 +307,7 @@
306307
21819FE816387FA600336015 /* ofxToggle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxToggle.cpp; sourceTree = "<group>"; };
307308
21819FE916387FA600336015 /* ofxToggle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxToggle.h; sourceTree = "<group>"; };
308309
21C22E3515C286400075A106 /* Kinect2Scratch4Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Kinect2Scratch4Mac.app; sourceTree = BUILT_PRODUCTS_DIR; };
310+
37A020351B5B629100E4BF38 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; };
309311
BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = "<group>"; };
310312
E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; };
311313
E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = "<absolute>"; };
@@ -333,6 +335,7 @@
333335
isa = PBXFrameworksBuildPhase;
334336
buildActionMask = 2147483647;
335337
files = (
338+
37A020361B5B629100E4BF38 /* CoreVideo.framework in Frameworks */,
336339
21C22E0E15C286400075A106 /* GLUT.framework in Frameworks */,
337340
21C22E0F15C286400075A106 /* openFrameworksDebug.a in Frameworks */,
338341
21C22E1015C286400075A106 /* AGL.framework in Frameworks */,
@@ -798,6 +801,7 @@
798801
BBAB23C913894ECA00AA2426 /* system frameworks */ = {
799802
isa = PBXGroup;
800803
children = (
804+
37A020351B5B629100E4BF38 /* CoreVideo.framework */,
801805
E4C2424410CC5A17004149E2 /* AppKit.framework */,
802806
E4C2424510CC5A17004149E2 /* Cocoa.framework */,
803807
E4C2424610CC5A17004149E2 /* IOKit.framework */,
@@ -905,6 +909,8 @@
905909
/* Begin PBXProject section */
906910
E4B69B4C0A3A1720003C02F2 /* Project object */ = {
907911
isa = PBXProject;
912+
attributes = {
913+
};
908914
buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "Kinect2Scratch4Mac" */;
909915
compatibilityVersion = "Xcode 2.4";
910916
developmentRegion = English;
@@ -971,10 +977,11 @@
971977
inputPaths = (
972978
);
973979
outputPaths = (
980+
"$(DERIVED_FILE_DIR)/myfile",
974981
);
975982
runOnlyForDeploymentPostprocessing = 0;
976983
shellPath = /bin/sh;
977-
shellScript = "cp -f ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";";
984+
shellScript = "cp -f ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";\ncp -f bin/data/openni/lib/libnimCodecs.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libnimCodecs.dylib\";\ncp -f bin/data/openni/lib/libnimMockNodes.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libnimMockNodes.dylib\";\ncp -f bin/data/openni/lib/libnimRecorder.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libnimRecorder.dylib\";\ncp -f bin/data/openni/lib/libOpenNI.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libOpenNI.dylib\";\ncp -f bin/data/openni/lib/libusb-1.0.0.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libusb-1.0.0.dylib\";\ncp -f bin/data/openni/lib/libXnCore.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libXnCore.dylib\";\ncp -f bin/data/openni/lib/libXnDDK.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libXnDDK.dylib\";\ncp -f bin/data/openni/lib/libXnDeviceFile.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libXnDeviceFile.dylib\";\ncp -f bin/data/openni/lib/libXnDeviceSensorV2KM.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libXnDeviceSensorV2KM.dylib\";\ncp -f bin/data/openni/lib/libXnFormats.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libXnFormats.dylib\";\ncp -f bin/data/openni/lib/libXnVCNITE_1_5_2.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libXnVCNITE_1_5_2.dylib\";\ncp -f bin/data/openni/lib/libXnVFeatures_1_5_2.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libXnVFeatures_1_5_2.dylib\";\ncp -f bin/data/openni/lib/libXnVHandGenerator_1_5_2.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libXnVHandGenerator_1_5_2.dylib\";\ncp -f bin/data/openni/lib/libXnVNite_1_5_2.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libXnVNite_1_5_2.dylib\";\n\n\n\nin=\"install_name_tool -change \"\n\ncd \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/\"\n\nlibs=(*.dylib)\nnum_libs=${#libs[*]}\n \nfor lib in *.dylib ; do\n i=0\n echo \"\"\n echo \"${lib}\"\n echo \"-------------------------------------------------\"\n lines=`otool -L ${lib}`\n echo ${lines}\n for linked_name in ${lines} ; do\n for local_lib in ${libs[@]}; do\n in=`echo ${linked_name} | grep -i ${local_lib}`\n if [ \"$in\" != \"\" ] ; then\n check_id=`echo \"${linked_name}\" | grep -i \"${lib}\"`\n \n if [ \"$check_id\" != \"\" ] ; then\n install_name_tool -id \"@executable_path/./${local_lib}\" ${lib}\n echo install_name_tool -id \"@executable_path/./${local_lib}\" ${lib}\n else\n install_name_tool -change \"${linked_name}\" \"@executable_path/./${local_lib}\" ${lib}\n echo install_name_tool -change \"${linked_name}\" \"@executable_path/./${local_lib}\" ${lib}\n fi\n fi\n done\n done\ndone\n\napp_lines=`otool -L $PRODUCT_NAME`\necho ${app_lines}\nfor linked_name in ${app_lines} ; do\n for local_lib in ${libs[@]} ; do\n in=`echo ${linked_name} | grep -i ${local_lib}`\n if [ \"$in\" != \"\" ] ; then\n check_id=`echo \"${linked_name}\" | grep -i \"$PRODUCT_NAME\"`\n if [ \"$check_id\" != \"\" ] ; then\n install_name_tool -id \"@executable_path/./${local_lib}\" $PRODUCT_NAME\n echo install_name_tool -id \"@executable_path/./${local_lib}\" $PRODUCT_NAME\n else\n install_name_tool -change \"${linked_name}\" \"@executable_path/./${local_lib}\" $PRODUCT_NAME\n echo install_name_tool -change \"${linked_name}\" \"@executable_path/./${local_lib}\" $PRODUCT_NAME\n fi\n fi\n done\ndone\n";
978985
};
979986
/* End PBXShellScriptBuildPhase section */
980987

@@ -1126,9 +1133,10 @@
11261133
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7 = "\"$(SRCROOT)/../../../addons/ofxOpenCv/libs/opencv/lib/vs2010\"";
11271134
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8 = "\"$(SRCROOT)/../../../addons/ofxOpenCv/libs/opencv/lib/win_cb\"";
11281135
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9 = "\"$(SRCROOT)/bin/data/openni/lib\"";
1129-
MACOSX_DEPLOYMENT_TARGET = 10.5;
1136+
MACOSX_DEPLOYMENT_TARGET = 10.9;
11301137
PREBINDING = NO;
11311138
PRODUCT_NAME = Kinect2Scratch4Mac;
1139+
SDKROOT = macosx10.9;
11321140
WRAPPER_EXTENSION = app;
11331141
};
11341142
name = Debug;
@@ -1241,9 +1249,10 @@
12411249
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7 = "\"$(SRCROOT)/../../../addons/ofxOpenCv/libs/opencv/lib/vs2010\"";
12421250
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8 = "\"$(SRCROOT)/../../../addons/ofxOpenCv/libs/opencv/lib/win_cb\"";
12431251
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9 = "\"$(SRCROOT)/bin/data/openni/lib\"";
1244-
MACOSX_DEPLOYMENT_TARGET = 10.5;
1252+
MACOSX_DEPLOYMENT_TARGET = 10.9;
12451253
PREBINDING = NO;
12461254
PRODUCT_NAME = Kinect2Scratch4Mac;
1255+
SDKROOT = macosx10.9;
12471256
WRAPPER_EXTENSION = app;
12481257
};
12491258
name = Release;
@@ -1272,6 +1281,7 @@
12721281
"-D__MACOSX_CORE__",
12731282
"-lpthread",
12741283
);
1284+
SDKROOT = macosx10.9;
12751285
};
12761286
name = Debug;
12771287
};
@@ -1301,6 +1311,7 @@
13011311
"-D__MACOSX_CORE__",
13021312
"-lpthread",
13031313
);
1314+
SDKROOT = macosx10.9;
13041315
};
13051316
name = Release;
13061317
};
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0640"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "21C22DE315C286400075A106"
18+
BuildableName = "Kinect2Scratch4Mac.app"
19+
BlueprintName = "Kinect2Scratch4Mac"
20+
ReferencedContainer = "container:Kinect2Scratch4Mac.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28+
shouldUseLaunchSchemeArgsEnv = "YES"
29+
buildConfiguration = "Debug">
30+
<Testables>
31+
</Testables>
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "21C22DE315C286400075A106"
36+
BuildableName = "Kinect2Scratch4Mac.app"
37+
BlueprintName = "Kinect2Scratch4Mac"
38+
ReferencedContainer = "container:Kinect2Scratch4Mac.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
41+
</TestAction>
42+
<LaunchAction
43+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
44+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
45+
launchStyle = "0"
46+
useCustomWorkingDirectory = "NO"
47+
buildConfiguration = "Debug"
48+
ignoresPersistentStateOnLaunch = "NO"
49+
debugDocumentVersioning = "YES"
50+
allowLocationSimulation = "YES">
51+
<BuildableProductRunnable
52+
runnableDebuggingMode = "0">
53+
<BuildableReference
54+
BuildableIdentifier = "primary"
55+
BlueprintIdentifier = "21C22DE315C286400075A106"
56+
BuildableName = "Kinect2Scratch4Mac.app"
57+
BlueprintName = "Kinect2Scratch4Mac"
58+
ReferencedContainer = "container:Kinect2Scratch4Mac.xcodeproj">
59+
</BuildableReference>
60+
</BuildableProductRunnable>
61+
<AdditionalOptions>
62+
</AdditionalOptions>
63+
</LaunchAction>
64+
<ProfileAction
65+
shouldUseLaunchSchemeArgsEnv = "YES"
66+
savedToolIdentifier = ""
67+
useCustomWorkingDirectory = "NO"
68+
buildConfiguration = "Release"
69+
debugDocumentVersioning = "YES">
70+
<BuildableProductRunnable
71+
runnableDebuggingMode = "0">
72+
<BuildableReference
73+
BuildableIdentifier = "primary"
74+
BlueprintIdentifier = "21C22DE315C286400075A106"
75+
BuildableName = "Kinect2Scratch4Mac.app"
76+
BlueprintName = "Kinect2Scratch4Mac"
77+
ReferencedContainer = "container:Kinect2Scratch4Mac.xcodeproj">
78+
</BuildableReference>
79+
</BuildableProductRunnable>
80+
</ProfileAction>
81+
<AnalyzeAction
82+
buildConfiguration = "Debug">
83+
</AnalyzeAction>
84+
<ArchiveAction
85+
buildConfiguration = "Release"
86+
revealArchiveInOrganizer = "YES">
87+
</ArchiveAction>
88+
</Scheme>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>Kinect2Scratch4Mac.xcscheme</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>1</integer>
11+
</dict>
12+
</dict>
13+
<key>SuppressBuildableAutocreation</key>
14+
<dict>
15+
<key>21C22DE315C286400075A106</key>
16+
<dict>
17+
<key>primary</key>
18+
<true/>
19+
</dict>
20+
</dict>
21+
</dict>
22+
</plist>

src/testApp.cpp

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,27 @@ string newJointNames[] = {"ShoulderCenter", "Spine", "Head", "ShoulderLeft", "El
1111
void testApp::setup() {
1212
//init
1313
ofBackground(100);
14-
isKinect = false;
15-
isScratch = false;
14+
readyKinect = false;
1615
isGui = true;
1716
scale = 1.0;
1817

1918
ofSetWindowTitle("Kinect2Scratch4Mac - v005b4");
2019

2120
//GUI
22-
gui.setup("Toggle gui panel:g");
23-
gui.add(connectKinect.setup("1:Kinect::Connect", false));
24-
gui.add(connectScratch.setup("2:Scratch::Connect", false));
25-
gui.add(tilt_angle.setup("Kinect::Motor", 0, -30, 30));
21+
gui.setup("Toggle GUI panel:g");
22+
gui.add(connect.setup("Launch"));
23+
gui.add(tilt_angle.setup("Adjust angle", 0, -30, 30));
2624
gui.add(oldValues.setup("Old style value name", false));
2725

28-
for (int i = 0; i < gui.getNumControls(); i++) {
29-
ofxBaseGui* part = gui.getControl(i);
30-
//write codes for setting here
31-
}
32-
3326
//Event listener
34-
connectKinect.addListener(this, &testApp::setupKinect);
35-
connectScratch.addListener(this, &testApp::setupScratch);
27+
connect.addListener(this, &testApp::setupKinect);
3628
}
3729

3830
//--------------------------------------------------------------
3931
void testApp::update(){
4032

41-
if (isKinect) {
33+
if (readyKinect) {
4234
updateKinect();
43-
}
44-
if (isScratch) {
4535
scratch.update();
4636
}
4737

@@ -65,7 +55,7 @@ void testApp::draw(){
6555

6656
ofSetColor(255);
6757

68-
if(isKinect){
58+
if(readyKinect){
6959

7060
ofSetColor(255, 255, 255);
7161

@@ -143,7 +133,11 @@ void testApp::windowResized(int w, int h){
143133
// /________\ //
144134
//-----------------------------------------------------//
145135

146-
void testApp::setupKinect(bool & dummy) {
136+
void testApp::setupKinect(bool & dummy) {
137+
if (readyKinect) {
138+
return;
139+
}
140+
147141
kinect.setup();
148142
kinect.setupFromXML(ofToDataPath("openni/config/modules.xml"));
149143
kinect.addDepthGenerator();
@@ -158,7 +152,9 @@ void testApp::setupKinect(bool & dummy) {
158152
dev_kinect.setup();
159153
tilt_angle = dev_kinect.getTiltAngle();
160154

161-
isKinect = true;
155+
scratch.setup();
156+
157+
readyKinect = true;
162158
}
163159

164160
//--------------------------------------------------------------
@@ -183,7 +179,7 @@ void testApp::updateKinect(){
183179

184180
//--------------------------------------------------------------
185181
void testApp::sendPoints(ofPoint position, int joint, int n){
186-
if (isScratch) {
182+
if (readyKinect) {
187183
//numbering
188184
n++;
189185
string number = "";
@@ -212,15 +208,10 @@ void testApp::sendPoints(ofPoint position, int joint, int n){
212208
}
213209
}
214210

215-
//--------------------------------------------------------------
216-
void testApp::setupScratch(bool & dummy) {
217-
scratch.setup();
218-
isScratch = true;
219-
}
220211

221212
//--------------------------------------------------------------
222213
void testApp::exit(){
223-
if(isKinect){
214+
if(readyKinect){
224215
kinect.stop();
225216
dev_kinect.shutDown();
226217
}

src/testApp.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ class testApp : public ofBaseApp{
3333
//Kinect
3434
ofxOpenNI kinect;
3535
ofxHardwareDriver dev_kinect;
36-
bool isKinect;
36+
bool readyKinect;
3737

3838
//Scratch
3939
ofxScratch scratch;
4040
void sendPoints(ofPoint position, int joint, int n);
41-
bool isScratch;
4241

4342
//GUI
4443
ofxPanel gui;
45-
ofxToggle connectScratch, connectKinect, oldValues;
44+
ofxButton connect;
45+
ofxToggle oldValues;
4646
ofxIntSlider tilt_angle;
4747
bool isGui;
4848
float scale;

0 commit comments

Comments
 (0)