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

NSView subclass that displays and edits Pad elements. More...

#include <PadView.h>

Inheritance diagram for PadView:
Collaboration diagram for PadView:

Instance Methods

(Controller *) - makeController
(Controller *) - getController
(void) - refresh
(void) - addPad:
(void) - addElement:
(NSPoint) - localPointForEvent:
(Pad *) - testForPadHitWithPoint:
(void) - startPad:
(void) - stopPad:
(void) - doPad:
(void) - doAction:
(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:
(void) - nullSweep
(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
(id) - initWithFrame: [implementation]
(bool) - shouldDrawPad: [implementation]
(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) - drawRect: [implementation]
(void) - doit: [implementation]
(void) - mouseDown: [implementation]
(void) - mouseDragged: [implementation]
(void) - mouseMoved: [implementation]
(void) - mouseUp: [implementation]
(BOOL) - isFlipped [implementation]
(void) - dealloc [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]

Class Methods

(NSPoint) + snap90Point:fromAnchor:

Protected Attributes

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

Detailed Description

NSView subclass that displays and edits Pad elements.

Concrete implementation of PadView behaviors, including drawing and events.

PadView maintains an element bag, supports selection/editing operations, draws a grid, and forwards user interactions to a Controller and MIDI layer.

Definition at line 25 of file PadView.h.

Method Documentation

◆ acceptsFirstMouse:

- (BOOL) acceptsFirstMouse: (NSEvent *) theEvent
implementation

Allows click-through activation.

Definition at line 50 of file PadView.m.

◆ acceptsFirstResponder

- (BOOL) acceptsFirstResponder
implementation

Accepts first responder to receive key and mouse events.

Definition at line 266 of file PadView.m.

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

◆ addElement:

- (void) addElement: (Element *) e

Adds a generic element to the element bag.

Adds a generic element to the internal element bag.

Definition at line 68 of file PadView.m.

◆ addPad:

- (void) addPad: (Pad *) pad

Adds a pad to the element bag.

Adds a pad to the internal element bag.

Definition at line 63 of file PadView.m.

Here is the caller graph for this function:

◆ alertDidEnd:returnCode:contextInfo:

- (void) alertDidEnd: (NSAlert *) alert
returnCode: (int) returnCode
contextInfo: (void *) contextInfo 
implementation

Alert sheet completion callback (reserved for future handling).

Provided by category PadView(Persist).

Definition at line 316 of file PadView+Persist.m.

◆ becomeFirstResponder

- (BOOL) becomeFirstResponder
implementation

Becomes first responder; returns YES.

Definition at line 270 of file PadView.m.

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

◆ cursorUpdate:

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

Placeholder: cursor update.

Definition at line 307 of file PadView.m.

◆ dealloc

- (void) dealloc
implementation

Releases retained objects before deallocation.

Reimplemented in NotePaletteArea, PageSelectArea, and PlayArea.

Definition at line 641 of file PadView.m.

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

◆ deletePad:

- (void) deletePad: (Pad*) pad

Deletes a pad from the element bag and clears orphans.

Removes a pad from the element bag and clears related state.

Definition at line 218 of file PadView.m.

Here is the caller graph for this function:

◆ deselectAllPads

- (void) deselectAllPads

Deselects all pads.

Definition at line 213 of file PadView.m.

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

◆ doAction:

- (void) doAction: (Pad *) pad

Performs a pad's UI action (mode toggles, etc.).

Performs a UI action associated with the pad (if any).

Reimplemented in PlayArea.

Definition at line 524 of file PadView.m.

Here is the caller graph for this function:

◆ doCopyElements

- (void) doCopyElements

Copies selected elements to an internal clipboard.

Copies selected pads to an internal clipboard without deleting them.

Definition at line 799 of file PadView.m.

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

◆ doCutElements

- (void) doCutElements

Cuts selected elements to an internal clipboard.

Cuts selected pads to an internal clipboard and deletes them from the view.

Definition at line 791 of file PadView.m.

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

◆ doDeleteElements

- (void) doDeleteElements

Deletes selected elements.

Deletes all currently selected pads.

Definition at line 825 of file PadView.m.

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

◆ doExport:

- (IBAction) doExport: (id) sender

Presents a Save panel to export the current document as XML (.muvi).

IBAction: Export to XML (.muvi).

Provided by category PadView(Persist).

Definition at line 690 of file PadView+Persist.m.

◆ doImport:

- (IBAction) doImport: (id) sender

Presents an Open panel to import an XML (.muvi) file.

IBAction: Import from XML (.muvi).

Provided by category PadView(Persist).

Definition at line 685 of file PadView+Persist.m.

◆ doit:

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

Convenience method to hit-test and perform a pad action for an event.

Reimplemented in NotePaletteArea, and PageSelectArea.

Definition at line 570 of file PadView.m.

Here is the call graph for this function:

◆ doOpen:

- (IBAction) doOpen: (id) sender

Presents an Open panel to choose and load a native .mv file.

IBAction: Open a native .mv file.

Provided by category PadView(Persist).

Definition at line 634 of file PadView+Persist.m.

◆ doPad:

- (void) doPad: (Pad *) pad

Performs a pad's primary action (if any).

Handles pad transitions: stops the previous pad if different and starts the new one.

Parameters
padThe pad to activate, or nil to stop the current one.

Reimplemented in PageSelectArea, and PlayArea.

Definition at line 534 of file PadView.m.

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

◆ doPasteElements

- (void) doPasteElements

Pastes elements from the internal clipboard.

Pastes pads from the internal clipboard onto the current layer and selects them.

Definition at line 806 of file PadView.m.

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

◆ doSave:

- (IBAction) doSave: (id) sender

Saves the current document to the existing .mv path or prompts with Save As.

IBAction: Save the current document. Falls back to Save As if no current file.

Provided by category PadView(Persist).

Definition at line 639 of file PadView+Persist.m.

◆ doSaveAs:

- (IBAction) doSaveAs: (id) sender

Presents a Save panel to choose a destination for the .mv file.

IBAction: Save As… to choose a new .mv destination.

Provided by category PadView(Persist).

Definition at line 680 of file PadView+Persist.m.

◆ doSelectAllElements

- (void) doSelectAllElements

Selects all elements on the current layer.

Selects all pads on the current layer and refreshes the view.

Definition at line 833 of file PadView.m.

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

◆ drawRect:

- (void) drawRect: (NSRect) dirtyRect
implementation

Draws the view: background, optional grid, pads, and marquee overlay.

Parameters
dirtyRectThe area that needs to be redrawn.

Reimplemented in NotePaletteArea, PageSelectArea, and PlayArea.

Definition at line 369 of file PadView.m.

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

◆ dummy

- (void) dummy
implementation

Definition at line 72 of file PadView.m.

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

◆ duplicateSelectedPads

- (void) duplicateSelectedPads

Duplicates selected pads with an offset.

Duplicates selected pads and offsets them by one grid step.

Definition at line 251 of file PadView.m.

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

◆ findPadForNote:

- (Pad *) findPadForNote: (int) note

Finds the first pad with the specified MIDI note number.

Finds the first pad with the given MIDI note number.

Definition at line 137 of file PadView.m.

◆ findPadsForNote:

- (NSMutableArray *) findPadsForNote: (int) note

Finds all pads with the specified MIDI note number.

Finds all pads with the given MIDI note number.

Definition at line 152 of file PadView.m.

Here is the caller graph for this function:

◆ findPadsForSelected:

- (NSMutableArray *) findPadsForSelected: (BOOL) selected
implementation

Returns all visible pads whose selected state matches the argument.

Definition at line 166 of file PadView.m.

Here is the caller graph for this function:

◆ getController

- (Controller *) getController

Returns the existing controller reference.

Returns the existing Controller instance.

Definition at line 102 of file PadView.m.

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

◆ getElementBag

- (NSMutableArray *) getElementBag

Returns the internal mutable element bag.

Provides access to the internal element storage.

Definition at line 681 of file PadView.m.

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

◆ getPointFromXYPair

- (BOOL) getPointFromXYPair (NSString *) xyPair
(NSPoint *) point 
implementation

Parse an SVG-style coordinate pair string into an NSPoint.

Parameters
xyPairA string containing "x,y".
pointOutput parameter that receives the parsed point (must be non-null).
Returns
YES if parsing succeeds and point is assigned; NO otherwise.

Provided by category PadView(Persist).

Definition at line 37 of file PadView+Persist.m.

◆ getSingleSelectedPad

- (Pad *) getSingleSelectedPad

Returns the single selected pad, or nil if zero or multiple selected.

Returns the single selected pad, or nil if zero or multiple are selected.

Definition at line 661 of file PadView.m.

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

◆ hideMarquee

- (void) hideMarquee

Hides the marquee rectangle.

Hides the marquee selection overlay and refreshes the view.

Definition at line 752 of file PadView.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 view with default grid and storage settings.

Parameters
frameThe initial frame rectangle.
Returns
An initialized PadView instance.

Reimplemented in NotePaletteArea, PageSelectArea, and PlayArea.

Definition at line 27 of file PadView.m.

Here is the caller graph for this function:

◆ isFlipped

- (BOOL) isFlipped
implementation

Returns YES to make the view's origin at the top-left (flipped coordinates).

Definition at line 636 of file PadView.m.

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

◆ keyUp:

- (void) keyUp: (NSEvent *) theEvent
implementation

Placeholder: key up.

Definition at line 300 of file PadView.m.

◆ localPointForEvent:

- (NSPoint) localPointForEvent: (NSEvent *) event

Converts a window event location to this view's local coordinates.

Converts an event's window location to local view coordinates.

Definition at line 561 of file PadView.m.

Here is the caller graph for this function:

◆ makeController

- (Controller *) makeController

Creates and returns a controller owned by this view.

Creates and retains a new Controller instance owned by this view.

Definition at line 95 of file PadView.m.

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

◆ mouseDown:

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

Handles mouse down: tests for pad hit and triggers action or playback.

Reimplemented in NotePaletteArea, PageSelectArea, and PlayArea.

Definition at line 576 of file PadView.m.

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

◆ mouseDownCanMoveWindow

- (BOOL) mouseDownCanMoveWindow
implementation

Allows dragging the window by clicking in the view.

Definition at line 58 of file PadView.m.

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

◆ mouseDragged:

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

Handles mouse drag: continues playback under cursor, or stops if leaving.

Reimplemented in NotePaletteArea, PageSelectArea, and PlayArea.

Definition at line 594 of file PadView.m.

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

◆ mouseEntered:

- (void) mouseEntered: (NSEvent *) theEvent
implementation

Placeholder: mouse entered.

Definition at line 296 of file PadView.m.

◆ mouseExited:

- (void) mouseExited: (NSEvent *) theEvent
implementation

Placeholder: mouse exited.

Definition at line 298 of file PadView.m.

◆ mouseMoved:

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

Displays pad info under the cursor without changing playback state.

Reimplemented in NotePaletteArea, PageSelectArea, and PlayArea.

Definition at line 609 of file PadView.m.

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

◆ mouseUp:

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

Completes interaction: stops any active pad and invokes nullSweep if needed.

Reimplemented in NotePaletteArea, PageSelectArea, and PlayArea.

Definition at line 621 of file PadView.m.

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

◆ noResponderFor:

- (void) noResponderFor: (SEL) eventSelector
implementation

Placeholder: no responder for selector.

Definition at line 309 of file PadView.m.

◆ nullSweep

- (void) nullSweep

Called when no pad was hit during a click-drag cycle.

Called when a click-drag resulted in no pad hit; override to customize.

Reimplemented in PlayArea.

Definition at line 632 of file PadView.m.

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

◆ numSelectedPads

- (int) numSelectedPads

Returns the number of selected pads.

Counts and returns the number of selected pads.

Definition at line 647 of file PadView.m.

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

◆ openMvFile

- (void) openMvFile
implementation

Present an Open panel to choose a native .mv file to open.

Provided by category PadView(Persist).

Definition at line 448 of file PadView+Persist.m.

Here is the caller graph for this function:

◆ openMvPanelDidEnd:returnCode:contextInfo:

- (void) openMvPanelDidEnd: (NSOpenPanel *) sheet
returnCode: (int) returnCode
contextInfo: (void *) contextInfo 
implementation

Completion handler for the Open panel when opening a native .mv file.

Provided by category PadView(Persist).

Definition at line 435 of file PadView+Persist.m.

◆ openXMLFile

- (void) openXMLFile
implementation

Present an Open panel to choose a .muvi XML file to import.

Provided by category PadView(Persist).

Definition at line 362 of file PadView+Persist.m.

Here is the caller graph for this function:

◆ openXmlPanelDidEnd:returnCode:contextInfo:

- (void) openXmlPanelDidEnd: (NSOpenPanel *) sheet
returnCode: (int) returnCode
contextInfo: (void *) contextInfo 
implementation

Completion handler for the Open panel when importing XML (.muvi). Persists the starting directory and triggers parsing.

Provided by category PadView(Persist).

Definition at line 349 of file PadView+Persist.m.

◆ otherMouseDown:

- (void) otherMouseDown: (NSEvent *) theEvent
implementation

Placeholder: other mouse down.

Definition at line 281 of file PadView.m.

◆ otherMouseDragged:

- (void) otherMouseDragged: (NSEvent *) theEvent
implementation

Placeholder: other mouse dragged.

Definition at line 294 of file PadView.m.

◆ otherMouseUp:

- (void) otherMouseUp: (NSEvent *) theEvent
implementation

Placeholder: other mouse up.

Definition at line 286 of file PadView.m.

◆ panel:userEnteredFilename:confirmed:

- (NSString *) panel: (id) sender
userEnteredFilename: (NSString *) filename
confirmed: (BOOL) okFlag 
implementation

NSSavePanel/NSOpenPanel delegate allowing user-entered filenames.

Returns
The confirmed filename when okFlag is YES; otherwise nil.

Provided by category PadView(Persist).

Definition at line 466 of file PadView+Persist.m.

◆ parseMvFile:

- (void) parseMvFile: (NSString *) pathToFile
implementation

Parse and load a native .mv archive produced by NSKeyedArchiver.

Parameters
pathToFileAbsolute path to the .mv file.

Provided by category PadView(Persist).

Definition at line 393 of file PadView+Persist.m.

Here is the caller graph for this function:

◆ parser:didEndElement:namespaceURI:qualifiedName:

- (void) parser: (NSXMLParser *) parser
didEndElement: (NSString *) elementName
namespaceURI: (NSString *) namespaceURI
qualifiedName: (NSString *) qName 
implementation

NSXMLParser delegate: end element handler (currently unused).

Provided by category PadView(Persist).

Definition at line 312 of file PadView+Persist.m.

◆ parser:didStartElement:namespaceURI:qualifiedName:attributes:

- (void) parser: (NSXMLParser *) parser
didStartElement: (NSString *) elementName
namespaceURI: (NSString *) namespaceURI
qualifiedName: (NSString *) qName
attributes: (NSDictionary *) attributeDict 
implementation

NSXMLParser delegate: called when the parser encounters a start element.

Handles <svg>, <g>, and <path> elements to construct Pad instances and their geometry/colors.

Parameters
parserThe XML parser.
elementNameThe qualified element name.
namespaceURIThe namespace URI (unused).
qNameThe qualified name (unused).
attributeDictAttributes for the element.

M (absolute) m (relative) moveto (x y)+ Start a new sub-path at the given (x,y) coordinate. M (uppercase) indicates that absolute coordinates will follow; m (lowercase) indicates that relative coordinates will follow. If a moveto is followed by multiple pairs of coordinates, the subsequent pairs are treated as implicit lineto commands. Hence, implicit lineto commands will be relative if the moveto is relative, and absolute if the moveto is absolute. If a relative moveto (m) appears as the first element of the path, then it is treated as a pair of absolute coordinates. In this case, subsequent pairs of coordinates are treated as relative even though the initial moveto is interpreted as an absolute moveto.

Provided by category PadView(Persist).

Definition at line 66 of file PadView+Persist.m.

◆ parser:parseErrorOccurred:

- (void) parser: (NSXMLParser *) parser
parseErrorOccurred: (NSError *) parseError 
implementation

NSXMLParser delegate: called when a parsing error occurs. Presents an alert describing the error, line, and column.

Parameters
parserThe XML parser.
parseErrorThe parsing error.

Provided by category PadView(Persist).

Definition at line 295 of file PadView+Persist.m.

◆ parseXMLFile:

- (void) parseXMLFile: (NSString *) pathToFile
implementation

Parse and import a .muvi XML/SVG file, updating the view contents.

Parameters
pathToFileAbsolute path to the .muvi file.

Provided by category PadView(Persist).

Definition at line 327 of file PadView+Persist.m.

Here is the caller graph for this function:

◆ randomColors

- (void) randomColors

Assigns random colors to selected pads.

Assigns random colors to all selected pads.

Definition at line 231 of file PadView.m.

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

◆ refresh

- (void) refresh

Marks the view as needing display.

Requests that the view be redrawn on the next update cycle.

Definition at line 556 of file PadView.m.

Here is the call graph for this function:

◆ resignFirstResponder

- (BOOL) resignFirstResponder
implementation

Resigns first responder; returns YES.

Definition at line 274 of file PadView.m.

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

◆ rightMouseDown:

- (void) rightMouseDown: (NSEvent *) theEvent
implementation

Placeholder: right mouse down.

Definition at line 279 of file PadView.m.

◆ rightMouseDragged:

- (void) rightMouseDragged: (NSEvent *) theEvent
implementation

Placeholder: right mouse dragged.

Definition at line 292 of file PadView.m.

◆ rightMouseUp:

- (void) rightMouseUp: (NSEvent *) theEvent
implementation

Placeholder: right mouse up.

Definition at line 284 of file PadView.m.

◆ saveMvFile

- (void) saveMvFile
implementation

Present a Save panel to save the current document as a native .mv file.

Provided by category PadView(Persist).

Definition at line 617 of file PadView+Persist.m.

Here is the caller graph for this function:

◆ saveMvPanelDidEnd:returnCode:contextInfo:

- (void) saveMvPanelDidEnd: (NSSavePanel *) sheet
returnCode: (NSInteger) returnCode
contextInfo: (void *) contextInfo 
implementation

Completion handler for the Save panel when saving a native .mv file.

Provided by category PadView(Persist).

Definition at line 596 of file PadView+Persist.m.

◆ saveMvToFile:

- (BOOL) saveMvToFile: (NSString *) pathToFile
implementation

Save the current elements to a native archive (.mv). called by doSave and by saveMvPanelDidEnd

Parameters
pathToFileDestination path for the archive.
Returns
YES on success; NO otherwise.

Provided by category PadView(Persist).

Definition at line 589 of file PadView+Persist.m.

◆ saveXMLFile

- (void) saveXMLFile
implementation

Present a Save panel to export the current document as XML (.muvi).

Provided by category PadView(Persist).

Definition at line 566 of file PadView+Persist.m.

Here is the caller graph for this function:

◆ saveXMLFile:

- (void) saveXMLFile: (NSString *) pathToFile
implementation

Serialize the current elements to an SVG-like XML file (.muvi).

Parameters
pathToFileDestination path for the XML.

Provided by category PadView(Persist).

Definition at line 483 of file PadView+Persist.m.

Here is the caller graph for this function:

◆ saveXmlPanelDidEnd:returnCode:contextInfo:

- (void) saveXmlPanelDidEnd: (NSSavePanel *) sheet
returnCode: (NSInteger) returnCode
contextInfo: (void *) contextInfo 
implementation

Completion handler for the Save panel when exporting XML (.muvi).

Provided by category PadView(Persist).

Definition at line 550 of file PadView+Persist.m.

◆ scrollWheel:

- (void) scrollWheel: (NSEvent *) theEvent
implementation

Placeholder: scroll wheel.

Definition at line 290 of file PadView.m.

◆ selectAllPads

- (void) selectAllPads

Selects all pads regardless of layer filtering.

Definition at line 209 of file PadView.m.

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

◆ selectAllPadsForCurrentLayer

- (void) selectAllPadsForCurrentLayer

Selects all pads on the current layer only.

Selects all pads whose layer equals the current padLayer.

Definition at line 188 of file PadView.m.

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

◆ selectedPads

- (NSMutableArray *) selectedPads

Returns all visible selected pads.

Definition at line 180 of file PadView.m.

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

◆ selectPadsIntersectingWithRect:onLayer:

- (void) selectPadsIntersectingWithRect: (NSRect) aRect
onLayer: (int) layer 

Selects pads intersecting a rect for a given layer.

http://www.cocoadev.com/index.pl?NSBezierPathcombinatorics Selects pads fully contained in aRect for the given layer filter.

Parameters
aRectThe selection rectangle in view coordinates.
layerThe target layer or 0 for all.

Definition at line 766 of file PadView.m.

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

◆ setAllPadsToSelected:

- (void) setAllPadsToSelected: (BOOL) selected

Sets selection state for all pads.

Sets selection state of all pads, regardless of layer.

Definition at line 200 of file PadView.m.

Here is the caller graph for this function:

◆ setCurrentFile:

- (void) setCurrentFile: (NSString *) pathToFile
implementation

Set the current .mv file path and update the window's represented filename.

Parameters
pathToFileThe path to associate with the current document.

Provided by category PadView(Persist).

Definition at line 383 of file PadView+Persist.m.

Here is the caller graph for this function:

◆ setMarquee:

- (void) setMarquee: (NSRect) aMarquee

Updates the marquee rectangle.

Updates the marquee selection rectangle.

Definition at line 741 of file PadView.m.

Here is the caller graph for this function:

◆ setNoteOfPad:fromPad:

- (void) setNoteOfPad: (Pad *) dstPad
fromPad: (Pad *) srcPad 
implementation

Copies note and color attributes from a source pad to a destination pad.

Parameters
dstPadThe destination pad to modify.
srcPadThe source pad providing attributes.

Definition at line 690 of file PadView.m.

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

◆ setNoteOfSelectedPads:

- (void) setNoteOfSelectedPads: (Pad *) srcPad

Sets note/color of selected pads based on a source pad.

Applies note/color from srcPad to all selected pads or last played pad.

Definition at line 712 of file PadView.m.

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

◆ setNoteOfSingleSelectedPad:

- (void) setNoteOfSingleSelectedPad: (Pad *) srcPad

Sets note/color of a single selected or last played pad.

Applies note/color from srcPad to a single selected or last played pad.

Definition at line 726 of file PadView.m.

Here is the call graph for this function:

◆ setSeeThru:

- (void) setSeeThru: (BOOL) seeThru

Sets selected pads to semi-transparent or opaque.

Toggles transparency on selected pads to a preset alpha.

Definition at line 239 of file PadView.m.

Here is the call graph for this function:
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 in PlayArea.

Definition at line 45 of file PadView.m.

◆ showMarquee

- (void) showMarquee

Shows the marquee rectangle.

Shows the marquee selection overlay and refreshes the view.

Definition at line 746 of file PadView.m.

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

◆ snap90Point:fromAnchor:

+ (NSPoint) snap90Point: (NSPoint) p
fromAnchor: (NSPoint) anchor 

Constrains a point to horizontal/vertical from an anchor.

Constrains movement to horizontal or vertical relative to an anchor.

Definition at line 352 of file PadView.m.

Here is the caller graph for this function:

◆ snapGridWithPoint:

- (NSPoint) snapGridWithPoint: (NSPoint) p

Snaps a point to the grid.

Snaps a point to the current grid.

Definition at line 347 of file PadView.m.

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

◆ snapGridWithX:Y:

- (NSPoint) snapGridWithX: (int) x
Y: (int) y 

Snaps raw integer coordinates to the grid.

Snaps integer coordinates to the current grid if the grid is shown.

Parameters
xThe x coordinate.
yThe y coordinate.
Returns
A point snapped to the grid.

Definition at line 323 of file PadView.m.

Here is the caller graph for this function:

◆ startPad:

- (void) startPad: (Pad *) pad

Starts playback of a pad's note and highlights it.

Starts a pad's note via MIDI, highlights it, and logs its path structure.

Parameters
padThe pad to start.

[pad setSelected:![pad selected]];

Definition at line 472 of file PadView.m.

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

◆ stopPad:

- (void) stopPad: (Pad *) pad

Stops playback of a pad's note and clears highlight.

Stops a pad's note via MIDI, clears highlight, and refreshes.

Definition at line 511 of file PadView.m.

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

◆ tabletPoint:

- (void) tabletPoint: (NSEvent *) theEvent
implementation

Placeholder: tablet point.

Definition at line 303 of file PadView.m.

◆ tabletProximity:

- (void) tabletProximity: (NSEvent *) theEvent
implementation

Placeholder: tablet proximity.

Definition at line 305 of file PadView.m.

◆ testForPadHitWithPoint:

- (Pad *) testForPadHitWithPoint: (NSPoint) p

Returns the topmost pad containing the given point, or nil.

Performs hit-testing from topmost to bottom to find a pad under a point.

Parameters
pA point in local view coordinates.
Returns
The topmost Pad containing the point, or nil if none.

Definition at line 112 of file PadView.m.

Here is the caller graph for this function:

◆ unselectedPads

- (NSMutableArray *) unselectedPads

Returns all visible unselected pads.

Definition at line 183 of file PadView.m.

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

Member Data Documentation

◆ _clipboard

- (NSMutableArray*) _clipboard
protected

Clipboard for copy/cut/paste of elements.

Definition at line 44 of file PadView.h.

◆ _hasHitPad

- (BOOL) _hasHitPad
protected

Tracks whether a pad was hit between mouseDown and mouseUp.

Definition at line 52 of file PadView.h.

◆ _marqueeSelectionBounds

- (NSRect) _marqueeSelectionBounds
protected

Bounds of the current marquee selection rectangle.

Definition at line 48 of file PadView.h.

◆ _marqueeVisible

- (BOOL) _marqueeVisible
protected

Whether the marquee selection rectangle is visible.

Definition at line 46 of file PadView.h.

◆ controller

- (IBOutlet Controller*) controller
protected

Connected controller that coordinates modes and UI.

Definition at line 29 of file PadView.h.

◆ elementBag

- (NSMutableArray*) elementBag
protected

Storage for pads and other drawable elements.

Definition at line 27 of file PadView.h.

◆ gridShow

- (Boolean) gridShow
protected

Whether the snapping grid is visible.

Definition at line 35 of file PadView.h.

◆ gridX

- (int) gridX
protected

Grid step in X direction (points).

Definition at line 37 of file PadView.h.

◆ gridY

- (int) gridY
protected

Grid step in Y direction (points).

Definition at line 39 of file PadView.h.

◆ lastPad

- (Pad*) lastPad
protected

Last pad whose note is sounding; used to stop previous note.

Definition at line 31 of file PadView.h.

◆ lastPadPlayed

- (Pad*) lastPadPlayed
protected

Last pad played; used for note palette operations.

Definition at line 33 of file PadView.h.

◆ num_draws

- (int) num_draws
protected

Draw counter for diagnostics.

Definition at line 50 of file PadView.h.

◆ padLayer

- (int) padLayer
readwriteprotected

Current filter layer for drawing/selection (0 means all).

The active layer index for filtering which pads are drawn/selected.

Definition at line 41 of file PadView.h.


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