From dd07419dacec5913fa29e97da9c8743de966cc32 Mon Sep 17 00:00:00 2001 From: Maximilian Maksutovic Date: Thu, 31 Aug 2023 18:02:39 -0700 Subject: [PATCH 1/2] Added @available derectives for MIDIMonitorKeyboard and removed Preview Macro --- Sources/Keyboard/MIDIMonitorKeyboard.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/Keyboard/MIDIMonitorKeyboard.swift b/Sources/Keyboard/MIDIMonitorKeyboard.swift index 7c1817f..7440911 100644 --- a/Sources/Keyboard/MIDIMonitorKeyboard.swift +++ b/Sources/Keyboard/MIDIMonitorKeyboard.swift @@ -2,12 +2,14 @@ import SwiftUI import Tonic +@available(iOS 15, macOS 12, *) extension GraphicsContext { func fill(rect: CGRect, with color: Color) { fill(Path(roundedRect: rect, cornerRadius: 0), with: GraphicsContext.Shading.color(color)) } } +@available(iOS 15, macOS 12, *) struct MIDIMonitorKeyboard: View { var layout: KeyboardLayout @@ -87,9 +89,13 @@ struct MIDIMonitorKeyboard: View { } var p = PitchSet(pitches: [Pitch(65), Pitch(68), Pitch(71), Pitch(74)]) + +//Removing Preview macro until Xcode 15 is released +/* #Preview { MIDIMonitorKeyboard(layout: .piano(pitchRange: Pitch(61)...Pitch(88)), activatedPitches: p, colorFunction: { x in Color(cgColor: PitchColor.helmholtz[Int(x.pitchClass)])} ).frame(width: 600, height: 100) } +*/ From 20ce75b33b8de9d09f4ae1b53ebe14da431bb1ea Mon Sep 17 00:00:00 2001 From: Maximilian Maksutovic Date: Thu, 31 Aug 2023 18:04:08 -0700 Subject: [PATCH 2/2] added space to comment --- Sources/Keyboard/MIDIMonitorKeyboard.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Keyboard/MIDIMonitorKeyboard.swift b/Sources/Keyboard/MIDIMonitorKeyboard.swift index 7440911..ec9aaa1 100644 --- a/Sources/Keyboard/MIDIMonitorKeyboard.swift +++ b/Sources/Keyboard/MIDIMonitorKeyboard.swift @@ -90,7 +90,7 @@ struct MIDIMonitorKeyboard: View { var p = PitchSet(pitches: [Pitch(65), Pitch(68), Pitch(71), Pitch(74)]) -//Removing Preview macro until Xcode 15 is released +// Removing Preview macro until Xcode 15 is released /* #Preview { MIDIMonitorKeyboard(layout: .piano(pitchRange: Pitch(61)...Pitch(88)),