Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	Sources/Keyboard/MIDIMonitorKeyboard.swift
  • Loading branch information
aure committed Jan 28, 2024
2 parents 2adf5c9 + f5e115d commit 538dea4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/Keyboard/MIDIMonitorKeyboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
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))
}
}

public struct MIDIMonitorKeyboard: View {
@available(iOS 15, macOS 12, *)
struct MIDIMonitorKeyboard: View {

var layout: KeyboardLayout
var activatedPitches: PitchSet
Expand Down Expand Up @@ -87,9 +89,13 @@ public 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)
}
*/

0 comments on commit 538dea4

Please sign in to comment.