Skip to content

Commit

Permalink
Merge pull request #3 from drummer-codes/stable
Browse files Browse the repository at this point in the history
Stable into master
  • Loading branch information
yaros-eu authored May 10, 2023
2 parents 45bdbb5 + b811674 commit 140ac31
Show file tree
Hide file tree
Showing 25 changed files with 403 additions and 404 deletions.
Binary file removed AppIcon.icns
Binary file not shown.
6 changes: 3 additions & 3 deletions Controller Classes/PatchTableDataSource.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#import <Cocoa/Cocoa.h>

@class Patch;
@class PatchbayDocument;
@class RouterDocument;


@interface PatchTableDataSource : NSObject<NSTableViewDataSource> {
PatchbayDocument* document;
RouterDocument* document;
NSMutableArray* patchArray;
}

- (PatchTableDataSource*)initWithDocument:(PatchbayDocument*)newDocument patchArray:(NSMutableArray*)newPatchArray;
- (PatchTableDataSource*)initWithDocument:(RouterDocument*)newDocument patchArray:(NSMutableArray*)newPatchArray;
- (void)dealloc;

- (void)setPatchArray:(NSMutableArray*)newPatchArray;
Expand Down
4 changes: 2 additions & 2 deletions Controller Classes/PatchTableDataSource.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#import "PatchTableDataSource.h"
#import "Patch.h"
#import "PatchTableCellData.h"
#import "PatchbayDocument.h"
#import "RouterDocument.h"


@implementation PatchTableDataSource


- (PatchTableDataSource*)initWithDocument:(PatchbayDocument*)newDocument patchArray:(NSMutableArray*)newPatchArray;
- (PatchTableDataSource*)initWithDocument:(RouterDocument*)newDocument patchArray:(NSMutableArray*)newPatchArray;
{
self = [super init];

Expand Down
8 changes: 0 additions & 8 deletions Controller Classes/PatchbayController.h

This file was deleted.

6 changes: 0 additions & 6 deletions Controller Classes/PatchbayController.m

This file was deleted.

8 changes: 8 additions & 0 deletions Controller Classes/RouterController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#import <Cocoa/Cocoa.h>


@interface RouterController : NSObject {

}

@end
6 changes: 6 additions & 0 deletions Controller Classes/RouterController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#import "RouterController.h"


@implementation RouterController

@end
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@class EndpointTableDataSource;


@interface PatchbayDocument : NSDocument<NSWindowDelegate> {
@interface RouterDocument : NSDocument<NSWindowDelegate> {
IBOutlet NSWindow* documentWindow;

// Stuff related to the table of patches
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#import "PatchbayDocument.h"
#import "RouterDocument.h"
#import "PYMIDI/PYMIDI.h"
#import "Patch.h"
#import "PatchTableCell.h"
#import "PatchTableDataSource.h"
#import "EndpointTableDataSource.h"


@implementation PatchbayDocument
@implementation RouterDocument


- (id)init
Expand Down Expand Up @@ -210,7 +210,7 @@ - (void)syncWithLoadedData

- (NSString*)windowNibName
{
return @"PatchbayDocument";
return @"RouterDocument";
}


Expand Down
8 changes: 4 additions & 4 deletions Credits.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
</style>
</head>
<body>
<p>Written by <a href="https://notahat.com">Pete Yandell</a>.</p>
<p>Written by Pete Yandell.</p>

<p>Big thanks to Dan Wilcox (<a href="https://zkm.de/en/about-the-zkm/organisation/hertz-lab">ZKM | Hertz-lab</a>) for his work on 64-bit support.</p>
<p>Modified and made into MIDI Router by drummer_codes.</p>

<p>Big thanks to Dan Wilcox for his work on 64-bit support.</p>

<p>Thanks to Anthony Lauzon for many fixes.</p>

<p>Icon by Kevan Staples.</p>
</body>
</html>
Binary file removed DocIcon.icns
Binary file not shown.
8 changes: 5 additions & 3 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mpb</string>
<string>mdrt</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>DocIcon</string>
<key>CFBundleTypeName</key>
<string>MIDI Patchbay document</string>
<string>MIDI Router document</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>NSDocumentClass</key>
<string>PatchbayDocument</string>
<string>RouterDocument</string>
</dict>
</array>
<key>CFBundleExecutable</key>
Expand All @@ -43,6 +43,8 @@
<string>public.app-category.music</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>LSUIElement</key>
<false/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Model Classes/Patch.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ - (Patch*)initWithInput:(PYMIDIEndpoint*)newInput output:(PYMIDIEndpoint*)newOut
output = [newOutput retain];
[output addSender:self];

isEnabled = YES;
isEnabled = NO;

return self;
}
Expand Down Expand Up @@ -177,6 +177,8 @@ - (void)rescueFromLimbo

- (NSString*)description
{
return @"";

NSMutableArray* parts = [NSMutableArray arrayWithCapacity:0];
NSString* description;

Expand Down
29 changes: 3 additions & 26 deletions View Classes/PatchTableCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
PatchTableCellData* data = [self objectValue];

NSFont* systemFont;
NSFont* smallSystemFont;
NSMutableParagraphStyle* leftAlign;
NSMutableParagraphStyle* rightAlign;
NSMutableParagraphStyle* centerAlign;
Expand All @@ -21,11 +20,8 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
NSDictionary* outputNameAttributes;
NSPoint arrowCenter;
NSBezierPath* arrow;
NSRect descriptionFrame;
NSDictionary* descriptionAttributes;

systemFont = [NSFont systemFontOfSize:[NSFont systemFontSize]];
smallSystemFont = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]];
leftAlign = [[NSMutableParagraphStyle alloc] init];
[leftAlign setAlignment:NSTextAlignmentLeft];
[leftAlign setLineBreakMode:NSLineBreakByTruncatingTail];
Expand All @@ -40,7 +36,7 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView


inputNameFrame = NSMakeRect (
cellFrame.origin.x + 10, cellFrame.origin.y,
cellFrame.origin.x + 10, cellFrame.origin.y + 10,
cellFrame.size.width / 2 - 30, 20
);

Expand All @@ -59,7 +55,7 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView


outputNameFrame = NSMakeRect (
cellFrame.origin.x + cellFrame.size.width / 2 + 20, cellFrame.origin.y,
cellFrame.origin.x + cellFrame.size.width / 2 + 20, cellFrame.origin.y + 10,
cellFrame.size.width / 2 - 30, 20
);

Expand All @@ -77,7 +73,7 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
[[data outputName] drawInRect:outputNameFrame withAttributes:outputNameAttributes];


arrowCenter = NSMakePoint (cellFrame.origin.x + cellFrame.size.width / 2, cellFrame.origin.y + 10);
arrowCenter = NSMakePoint (cellFrame.origin.x + cellFrame.size.width / 2, cellFrame.origin.y + 20);
arrow = [NSBezierPath bezierPath];
[arrow moveToPoint:NSMakePoint (arrowCenter.x - 15, arrowCenter.y + 1)];
[arrow lineToPoint:NSMakePoint (arrowCenter.x, arrowCenter.y + 1)];
Expand All @@ -95,25 +91,6 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
}

[arrow fill];


descriptionFrame = NSMakeRect (
cellFrame.origin.x, cellFrame.origin.y + 20,
cellFrame.size.width, cellFrame.size.height - 20
);

descriptionAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:
smallSystemFont, NSFontAttributeName,
centerAlign, NSParagraphStyleAttributeName,
[NSColor labelColor], NSForegroundColorAttributeName,
nil
];

if (self.isHighlighted) {
[descriptionAttributes setValue:[NSColor alternateSelectedControlTextColor] forKey:NSForegroundColorAttributeName];
}

[[data description] drawInRect:descriptionFrame withAttributes:descriptionAttributes];
}


Expand Down
Binary file modified en.lproj/InfoPlist.strings
Binary file not shown.
17 changes: 9 additions & 8 deletions en.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication"/>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<menu title="MainMenu" systemMenu="main" id="29" userLabel="MainMenu">
<items>
<menuItem title="MIDI Patchbay" id="56">
<menu key="submenu" title="MIDI Patchbay" systemMenu="apple" id="57">
<menuItem title="MIDI Router" id="56">
<menu key="submenu" title="MIDI Router" systemMenu="apple" id="57">
<items>
<menuItem title="About MIDI Patchbay" id="58">
<menuItem title="About MIDI Router" id="58">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
Expand All @@ -27,7 +28,7 @@
<menuItem isSeparatorItem="YES" id="144">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Hide MIDI Patchbay" keyEquivalent="h" id="134">
<menuItem title="Hide MIDI Router" keyEquivalent="h" id="134">
<connections>
<action selector="hide:" target="-2" id="152"/>
</connections>
Expand All @@ -46,7 +47,7 @@
<menuItem isSeparatorItem="YES" id="149">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Quit MIDI Patchbay" keyEquivalent="q" id="136">
<menuItem title="Quit MIDI Router" keyEquivalent="q" id="136">
<connections>
<action selector="terminate:" target="-2" id="139"/>
</connections>
Expand Down Expand Up @@ -206,6 +207,6 @@
</items>
<point key="canvasLocation" x="139" y="154"/>
</menu>
<customObject id="204" userLabel="PatchbayController" customClass="PatchbayController"/>
<customObject id="204" userLabel="RouterController" customClass="RouterController"/>
</objects>
</document>
Loading

0 comments on commit 140ac31

Please sign in to comment.