Joris Kluivers avatar Joris Kluivers committed fea0571

Initial plugin providing a fixed heartrate

Comments (0)

Files changed (7)

+# .gitignore in use by Joris Kluivers
+#
+# Latest version:
+# https://gist.github.com/gists/1923197
+ 
+*.DS_Store
+ 
+# Xcode
+*.pbxuser
+*.mode1v3
+*.move2v3
+*.perspectivev3
+*.xcuserstate
+project.xcworkspace/
+xcuserdata/
+ 
+build/
+ 
+# Generated
+*.o
+*.pyc

Heartrates.xcodeproj/project.pbxproj

+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 46;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		A9F0A32116ECDCB6006C9A67 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F0A32016ECDCB6006C9A67 /* Cocoa.framework */; };
+		A9F0A32316ECDCB6006C9A67 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F0A32216ECDCB6006C9A67 /* Quartz.framework */; };
+		A9F0A32F16ECDCB6006C9A67 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A9F0A32D16ECDCB6006C9A67 /* InfoPlist.strings */; };
+		A9F0A33216ECDCB6006C9A67 /* HeartratesPlugIn.m in Sources */ = {isa = PBXBuildFile; fileRef = A9F0A33116ECDCB6006C9A67 /* HeartratesPlugIn.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		A9F0A31D16ECDCB6006C9A67 /* Heartrates.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Heartrates.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
+		A9F0A32016ECDCB6006C9A67 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+		A9F0A32216ECDCB6006C9A67 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; };
+		A9F0A32516ECDCB6006C9A67 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+		A9F0A32616ECDCB6006C9A67 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
+		A9F0A32716ECDCB6006C9A67 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+		A9F0A32C16ECDCB6006C9A67 /* Heartrates-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Heartrates-Info.plist"; sourceTree = "<group>"; };
+		A9F0A32E16ECDCB6006C9A67 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		A9F0A33016ECDCB6006C9A67 /* HeartratesPlugIn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HeartratesPlugIn.h; sourceTree = "<group>"; };
+		A9F0A33116ECDCB6006C9A67 /* HeartratesPlugIn.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HeartratesPlugIn.m; sourceTree = "<group>"; };
+		A9F0A33316ECDCB6006C9A67 /* Heartrates-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Heartrates-Prefix.pch"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		A9F0A31916ECDCB6006C9A67 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				A9F0A32116ECDCB6006C9A67 /* Cocoa.framework in Frameworks */,
+				A9F0A32316ECDCB6006C9A67 /* Quartz.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		A9F0A31116ECDCB6006C9A67 = {
+			isa = PBXGroup;
+			children = (
+				A9F0A32A16ECDCB6006C9A67 /* Heartrates */,
+				A9F0A31F16ECDCB6006C9A67 /* Frameworks */,
+				A9F0A31E16ECDCB6006C9A67 /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		A9F0A31E16ECDCB6006C9A67 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				A9F0A31D16ECDCB6006C9A67 /* Heartrates.plugin */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		A9F0A31F16ECDCB6006C9A67 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				A9F0A32016ECDCB6006C9A67 /* Cocoa.framework */,
+				A9F0A32216ECDCB6006C9A67 /* Quartz.framework */,
+				A9F0A32416ECDCB6006C9A67 /* Other Frameworks */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+		A9F0A32416ECDCB6006C9A67 /* Other Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				A9F0A32516ECDCB6006C9A67 /* AppKit.framework */,
+				A9F0A32616ECDCB6006C9A67 /* CoreData.framework */,
+				A9F0A32716ECDCB6006C9A67 /* Foundation.framework */,
+			);
+			name = "Other Frameworks";
+			sourceTree = "<group>";
+		};
+		A9F0A32A16ECDCB6006C9A67 /* Heartrates */ = {
+			isa = PBXGroup;
+			children = (
+				A9F0A33016ECDCB6006C9A67 /* HeartratesPlugIn.h */,
+				A9F0A33116ECDCB6006C9A67 /* HeartratesPlugIn.m */,
+				A9F0A32B16ECDCB6006C9A67 /* Supporting Files */,
+			);
+			path = Heartrates;
+			sourceTree = "<group>";
+		};
+		A9F0A32B16ECDCB6006C9A67 /* Supporting Files */ = {
+			isa = PBXGroup;
+			children = (
+				A9F0A32C16ECDCB6006C9A67 /* Heartrates-Info.plist */,
+				A9F0A32D16ECDCB6006C9A67 /* InfoPlist.strings */,
+				A9F0A33316ECDCB6006C9A67 /* Heartrates-Prefix.pch */,
+			);
+			name = "Supporting Files";
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		A9F0A31C16ECDCB6006C9A67 /* Heartrates */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = A9F0A33616ECDCB6006C9A67 /* Build configuration list for PBXNativeTarget "Heartrates" */;
+			buildPhases = (
+				A9F0A31816ECDCB6006C9A67 /* Sources */,
+				A9F0A31916ECDCB6006C9A67 /* Frameworks */,
+				A9F0A31A16ECDCB6006C9A67 /* Resources */,
+				A9F0A31B16ECDCB6006C9A67 /* ShellScript */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = Heartrates;
+			productName = Heartrates;
+			productReference = A9F0A31D16ECDCB6006C9A67 /* Heartrates.plugin */;
+			productType = "com.apple.product-type.bundle";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		A9F0A31316ECDCB6006C9A67 /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 0450;
+				ORGANIZATIONNAME = "Joris Kluivers";
+			};
+			buildConfigurationList = A9F0A31616ECDCB6006C9A67 /* Build configuration list for PBXProject "Heartrates" */;
+			compatibilityVersion = "Xcode 3.2";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+			);
+			mainGroup = A9F0A31116ECDCB6006C9A67;
+			productRefGroup = A9F0A31E16ECDCB6006C9A67 /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				A9F0A31C16ECDCB6006C9A67 /* Heartrates */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		A9F0A31A16ECDCB6006C9A67 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				A9F0A32F16ECDCB6006C9A67 /* InfoPlist.strings in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+		A9F0A31B16ECDCB6006C9A67 /* ShellScript */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "# This shell script simply copies the built plug-in to \"~/Library/Graphics/Quartz Composer Plug-Ins\" and overrides any previous version at that location\n\nmkdir -p \"$USER_LIBRARY_DIR/Graphics/Quartz Composer Plug-Ins\"\nrm -rf \"$USER_LIBRARY_DIR/Graphics/Quartz Composer Plug-Ins/Heartrates.plugin\"\ncp -rf \"$BUILT_PRODUCTS_DIR/Heartrates.plugin\" \"$USER_LIBRARY_DIR/Graphics/Quartz Composer Plug-Ins/\"\n";
+		};
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		A9F0A31816ECDCB6006C9A67 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				A9F0A33216ECDCB6006C9A67 /* HeartratesPlugIn.m in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+		A9F0A32D16ECDCB6006C9A67 /* InfoPlist.strings */ = {
+			isa = PBXVariantGroup;
+			children = (
+				A9F0A32E16ECDCB6006C9A67 /* en */,
+			);
+			name = InfoPlist.strings;
+			sourceTree = "<group>";
+		};
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+		A9F0A33416ECDCB6006C9A67 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COPY_PHASE_STRIP = NO;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.8;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = macosx;
+			};
+			name = Debug;
+		};
+		A9F0A33516ECDCB6006C9A67 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COPY_PHASE_STRIP = YES;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.8;
+				SDKROOT = macosx;
+			};
+			name = Release;
+		};
+		A9F0A33716ECDCB6006C9A67 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
+				GCC_ENABLE_OBJC_GC = supported;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "Heartrates/Heartrates-Prefix.pch";
+				INFOPLIST_FILE = "Heartrates/Heartrates-Info.plist";
+				INSTALL_PATH = "$(HOME)/Library/Graphics/Quartz Composer Plug-Ins";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				WRAPPER_EXTENSION = plugin;
+			};
+			name = Debug;
+		};
+		A9F0A33816ECDCB6006C9A67 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
+				GCC_ENABLE_OBJC_GC = supported;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "Heartrates/Heartrates-Prefix.pch";
+				INFOPLIST_FILE = "Heartrates/Heartrates-Info.plist";
+				INSTALL_PATH = "$(HOME)/Library/Graphics/Quartz Composer Plug-Ins";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				WRAPPER_EXTENSION = plugin;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		A9F0A31616ECDCB6006C9A67 /* Build configuration list for PBXProject "Heartrates" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				A9F0A33416ECDCB6006C9A67 /* Debug */,
+				A9F0A33516ECDCB6006C9A67 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		A9F0A33616ECDCB6006C9A67 /* Build configuration list for PBXNativeTarget "Heartrates" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				A9F0A33716ECDCB6006C9A67 /* Debug */,
+				A9F0A33816ECDCB6006C9A67 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = A9F0A31316ECDCB6006C9A67 /* Project object */;
+}

Heartrates/Heartrates-Info.plist

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>${EXECUTABLE_NAME}</string>
+	<key>CFBundleIdentifier</key>
+	<string>nl.tarento.${PRODUCT_NAME:rfc1034identifier}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>${PRODUCT_NAME}</string>
+	<key>CFBundlePackageType</key>
+	<string>BNDL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.1</string>
+	<key>CFBundleVersion</key>
+	<string>1.0</string>
+	<key>NSHumanReadableCopyright</key>
+	<string>Copyright © 2013 Joris Kluivers. All rights reserved.</string>
+	<key>QCPlugInClasses</key>
+	<array>
+		<string>HeartratesPlugIn</string>
+	</array>
+</dict>
+</plist>

Heartrates/Heartrates-Prefix.pch

+//
+// Prefix header for all source files of the 'Heartrates' target in the 'Heartrates' project
+//
+
+#ifdef __OBJC__
+#endif

Heartrates/HeartratesPlugIn.h

+//
+//  HeartratesPlugIn.h
+//  Heartrates
+//
+//  Created by Joris Kluivers on 3/10/13.
+//  Copyright (c) 2013 Joris Kluivers. All rights reserved.
+//
+
+#import <Quartz/Quartz.h>
+
+@interface HeartratesPlugIn : QCPlugIn
+
+// Declare here the properties to be used as input and output ports for the plug-in e.g.
+//@property double inputFoo;
+//@property (copy) NSString* outputBar;
+
+@property(assign) NSUInteger heartrate;
+
+@end

Heartrates/HeartratesPlugIn.m

+//
+//  HeartratesPlugIn.m
+//  Heartrates
+//
+//  Created by Joris Kluivers on 3/10/13.
+//  Copyright (c) 2013 Joris Kluivers. All rights reserved.
+//
+
+// It's highly recommended to use CGL macros instead of changing the current context for plug-ins that perform OpenGL rendering
+#import <OpenGL/CGLMacro.h>
+
+#import "HeartratesPlugIn.h"
+
+#define	kQCPlugIn_Name				@"Heartrates"
+#define	kQCPlugIn_Description		@"Connects to a hartrate monitor and gives access to person heartrate"
+
+@implementation HeartratesPlugIn
+
+@dynamic heartrate;
+
++ (NSDictionary *)attributes
+{
+	// Return a dictionary of attributes describing the plug-in (QCPlugInAttributeNameKey, QCPlugInAttributeDescriptionKey...).
+    return @{QCPlugInAttributeNameKey:kQCPlugIn_Name, QCPlugInAttributeDescriptionKey:kQCPlugIn_Description};
+}
+
++ (NSDictionary *)attributesForPropertyPortWithKey:(NSString *)key
+{
+	if ([key isEqualToString:@"heartrate"]) {
+		return @{ QCPortAttributeNameKey: @"Heartrate" };
+	}
+	
+	return nil;
+}
+
++ (QCPlugInExecutionMode)executionMode
+{
+	return kQCPlugInExecutionModeProvider;
+}
+
++ (QCPlugInTimeMode)timeMode
+{
+	// Return the time dependency mode of the plug-in: kQCPlugInTimeModeNone, kQCPlugInTimeModeIdle or kQCPlugInTimeModeTimeBase.
+	return kQCPlugInTimeModeNone;
+}
+
+- (id)init
+{
+	self = [super init];
+	if (self) {
+		// Allocate any permanent resource required by the plug-in.
+		self.heartrate = 98;
+	}
+	
+	return self;
+}
+
+
+@end
+
+@implementation HeartratesPlugIn (Execution)
+
+- (BOOL)startExecution:(id <QCPlugInContext>)context
+{
+	// Called by Quartz Composer when rendering of the composition starts: perform any required setup for the plug-in.
+	// Return NO in case of fatal failure (this will prevent rendering of the composition to start).
+	
+	return YES;
+}
+
+- (void)enableExecution:(id <QCPlugInContext>)context
+{
+	// Called by Quartz Composer when the plug-in instance starts being used by Quartz Composer.
+}
+
+- (BOOL)execute:(id <QCPlugInContext>)context atTime:(NSTimeInterval)time withArguments:(NSDictionary *)arguments
+{
+	/*
+	Called by Quartz Composer whenever the plug-in instance needs to execute.
+	Only read from the plug-in inputs and produce a result (by writing to the plug-in outputs or rendering to the destination OpenGL context) within that method and nowhere else.
+	Return NO in case of failure during the execution (this will prevent rendering of the current frame to complete).
+	
+	The OpenGL context for rendering can be accessed and defined for CGL macros using:
+	CGLContextObj cgl_ctx = [context CGLContextObj];
+	*/
+	
+	return YES;
+}
+
+- (void)disableExecution:(id <QCPlugInContext>)context
+{
+	// Called by Quartz Composer when the plug-in instance stops being used by Quartz Composer.
+}
+
+- (void)stopExecution:(id <QCPlugInContext>)context
+{
+	// Called by Quartz Composer when rendering of the composition stops: perform any required cleanup for the plug-in.
+}
+
+@end

Heartrates/en.lproj/InfoPlist.strings

+/* Localized versions of Info.plist keys */
+
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.