DISTRHO Plugin Framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
4.1KB

  1. /*
  2. * DISTRHO Plugin Framework (DPF)
  3. * Copyright (C) 2012-2016 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. #ifndef DISTRHO_PLUGIN_CHECKS_H_INCLUDED
  17. #define DISTRHO_PLUGIN_CHECKS_H_INCLUDED
  18. #include "DistrhoPluginInfo.h"
  19. // -----------------------------------------------------------------------
  20. // Check if all required macros are defined
  21. #ifndef DISTRHO_PLUGIN_NAME
  22. # error DISTRHO_PLUGIN_NAME undefined!
  23. #endif
  24. #ifndef DISTRHO_PLUGIN_NUM_INPUTS
  25. # error DISTRHO_PLUGIN_NUM_INPUTS undefined!
  26. #endif
  27. #ifndef DISTRHO_PLUGIN_NUM_OUTPUTS
  28. # error DISTRHO_PLUGIN_NUM_OUTPUTS undefined!
  29. #endif
  30. #ifndef DISTRHO_PLUGIN_URI
  31. # error DISTRHO_PLUGIN_URI undefined!
  32. #endif
  33. // -----------------------------------------------------------------------
  34. // Define optional macros if not done yet
  35. #ifndef DISTRHO_PLUGIN_HAS_UI
  36. # define DISTRHO_PLUGIN_HAS_UI 0
  37. #endif
  38. #ifndef DISTRHO_PLUGIN_HAS_EXTERNAL_UI
  39. # define DISTRHO_PLUGIN_HAS_EXTERNAL_UI 0
  40. #endif
  41. #ifndef DISTRHO_PLUGIN_IS_RT_SAFE
  42. # define DISTRHO_PLUGIN_IS_RT_SAFE 0
  43. #endif
  44. #ifndef DISTRHO_PLUGIN_IS_SYNTH
  45. # define DISTRHO_PLUGIN_IS_SYNTH 0
  46. #endif
  47. #ifndef DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
  48. # define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0
  49. #endif
  50. #ifndef DISTRHO_PLUGIN_WANT_LATENCY
  51. # define DISTRHO_PLUGIN_WANT_LATENCY 0
  52. #endif
  53. #ifndef DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
  54. # define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 0
  55. #endif
  56. #ifndef DISTRHO_PLUGIN_WANT_PROGRAMS
  57. # define DISTRHO_PLUGIN_WANT_PROGRAMS 0
  58. #endif
  59. #ifndef DISTRHO_PLUGIN_WANT_STATE
  60. # define DISTRHO_PLUGIN_WANT_STATE 0
  61. #endif
  62. #ifndef DISTRHO_PLUGIN_WANT_FULL_STATE
  63. # define DISTRHO_PLUGIN_WANT_FULL_STATE 0
  64. #endif
  65. #ifndef DISTRHO_PLUGIN_WANT_TIMEPOS
  66. # define DISTRHO_PLUGIN_WANT_TIMEPOS 0
  67. #endif
  68. #ifndef DISTRHO_UI_USE_NANOVG
  69. # define DISTRHO_UI_USE_NANOVG 0
  70. #endif
  71. // -----------------------------------------------------------------------
  72. // Define DISTRHO_PLUGIN_HAS_EMBED_UI if needed
  73. #ifndef DISTRHO_PLUGIN_HAS_EMBED_UI
  74. # ifdef HAVE_DGL
  75. # define DISTRHO_PLUGIN_HAS_EMBED_UI 1
  76. # else
  77. # define DISTRHO_PLUGIN_HAS_EMBED_UI 0
  78. # endif
  79. #endif
  80. // -----------------------------------------------------------------------
  81. // Define DISTRHO_UI_URI if needed
  82. #ifndef DISTRHO_UI_URI
  83. # define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI"
  84. #endif
  85. // -----------------------------------------------------------------------
  86. // Test if synth has audio outputs
  87. #if DISTRHO_PLUGIN_IS_SYNTH && DISTRHO_PLUGIN_NUM_OUTPUTS == 0
  88. # error Synths need audio output to work!
  89. #endif
  90. // -----------------------------------------------------------------------
  91. // Enable MIDI input if synth, test if midi-input disabled when synth
  92. #ifndef DISTRHO_PLUGIN_WANT_MIDI_INPUT
  93. # define DISTRHO_PLUGIN_WANT_MIDI_INPUT DISTRHO_PLUGIN_IS_SYNTH
  94. #elif DISTRHO_PLUGIN_IS_SYNTH && ! DISTRHO_PLUGIN_WANT_MIDI_INPUT
  95. # error Synths need MIDI input to work!
  96. #endif
  97. // -----------------------------------------------------------------------
  98. // Enable full state if plugin exports presets
  99. #if DISTRHO_PLUGIN_WANT_PROGRAMS && DISTRHO_PLUGIN_WANT_STATE
  100. # undef DISTRHO_PLUGIN_WANT_FULL_STATE
  101. # define DISTRHO_PLUGIN_WANT_FULL_STATE 1
  102. #endif
  103. // -----------------------------------------------------------------------
  104. // Disable UI if DGL or External UI is not available
  105. #if DISTRHO_PLUGIN_HAS_UI && ! DISTRHO_PLUGIN_HAS_EXTERNAL_UI && ! defined(HAVE_DGL)
  106. # undef DISTRHO_PLUGIN_HAS_UI
  107. # define DISTRHO_PLUGIN_HAS_UI 0
  108. #endif
  109. // -----------------------------------------------------------------------
  110. #endif // DISTRHO_PLUGIN_CHECKS_H_INCLUDED