Muvicado HD
Loading...
Searching...
No Matches
PlayArea Class Reference

NSView subclass that hosts pads, modes, and editing commands. More...

#include <PlayArea.h>

Inheritance diagram for PlayArea:
Collaboration diagram for PlayArea:

Instance Methods

(void) - setMode:
(void) - setTemporaryPad:
(void) - clearTemporaryPad
(IBAction) - startMIDI:
(IBAction) - stopMIDI:
(void) - setColorPlay:
(void) - setColorMove:
(IBAction) - setColorA:
(IBAction) - setColorB:
(IBAction) - doCut:
(IBAction) - doCopy:
(IBAction) - doPaste:
(IBAction) - doDelete:
(IBAction) - doSelectAll:
(void) - drawGridOfPads
(id) - initWithFrame: [implementation]
(void) - awakeFromNib [implementation]
(void) - dealloc [implementation]
(void) - doAction: [implementation]
(void) - setLineWidth [implementation]
(void) - duplicatePadsWithDX:DY: [implementation]
(void) - movePadsWithDX:DY: [implementation]
(void) - scalePadsWithSX:SY: [implementation]
(void) - rotateByDegrees: [implementation]
(void) - pathOperation: [implementation]
(void) - rotateCommand:forEvent: [implementation]
(void) - scaleCommand:forEvent: [implementation]
(void) - nudgeCommand:forEvent: [implementation]
(void) - keyDown: [implementation]
(void) - doPad: [implementation]
(void) - mouseDown: [implementation]
(void) - mouseDragged: [implementation]
(void) - mouseMoved: [implementation]
(void) - mouseUp: [implementation]
(void) - nullSweep [implementation]
(void) - resetCursorRects [implementation]
(bool) - shouldDrawPad: [implementation]
(void) - drawRect: [implementation]
Instance Methods inherited from PadView
(Controller *) - makeController
(Controller *) - getController
(void) - refresh
(void) - addPad:
(void) - addElement:
(NSPoint) - localPointForEvent:
(Pad *) - testForPadHitWithPoint:
(void) - startPad:
(void) - stopPad:
(Pad *) - findPadForNote:
(NSMutableArray *) - findPadsForNote:
(NSMutableArray *) - selectedPads
(NSMutableArray *) - unselectedPads
(void) - selectAllPadsForCurrentLayer
(void) - setAllPadsToSelected:
(void) - selectAllPads
(void) - deselectAllPads
(void) - deletePad:
(void) - randomColors
(void) - setSeeThru:
(void) - duplicateSelectedPads
(NSPoint) - snapGridWithX:Y:
(NSPoint) - snapGridWithPoint:
(int) - numSelectedPads
(Pad *) - getSingleSelectedPad
(NSMutableArray *) - getElementBag
(void) - setNoteOfSelectedPads:
(void) - setNoteOfSingleSelectedPad:
(void) - setMarquee:
(void) - showMarquee
(void) - hideMarquee
(void) - selectPadsIntersectingWithRect:onLayer:
(void) - doCutElements
(void) - doCopyElements
(void) - doPasteElements
(void) - doDeleteElements
(void) - doSelectAllElements
(BOOL) - acceptsFirstMouse: [implementation]
(BOOL) - mouseDownCanMoveWindow [implementation]
(void) - dummy [implementation]
(NSMutableArray *) - findPadsForSelected: [implementation]
(BOOL) - acceptsFirstResponder [implementation]
(BOOL) - becomeFirstResponder [implementation]
(BOOL) - resignFirstResponder [implementation]
(void) - rightMouseDown: [implementation]
(void) - otherMouseDown: [implementation]
(void) - rightMouseUp: [implementation]
(void) - otherMouseUp: [implementation]
(void) - scrollWheel: [implementation]
(void) - rightMouseDragged: [implementation]
(void) - otherMouseDragged: [implementation]
(void) - mouseEntered: [implementation]
(void) - mouseExited: [implementation]
(void) - keyUp: [implementation]
(void) - tabletPoint: [implementation]
(void) - tabletProximity: [implementation]
(void) - cursorUpdate: [implementation]
(void) - noResponderFor: [implementation]
(void) - doit: [implementation]
(BOOL) - isFlipped [implementation]
(void) - setNoteOfPad:fromPad: [implementation]
(IBAction) - doOpen:
(IBAction) - doSave:
(IBAction) - doSaveAs:
(IBAction) - doImport:
(IBAction) - doExport:
(BOOL) - getPointFromXYPair [implementation]
(void) - parser:didStartElement:namespaceURI:qualifiedName:attributes: [implementation]
(void) - parser:parseErrorOccurred: [implementation]
(void) - parser:didEndElement:namespaceURI:qualifiedName: [implementation]
(void) - alertDidEnd:returnCode:contextInfo: [implementation]
(void) - parseXMLFile: [implementation]
(void) - openXmlPanelDidEnd:returnCode:contextInfo: [implementation]
(void) - openXMLFile [implementation]
(void) - setCurrentFile: [implementation]
(void) - parseMvFile: [implementation]
(void) - openMvPanelDidEnd:returnCode:contextInfo: [implementation]
(void) - openMvFile [implementation]
(NSString *) - panel:userEnteredFilename:confirmed: [implementation]
(void) - saveXMLFile: [implementation]
(void) - saveXmlPanelDidEnd:returnCode:contextInfo: [implementation]
(void) - saveXMLFile [implementation]
(BOOL) - saveMvToFile: [implementation]
(void) - saveMvPanelDidEnd:returnCode:contextInfo: [implementation]
(void) - saveMvFile [implementation]

Protected Attributes

NSBezierPath * wallpaperPath
NSColor * cA
NSColor * cB
IBOutlet NSColorWell * colorA
IBOutlet NSColorWell * colorB
Modemode
Protected Attributes inherited from PadView
NSMutableArray * elementBag
IBOutlet Controllercontroller
PadlastPad
PadlastPadPlayed
Boolean gridShow
int gridX
int gridY
int padLayer
NSMutableArray * _clipboard
BOOL _marqueeVisible
NSRect _marqueeSelectionBounds
int num_draws
BOOL _hasHitPad

Additional Inherited Members

Class Methods inherited from PadView
(NSPoint) + snap90Point:fromAnchor:

Detailed Description

NSView subclass that hosts pads, modes, and editing commands.

Concrete implementation of PlayArea behaviors and event routing.

Adds mode switching, color management, MIDI controls, and utilities for drawing sample content on top of the base PadView behaviors.

Definition at line 25 of file PlayArea.h.

Method Documentation

◆ awakeFromNib

- (void) awakeFromNib
implementation

Enables mouse moved events and brings the window to the front.

Definition at line 218 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearTemporaryPad

- (void) clearTemporaryPad

Clears any temporary pad currently being displayed.

Clears any temporary pad.

Definition at line 902 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dealloc

- (void) dealloc
implementation

Releases retained resources including wallpaper path and colors.

Reimplemented from PadView.

Definition at line 229 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doAction:

- (void) doAction: (Pad *) pad
implementation

Executes a UI action associated with a pad (mode switches, grid toggle, etc.).

Parameters
padThe pad whose action should be performed.

Reimplemented from PadView.

Definition at line 241 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doCopy:

- (IBAction) doCopy: (id) sender

Copies selected elements.

Definition at line 1068 of file PlayArea.m.

Here is the call graph for this function:

◆ doCut:

- (IBAction) doCut: (id) sender

Cuts selected elements.

Definition at line 1064 of file PlayArea.m.

Here is the call graph for this function:

◆ doDelete:

- (IBAction) doDelete: (id) sender

Deletes selected elements.

Definition at line 1076 of file PlayArea.m.

Here is the call graph for this function:

◆ doPad:

- (void) doPad: (Pad *) pad
implementation

Overrides PadView to handle layer switching when interacting with pads.

Reimplemented from PadView.

Definition at line 834 of file PlayArea.m.

Here is the call graph for this function:

◆ doPaste:

- (IBAction) doPaste: (id) sender

Pastes previously cut/copied elements.

Pastes elements.

Definition at line 1072 of file PlayArea.m.

Here is the call graph for this function:

◆ doSelectAll:

- (IBAction) doSelectAll: (id) sender

Selects all elements on the current layer.

Selects all elements.

Definition at line 1080 of file PlayArea.m.

Here is the call graph for this function:

◆ drawGridOfPads

- (void) drawGridOfPads

Programmatically generates a grid of pads for testing/demo purposes.

Creates a matrix of pads across multiple layers for testing.

Definition at line 487 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawRect:

- (void) drawRect: (NSRect) dirtyRect
implementation

Draws background color, pads, temporary pad, and mode overlays.

Reimplemented from PadView.

Definition at line 1002 of file PlayArea.m.

Here is the call graph for this function:

◆ duplicatePadsWithDX:DY:

- (void) duplicatePadsWithDX: (CGFloat) deltaX
DY: (CGFloat) deltaY 
implementation

Duplicates selected pads by a translation and selects the new copies.

Definition at line 316 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initWithFrame:

- (id) initWithFrame: (NSRect) frame
implementation

Initializes the play area with default content and configuration.

Parameters
frameThe initial frame rectangle.

Reimplemented from PadView.

Definition at line 32 of file PlayArea.m.

Here is the call graph for this function:

◆ keyDown:

- (void) keyDown: (NSEvent *) event
implementation

Handles keyboard shortcuts for selection, colors, transformations, and modes.

Definition at line 534 of file PlayArea.m.

Here is the call graph for this function:

◆ mouseDown:

- (void) mouseDown: (NSEvent *) event
implementation

Forwards mouse down to current mode or super.

Reimplemented from PadView.

Definition at line 843 of file PlayArea.m.

Here is the call graph for this function:

◆ mouseDragged:

- (void) mouseDragged: (NSEvent *) event
implementation

Forwards mouse dragged to current mode or super.

Reimplemented from PadView.

Definition at line 853 of file PlayArea.m.

Here is the call graph for this function:

◆ mouseMoved:

- (void) mouseMoved: (NSEvent *) event
implementation

Forwards mouse moved to current mode or super.

Reimplemented from PadView.

Definition at line 863 of file PlayArea.m.

Here is the call graph for this function:

◆ mouseUp:

- (void) mouseUp: (NSEvent *) event
implementation

Forwards mouse up to current mode or super.

Reimplemented from PadView.

Definition at line 873 of file PlayArea.m.

Here is the call graph for this function:

◆ movePadsWithDX:DY:

- (void) movePadsWithDX: (CGFloat) deltaX
DY: (CGFloat) deltaY 
implementation

Translates all selected pads by the specified deltas.

Definition at line 333 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nudgeCommand:forEvent:

- (void) nudgeCommand: (unichar) ch
forEvent: (NSEvent *) event 
implementation

Nudges selected pads by grid-sized deltas using arrow keys.

Definition at line 465 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nullSweep

- (void) nullSweep
implementation

Called when a click/drag cycle hits no pads: toggles between Move and Rest modes.

Reimplemented from PadView.

Definition at line 885 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pathOperation:

- (void) pathOperation: (gpc_op) op
implementation

Performs a boolean path operation (union, xor, etc.) on two selected pads.

Definition at line 395 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetCursorRects

- (void) resetCursorRects
implementation

Updates the cursor rects to match the current mode's cursor.

Definition at line 913 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateByDegrees:

- (void) rotateByDegrees: (CGFloat) angle
implementation

Rotates selected pads around their combined center by degrees.

Definition at line 372 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateCommand:forEvent:

- (void) rotateCommand: (unichar) ch
forEvent: (NSEvent *) event 
implementation

Interprets arrow keys with modifiers as rotate commands.

Definition at line 423 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scaleCommand:forEvent:

- (void) scaleCommand: (unichar) ch
forEvent: (NSEvent *) event 
implementation

Interprets arrow keys with Control/Shift as scale commands.

Definition at line 443 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scalePadsWithSX:SY:

- (void) scalePadsWithSX: (CGFloat) scaleX
SY: (CGFloat) scaleY 
implementation

Scales selected pads around their combined center.

Definition at line 346 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColorA:

- (IBAction) setColorA: (id) sender

IBAction to update play color from a color well.

Definition at line 975 of file PlayArea.m.

Here is the call graph for this function:

◆ setColorB:

- (IBAction) setColorB: (id) sender

IBAction to update move color from a color well.

Definition at line 983 of file PlayArea.m.

Here is the call graph for this function:

◆ setColorMove:

- (void) setColorMove: (NSColor *) color

Sets the color used when an interaction mode is active.

Sets the secondary background color used when a mode is active.

Definition at line 963 of file PlayArea.m.

Here is the call graph for this function:

◆ setColorPlay:

- (void) setColorPlay: (NSColor *) color

Sets the color used when the area is in play (no mode) state.

Sets the primary background color used when no mode is active.

Definition at line 952 of file PlayArea.m.

Here is the call graph for this function:

◆ setLineWidth

- (void) setLineWidth
implementation

Sets line width of selected pads to 0.0 and refreshes.

Definition at line 305 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMode:

- (void) setMode: (Mode *) aMode

Sets the active interaction mode for the play area.

Switches the active mode, calling cleanUp/setUp appropriately and updating the cursor.

Parameters
aModeThe new mode or nil to clear.

Definition at line 925 of file PlayArea.m.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTemporaryPad:

- (void) setTemporaryPad: (Pad *) pad

Sets a temporary pad used for interactive creation feedback.

Sets a temporary pad displayed during interactive creation.

Definition at line 898 of file PlayArea.m.

Here is the caller graph for this function:

◆ shouldDrawPad:

- (bool) shouldDrawPad: (Pad *) pad
implementation

Determines if a pad should be drawn by this view instance. Subclasses can override to filter by layer or other criteria.

Parameters
padThe pad in question.
Returns
YES if the pad should be drawn; otherwise NO.

Reimplemented from PadView.

Definition at line 990 of file PlayArea.m.

◆ startMIDI:

- (IBAction) startMIDI: (id) sender

Starts MIDI services and device connections.

Starts MIDI devices and connections.

Definition at line 1088 of file PlayArea.m.

Here is the call graph for this function:

◆ stopMIDI:

- (IBAction) stopMIDI: (id) sender

Stops MIDI services and releases device connections.

Stops MIDI devices and connections.

Definition at line 1100 of file PlayArea.m.

Here is the call graph for this function:

Member Data Documentation

◆ cA

- (NSColor*) cA
protected

Primary color used when no mode is active ("play" color).

Definition at line 29 of file PlayArea.h.

◆ cB

- (NSColor*) cB
protected

Secondary color used when a mode is active ("move" color).

Definition at line 31 of file PlayArea.h.

◆ colorA

- (IBOutlet NSColorWell*) colorA
protected

Color well bound to the play color.

Definition at line 33 of file PlayArea.h.

◆ colorB

- (IBOutlet NSColorWell*) colorB
protected

Color well bound to the move color.

Definition at line 35 of file PlayArea.h.

◆ mode

- (Mode*) mode
protected

Currently active interaction mode for the play area.

Definition at line 37 of file PlayArea.h.

◆ wallpaperPath

- (NSBezierPath*) wallpaperPath
protected

Decorative background path used as wallpaper.

Definition at line 27 of file PlayArea.h.


The documentation for this class was generated from the following files: