Skip to content
This repository has been archived by the owner on Jan 30, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorloff committed May 14, 2019
2 parents cb01fc7 + 9dd10b0 commit cb7cfa8
Show file tree
Hide file tree
Showing 14 changed files with 145 additions and 72 deletions.
113 changes: 63 additions & 50 deletions Attenuator.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@
ReferencedContainer = "container:Attenuator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_A71F9727AA9C3A06FAC3AC8E5D71F7EB"
BuildableName = "Attenuator.app"
BlueprintName = "Attenuator-macOS"
ReferencedContainer = "container:Attenuator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<LaunchAction
Expand Down
5 changes: 3 additions & 2 deletions Configuration/Release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: Swift 5 compatibility update.
name: Extension Registration Fix.
description:
- Xcode 10.2.1 compatibility update.
- Fixes previously broken Plug-In registration.
- See Docs/Troubleshooting.md
4 changes: 2 additions & 2 deletions Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// Copyright © 2016 WaveLabs. All rights reserved.
//

APP_BUNDLE_VERSION=38
APP_PROJECT_VERSION=1.1.12
APP_BUNDLE_VERSION=39
APP_PROJECT_VERSION=1.1.13
44 changes: 44 additions & 0 deletions Docs/Troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Step #1. Reveal Extensions registered in System and identify yours one:

```bash
pluginkit -m

# Same as above but more verbose
pluginkit -mv

# Same as above but only Audio Unit UIs
pluginkit -mvp com.apple.AudioUnit-UI

# Same as above but only Audio Units
pluginkit -mvp com.apple.AudioUnit
```

Step #2. Reveal Audio Units registered in System and identify yours one:

```bash
# All Audio Units
auval -a

# Only Audio Unit Effects
auval -s aufx

# Only certain Audio Unit
auval -v aufx attr wlUA
```

Step #3. Validate Audio Unit:

```bash
auval -v aufx attr wlUA
```

To explicitely unregister/redister Extension in System:

```bash
pluginkit -vr /tmp/Attenuator.dst/Applications/Attenuator.app/Contents/PlugIns/AttenuatorAU.appex
pluginkit -va /tmp/Attenuator.dst/Applications/Attenuator.app/Contents/PlugIns/AttenuatorAU.appex
```

Apple API:

- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AudioToolbox.framework/Versions/A/Headers/AUAudioUnitImplementation.h
21 changes: 18 additions & 3 deletions Project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def generate()

attenuator = gen.addApplication("Attenuator", "SampleAUPlugin/Attenuator", "macOS")
gen.addFiles(attenuator, "Common")
gen.addFiles(attenuator, "SampleAUPlugin/AttenuatorKit")
gen.addFiles(attenuator, "SampleAUPlugin/Common")
gen.addBuildSettings(attenuator, {
"PRODUCT_BUNDLE_IDENTIFIER" => "ua.com.wavelabs.Attenuator", "DEPLOYMENT_LOCATION" => "YES"
})
addSharedSources(gen, attenuator, true)

auExtension = gen.addExtension("AttenuatorAU", "SampleAUPlugin/AttenuatorAU", "macOS")
gen.addFiles(auExtension, "SampleAUPlugin/AttenuatorKit")
gen.addFiles(auExtension, "SampleAUPlugin/Common")
gen.addBuildSettings(auExtension, {
"PRODUCT_BUNDLE_IDENTIFIER" => "ua.com.wavelabs.Attenuator.AttenuatorAU", "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES" => "YES",
"SWIFT_INCLUDE_PATHS" => "Common"
Expand All @@ -70,12 +70,27 @@ def generate()

gen.addDependencies(attenuator, [auExtension])
gen.setAsLaunchTarget(auHost, auExtension)
gen.addToBuildScheme(attenuator, auExtension)
script = <<DATA
CMD="pluginkit -v -a \"$CODESIGNING_FOLDER_PATH/Contents/PlugIns/AttenuatorAU.appex\""
# Due Not-In-Time/Too-Late Plug-In registration we have to manually do it.
CMD="pluginkit -vr \"$CODESIGNING_FOLDER_PATH/Contents/PlugIns/AttenuatorAU.appex\" || true"
echo Running: $CMD
$CMD
CMD="pluginkit -va \"$CODESIGNING_FOLDER_PATH/Contents/PlugIns/AttenuatorAU.appex\""
echo Running: $CMD
$CMD
DATA
gen.addScript(attenuator, "Register Extension", script, true)
script = <<DATA
# Comment line below for AU Validation
exit 0
sleep .5
CMD="auval -v aufx attr wlUA"
echo Running: $CMD
$CMD
DATA
gen.addScript(attenuator, "Verify Extension", script, true)

gen.save()
end
Expand Down
15 changes: 0 additions & 15 deletions SampleAUPlugin/AttenuatorAU/Attenuator.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ open class AttenuatorViewController: AUViewController {
extension AttenuatorViewController: AUAudioUnitFactory {

public func createAudioUnit(with componentDescription: AudioComponentDescription) throws -> AUAudioUnit {
log.info(.controller, "Creating AudioUnit for component description: \(componentDescription)")
let au = try AttenuatorAudioUnit(componentDescription: componentDescription, options: [])
audioUnit = au
DispatchQueue.main.async {
Expand Down

0 comments on commit cb7cfa8

Please sign in to comment.