diff --git a/Controller Classes/EndpointTableDataSource.h b/Controller Classes/EndpointTableDataSource.h index 7b24e91..732e316 100644 --- a/Controller Classes/EndpointTableDataSource.h +++ b/Controller Classes/EndpointTableDataSource.h @@ -2,7 +2,7 @@ #import -@interface EndpointTableDataSource : NSObject { +@interface EndpointTableDataSource : NSObject { Class endpointClass; NSMutableArray* endpointArray; NSUndoManager* undoManager; diff --git a/Controller Classes/EndpointTableDataSource.m b/Controller Classes/EndpointTableDataSource.m index aba0f8a..930a9a1 100644 --- a/Controller Classes/EndpointTableDataSource.m +++ b/Controller Classes/EndpointTableDataSource.m @@ -54,11 +54,13 @@ - (id)tableView:(NSTableView*)tableView objectValueForTableColumn:(NSTableColumn - (BOOL)control:(NSControl*)control isValidObject:(id)value { if (PYMIDIIsEndpointNameTaken (value)) { - NSRunAlertPanel ( - [NSString stringWithFormat:@"The name \"%@\" is already taken.", value], - @"Please choose a different name.", - nil, nil, nil - ); + NSAlert *alert = [[NSAlert alloc] init]; + [alert addButtonWithTitle:@"OK"]; + [alert setMessageText: [NSString stringWithFormat:@"The name \"%@\" is already taken.", value]]; + [alert setInformativeText:@"Please choose a different name."]; + [alert setAlertStyle:NSWarningAlertStyle]; + [alert runModal]; + return NO; } else @@ -72,11 +74,13 @@ - (void)tableView:(NSTableView*)tableView setObjectValue:(id)value forTableColum if (![value isEqualToString:@""] && ![value isEqualToString:[endpoint name]]) { if (PYMIDIIsEndpointNameTaken (value)) { - NSRunAlertPanel ( - [NSString stringWithFormat:@"The name \"%@\" is already taken.", value], - @"Please choose a different name.", - nil, nil, nil - ); + NSAlert *alert = [[NSAlert alloc] init]; + [alert addButtonWithTitle:@"OK"]; + [alert setMessageText: [NSString stringWithFormat:@"The name \"%@\" is already taken.", value]]; + [alert setInformativeText:@"Please choose a different name."]; + [alert setAlertStyle:NSWarningAlertStyle]; + [alert runModal]; + } else { [self tableView:tableView setName:(NSString*)value forEndpointAtIndex:rowIndex]; @@ -90,11 +94,14 @@ - (void)deleteSelection:(NSTableView*)tableView PYMIDIVirtualEndpoint* endpoint = [endpointArray objectAtIndex:[tableView selectedRow]]; if ([endpoint isInUse]) { - NSRunAlertPanel ( - @"The selection is in use by one or more patches and cannot be deleted.", - @"", - nil, nil, nil - ); + NSAlert *alert = [[NSAlert alloc] init]; + + [alert addButtonWithTitle:@"OK"]; + [alert setMessageText:@"The selection is in use by one or more patches and cannot be deleted."]; + [alert setInformativeText:@""]; + [alert setAlertStyle:NSWarningAlertStyle]; + [alert runModal]; + } else { [self tableView:tableView removeEndpointAtIndex:[tableView selectedRow]]; diff --git a/Controller Classes/PatchTableDataSource.h b/Controller Classes/PatchTableDataSource.h index fe58e2d..35230e5 100644 --- a/Controller Classes/PatchTableDataSource.h +++ b/Controller Classes/PatchTableDataSource.h @@ -4,7 +4,7 @@ @class PatchbayDocument; -@interface PatchTableDataSource : NSObject { +@interface PatchTableDataSource : NSObject { PatchbayDocument* document; NSMutableArray* patchArray; } diff --git a/Controller Classes/PatchbayDocument.h b/Controller Classes/PatchbayDocument.h index 7a7a497..2d62942 100644 --- a/Controller Classes/PatchbayDocument.h +++ b/Controller Classes/PatchbayDocument.h @@ -11,7 +11,7 @@ @class EndpointTableDataSource; -@interface PatchbayDocument : NSDocument { +@interface PatchbayDocument : NSDocument { IBOutlet NSWindow* documentWindow; // Stuff related to the table of patches @@ -20,10 +20,11 @@ PatchTableDataSource* patchTableDataSource; IBOutlet NSButton* addPatchButton; + IBOutlet NSButton* removePatchButton; NSMutableArray* patchArray; Patch* selectedPatch; - + int selectedIndex; // Stuff related to editing a patch @@ -89,6 +90,7 @@ - (void)selectedPatchChanged:(NSNotification*)notification; - (IBAction)addPatchButtonPressed:(id)sender; +- (IBAction)removePatchButtonPressed:(id)sender; - (void)addPatch:(Patch*)patch atIndex:(int)index; - (void)addPatchFromArchive:(NSData*)data atIndex:(int)index; diff --git a/Controller Classes/PatchbayDocument.m b/Controller Classes/PatchbayDocument.m index 1c80f9c..0a26042 100644 --- a/Controller Classes/PatchbayDocument.m +++ b/Controller Classes/PatchbayDocument.m @@ -41,7 +41,7 @@ - (id)init // Uncomment the following line for debugging if you want to // disable undo, which makes tracking retain/release issues easier. //[self setUndoManager:nil]; - + selectedIndex = -1; return self; } @@ -50,7 +50,7 @@ - (void)windowControllerDidLoadNib:(NSWindowController*)windowController { NSButtonCell* buttonCell; PatchTableCell* patchTableCell; - + [super windowControllerDidLoadNib:windowController]; // These are so that our window and panel use the correct undo manager @@ -113,7 +113,6 @@ - (void)windowControllerDidLoadNib:(NSWindowController*)windowController // See the comment on tabView:shouldSelectTabViewItem; in EndpointTableDataSource [virtualEndpointTabView setDelegate:inputTableDataSource]; - [self syncWithLoadedData]; } @@ -192,7 +191,7 @@ - (void)syncWithLoadedData [patchTable reloadData]; if ([patchArray count] > 0) - [patchTable selectRow:0 byExtendingSelection:NO]; + [patchTable selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; else [patchTable deselectAll:self]; @@ -252,15 +251,17 @@ - (void)selectedPatchChanged:(NSNotification*)notification [self setTransposeControls]; [self setTransmitClockControls]; [self setOutputPopUp]; + + selectedIndex = patchIndex; } -- (IBAction)addPatchButtonPressed:(id)sender +- (IBAction) addPatchButtonPressed:(id)sender { - Patch* patch; - if (selectedPatch != nil) { - patch = [[Patch alloc] initFromPatch:selectedPatch]; + Patch *patch = [[Patch alloc] initFromPatch:selectedPatch]; + [self addPatch:patch atIndex:[patchArray count]]; + [patch release]; } else { // Pick a default input and output for a blank patch @@ -276,14 +277,20 @@ - (IBAction)addPatchButtonPressed:(id)sender PYMIDIEndpoint* output; do { output = [enumerator nextObject]; } while ([output isIACBus]); - patch = [[Patch alloc] initWithInput:input output:output]; + Patch *patch = [[Patch alloc] initWithInput:input output:output]; + [self addPatch:patch atIndex:[patchArray count]]; + [patch release]; } - - [self addPatch:patch atIndex:[patchArray count]]; - - [patch release]; + } +- (IBAction)removePatchButtonPressed:(id)sender +{ + if (selectedIndex >= 0) { + [self removePatchAtIndex: selectedIndex]; + } + +} - (void)addPatch:(Patch*)patch atIndex:(int)index { @@ -293,7 +300,7 @@ - (void)addPatch:(Patch*)patch atIndex:(int)index [patchArray insertObject:patch atIndex:index]; [patchTable reloadData]; - [patchTable selectRow:index byExtendingSelection:NO]; + [patchTable selectRowIndexes:[NSIndexSet indexSetWithIndex:index] byExtendingSelection:NO]; [[undoManager prepareWithInvocationTarget:self] removePatchAtIndex:index @@ -1021,13 +1028,15 @@ - (IBAction)editVirtualInputs:(id)sender panelWasOpenedToInputs = YES; + [documentWindow beginSheet: virtualEndpointPanel completionHandler: nil]; + /* [[NSApplication sharedApplication] beginSheet:virtualEndpointPanel modalForWindow:documentWindow modalDelegate:self didEndSelector:@selector(endpointPanelDidEnd:returnCode:contextInfo:) contextInfo:nil - ]; + ];*/ } @@ -1041,14 +1050,15 @@ - (IBAction)editVirtualOutputs:(id)sender [[self undoManager] beginUndoGrouping]; panelWasOpenedToInputs = NO; - + [documentWindow beginSheet:virtualEndpointPanel completionHandler: nil]; + /* [[NSApplication sharedApplication] beginSheet:virtualEndpointPanel modalForWindow:documentWindow modalDelegate:self didEndSelector:@selector(endpointPanelDidEnd:returnCode:contextInfo:) contextInfo:nil - ]; + ];*/ } @@ -1058,10 +1068,11 @@ - (IBAction)newInputButtonPressed:(id)sender [[[self displayName] lastPathComponent] stringByDeletingPathExtension] ]; - [[inputTable dataSource] tableView:inputTable newEndpointWithName:baseName]; + [(EndpointTableDataSource *)[inputTable dataSource] tableView:inputTable newEndpointWithName:baseName]; // Set up the newly created endpoint for editing - [inputTable selectRow:[inputTable numberOfRows]-1 byExtendingSelection:NO]; + + [inputTable selectRowIndexes:[NSIndexSet indexSetWithIndex:[inputTable numberOfRows]-1] byExtendingSelection:NO]; [inputTable editColumn:0 row:[inputTable selectedRow] withEvent:nil select:YES]; } @@ -1073,10 +1084,11 @@ - (IBAction)newOutputButtonPressed:(id)sender [[[self displayName] lastPathComponent] stringByDeletingPathExtension] ]; - [[outputTable dataSource] tableView:outputTable newEndpointWithName:baseName]; + [(EndpointTableDataSource *)[outputTable dataSource] tableView:outputTable newEndpointWithName:baseName]; // Set up the newly created endpoint for editing - [outputTable selectRow:[outputTable numberOfRows]-1 byExtendingSelection:NO]; + [outputTable selectRowIndexes:[NSIndexSet indexSetWithIndex:[outputTable numberOfRows]-1] byExtendingSelection:NO]; + [outputTable editColumn:0 row:[outputTable selectedRow] withEvent:nil select:YES]; } @@ -1086,7 +1098,7 @@ - (IBAction)endpointPanelButtonPressed:(id)sender { if ([virtualEndpointPanel makeFirstResponder:nil]) { [virtualEndpointPanel orderOut:self]; - [[NSApplication sharedApplication] endSheet:virtualEndpointPanel returnCode:0]; + [documentWindow endSheet:virtualEndpointPanel returnCode:0]; } } diff --git a/English.lproj/MainMenu.nib/classes.nib b/English.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index aefca1a..0000000 --- a/English.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,36 +0,0 @@ - - - - - IBClasses - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - ACTIONS - - displayLicense - id - sendFeedback - id - visitWebSite - id - - CLASS - PatchbayController - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - IBVersion - 1 - - diff --git a/English.lproj/MainMenu.nib/designable.nib b/English.lproj/MainMenu.nib/designable.nib new file mode 100644 index 0000000..f1b8717 --- /dev/null +++ b/English.lproj/MainMenu.nib/designable.nib @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib deleted file mode 100644 index bb86cd1..0000000 --- a/English.lproj/MainMenu.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 629 - IBLastKnownRelativeProjectPath - ../../MIDI Patchbay.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 57 - - IBSystem Version - 9B18 - targetFramework - IBCocoaFramework - - diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index 24c52be..b30779f 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/English.lproj/PatchbayDocument.nib/classes.nib b/English.lproj/PatchbayDocument.nib/classes.nib deleted file mode 100644 index 8058cb4..0000000 --- a/English.lproj/PatchbayDocument.nib/classes.nib +++ /dev/null @@ -1,144 +0,0 @@ - - - - - IBClasses - - - ACTIONS - - addPatchButtonPressed - id - endpointPanelButtonPressed - id - filterChannelMatrixChanged - id - filterChannelRadioButtonsChanged - id - filterRangeRadioButtonsChanged - id - highestAllowedNoteSliderChanged - id - highestAllowedNoteStepperChanged - id - inputPopUpChanged - id - lowestAllowedNoteSliderChanged - id - lowestAllowedNoteStepperChanged - id - newInputButtonPressed - id - newOutputButtonPressed - id - outputPopUpChanged - id - remapChannelButtonChanged - id - remapChannelPopUpChanged - id - transmitClockButtonChanged - id - transposeButtonChanged - id - transposeDistanceSliderChanged - id - transposeDistanceStepperChanged - id - - CLASS - PatchbayDocument - LANGUAGE - ObjC - OUTLETS - - addPatchButton - NSButton - documentWindow - NSWindow - filterChannelMatrix - NSMatrix - filterChannelRadioButtons - NSMatrix - filterRangeLabelField - NSTextField - filterRangeRadioButtons - NSMatrix - highestAllowedNoteField - NSTextField - highestAllowedNoteSlider - NSSlider - highestAllowedNoteStepper - NSStepper - inputPopUp - NSPopUpButton - inputTable - NSTableView - lowestAllowedNoteField - NSTextField - lowestAllowedNoteSlider - NSSlider - lowestAllowedNoteStepper - NSStepper - outputPopUp - NSPopUpButton - outputTable - NSTableView - patchTable - NSTableView - remapChannelButton - NSButton - remapChannelPopUp - NSPopUpButton - transmitClockButton - NSButton - transposeButton - NSButton - transposeDistanceField - NSTextField - transposeDistanceSlider - NSSlider - transposeDistanceStepper - NSStepper - virtualEndpointPanel - NSPanel - virtualEndpointTabView - NSTabView - - SUPERCLASS - NSDocument - - - ACTIONS - - clear - id - deleteBackward - id - deleteForward - id - moveDown - id - moveUp - id - - CLASS - KeyTableView - LANGUAGE - ObjC - SUPERCLASS - NSTableView - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - IBVersion - 1 - - diff --git a/English.lproj/PatchbayDocument.nib/designable.nib b/English.lproj/PatchbayDocument.nib/designable.nib new file mode 100644 index 0000000..0642ecd --- /dev/null +++ b/English.lproj/PatchbayDocument.nib/designable.nib @@ -0,0 +1,628 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/English.lproj/PatchbayDocument.nib/info.nib b/English.lproj/PatchbayDocument.nib/info.nib deleted file mode 100644 index b25c89f..0000000 --- a/English.lproj/PatchbayDocument.nib/info.nib +++ /dev/null @@ -1,18 +0,0 @@ - - - - - IBFramework Version - 629 - IBLastKnownRelativeProjectPath - ../../MIDI Patchbay.xcodeproj - IBOldestOS - 3 - IBOpenObjects - - IBSystem Version - 9B18 - targetFramework - IBCocoaFramework - - diff --git a/English.lproj/PatchbayDocument.nib/keyedobjects.nib b/English.lproj/PatchbayDocument.nib/keyedobjects.nib index 6766a1c..83f602b 100644 Binary files a/English.lproj/PatchbayDocument.nib/keyedobjects.nib and b/English.lproj/PatchbayDocument.nib/keyedobjects.nib differ diff --git a/English.lproj/PatchbayDocument~.nib/classes.nib b/English.lproj/PatchbayDocument~.nib/classes.nib deleted file mode 100644 index 0083d00..0000000 --- a/English.lproj/PatchbayDocument~.nib/classes.nib +++ /dev/null @@ -1,72 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = { - clear = id; - deleteBackward = id; - deleteForward = id; - moveDown = id; - moveUp = id; - }; - CLASS = KeyTableView; - LANGUAGE = ObjC; - SUPERCLASS = NSTableView; - }, - { - ACTIONS = { - addPatchButtonPressed = id; - endpointPanelButtonPressed = id; - filterChannelMatrixChanged = id; - filterChannelRadioButtonsChanged = id; - filterRangeRadioButtonsChanged = id; - highestAllowedNoteSliderChanged = id; - highestAllowedNoteStepperChanged = id; - inputPopUpChanged = id; - lowestAllowedNoteSliderChanged = id; - lowestAllowedNoteStepperChanged = id; - newInputButtonPressed = id; - newOutputButtonPressed = id; - outputPopUpChanged = id; - remapChannelButtonChanged = id; - remapChannelPopUpChanged = id; - transmitClockButtonChanged = id; - transposeButtonChanged = id; - transposeDistanceSliderChanged = id; - transposeDistanceStepperChanged = id; - }; - CLASS = PatchbayDocument; - LANGUAGE = ObjC; - OUTLETS = { - addPatchButton = NSButton; - documentWindow = NSWindow; - filterChannelMatrix = NSMatrix; - filterChannelRadioButtons = NSMatrix; - filterRangeLabelField = NSTextField; - filterRangeRadioButtons = NSMatrix; - highestAllowedNoteField = NSTextField; - highestAllowedNoteSlider = NSSlider; - highestAllowedNoteStepper = NSStepper; - inputPopUp = NSPopUpButton; - inputTable = NSTableView; - lowestAllowedNoteField = NSTextField; - lowestAllowedNoteSlider = NSSlider; - lowestAllowedNoteStepper = NSStepper; - outputPopUp = NSPopUpButton; - outputTable = NSTableView; - patchTable = NSTableView; - remapChannelButton = NSButton; - remapChannelPopUp = NSPopUpButton; - transmitClockButton = NSButton; - transposeButton = NSButton; - transposeDistanceField = NSTextField; - transposeDistanceSlider = NSSlider; - transposeDistanceStepper = NSStepper; - virtualEndpointPanel = NSPanel; - virtualEndpointTabView = NSTabView; - }; - SUPERCLASS = NSDocument; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/English.lproj/PatchbayDocument~.nib/info.nib b/English.lproj/PatchbayDocument~.nib/info.nib deleted file mode 100644 index 50938ff..0000000 --- a/English.lproj/PatchbayDocument~.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBDocumentLocation - 145 64 474 240 0 0 1600 1178 - IBFramework Version - 291.0 - IBOpenObjects - - 5 - - IBSystem Version - 6G30 - - diff --git a/English.lproj/PatchbayDocument~.nib/objects.nib b/English.lproj/PatchbayDocument~.nib/objects.nib deleted file mode 100644 index ffa3815..0000000 Binary files a/English.lproj/PatchbayDocument~.nib/objects.nib and /dev/null differ diff --git a/Info.plist b/Info.plist index 600c0d5..a24bd72 100644 --- a/Info.plist +++ b/Info.plist @@ -33,15 +33,17 @@ ${PRODUCT_NAME} CFBundlePackageType APPL + CFBundleShortVersionString + 1.0.4 CFBundleSignature ???? CFBundleVersion - 1.0.3 + 1.0.4 + LSApplicationCategoryType + public.app-category.music NSMainNibFile MainMenu NSPrincipalClass NSApplication - CFBundleShortVersionString - 1.0.3 diff --git a/MIDI Patchbay.xcodeproj/project.pbxproj b/MIDI Patchbay.xcodeproj/project.pbxproj index 3183293..36dd127 100644 --- a/MIDI Patchbay.xcodeproj/project.pbxproj +++ b/MIDI Patchbay.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 44; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -257,7 +257,6 @@ C12C7FE805AECD9D0066E007 /* Resources */, C12C7FF005AECD9D0066E007 /* Sources */, C12C7FFA05AECD9D0066E007 /* Frameworks */, - C14601500D3CB30B002E94E5 /* ShellScript */, ); buildRules = ( ); @@ -274,9 +273,16 @@ /* Begin PBXProject section */ 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + }; buildConfigurationList = C101046C088A0A7C001DFE4F /* Build configuration list for PBXProject "MIDI Patchbay" */; - compatibilityVersion = "Xcode 3.0"; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; hasScannedForEncodings = 1; + knownRegions = ( + en, + ); mainGroup = 2A37F4AAFDCFA73011CA2CEA /* MIDI Patchbay */; projectDirPath = ""; projectRoot = ""; @@ -303,22 +309,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - C14601500D3CB30B002E94E5 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = "/usr/bin/perl -w"; - shellScript = "# Xcode auto-versioning script for Subversion\n# by Axel Andersson, modified by Daniel Jalkut to add\n# \"--revision HEAD\" to the svn info line, which allows\n# the latest revision to always be used.\n\n# See http://www.red-sweater.com/blog/23/automatic-build-sub-versioning-in-xcode#finalscript\n\nuse strict;\n\ndie \"$0: Must be run from Xcode\" unless $ENV{\"BUILT_PRODUCTS_DIR\"};\n\n# Get the current subversion revision number and use it to set the CFBundleVersion value\nmy $REV = `/opt/local/bin/svnversion -n ./`;\nmy $INFO = \"$ENV{BUILT_PRODUCTS_DIR}/$ENV{WRAPPER_NAME}/Contents/Info.plist\";\n\nmy $version = $REV;\n\n# (Match the last group of digits and optional letter M/S):\n\n# ugly yet functional (barely) regex by Daniel Jalkut:\n#$version =~ s/([\\d]*:)(\\d+[M|S]*).*/$2/;\n\n# better yet still functional regex via Kevin \"Regex Nerd\" Ballard\n#($version =~ m/\\d+[MS]*$/) && ($version = $&);\n\n# or a custom version that ignores the M and S flags by Pete Yandell\n($version =~ m/(\\d+)[MS]*$/) && ($version = $1);\n\ndie \"$0: No Subversion revision found\" unless $version;\n\nopen(FH, \"$INFO\") or die \"$0: $INFO: $!\";\nmy $info = join(\"\", );\nclose(FH);\n\n$info =~ s/([\\t ]+CFBundleVersion<\\/key>\\n[\\t ]+).*?(<\\/string>)/$1$version$2/;\n\nopen(FH, \">$INFO\") or die \"$0: $INFO: $!\";\nprint FH $info;\nclose(FH);"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ C12C7FF005AECD9D0066E007 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -380,8 +370,9 @@ C1010469088A0A7C001DFE4F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ../PYMIDI/build; + FRAMEWORK_SEARCH_PATHS = ""; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -391,11 +382,14 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.2; + MACOSX_DEPLOYMENT_TARGET = 10.10; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = "MIDI Patchbay"; + SDKROOT = macosx10.10; SECTORDER_FLAGS = ""; + VALID_ARCHS = x86_64; WARNING_CFLAGS = ( "-Wmost", "-Wno-four-char-constants", @@ -409,8 +403,9 @@ C101046A088A0A7C001DFE4F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; - FRAMEWORK_SEARCH_PATHS = ../PYMIDI/build; + FRAMEWORK_SEARCH_PATHS = ""; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = 3; @@ -419,11 +414,16 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.2; + MACOSX_DEPLOYMENT_TARGET = 10.10; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = "MIDI Patchbay"; + SDKROOT = macosx10.10; + "SDKROOT[arch=i386]" = macosx10.10; + "SDKROOT[arch=ppc]" = macosx10.10; SECTORDER_FLAGS = ""; + VALID_ARCHS = x86_64; WARNING_CFLAGS = ( "-Wmost", "-Wno-four-char-constants", @@ -439,9 +439,11 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; HEADER_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.2; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx10.10; USER_HEADER_SEARCH_PATHS = .; + VALID_ARCHS = x86_64; }; name = Debug; }; @@ -449,20 +451,16 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = ( - i386, - ppc, - ); GCC_VERSION_i386 = 4.0; GCC_VERSION_ppc = 3.3; HEADER_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.2; - "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=ppc]" = 10.3; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - "SDKROOT[arch=i386]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - "SDKROOT[arch=ppc]" = /Developer/SDKs/MacOSX10.3.9.sdk; + MACOSX_DEPLOYMENT_TARGET = 10.10; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx10.10; + "SDKROOT[arch=i386]" = macosx10.10; + "SDKROOT[arch=ppc]" = macosx10.10; USER_HEADER_SEARCH_PATHS = .; + VALID_ARCHS = x86_64; }; name = Release; }; diff --git a/Model Classes/Patch.m b/Model Classes/Patch.m index 4736a20..4a15cab 100644 --- a/Model Classes/Patch.m +++ b/Model Classes/Patch.m @@ -45,6 +45,7 @@ - (Patch*)initWithInput:(PYMIDIEndpoint*)newInput output:(PYMIDIEndpoint*)newOut isEnabled = YES; + return self; } diff --git a/PYMIDI/PYMIDIEndpoint.m b/PYMIDI/PYMIDIEndpoint.m index 46c0cdd..9a6cfd8 100644 --- a/PYMIDI/PYMIDIEndpoint.m +++ b/PYMIDI/PYMIDIEndpoint.m @@ -96,7 +96,7 @@ - (PYMIDIEndpointDescriptor*)descriptor - (void)setPropertiesFromMIDIEndpoint { - if (midiEndpointRef == NULL) return; + if (!midiEndpointRef) return; [self setUniqueIDFromMIDIEndpoint]; [self setNameFromMIDIEndpoint]; @@ -301,7 +301,7 @@ - (BOOL)isOffline SInt32 isOffline; OSStatus result; - if (midiEndpointRef == nil) return YES; + if (!midiEndpointRef) return YES; result = MIDIObjectGetIntegerProperty (midiEndpointRef, kMIDIPropertyOffline, &isOffline); return result == noErr && isOffline; diff --git a/PYMIDI/PYMIDIEndpointSet.h b/PYMIDI/PYMIDIEndpointSet.h index c58b48e..f715688 100644 --- a/PYMIDI/PYMIDIEndpointSet.h +++ b/PYMIDI/PYMIDIEndpointSet.h @@ -3,7 +3,7 @@ @class PYMIDIEndpointDescriptor; @class PYMIDIEndpoint; -@interface PYMIDIEndpointSet : NSObject { +@interface PYMIDIEndpointSet : NSObject { NSArray* endpointArray; } diff --git a/PYMIDI/PYMIDIRealDestination.m b/PYMIDI/PYMIDIRealDestination.m index 62fcb84..09ed862 100644 --- a/PYMIDI/PYMIDIRealDestination.m +++ b/PYMIDI/PYMIDIRealDestination.m @@ -22,7 +22,7 @@ - (id)initWithCoder:(NSCoder*)coder descriptor = [PYMIDIEndpointDescriptor descriptorWithName:newName uniqueID:newUniqueID]; [self release]; - return [[manager realDestinationWithDescriptor:descriptor] retain]; + return [(PYMIDIRealDestination *)[manager realDestinationWithDescriptor:descriptor] retain]; } @@ -35,8 +35,8 @@ - (void)syncWithMIDIEndpoint else newEndpointRef = NULL; - if (newEndpointRef == NULL) newEndpointRef = PYMIDIGetDestinationByUniqueID (uniqueID); - if (newEndpointRef == NULL) newEndpointRef = PYMIDIGetDestinationByName (name); + if (!newEndpointRef) newEndpointRef = PYMIDIGetDestinationByUniqueID (uniqueID); + if (!newEndpointRef) newEndpointRef = PYMIDIGetDestinationByName (name); if (midiEndpointRef != newEndpointRef) { [self stopIO]; @@ -50,7 +50,7 @@ - (void)syncWithMIDIEndpoint - (void)startIO { - if (midiEndpointRef == nil || midiPortRef != nil) return; + if ( !midiEndpointRef || midiPortRef ) return; MIDIOutputPortCreate ( [[PYMIDIManager sharedInstance] midiClientRef], CFSTR("PYMIDIRealDestination"), @@ -61,7 +61,7 @@ - (void)startIO - (void)stopIO { - if (midiPortRef == nil) return; + if (!midiPortRef) return; MIDIPortDispose (midiPortRef); midiPortRef = nil; @@ -70,7 +70,7 @@ - (void)stopIO - (void)processMIDIPacketList:(const MIDIPacketList*)packetList sender:(id)sender { - if (midiEndpointRef != NULL && midiPortRef != NULL) + if (midiEndpointRef && midiPortRef) MIDISend (midiPortRef, midiEndpointRef, packetList); } diff --git a/PYMIDI/PYMIDIRealEndpoint.m b/PYMIDI/PYMIDIRealEndpoint.m index 4ae7d2a..a05affe 100644 --- a/PYMIDI/PYMIDIRealEndpoint.m +++ b/PYMIDI/PYMIDIRealEndpoint.m @@ -36,7 +36,7 @@ - (void)syncWithMIDIEndpoint - (BOOL)ioIsRunning { - return midiPortRef != nil; + return !midiPortRef; } diff --git a/PYMIDI/PYMIDIRealSource.m b/PYMIDI/PYMIDIRealSource.m index 9623a91..8921645 100644 --- a/PYMIDI/PYMIDIRealSource.m +++ b/PYMIDI/PYMIDIRealSource.m @@ -25,7 +25,7 @@ - (id)initWithCoder:(NSCoder*)coder descriptor = [PYMIDIEndpointDescriptor descriptorWithName:newName uniqueID:newUniqueID]; [self release]; - return [[manager realSourceWithDescriptor:descriptor] retain]; + return (PYMIDIRealSource *)[[manager realSourceWithDescriptor:descriptor] retain]; } @@ -39,8 +39,8 @@ - (void)syncWithMIDIEndpoint else newEndpointRef = NULL; - if (newEndpointRef == NULL) newEndpointRef = PYMIDIGetSourceByUniqueID (uniqueID); - if (newEndpointRef == NULL) newEndpointRef = PYMIDIGetSourceByName (name); + if (!newEndpointRef) newEndpointRef = PYMIDIGetSourceByUniqueID (uniqueID); + if (!newEndpointRef) newEndpointRef = PYMIDIGetSourceByName (name); if (midiEndpointRef != newEndpointRef) { [self stopIO]; @@ -54,7 +54,7 @@ - (void)syncWithMIDIEndpoint - (void)startIO { - if (midiEndpointRef == nil || midiPortRef != nil) return; + if (!midiEndpointRef || midiPortRef ) return; MIDIInputPortCreate ( [[PYMIDIManager sharedInstance] midiClientRef], CFSTR("PYMIDIRealSource"), @@ -66,7 +66,7 @@ - (void)startIO - (void)stopIO { - if (midiPortRef == nil) return; + if (!midiPortRef) return; MIDIPortDisconnectSource (midiPortRef, midiEndpointRef); MIDIPortDispose (midiPortRef); @@ -86,7 +86,7 @@ - (void)processMIDIPacketList:(const MIDIPacketList*)packetList sender:(id)sende NSEnumerator* enumerator = [receivers objectEnumerator]; id receiver; - while (receiver = [[enumerator nextObject] nonretainedObjectValue]) + while ((receiver = [[enumerator nextObject] nonretainedObjectValue])) [receiver processMIDIPacketList:packetList sender:self]; [pool release]; diff --git a/PYMIDI/PYMIDIUtils.m b/PYMIDI/PYMIDIUtils.m index a82fe1c..e1970e7 100644 --- a/PYMIDI/PYMIDIUtils.m +++ b/PYMIDI/PYMIDIUtils.m @@ -27,15 +27,11 @@ // Stick the two names together, handling all the cases where one or the other doesn't exist NSString* name; - if (endpointName != nil) { if (deviceName != nil) { - bool endpointNameBeginsWithDeviceName = - CFStringCompareWithOptions ( - endpointName, deviceName, - CFRangeMake(0, CFStringGetLength (deviceName)), - kCFCompareCaseInsensitive - ) == kCFCompareEqualTo; + NSString *endpointNameNS = (NSString *)endpointName; + NSString *deviceNameNS = (NSString *)deviceName; + bool endpointNameBeginsWithDeviceName = [endpointNameNS compare:deviceNameNS options:NSCaseInsensitiveSearch] == NSOrderedSame; if (endpointNameBeginsWithDeviceName) name = [NSString stringWithString:(NSString*)endpointName]; @@ -215,8 +211,8 @@ Boolean PYMIDIIsEndpointNameTaken (NSString* name) { - return PYMIDIGetSourceByName (name) != NULL || - PYMIDIGetDestinationByName (name) != NULL; + return PYMIDIGetSourceByName (name) || + PYMIDIGetDestinationByName (name) ; } diff --git a/PYMIDI/PYMIDIVirtualDestination.m b/PYMIDI/PYMIDIVirtualDestination.m index 0ff7865..16d209e 100644 --- a/PYMIDI/PYMIDIVirtualDestination.m +++ b/PYMIDI/PYMIDIVirtualDestination.m @@ -58,7 +58,7 @@ - (void)processMIDIPacketList:(const MIDIPacketList*)packetList sender:(id)sende pool = [[NSAutoreleasePool alloc] init]; enumerator = [receivers objectEnumerator]; - while (receiver = [[enumerator nextObject] nonretainedObjectValue]) + while ((receiver = [[enumerator nextObject] nonretainedObjectValue])) [receiver processMIDIPacketList:packetList sender:self]; [pool release]; diff --git a/View Classes/KeyTableView.h b/View Classes/KeyTableView.h index 56d039a..47effee 100644 --- a/View Classes/KeyTableView.h +++ b/View Classes/KeyTableView.h @@ -1,7 +1,7 @@ #import +#import - -@interface KeyTableView : NSTableView { +@interface KeyTableView : NSTableView { } @@ -11,7 +11,7 @@ - (void)moveUp:(id)sender; - (void)moveDown:(id)sender; -- (BOOL)validateMenuItem:(id )menuItem; +- (BOOL)validateUserInterfaceItem:(id) menuItem; - (void)clear:(id)sender; - (void)textDidEndEditing:(NSNotification*)notification; diff --git a/View Classes/KeyTableView.m b/View Classes/KeyTableView.m index 7984b5b..32d813b 100644 --- a/View Classes/KeyTableView.m +++ b/View Classes/KeyTableView.m @@ -25,7 +25,7 @@ - (void)deleteBackward:(id)sender - (void)moveUp:(id)sender { if ([self selectedRow] > 0) { - [self selectRow:[self selectedRow] - 1 byExtendingSelection:NO]; + [self selectRowIndexes:[NSIndexSet indexSetWithIndex:[self selectedRow] - 1] byExtendingSelection:NO]; } } @@ -33,12 +33,12 @@ - (void)moveUp:(id)sender - (void)moveDown:(id)sender { if ([self selectedRow] != -1 && [self selectedRow] < [self numberOfRows]-1) { - [self selectRow:[self selectedRow] + 1 byExtendingSelection:NO]; + [self selectRowIndexes:[NSIndexSet indexSetWithIndex:[self selectedRow] + 1] byExtendingSelection:NO]; } } -- (BOOL)validateMenuItem:(id )menuItem +- (BOOL)validateUserInterfaceItem:(id) menuItem { if ([menuItem action] == @selector(clear:)) return [self numberOfSelectedRows] > 0;