Skip to content

Commit

Permalink
Merge pull request #63 from orchetect/dev
Browse files Browse the repository at this point in the history
Dev merge
  • Loading branch information
orchetect authored Jan 10, 2022
2 parents 7599a32 + c553953 commit 3b3b6ee
Show file tree
Hide file tree
Showing 48 changed files with 1,254 additions and 1,396 deletions.
35 changes: 6 additions & 29 deletions Examples/MIDIEventLogger/MIDIEventLogger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
E26A25B426C586F700FFCF40 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E26A25B326C586F700FFCF40 /* Assets.xcassets */; };
E26A25B726C586F700FFCF40 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E26A25B526C586F700FFCF40 /* Main.storyboard */; };
E26A25C226C5873B00FFCF40 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E26A25BE26C5873B00FFCF40 /* AppDelegate.swift */; };
E26A25C326C5873B00FFCF40 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = E26A25BF26C5873B00FFCF40 /* Log.swift */; };
E26A25C426C5873B00FFCF40 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E26A25C026C5873B00FFCF40 /* ContentView.swift */; };
Expand All @@ -20,8 +18,6 @@
/* Begin PBXFileReference section */
E216886026C5E5A400BF7959 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E26A25AC26C586F600FFCF40 /* MIDIEventLogger.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MIDIEventLogger.app; sourceTree = BUILT_PRODUCTS_DIR; };
E26A25B326C586F700FFCF40 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
E26A25B626C586F700FFCF40 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
E26A25BE26C5873B00FFCF40 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
E26A25BF26C5873B00FFCF40 /* Log.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = "<group>"; };
E26A25C026C5873B00FFCF40 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -69,8 +65,6 @@
E26A25BF26C5873B00FFCF40 /* Log.swift */,
E216886026C5E5A400BF7959 /* Info.plist */,
E2B38F2026C63918008770A6 /* MIDIEventLogger.entitlements */,
E26A25B326C586F700FFCF40 /* Assets.xcassets */,
E26A25B526C586F700FFCF40 /* Main.storyboard */,
);
path = MIDIEventLogger;
sourceTree = "<group>";
Expand Down Expand Up @@ -141,8 +135,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E26A25B426C586F700FFCF40 /* Assets.xcassets in Resources */,
E26A25B726C586F700FFCF40 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -162,17 +154,6 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
E26A25B526C586F700FFCF40 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
E26A25B626C586F700FFCF40 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
E26A25B826C586F700FFCF40 /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down Expand Up @@ -214,7 +195,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_OPTIMIZATION_LEVEL = 1;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand All @@ -225,13 +206,13 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_OPTIMIZATION_LEVEL = "-O";
};
name = Debug;
};
Expand Down Expand Up @@ -280,7 +261,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
Expand All @@ -292,7 +273,6 @@
E26A25BB26C586F700FFCF40 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MIDIEventLogger/MIDIEventLogger.entitlements;
Expand All @@ -307,13 +287,12 @@
INFOPLIST_FILE = MIDIEventLogger/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
INFOPLIST_KEY_NSMainStoryboardFile = MIDIEventLogger;
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.orchetect.MIDIEventLogger;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -326,7 +305,6 @@
E26A25BC26C586F700FFCF40 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MIDIEventLogger/MIDIEventLogger.entitlements;
Expand All @@ -341,13 +319,12 @@
INFOPLIST_FILE = MIDIEventLogger/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
INFOPLIST_KEY_NSMainStoryboardFile = MIDIEventLogger;
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.orchetect.MIDIEventLogger;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
75 changes: 20 additions & 55 deletions Examples/MIDIEventLogger/MIDIEventLogger/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,30 @@ import OTCore
import MIDIKit

@main
class AppDelegate: NSObject, NSApplicationDelegate {
struct MIDIEventLogger: App {

var window: NSWindow!
var midiManager: MIDI.IO.Manager = {
let newManager =
MIDI.IO.Manager(clientName: "MIDIEventLogger",
model: "LoggerApp",
manufacturer: "Orchetect")
do {
logger.debug("Starting MIDI manager")
try newManager.start()
} catch {
logger.default(error)
}

return newManager
}()

fileprivate(set) var midiManager: MIDI.IO.Manager?

func applicationDidFinishLaunching(_ aNotification: Notification) {

// set up midi manager

midiManager = {
let newManager =
MIDI.IO.Manager(clientName: "MIDIEventLogger",
model: "LoggerApp",
manufacturer: "Orchetect")
do {
logger.debug("Starting MIDI manager")
try newManager.start()
} catch {
logger.default(error)
}

#warning("> TODO: remove this")
//newManager.preferredAPI = .newCoreMIDI

return newManager
}()

guard let unwrappedMIDIManager = midiManager
else { return }

// Create the window and set the content view.
window = NSWindow(
contentRect: NSRect(x: 0,
y: 0,
width: ContentView.kMinWidth,
height: ContentView.kMinHeight),
styleMask: [.titled, .miniaturizable, .resizable],
backing: .buffered,
defer: false
)
var body: some Scene {

// Create the SwiftUI view that provides the window contents.
window.isReleasedWhenClosed = true
WindowGroup {
ContentView()
.environmentObject(midiManager)
}

window.center()
window.setFrameAutosaveName("Main Window")

window.title = "MIDIKit Event Logger"
window.contentView = NSHostingView(
rootView: ContentView(midiManager: unwrappedMIDIManager)
)

window.makeKeyAndOrderFront(nil)

}

func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}

}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3b3b6ee

Please sign in to comment.