DISTRHO Plugin Framework
DistrhoStandaloneUtils.hpp
1 /*
2  * DISTRHO Plugin Framework (DPF)
3  * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
4  *
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.
8  *
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.
15  */
16 
17 #ifndef DISTRHO_STANDALONE_UTILS_HPP_INCLUDED
18 #define DISTRHO_STANDALONE_UTILS_HPP_INCLUDED
19 
20 #include "src/DistrhoDefines.h"
21 
23 
24 /* ------------------------------------------------------------------------------------------------------------
25  * Standalone plugin related utilities */
26 
27 /**
28  @defgroup StandalonePluginRelatedUtilities Plugin related utilities
29 
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.
32 
33  !!EXPERIMENTAL!!
34 
35  Still under development and testing.
36 
37  @{
38  */
39 
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.
43 */
44 bool isUsingNativeAudio() noexcept;
45 
46 /**
47  Check if the current standalone supports audio input.
48 */
50 
51 /**
52  Check if the current standalone supports dynamic buffer size changes.
53 */
55 
56 /**
57  Check if the current standalone supports MIDI.
58 */
59 bool supportsMIDI();
60 
61 /**
62  Check if the current standalone has audio input enabled.
63 */
65 
66 /**
67  Check if the current standalone has MIDI enabled.
68 */
70 
71 /**
72  Get the current buffer size.
73 */
75 
76 /**
77  Request permissions to use audio input.
78  Only valid to call if audio input is supported but not currently enabled.
79 */
81 
82 /**
83  Request change to a new buffer size.
84 */
85 bool requestBufferSizeChange(uint newBufferSize);
86 
87 /**
88  Request permissions to use MIDI.
89  Only valid to call if MIDI is supported but not currently enabled.
90 */
91 bool requestMIDI();
92 
93 /** @} */
94 
95 // -----------------------------------------------------------------------------------------------------------
96 
98 
99 #endif // DISTRHO_STANDALONE_UTILS_HPP_INCLUDED
#define END_NAMESPACE_DISTRHO
Definition: DistrhoInfo.hpp:949
#define START_NAMESPACE_DISTRHO
Definition: DistrhoInfo.hpp:943
bool isAudioInputEnabled()
bool supportsAudioInput()
bool isMIDIEnabled()
bool requestBufferSizeChange(uint newBufferSize)
bool requestAudioInput()
bool requestMIDI()
bool supportsMIDI()
bool supportsBufferSizeChanges()
bool isUsingNativeAudio() noexcept
uint getBufferSize()