Browse Source

AU: always allow to set input element rate, fix build

Signed-off-by: falkTX <falktx@falktx.com>
pull/452/head
falkTX 1 year ago
parent
commit
db7ee14af9
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 24 additions and 17 deletions
  1. +1
    -3
      Makefile.plugins.mk
  2. +2
    -0
      cmake/DPF-plugin.cmake
  3. +21
    -14
      distrho/src/DistrhoPluginAU.cpp

+ 1
- 3
Makefile.plugins.mk View File

@@ -693,9 +693,7 @@ $(au): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_AU.cpp.o
endif
-@mkdir -p $(shell dirname $@)
@echo "Creating AU component for $(NAME)"
$(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(EXTRA_LIBS) $(EXTRA_DSP_LIBS) $(EXTRA_UI_LIBS) $(DGL_LIBS) -framework AudioToolbox -framework CoreFoundation $(SHARED) $(SYMBOLS_AU) -o $@

# -framework AudioUnit
$(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(EXTRA_LIBS) $(EXTRA_DSP_LIBS) $(EXTRA_UI_LIBS) $(DGL_LIBS) -framework AudioToolbox -framework AudioUnit -framework CoreFoundation $(SHARED) $(SYMBOLS_AU) -o $@

# ---------------------------------------------------------------------------------------------------------------------
# Export


+ 2
- 0
cmake/DPF-plugin.cmake View File

@@ -561,12 +561,14 @@ function(dpf__build_au NAME HAS_UI)
dpf__add_ui_main("${NAME}-au" "au" "${HAS_UI}")
dpf__set_module_export_list("${NAME}-au" "au")
find_library(APPLE_AUDIOTOOLBOX_FRAMEWORK "AudioToolbox")
find_library(APPLE_AUDIOUNIT_FRAMEWORK "AudioUnit")
find_library(APPLE_COREFOUNDATION_FRAMEWORK "CoreFoundation")
target_compile_options("${NAME}-au" PRIVATE "-ObjC++")
target_link_libraries("${NAME}-au" PRIVATE
"${NAME}-dsp"
"${NAME}-ui"
"${APPLE_AUDIOTOOLBOX_FRAMEWORK}"
"${APPLE_AUDIOUNIT_FRAMEWORK}"
"${APPLE_COREFOUNDATION_FRAMEWORK}")
set_target_properties("${NAME}-au" PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}.component/Contents/MacOS/$<0:>"


+ 21
- 14
distrho/src/DistrhoPluginAU.cpp View File

@@ -431,15 +431,22 @@ public:
return noErr;

case kAudioUnitProperty_SampleRate:
#if DISTRHO_PLUGIN_NUM_INPUTS == 0 && DISTRHO_PLUGIN_NUM_OUTPUTS != 0
DISTRHO_SAFE_ASSERT_UINT_RETURN(inScope == kAudioUnitScope_Output, inScope, kAudioUnitErr_InvalidScope);
#else
DISTRHO_SAFE_ASSERT_UINT_RETURN(inScope == kAudioUnitScope_Input || inScope == kAudioUnitScope_Output, inScope, kAudioUnitErr_InvalidScope);
#endif
DISTRHO_SAFE_ASSERT_UINT_RETURN(inElement == 0, inElement, kAudioUnitErr_InvalidElement);
outDataSize = sizeof(Float64);
outWritable = true;
return noErr;
if (inScope == kAudioUnitScope_Input)
{
outDataSize = sizeof(Float64);
outWritable = true;
return noErr;
}
#if DISTRHO_PLUGIN_NUM_OUTPUTS != 0
if (inScope == kAudioUnitScope_Output)
{
outDataSize = sizeof(Float64);
outWritable = true;
return noErr;
}
#endif
return kAudioUnitErr_InvalidScope;

case kAudioUnitProperty_ParameterList:
DISTRHO_SAFE_ASSERT_UINT_RETURN(inElement == 0, inElement, kAudioUnitErr_InvalidElement);
@@ -1062,10 +1069,10 @@ public:
return noErr;

case kAudioUnitProperty_SampleRate:
#if DISTRHO_PLUGIN_NUM_INPUTS == 0 && DISTRHO_PLUGIN_NUM_OUTPUTS != 0
DISTRHO_SAFE_ASSERT_UINT_RETURN(inScope == kAudioUnitScope_Output, inScope, kAudioUnitErr_InvalidScope);
#else
#if DISTRHO_PLUGIN_NUM_OUTPUTS != 0
DISTRHO_SAFE_ASSERT_UINT_RETURN(inScope == kAudioUnitScope_Input || inScope == kAudioUnitScope_Output, inScope, kAudioUnitErr_InvalidScope);
#else
DISTRHO_SAFE_ASSERT_UINT_RETURN(inScope == kAudioUnitScope_Input, inScope, kAudioUnitErr_InvalidScope);
#endif
DISTRHO_SAFE_ASSERT_UINT_RETURN(inElement == 0, inElement, kAudioUnitErr_InvalidElement);
DISTRHO_SAFE_ASSERT_UINT_RETURN(inDataSize == sizeof(Float64), inDataSize, kAudioUnitErr_InvalidPropertyValue);
@@ -1113,10 +1120,10 @@ public:
return kAudioUnitErr_InvalidScope;

case kAudioUnitProperty_StreamFormat:
#if DISTRHO_PLUGIN_NUM_INPUTS == 0 && DISTRHO_PLUGIN_NUM_OUTPUTS != 0
DISTRHO_SAFE_ASSERT_UINT_RETURN(inScope == kAudioUnitScope_Output, inScope, kAudioUnitErr_InvalidScope);
#else
#if DISTRHO_PLUGIN_NUM_OUTPUTS != 0
DISTRHO_SAFE_ASSERT_UINT_RETURN(inScope == kAudioUnitScope_Input || inScope == kAudioUnitScope_Output, inScope, kAudioUnitErr_InvalidScope);
#else
DISTRHO_SAFE_ASSERT_UINT_RETURN(inScope == kAudioUnitScope_Input, inScope, kAudioUnitErr_InvalidScope);
#endif
DISTRHO_SAFE_ASSERT_UINT_RETURN(inElement == 0, inElement, kAudioUnitErr_InvalidElement);
DISTRHO_SAFE_ASSERT_UINT_RETURN(inDataSize == sizeof(AudioStreamBasicDescription), inDataSize, kAudioUnitErr_InvalidPropertyValue);


Loading…
Cancel
Save