QCPatch Methods
From QuartzCompositions.com the central source for Quartz Composer :: wiki
When implementing Custom Patches, the developer has the option to perform self-operations on a subclass of QCPatch.
| Table of contents |
[edit]
Pausing and Resuming Notifications
[edit]
[self pauseNotifications];
- Pause notifications before creating/deleting input/output ports.
[edit]
[self resumeNotifications];
- Resume notifications after input/output port creation/deletion is complete.
[edit]
Creating and Deleting Input and Output Ports
[edit]
[self createInputWithPortClass:portclass forKey:key attributes:0x0];
- adds key to the input ports list
- portclass should be the "class" method of a class derived from QCPort. For example: [QCNumberPort class]
- key should be an arbitrary NSString, unique to this patch instance. For example: @"controller_0"
- attributes is possibly used to specify enum lists
[edit]
[self deleteInputForKey:key];
- removes key from the input ports list
[edit]
[self createOutputWithPortClass:portclass forKey:key attributes:0x0];
- adds key to the output ports list
- portclass should be the "class" method of a class derived from QCPort. For example: [QCNumberPort class]
- key should be an arbitrary NSString, unique to this patch instance. For example: @"controller_0"
- attributes is possibly used to specify enum lists
- Consumer patches (executionMode() == 1) cannot have output ports.
[edit]
[self deleteOutputForKey:key];
- removes key from the output ports list
[edit]
Logging
[edit]
[self logMessage:@"foo"];
- Logs a message to the system console.
- Logs a message to the Viewer Log Drawer.
- Puts the patch in Debug mode.
[edit]
NSLog(@"foo");
- Logs a message to the system console (without logging to the Viewer Log Drawer or putting the patch in Debug Mode.
