Skip to content

Commit

Permalink
AudioUnitSDK - version 1.1.0
Browse files Browse the repository at this point in the history
* The `Source` folder was split in two folders: `include` for public headers, and `src` for private source files.
* Add Mac Catalyst Support.
* Several small bug fixes and improvements.
  • Loading branch information
ApplJam committed Aug 23, 2022
1 parent 53ea94e commit 53a9a20
Show file tree
Hide file tree
Showing 36 changed files with 428 additions and 488 deletions.
129 changes: 94 additions & 35 deletions AudioUnitSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
394A97042576BF1700897571 /* AUMIDIUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 394A97032576BF1700897571 /* AUMIDIUtility.h */; };
394A97042576BF1700897571 /* AUMIDIUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 394A97032576BF1700897571 /* AUMIDIUtility.h */; settings = {ATTRIBUTES = (Public, ); }; };
9100832E24DF0EB6003E57AE /* AUInputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 914EC75924D9181600725ABE /* AUInputElement.cpp */; };
9100832F24DF0EE7003E57AE /* AUOutputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 914EC75824D9181600725ABE /* AUOutputElement.cpp */; };
9100833024DF0F2C003E57AE /* AUBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 914EC76224D9181600725ABE /* AUBase.cpp */; };
Expand Down Expand Up @@ -146,21 +146,22 @@
name = Frameworks;
sourceTree = "<group>";
};
9100837324E06B8F003E57AE /* Tools */ = {
9100837324E06B8F003E57AE /* tools */ = {
isa = PBXGroup;
children = (
9100837424E06BA7003E57AE /* build.sh */,
);
path = Tools;
path = tools;
sourceTree = "<group>";
};
910C29C524D910D300B9116B = {
isa = PBXGroup;
children = (
9100837324E06B8F003E57AE /* Tools */,
910C29D524D910FA00B9116B /* Source */,
9100833624DF1C82003E57AE /* EmptyPlugIns */,
91E93AC124E8962D00BF7289 /* Tests */,
B487F106284500520074F0B2 /* include */,
B487F108284500630074F0B2 /* src */,
9100837324E06B8F003E57AE /* tools */,
B487F109284501700074F0B2 /* demos */,
91E93AC124E8962D00BF7289 /* tests */,
910C29CF24D910D300B9116B /* Products */,
9100834024DF1EEB003E57AE /* Frameworks */,
);
Expand All @@ -176,47 +177,78 @@
name = Products;
sourceTree = "<group>";
};
910C29D524D910FA00B9116B /* Source */ = {
91E93AC124E8962D00BF7289 /* tests */ = {
isa = PBXGroup;
children = (
91E93AC224E8962D00BF7289 /* Tests.mm */,
91E93AC424E8962D00BF7289 /* Info.plist */,
);
path = tests;
sourceTree = "<group>";
};
B487F106284500520074F0B2 /* include */ = {
isa = PBXGroup;
children = (
B4888687282AC1D800521D1A /* AudioUnitSDK */,
);
path = include;
sourceTree = "<group>";
};
B487F108284500630074F0B2 /* src */ = {
isa = PBXGroup;
children = (
B48885E4282A6D6D00521D1A /* AudioUnitSDK */,
);
path = src;
sourceTree = "<group>";
};
B487F109284501700074F0B2 /* demos */ = {
isa = PBXGroup;
children = (
9100833624DF1C82003E57AE /* EmptyPlugIns */,
);
path = demos;
sourceTree = "<group>";
};
B48885E4282A6D6D00521D1A /* AudioUnitSDK */ = {
isa = PBXGroup;
children = (
914EC76224D9181600725ABE /* AUBase.cpp */,
914EC76124D9181600725ABE /* AUBase.h */,
914EC77524D920CC00725ABE /* AUBuffer.cpp */,
914EC77624D920CC00725ABE /* AUBuffer.h */,
919B0CC42555C72000C59BDC /* AUBufferAllocator.cpp */,
914EC77A24D9225800725ABE /* AudioUnitSDK.h */,
9100834F24DF3245003E57AE /* AUEffectBase.cpp */,
9100834924DF3245003E57AE /* AUEffectBase.h */,
914EC75924D9181600725ABE /* AUInputElement.cpp */,
914EC76024D9181600725ABE /* AUInputElement.h */,
9100834E24DF3245003E57AE /* AUMIDIBase.cpp */,
9100834424DF3245003E57AE /* AUMIDIBase.h */,
9100834C24DF3245003E57AE /* AUMIDIEffectBase.cpp */,
9100834524DF3245003E57AE /* AUMIDIEffectBase.h */,
394A97032576BF1700897571 /* AUMIDIUtility.h */,
914EC75824D9181600725ABE /* AUOutputElement.cpp */,
914EC75B24D9181600725ABE /* AUOutputElement.h */,
914EC77324D91FFA00725ABE /* AUPlugInDispatch.cpp */,
914EC75F24D9181600725ABE /* AUPlugInDispatch.h */,
914EC75D24D9181600725ABE /* AUScopeElement.cpp */,
914EC75C24D9181600725ABE /* AUScopeElement.h */,
9100835224DF3DAC003E57AE /* AUSilentTimeout.h */,
9100832D24DF0C5B003E57AE /* AUUtility.h */,
910C29D724D9115100B9116B /* ComponentBase.cpp */,
910C29D624D9115100B9116B /* ComponentBase.h */,
9100834624DF3245003E57AE /* MusicDeviceBase.cpp */,
9100834B24DF3245003E57AE /* MusicDeviceBase.h */,
);
path = Source;
path = AudioUnitSDK;
sourceTree = "<group>";
};
91E93AC124E8962D00BF7289 /* Tests */ = {
B4888687282AC1D800521D1A /* AudioUnitSDK */ = {
isa = PBXGroup;
children = (
91E93AC224E8962D00BF7289 /* Tests.mm */,
91E93AC424E8962D00BF7289 /* Info.plist */,
914EC76124D9181600725ABE /* AUBase.h */,
914EC77624D920CC00725ABE /* AUBuffer.h */,
914EC77A24D9225800725ABE /* AudioUnitSDK.h */,
9100834924DF3245003E57AE /* AUEffectBase.h */,
914EC76024D9181600725ABE /* AUInputElement.h */,
9100834424DF3245003E57AE /* AUMIDIBase.h */,
9100834524DF3245003E57AE /* AUMIDIEffectBase.h */,
394A97032576BF1700897571 /* AUMIDIUtility.h */,
914EC75B24D9181600725ABE /* AUOutputElement.h */,
914EC75F24D9181600725ABE /* AUPlugInDispatch.h */,
914EC75C24D9181600725ABE /* AUScopeElement.h */,
9100835224DF3DAC003E57AE /* AUSilentTimeout.h */,
9100832D24DF0C5B003E57AE /* AUUtility.h */,
910C29D624D9115100B9116B /* ComponentBase.h */,
9100834B24DF3245003E57AE /* MusicDeviceBase.h */,
);
path = Tests;
path = AudioUnitSDK;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -360,6 +392,7 @@
/* Begin PBXShellScriptBuildPhase section */
9100837924E1A54B003E57AE /* Install clang-format hook */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -436,12 +469,14 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = S5585LNN66;
INFOPLIST_FILE = EmptyPlugIns/Info.plist;
DEVELOPMENT_TEAM = "";
HEADER_SEARCH_PATHS = include;
INFOPLIST_FILE = demos/EmptyPlugIns/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
PRODUCT_BUNDLE_IDENTIFIER = com.apple.audio.EmptyPlugIns;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
USE_HEADERMAP = NO;
WRAPPER_EXTENSION = bundle;
};
name = Debug;
Expand All @@ -451,12 +486,14 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = S5585LNN66;
INFOPLIST_FILE = EmptyPlugIns/Info.plist;
DEVELOPMENT_TEAM = "";
HEADER_SEARCH_PATHS = include;
INFOPLIST_FILE = demos/EmptyPlugIns/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
PRODUCT_BUNDLE_IDENTIFIER = com.apple.audio.EmptyPlugIns;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
USE_HEADERMAP = NO;
WRAPPER_EXTENSION = bundle;
};
name = Release;
Expand Down Expand Up @@ -514,16 +551,22 @@
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LLVM_LTO = NO;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
SUPPORTED_PLATFORMS = "macosx iphoneos appletvos watchos";
SUPPORTS_MACCATALYST = YES;
WARNING_CFLAGS = (
"-Wall",
"-Wextra",
"-Wimport-preprocessor-directive-pedantic",
"-Wunreachable-code-break",
"-Wunreachable-code-return",
"-Wvla",
);
};
name = Debug;
Expand Down Expand Up @@ -575,16 +618,22 @@
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LLVM_LTO = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
SUPPORTED_PLATFORMS = "macosx iphoneos appletvos watchos";
SUPPORTS_MACCATALYST = YES;
WARNING_CFLAGS = (
"-Wall",
"-Wextra",
"-Wimport-preprocessor-directive-pedantic",
"-Wunreachable-code-break",
"-Wunreachable-code-return",
"-Wvla",
);
};
name = Release;
Expand All @@ -595,9 +644,12 @@
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
HEADER_SEARCH_PATHS = include;
OTHER_CFLAGS = "-fvisibility=hidden";
PRODUCT_NAME = "$(TARGET_NAME)";
PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/AudioUnitSDK;
SUPPORTS_MACCATALYST = YES;
USE_HEADERMAP = NO;
};
name = Debug;
};
Expand All @@ -607,39 +659,46 @@
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
HEADER_SEARCH_PATHS = include;
OTHER_CFLAGS = "-fvisibility=hidden";
PRODUCT_NAME = "$(TARGET_NAME)";
PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/AudioUnitSDK;
SUPPORTS_MACCATALYST = YES;
USE_HEADERMAP = NO;
};
name = Release;
};
91E93AC824E8962D00BF7289 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = Tests/Info.plist;
HEADER_SEARCH_PATHS = include;
INFOPLIST_FILE = tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.apple.audio.Tests;
PRODUCT_NAME = "$(TARGET_NAME)";
USE_HEADERMAP = NO;
};
name = Debug;
};
91E93AC924E8962D00BF7289 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = Tests/Info.plist;
HEADER_SEARCH_PATHS = include;
INFOPLIST_FILE = tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.apple.audio.Tests;
PRODUCT_NAME = "$(TARGET_NAME)";
USE_HEADERMAP = NO;
};
name = Release;
};
Expand Down
17 changes: 17 additions & 0 deletions Tools/FindUB.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /bin/sh

# Certain types can only safely be accessed through pointers, not C++ references.
# This is due to their being variably-sized. <rdar://91434355>
# Find code that uses references to the problem types.

SearchDir="$1"

if [ -z "$SearchDir" ] ; then
SearchDir=.
fi

egrep -r "(AURenderEvent|MIDI(Packet|Event)List)\s*(const\s*)?&" "$SearchDir"
if [ $? -eq 0 ]; then
echo "error: forming reference to a type which causes UB <rdar://91434355>"
exit 1
fi
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// EmptyPlugIns
//

#include "AUEffectBase.h"
#include "MusicDeviceBase.h"
#include <AudioUnitSDK/AUEffectBase.h>
#include <AudioUnitSDK/MusicDeviceBase.h>

// -------------------------------------------------------------------------------------------------

Expand All @@ -14,10 +14,7 @@ class AUBase_Derived : public ausdk::AUBase {
public:
explicit AUBase_Derived(AudioComponentInstance ci) : Base{ ci, 1, 1 } {}

bool StreamFormatWritable(AudioUnitScope scope, AudioUnitElement element) override
{
return true;
}
bool StreamFormatWritable(AudioUnitScope, AudioUnitElement) override { return true; }

bool CanScheduleParameters() const override { return false; }
};
Expand All @@ -43,10 +40,7 @@ class MusicDeviceBase_Derived : public ausdk::MusicDeviceBase {
public:
explicit MusicDeviceBase_Derived(AudioComponentInstance ci) : Base{ ci, 0, 1 } {}

bool StreamFormatWritable(AudioUnitScope scope, AudioUnitElement element) override
{
return true;
}
bool StreamFormatWritable(AudioUnitScope, AudioUnitElement) override { return true; }

bool CanScheduleParameters() const override { return false; }
};
Expand Down
File renamed without changes.
15 changes: 4 additions & 11 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
#! /bin/zsh
# This pre-commit hook uses clang-format to format the staged changes.

if ! git rev-parse --verify HEAD >/dev/null 2>&1
Expand All @@ -9,19 +9,12 @@ fi

set -e

# do the formatting
REPO_ROOT=$(git rev-parse --show-toplevel)
DIFF_ARGS="--name-only --diff-filter=ACMRT"
while read -r FILE
git diff-index ${=DIFF_ARGS} --cached HEAD | grep -E "\.(h|hpp|c|cpp|m|mm)$" | while read -r FILE
do
# an empty line read is possible when the input is empty
if [[ -z $FILE ]]
then
continue
fi

FILE_PATH="${REPO_ROOT}"/"${FILE}"
if [[ `git diff $DIFF_ARGS "${FILE_PATH}"` == $FILE ]]
if [[ `git diff ${=DIFF_ARGS} "${FILE_PATH}"` == $FILE ]]
then
echo -e "\xF0\x9F\x94\xA5 \xE2\x98\xA0 \xF0\x9F\x94\xA5 WARNING: creating a stash for file due to unstaged changes: ${FILE}"
# format before stashing to avoid a merge conflict when applying the stash after commit
Expand All @@ -31,4 +24,4 @@ do

xcrun clang-format -i "${FILE_PATH}"
git add "${FILE_PATH}"
done <<< "`git diff-index $DIFF_ARGS --cached HEAD | grep -E "\.(h|hpp|c|cpp|m|mm)$"`"
done
Loading

0 comments on commit 53a9a20

Please sign in to comment.