Mercurial > projects > dstep
view dstep/qtkit/QTCaptureSession.d @ 25:b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Tue, 06 Apr 2010 11:37:27 +0200 |
parents | 19885b43130e |
children |
line wrap: on
line source
/** * Copyright: Copyright (c) 2009 Jacob Carlborg. * Authors: Jacob Carlborg * Version: Initial created: Sep 28, 2009 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) */ module dstep.qtkit.QTCaptureSession; import dstep.foundation.Foundation; import dstep.objc.bridge.Bridge; import dstep.objc.objc; import dstep.qtkit.QTCaptureConnection; import dstep.qtkit.QTCaptureInput; import dstep.qtkit.QTCaptureOutput; import dstep.qtkit.QTKitDefines; import bindings = dstep.qtkit.QTCaptureSession_bindings; private { NSString QTCaptureSessionRuntimeErrorNotification_; NSString QTCaptureSessionErrorKey_; } NSString QTCaptureSessionRuntimeErrorNotification () { if (QTCaptureSessionRuntimeErrorNotification_) return QTCaptureSessionRuntimeErrorNotification_; return QTCaptureSessionRuntimeErrorNotification_ = new NSString(bindings.QTCaptureSessionRuntimeErrorNotification); } NSString QTCaptureSessionErrorKey () { if (QTCaptureSessionErrorKey_) return QTCaptureSessionErrorKey_; return QTCaptureSessionErrorKey_ = new NSString(bindings.QTCaptureSessionErrorKey); } class QTCaptureSession : NSObject, INSCoding { mixin ObjcWrap; this (id object) { super(object); } NSArray inputs () { return invokeObjcSelf!(NSArray, "inputs"); } bool addInput (QTCaptureInput input, ref NSError errorPtr) { id error; if (errorPtr) error = errorPtr.objcObject; bool result = invokeObjcSelf!(bool, "addInput:error:", QTCaptureInput, id*)(input, &error); if (error) errorPtr = new NSError(error); return result; } void removeInput (QTCaptureInput input) { return invokeObjcSelf!(void, "removeInput:", QTCaptureInput)(input); } NSArray outputs () { return invokeObjcSelf!(NSArray, "outputs"); } bool addOutput (QTCaptureOutput output, ref NSError errorPtr) { id error; if (errorPtr) error = errorPtr.objcObject; bool result = invokeObjcSelf!(bool, "addOutput:error:", QTCaptureOutput, id*)(output, &error); if (error) errorPtr = new NSError(error); return result; } void removeOutput (QTCaptureOutput output) { return invokeObjcSelf!(void, "removeOutput:", QTCaptureOutput)(output); } bool isRunning () { return invokeObjcSelf!(bool, "isRunning"); } void startRunning () { return invokeObjcSelf!(void, "startRunning"); } void stopRunning () { return invokeObjcSelf!(void, "stopRunning"); } void encodeWithCoder (NSCoder aCoder) { return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); } QTCaptureSession initWithCoder (NSCoder aDecoder) { return invokeObjcSelf!(QTCaptureSession, "initWithCoder:", NSCoder)(aDecoder); } }