Skip to content

Commit

Permalink
Updates for latest AUv3Support API
Browse files Browse the repository at this point in the history
  • Loading branch information
bradhowes committed Nov 11, 2024
1 parent 92072b4 commit 32f8e7f
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 56 deletions.
2 changes: 1 addition & 1 deletion --NAME--.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@
repositoryURL = "https://github.com/bradhowes/AUv3Support";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 13.0.4;
minimumVersion = 13.0.5;
};
};
BD8D4E1327B589D4007011A5 /* XCRemoteSwiftPackageReference "knob" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/bradhowes/AUv3Support",
"state" : {
"revision" : "68fc0af6df3323703afa5faf25766fec79acfe97",
"version" : "13.0.4"
"revision" : "63ef6cc3a1f99e4e572f78bfc10c8450cbc062c7",
"version" : "13.0.5"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion --NAME--.xcodeproj/xcshareddata/xcschemes/All.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C437FE792223688D008D6C09"
BuildableName = "--NAME--.app"
BuildableName = "--NAME--Host.app"
BlueprintName = "macOS App"
ReferencedContainer = "container:--NAME--.xcodeproj">
</BuildableReference>
Expand Down
8 changes: 4 additions & 4 deletions --NAME--.xcodeproj/xcshareddata/xcschemes/macOS App.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C437FE792223688D008D6C09"
BuildableName = "--NAME--.app"
BuildableName = "--NAME--Host.app"
BlueprintName = "macOS App"
ReferencedContainer = "container:--NAME--.xcodeproj">
</BuildableReference>
Expand All @@ -31,7 +31,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C437FE792223688D008D6C09"
BuildableName = "--NAME--.app"
BuildableName = "--NAME--Host.app"
BlueprintName = "macOS App"
ReferencedContainer = "container:--NAME--.xcodeproj">
</BuildableReference>
Expand Down Expand Up @@ -84,7 +84,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C437FE792223688D008D6C09"
BuildableName = "--NAME--.app"
BuildableName = "--NAME--Host.app"
BlueprintName = "macOS App"
ReferencedContainer = "container:--NAME--.xcodeproj">
</BuildableReference>
Expand All @@ -108,7 +108,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C437FE792223688D008D6C09"
BuildableName = "--NAME--.app"
BuildableName = "--NAME--Host.app"
BlueprintName = "macOS App"
ReferencedContainer = "container:--NAME--.xcodeproj">
</BuildableReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C437FE792223688D008D6C09"
BuildableName = "--NAME--.app"
BuildableName = "--NAME--Host.app"
BlueprintName = "macOS App"
ReferencedContainer = "container:--NAME--.xcodeproj">
</BuildableReference>
Expand Down Expand Up @@ -95,7 +95,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C437FE792223688D008D6C09"
BuildableName = "--NAME--.app"
BuildableName = "--NAME--Host.app"
BlueprintName = "macOS App"
ReferencedContainer = "container:--NAME--.xcodeproj">
</BuildableReference>
Expand Down
47 changes: 28 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
# See LICENSE folder for this sample’s licensing information.
#
# Apple sample code gitignore configuration.

## User settings
xcuserdata/
# Finder
.DS_Store

## Obj-C/Swift specific
*.hmap
# Xcode - User files
xcuserdata/

## App packaging
*.ipa
*.dSYM.zip
*.dSYM
**/*.xcodeproj/project.xcworkspace/*
!**/*.xcodeproj/project.xcworkspace/xcshareddata

## Playgrounds
timeline.xctimeline
playground.xcworkspace
**/*.xcodeproj/project.xcworkspace/xcshareddata/*
!**/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

# Swift Package Manager
.build/
**/*.playground/playground.xcworkspace/*
!**/*.playground/playground.xcworkspace/xcshareddata

# fastlane
**/*.playground/playground.xcworkspace/xcshareddata/*
!**/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output
DerivedData/
.DerivedData-iOS/
.DerivedData-macOS/

# Files from scripts/bumpVersions.py
**/*.old

Gemfile
Gemfile.lock

fastlane
Packages/.swiftpm/
Packages/.build/
Packages/Package.resolved
.version
exportOptions.plist
21 changes: 18 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PLATFORM_IOS = iOS Simulator,name=iPad mini (6th generation)
PLATFORM_IOS = iOS Simulator,name=iPad mini (A17 Pro)
PLATFORM_MACOS = macOS

default: build
Expand All @@ -10,6 +10,13 @@ build-iOS:
-derivedDataPath "$(PWD)/.DerivedData-iOS" \
-destination platform="$(PLATFORM_IOS)"

test-iOS:
rm -rf "$(PWD)/.DerivedData-iOS"
xcodebuild test \
-scheme 'iOS App' \
-derivedDataPath "$(PWD)/.DerivedData-iOS" \
-destination platform="$(PLATFORM_IOS)"

build-macOS:
rm -rf "$(PWD)/.DerivedData-macOS"
xcodebuild build \
Expand All @@ -18,9 +25,17 @@ build-macOS:
-destination platform="$(PLATFORM_MACOS)" \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO

build: build-iOS build-macOS
test-macOS:
rm -rf "$(PWD)/.DerivedData-macOS"
xcodebuild test \
-scheme 'macOS App' \
-derivedDataPath "$(PWD)/.DerivedData-macOS" \
-destination platform="$(PLATFORM_MACOS)" \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO

build: test-iOS test-macOS

.PHONY: build build-iOS build-macOS
.PHONY: build build-iOS test-macOS

clean:
-rm -rf $(PWD)/.DerivedData-macOS $(PWD)/.DerivedData-iOS
2 changes: 1 addition & 1 deletion Packages/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
.library(name: "Theme", targets: ["Theme"])
],
dependencies: [
.package(url: "https://github.com/bradhowes/AUv3Support", from: "13.0.4"),
.package(url: "https://github.com/bradhowes/AUv3Support", from: "13.0.5"),
],
targets: [
.target(
Expand Down
10 changes: 5 additions & 5 deletions Packages/Sources/Kernel/C++/Kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ class Kernel : public DSPHeaders::EventProcessor<Kernel> {
auto [evenTap, oddTap] = odd90 ? calcDoubleTap(center, variance) : calcSingleTap(center, variance);
writeSample(ins, outs, evenTap, oddTap, feedback, wetMix_.frameValue(), dryMix_.frameValue());
} else [[likely]] {
auto delay = delay_.getImmediate();
auto depth = depth_.getImmediate();
auto feedback = (negativeFeedback_ ? -1.0 : 1.0) * feedback_.getImmediate();
auto wetMix = wetMix_.getImmediate();
auto dryMix = dryMix_.getImmediate();
auto delay = delay_.finalValue();
auto depth = depth_.finalValue();
auto feedback = (negativeFeedback_ ? -1.0 : 1.0) * feedback_.finalValue();
auto wetMix = wetMix_.finalValue();
auto dryMix = dryMix_.finalValue();
auto [center, variance] = calcCenterVariance(delay, depth);
if (odd90) {
while (frameCount-- >0) {
Expand Down
21 changes: 14 additions & 7 deletions iOS/App/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@ final class MainViewController: UIViewController {
guard let delegate = UIApplication.shared.delegate as? AppDelegate else { fatalError() }

let bundle = Bundle.main
let component = AudioComponentDescription(componentType: bundle.auComponentType,
componentSubType: bundle.auComponentSubtype,
componentManufacturer: bundle.auComponentManufacturer,
componentFlags: 0, componentFlagsMask: 0)
let component = AudioComponentDescription(
componentType: bundle.auComponentType,
componentSubType: bundle.auComponentSubtype,
componentManufacturer: bundle.auComponentManufacturer,
componentFlags: 0, componentFlagsMask: 0
)

let tintColor = UIColor(named: "label")!
let config = HostViewConfig(name: bundle.auBaseName, version: bundle.releaseVersionNumber, appDelegate: delegate,
appStoreId: bundle.appStoreId, componentDescription: component, sampleLoop: .sample1,
tintColor: tintColor) { url in
let config = HostViewConfig(
name: bundle.auBaseName,
appDelegate: delegate,
appStoreId: bundle.appStoreId,
componentDescription: component,
sampleLoop: .sample1,
tintColor: tintColor
) { url in
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}

Expand Down
7 changes: 4 additions & 3 deletions iOS/Extension/Base.lproj/MainInterface.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="landscape" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -23,7 +23,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="v1.0.0" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sOK-vA-Qxl" userLabel="APP_VERSION">
<rect key="frame" x="545" y="250" width="37.5" height="18"/>
<rect key="frame" x="543" y="250" width="39.5" height="18"/>
<accessibility key="accessibilityConfiguration">
<bool key="isElement" value="NO"/>
</accessibility>
Expand Down Expand Up @@ -497,6 +497,7 @@
<outlet property="rateTapEdit" destination="8ki-wy-l3o" id="Dn4-Sz-0GY"/>
<outlet property="rateValueLabel" destination="GCP-HR-UOg" id="VWE-EP-QhB"/>
<outlet property="titleLabel" destination="Vbj-fp-p3P" id="8oV-EU-1us"/>
<outlet property="versionTag" destination="sOK-vA-Qxl" id="8QD-5i-nvk"/>
<outlet property="wetMixControl" destination="xjB-dE-KcA" id="G3O-Zd-53a"/>
<outlet property="wetMixTapEdit" destination="lM5-yt-nYm" id="dJx-W1-fuq"/>
<outlet property="wetMixValueLabel" destination="OFy-GK-jEJ" id="taI-uJ-K5A"/>
Expand Down
2 changes: 1 addition & 1 deletion iOS/Extension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>$(AU_BASE_NAME}</string>
<string>$(AU_BASE_NAME)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down
15 changes: 14 additions & 1 deletion iOS/Extension/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ extension Knob: @retroactive AUParameterValueProvider, @retroactive RangedContro
@IBOutlet weak var odd90Control: Switch!
@IBOutlet weak var negativeFeedbackControl: Switch!

@IBOutlet weak var versionTag: UILabel!

private lazy var controls: [ParameterAddress: [(Knob, Label, UIView)]] = [
.depth: [(depthControl, depthValueLabel, depthTapEdit),
(altDepthControl, altDepthValueLabel, altDepthTapEdit)],
Expand Down Expand Up @@ -127,7 +129,13 @@ extension ViewController: AudioUnitViewConfigurationManager {}

extension ViewController: AUAudioUnitFactory {
@objc public func createAudioUnit(with componentDescription: AudioComponentDescription) throws -> AUAudioUnit {
let kernel = KernelBridge(Bundle.main.auBaseName, maxDelayMilliseconds: parameters[.delay].maxValue)
let bundle = InternalConstants.bundle

DispatchQueue.main.async {
self.versionTag.text = bundle.versionTag
}

let kernel = KernelBridge(bundle.auBaseName, maxDelayMilliseconds: parameters[.delay].maxValue)
let audioUnit = try FilterAudioUnitFactory.create(componentDescription: componentDescription,
parameters: parameters, kernel: kernel,
viewConfigurationManager: self)
Expand Down Expand Up @@ -219,3 +227,8 @@ extension ViewController: AUParameterEditorDelegate {
os_log(.debug, log: log, "controlChanged END")
}
}

private enum InternalConstants {
private class EmptyClass {}
static let bundle = Bundle(for: InternalConstants.EmptyClass.self)
}
1 change: 0 additions & 1 deletion macOS/App/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ extension MainViewController {
componentManufacturer: bundle.auComponentManufacturer,
componentFlags: 0, componentFlagsMask: 0)
let config = HostViewConfig(componentName: audioUnitName,
componentVersion: bundle.releaseVersionNumber,
componentDescription: componentDescription,
sampleLoop: .sample1,
playButton: windowController.playButton,
Expand Down
15 changes: 14 additions & 1 deletion macOS/Extension/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ extension Knob: @retroactive AUParameterValueProvider, @retroactive RangedContro
@IBOutlet private weak var odd90Control: NSSwitch!
@IBOutlet private weak var negativeFeedbackControl: NSSwitch!

@IBOutlet private weak var versionTag: NSTextView!

private lazy var controls: [ParameterAddress: (Knob, FocusAwareTextField)] = [
.depth: (depthControl, depthValueLabel),
.rate: (rateControl, rateValueLabel),
Expand Down Expand Up @@ -100,7 +102,13 @@ extension ViewController: AudioUnitViewConfigurationManager {}

extension ViewController: AUAudioUnitFactory {
@objc public func createAudioUnit(with componentDescription: AudioComponentDescription) throws -> AUAudioUnit {
let kernel = KernelBridge(Bundle.main.auBaseName, maxDelayMilliseconds: parameters[.delay].maxValue)
let bundle = InternalConstants.bundle

DispatchQueue.main.async {
self.versionTag.string = bundle.versionTag
}

let kernel = KernelBridge(bundle.auBaseName, maxDelayMilliseconds: parameters[.delay].maxValue)
let audioUnit = try FilterAudioUnitFactory.create(componentDescription: componentDescription,
parameters: parameters,
kernel: kernel,
Expand Down Expand Up @@ -188,3 +196,8 @@ private extension ViewController {
editor.controlChanged(source: control)
}
}

private enum InternalConstants {
private class EmptyClass {}
static let bundle = Bundle(for: InternalConstants.EmptyClass.self)
}
9 changes: 5 additions & 4 deletions macOS/Extension/ViewController.xib
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="ViewController" customModule="ZZZAU">
<customObject id="-2" userLabel="File's Owner" customClass="ViewController" customModule="__NAME__AU">
<connections>
<outlet property="controlsView" destination="oPI-wC-N8q" id="nuC-JX-CtU"/>
<outlet property="delayControl" destination="1VT-Na-dOb" id="6Ci-Ox-yQb"/>
Expand All @@ -22,6 +22,7 @@
<outlet property="odd90Control" destination="l5S-ZP-tBO" id="3vV-9N-bPP"/>
<outlet property="rateControl" destination="25e-Ls-Yhr" id="dxc-H0-f1l"/>
<outlet property="rateValueLabel" destination="YuF-pJ-Rk3" id="7as-t3-K1d"/>
<outlet property="versionTag" destination="wUu-Yz-l9v" id="Sxv-0S-PyL"/>
<outlet property="view" destination="Hz6-mo-xeY" id="H7S-LS-0kL"/>
<outlet property="wetMixControl" destination="KfU-K8-Mrs" id="0Ek-vi-hRR"/>
<outlet property="wetMixValueLabel" destination="Bgn-eW-ymD" id="C3K-s8-j1e"/>
Expand All @@ -32,7 +33,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="wUu-Yz-l9v" userLabel="v1.0.0">
<rect key="frame" x="500" y="59" width="40" height="17"/>
<rect key="frame" x="498" y="59" width="42" height="17"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="v1.0.0" id="p30-Bk-a8R" userLabel="APP_VERSION">
<font key="font" metaFont="system" size="14"/>
<color key="textColor" name="title"/>
Expand Down

0 comments on commit 32f8e7f

Please sign in to comment.