QCPatch Configuration

From QuartzCompositions.com the central source for Quartz Composer :: wiki

When implementing Custom Patches, the developer has the option to configure these parameters in a subclass of QCPatch.


Table of contents

Patch Configuration (Class Methods)


+ (int)executionMode;

Return a constant that specifies how this Patch is to be executed when evaluating the GFGraph.

Defaults to 0.

Return values:

Numeric / Modifier / Generator --- green title bar
"Consumer Patch" --- Renderer / Environment --- pink title bar --- not permitted to have Output Ports
Source / Tool / Controller --- blue title bar

todo: document exactly how each executionMode differs

Examples of 0 : Numeric / Modifier / Generator

Examples of 1 : Renderer / Environment

Examples of 2 : Source / Tool / Controller

+ (BOOL)allowsSubpatches;

Defaults to 0.

Return values:

Not a Macro Patch; do not allow patches within this patch; patch rendered with round edges
Macro Patch; allow patches within this patch; patch rendered with square edges

Examples of 0

(everything else)

Examples of 1


+ (int)timeMode;

Controls whether the patch renders all the time, or only when inputs change / redraw / mouse and keyboard events. Maybe it controls more too.

Defaults to 0.

Return values:

0

  • If executionMode == 1, patch is only execute()d when inputs change / redraw / mouse and keyboard events
  • If executionMode != 1, patch is only execute()d if connected to a Renderer patch, and only when inputs change / redraw / mouse and keyboard events
  • "Timebase" menu option is hidden

1

  • If executionMode == 1, patch is constantly execute()d
  • If executionMode != 1, patch is constantly execute()d if connected to a Renderer patch
  • "Timebase" menu option is enabled --- Image:QCClock-Timebase.png

2

  • If executionMode == 1, patch is only execute()d when inputs change / redraw / mouse and keyboard events
  • If executionMode != 1, patch is only execute()d if connected to a Renderer patch, and only when inputs change / redraw / mouse and keyboard events
  • "Timebase" menu option is hidden

(how does this differ from timeMode==0 ?)


Examples of 0

(everything else)

Examples of 1

Examples of 2

+ (unsigned int)stateVersion;

(unknown purpose)

Defaults to 0.

Return values:

(unknown)
(unknown)

Examples of 0

(everything else)

Examples of 1