|
Muvicado HD
|
NSView subclass that displays and edits Pad elements. More...
#include <PadView.h>


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 Controller * | controller |
| Pad * | lastPad |
| Pad * | lastPadPlayed |
| Boolean | gridShow |
| int | gridX |
| int | gridY |
| int | padLayer |
| NSMutableArray * | _clipboard |
| BOOL | _marqueeVisible |
| NSRect | _marqueeSelectionBounds |
| int | num_draws |
| BOOL | _hasHitPad |
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.
|
implementation |
|
implementation |
| - (void) addElement: | (Element *) | e |
| - (void) addPad: | (Pad *) | pad |
|
implementation |
Alert sheet completion callback (reserved for future handling).
Provided by category PadView(Persist).
Definition at line 316 of file PadView+Persist.m.
|
implementation |
|
implementation |
|
implementation |
Releases retained objects before deallocation.
Reimplemented in NotePaletteArea, PageSelectArea, and PlayArea.
Definition at line 641 of file PadView.m.


| - (void) deletePad: | (Pad*) | pad |
| - (void) deselectAllPads |
| - (void) doAction: | (Pad *) | pad |
| - (void) doCopyElements |
| - (void) doCutElements |
| - (void) doDeleteElements |
| - (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.
| - (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.
|
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.

| - (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.
| - (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.
| pad | The pad to activate, or nil to stop the current one. |
Reimplemented in PageSelectArea, and PlayArea.
Definition at line 534 of file PadView.m.


| - (void) doPasteElements |
| - (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.
| - (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.
| - (void) doSelectAllElements |
|
implementation |
Draws the view: background, optional grid, pads, and marquee overlay.
| dirtyRect | The area that needs to be redrawn. |
Reimplemented in NotePaletteArea, PageSelectArea, and PlayArea.
Definition at line 369 of file PadView.m.


|
implementation |
| - (void) duplicateSelectedPads |
| - (Pad *) findPadForNote: | (int) | note |
| - (NSMutableArray *) findPadsForNote: | (int) | note |
|
implementation |
| - (Controller *) getController |
Returns the existing controller reference.
Returns the existing Controller instance.
Definition at line 102 of file PadView.m.


| - (NSMutableArray *) getElementBag |
|
implementation |
Parse an SVG-style coordinate pair string into an NSPoint.
| xyPair | A string containing "x,y". |
| point | Output parameter that receives the parsed point (must be non-null). |
Provided by category PadView(Persist).
Definition at line 37 of file PadView+Persist.m.
| - (Pad *) getSingleSelectedPad |
| - (void) hideMarquee |
|
implementation |
Initializes the view with default grid and storage settings.
| frame | The initial frame rectangle. |
Reimplemented in NotePaletteArea, PageSelectArea, and PlayArea.
Definition at line 27 of file PadView.m.

|
implementation |
|
implementation |
| - (NSPoint) localPointForEvent: | (NSEvent *) | event |
| - (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.


|
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.


|
implementation |
|
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.


|
implementation |
|
implementation |
|
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.


|
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.


|
implementation |
| - (void) nullSweep |
| - (int) numSelectedPads |
|
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.

|
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.
|
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.

|
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.
|
implementation |
|
implementation |
|
implementation |
|
implementation |
NSSavePanel/NSOpenPanel delegate allowing user-entered filenames.
Provided by category PadView(Persist).
Definition at line 466 of file PadView+Persist.m.
|
implementation |
Parse and load a native .mv archive produced by NSKeyedArchiver.
| pathToFile | Absolute path to the .mv file. |
Provided by category PadView(Persist).
Definition at line 393 of file PadView+Persist.m.

|
implementation |
NSXMLParser delegate: end element handler (currently unused).
Provided by category PadView(Persist).
Definition at line 312 of file PadView+Persist.m.
|
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.
| parser | The XML parser. |
| elementName | The qualified element name. |
| namespaceURI | The namespace URI (unused). |
| qName | The qualified name (unused). |
| attributeDict | Attributes 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.
|
implementation |
NSXMLParser delegate: called when a parsing error occurs. Presents an alert describing the error, line, and column.
| parser | The XML parser. |
| parseError | The parsing error. |
Provided by category PadView(Persist).
Definition at line 295 of file PadView+Persist.m.
|
implementation |
Parse and import a .muvi XML/SVG file, updating the view contents.
| pathToFile | Absolute path to the .muvi file. |
Provided by category PadView(Persist).
Definition at line 327 of file PadView+Persist.m.

| - (void) randomColors |
| - (void) refresh |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
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.

|
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.
|
implementation |
Save the current elements to a native archive (.mv). called by doSave and by saveMvPanelDidEnd
| pathToFile | Destination path for the archive. |
Provided by category PadView(Persist).
Definition at line 589 of file PadView+Persist.m.
|
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.

|
implementation |
Serialize the current elements to an SVG-like XML file (.muvi).
| pathToFile | Destination path for the XML. |
Provided by category PadView(Persist).
Definition at line 483 of file PadView+Persist.m.

|
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.
|
implementation |
| - (void) selectAllPads |
| - (void) selectAllPadsForCurrentLayer |
| - (NSMutableArray *) selectedPads |
| - (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.
| aRect | The selection rectangle in view coordinates. |
| layer | The target layer or 0 for all. |
Definition at line 766 of file PadView.m.


| - (void) setAllPadsToSelected: | (BOOL) | selected |
|
implementation |
Set the current .mv file path and update the window's represented filename.
| pathToFile | The path to associate with the current document. |
Provided by category PadView(Persist).
Definition at line 383 of file PadView+Persist.m.

| - (void) setMarquee: | (NSRect) | aMarquee |
| - (void) setNoteOfSelectedPads: | (Pad *) | srcPad |
| - (void) setNoteOfSingleSelectedPad: | (Pad *) | srcPad |
| - (void) setSeeThru: | (BOOL) | seeThru |
|
implementation |
| - (void) showMarquee |
| + (NSPoint) snap90Point: | (NSPoint) | p | |
| fromAnchor: | (NSPoint) | anchor |
| - (NSPoint) snapGridWithPoint: | (NSPoint) | p |
| - (NSPoint) snapGridWithX: | (int) | x | |
| Y: | (int) | y |
| - (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.
| pad | The pad to start. |
[pad setSelected:![pad selected]];
Definition at line 472 of file PadView.m.


| - (void) stopPad: | (Pad *) | pad |
|
implementation |
|
implementation |
| - (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.
| p | A point in local view coordinates. |
Definition at line 112 of file PadView.m.

| - (NSMutableArray *) unselectedPads |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
readwriteprotected |