Add initial bits for Qt6 support
[carla.git] / source / modules / distrho / DistrhoStandaloneUtils.hpp
blob8fffcdaa00d2b7d19bb05e26c046990f365e085d
1 /*
2 * DISTRHO Plugin Framework (DPF)
3 * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
5 * Permission to use, copy, modify, and/or distribute this software for any purpose with
6 * or without fee is hereby granted, provided that the above copyright notice and this
7 * permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
10 * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
11 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
12 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef DISTRHO_STANDALONE_UTILS_HPP_INCLUDED
18 #define DISTRHO_STANDALONE_UTILS_HPP_INCLUDED
20 #include "src/DistrhoDefines.h"
22 START_NAMESPACE_DISTRHO
24 /* ------------------------------------------------------------------------------------------------------------
25 * Standalone plugin related utilities */
27 /**
28 @defgroup StandalonePluginRelatedUtilities Plugin related utilities
30 When the plugin is running as standalone and JACK is not available, a native audio handling is in place.
31 It is a very simple handling, auto-connecting to the default audio interface for outputs.
33 !!EXPERIMENTAL!!
35 Still under development and testing.
40 /**
41 Check if the current standalone is using native audio methods.
42 If this function returns false, you MUST NOT use any other function from this group.
44 bool isUsingNativeAudio() noexcept;
46 /**
47 Check if the current standalone supports audio input.
49 bool supportsAudioInput();
51 /**
52 Check if the current standalone supports dynamic buffer size changes.
54 bool supportsBufferSizeChanges();
56 /**
57 Check if the current standalone supports MIDI.
59 bool supportsMIDI();
61 /**
62 Check if the current standalone has audio input enabled.
64 bool isAudioInputEnabled();
66 /**
67 Check if the current standalone has MIDI enabled.
69 bool isMIDIEnabled();
71 /**
72 Get the current buffer size.
74 uint getBufferSize();
76 /**
77 Request permissions to use audio input.
78 Only valid to call if audio input is supported but not currently enabled.
80 bool requestAudioInput();
82 /**
83 Request change to a new buffer size.
85 bool requestBufferSizeChange(uint newBufferSize);
87 /**
88 Request permissions to use MIDI.
89 Only valid to call if MIDI is supported but not currently enabled.
91 bool requestMIDI();
93 /** @} */
95 // -----------------------------------------------------------------------------------------------------------
97 END_NAMESPACE_DISTRHO
99 #endif // DISTRHO_STANDALONE_UTILS_HPP_INCLUDED