From e3a0aad27a01c1a91e12000c9df856a1df0f34fa Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 26 Jul 2022 03:12:23 +0100 Subject: [PATCH] Add missing file Signed-off-by: falkTX --- data/update-dpf | 1 - .../distrho/DistrhoStandaloneUtils.hpp | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 source/modules/distrho/DistrhoStandaloneUtils.hpp diff --git a/data/update-dpf b/data/update-dpf index 89ee55c3b..f2381e9e5 100755 --- a/data/update-dpf +++ b/data/update-dpf @@ -46,6 +46,5 @@ rm ${CARLA_DIR}/source/modules/distrho/DistrhoInfo.hpp rm ${CARLA_DIR}/source/modules/distrho/src/DistrhoPlugin{JACK,LADSPA+DSSI,LV2,LV2export,VST2,VST3}.cpp rm ${CARLA_DIR}/source/modules/distrho/src/DistrhoPluginVST.hpp rm ${CARLA_DIR}/source/modules/distrho/src/DistrhoUI{DSSI,LV2,VST3}.cpp -rm ${CARLA_DIR}/source/modules/distrho/DistrhoStandaloneUtils.hpp rm -rf ${DPF_DIR} diff --git a/source/modules/distrho/DistrhoStandaloneUtils.hpp b/source/modules/distrho/DistrhoStandaloneUtils.hpp new file mode 100644 index 000000000..8fffcdaa0 --- /dev/null +++ b/source/modules/distrho/DistrhoStandaloneUtils.hpp @@ -0,0 +1,99 @@ +/* + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2022 Filipe Coelho + * + * Permission to use, copy, modify, and/or distribute this software for any purpose with + * or without fee is hereby granted, provided that the above copyright notice and this + * permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD + * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef DISTRHO_STANDALONE_UTILS_HPP_INCLUDED +#define DISTRHO_STANDALONE_UTILS_HPP_INCLUDED + +#include "src/DistrhoDefines.h" + +START_NAMESPACE_DISTRHO + +/* ------------------------------------------------------------------------------------------------------------ + * Standalone plugin related utilities */ + +/** + @defgroup StandalonePluginRelatedUtilities Plugin related utilities + + When the plugin is running as standalone and JACK is not available, a native audio handling is in place. + It is a very simple handling, auto-connecting to the default audio interface for outputs. + + !!EXPERIMENTAL!! + + Still under development and testing. + + @{ + */ + +/** + Check if the current standalone is using native audio methods. + If this function returns false, you MUST NOT use any other function from this group. +*/ +bool isUsingNativeAudio() noexcept; + +/** + Check if the current standalone supports audio input. +*/ +bool supportsAudioInput(); + +/** + Check if the current standalone supports dynamic buffer size changes. +*/ +bool supportsBufferSizeChanges(); + +/** + Check if the current standalone supports MIDI. +*/ +bool supportsMIDI(); + +/** + Check if the current standalone has audio input enabled. +*/ +bool isAudioInputEnabled(); + +/** + Check if the current standalone has MIDI enabled. +*/ +bool isMIDIEnabled(); + +/** + Get the current buffer size. +*/ +uint getBufferSize(); + +/** + Request permissions to use audio input. + Only valid to call if audio input is supported but not currently enabled. +*/ +bool requestAudioInput(); + +/** + Request change to a new buffer size. +*/ +bool requestBufferSizeChange(uint newBufferSize); + +/** + Request permissions to use MIDI. + Only valid to call if MIDI is supported but not currently enabled. +*/ +bool requestMIDI(); + +/** @} */ + +// ----------------------------------------------------------------------------------------------------------- + +END_NAMESPACE_DISTRHO + +#endif // DISTRHO_STANDALONE_UTILS_HPP_INCLUDED