From 51186ba54ab4f15e19bba8cf29c96e93fb938cce Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 7 Apr 2019 05:48:38 +0900 Subject: [PATCH] Update Signed-off-by: falkTX --- App_8hpp_source.html | 197 --- Application_8hpp_source.html | 4 +- Base64_8hpp_source.html | 2 +- Base_8hpp_source.html | 2 +- Color_8hpp_source.html | 2 +- DistrhoInfo_8hpp_source.html | 4 +- DistrhoPlugin_8hpp_source.html | 20 +- DistrhoUI_8hpp_source.html | 10 +- DistrhoUtils_8hpp_source.html | 2 +- ExternalWindow_8hpp_source.html | 4 +- Geometry_8hpp_source.html | 2 +- ImageAboutWindow_8hpp_source.html | 122 -- ImageButton_8hpp_source.html | 122 -- ImageKnob_8hpp_source.html | 122 -- ImageSlider_8hpp_source.html | 122 -- ImageSwitch_8hpp_source.html | 122 -- ImageWidgets_8hpp_source.html | 20 +- Image_8hpp_source.html | 2 +- LeakDetector_8hpp_source.html | 2 +- Mutex_8hpp_source.html | 2 +- NanoVG_8hpp_source.html | 6 +- NanoWidgets_8hpp_source.html | 176 --- ScopedPointer_8hpp_source.html | 2 +- Sleep_8hpp_source.html | 2 +- StandaloneWindow_8hpp_source.html | 6 +- String_8hpp_source.html | 2 +- Thread_8hpp_source.html | 2 +- Widget_8hpp_source.html | 43 +- Window_8hpp_source.html | 14 +- annotated.html | 15 +- arrowdown.png | Bin 246 -> 0 bytes arrowright.png | Bin 229 -> 0 bytes classApp-members.html | 107 -- classApp.html | 247 ---- classApp.png | Bin 470 -> 0 bytes classApplication-members.html | 2 +- classApplication.html | 2 +- classBlendishButton-members.html | 267 ---- classBlendishButton.html | 550 -------- classBlendishButton.png | Bin 906 -> 0 bytes classBlendishButton_1_1Callback-members.html | 107 -- classBlendishButton_1_1Callback.html | 115 -- classCircle-members.html | 2 +- classCircle.html | 2 +- classExternalWindow-members.html | 16 +- classExternalWindow.html | 26 +- classIdleCallback-members.html | 2 +- classIdleCallback.html | 2 +- classImage-members.html | 2 +- classImage.html | 2 +- classImageAboutWindow-members.html | 73 +- classImageAboutWindow.html | 28 +- classImageButton-members.html | 43 +- classImageButton.html | 4 +- classImageButton_1_1Callback-members.html | 2 +- classImageButton_1_1Callback.html | 2 +- classImageKnob-members.html | 65 +- classImageKnob.html | 4 +- classImageKnob_1_1Callback-members.html | 2 +- classImageKnob_1_1Callback.html | 2 +- classImageSlider-members.html | 22 +- classImageSlider.html | 7 +- classImageSlider_1_1Callback-members.html | 2 +- classImageSlider_1_1Callback.html | 2 +- classImageSwitch-members.html | 45 +- classImageSwitch.html | 4 +- classImageSwitch_1_1Callback-members.html | 4 +- classImageSwitch_1_1Callback.html | 8 +- classLeakedObjectDetector-members.html | 2 +- classLeakedObjectDetector.html | 2 +- classLine-members.html | 2 +- classLine.html | 2 +- classMutex-members.html | 2 +- classMutex.html | 2 +- classNanoImage-members.html | 2 +- classNanoImage.html | 2 +- classNanoVG-members.html | 2 +- classNanoVG.html | 2 +- classNanoWidget-members.html | 143 +- classNanoWidget.html | 4 +- classPlugin-members.html | 2 +- classPlugin.html | 2 +- classPoint-members.html | 2 +- classPoint.html | 2 +- classRectangle-members.html | 2 +- classRectangle.html | 2 +- classRecursiveMutex-members.html | 2 +- classRecursiveMutex.html | 2 +- classScopeLocker-members.html | 2 +- classScopeLocker.html | 2 +- classScopeTryLocker-members.html | 2 +- classScopeTryLocker.html | 2 +- classScopeUnlocker-members.html | 2 +- classScopeUnlocker.html | 2 +- classScopedLocker-members.html | 102 -- classScopedLocker.html | 110 -- classScopedPointer-members.html | 2 +- classScopedPointer.html | 2 +- classScopedUnlocker-members.html | 102 -- classScopedUnlocker.html | 110 -- classSignal-members.html | 2 +- classSignal.html | 2 +- classSize-members.html | 2 +- classSize.html | 2 +- classStandaloneWindow-members.html | 32 +- classStandaloneWindow.html | 26 +- classString-members.html | 2 +- classString.html | 2 +- classThread-members.html | 2 +- classThread.html | 2 +- classTriangle-members.html | 2 +- classTriangle.html | 2 +- classUI-members.html | 26 +- classUI.html | 127 +- classWidget-members.html | 38 +- classWidget.html | 36 +- classWindow-members.html | 53 +- classWindow.html | 29 +- classd__string-members.html | 147 --- classd__string.html | 242 ---- classes.html | 46 +- d__leakdetector_8hpp_source.html | 241 ---- d__mutex_8hpp_source.html | 332 ----- d__scopedpointer_8hpp_source.html | 357 ----- d__sleep_8hpp_source.html | 160 --- d__string_8hpp_source.html | 849 ------------ d__thread_8hpp_source.html | 393 ------ dir_37257469cca17bab24b582e18a78eb75.html | 2 +- dir_99893ac99dd47c2a73745483a12a725f.html | 2 +- dir_b1be46be7d80596b116b2b4ac973f2f0.html | 2 +- doxygen_sqlite3.db | Bin 9912320 -> 0 bytes files.html | 2 +- ftv2blank.png | Bin 86 -> 0 bytes ftv2cl.png | Bin 453 -> 0 bytes ftv2doc.png | Bin 746 -> 0 bytes ftv2folderclosed.png | Bin 616 -> 0 bytes ftv2folderopen.png | Bin 597 -> 0 bytes ftv2lastnode.png | Bin 86 -> 0 bytes ftv2link.png | Bin 746 -> 0 bytes ftv2mlastnode.png | Bin 246 -> 0 bytes ftv2mnode.png | Bin 246 -> 0 bytes ftv2mo.png | Bin 403 -> 0 bytes ftv2node.png | Bin 86 -> 0 bytes ftv2ns.png | Bin 388 -> 0 bytes ftv2plastnode.png | Bin 229 -> 0 bytes ftv2pnode.png | Bin 229 -> 0 bytes ftv2splitbar.png | Bin 314 -> 0 bytes ftv2vertline.png | Bin 86 -> 0 bytes functions.html | 2 +- functions_0x7e.html | 2 +- functions_b.html | 2 +- functions_c.html | 16 +- functions_d.html | 2 +- functions_e.html | 2 +- functions_enum.html | 2 +- functions_eval.html | 2 +- functions_f.html | 2 +- functions_func.html | 2 +- functions_func_0x7e.html | 2 +- functions_func_b.html | 2 +- functions_func_c.html | 16 +- functions_func_d.html | 2 +- functions_func_e.html | 2 +- functions_func_f.html | 2 +- functions_func_g.html | 2 +- functions_func_h.html | 2 +- functions_func_i.html | 2 +- functions_func_k.html | 2 +- functions_func_l.html | 2 +- functions_func_m.html | 2 +- functions_func_n.html | 2 +- functions_func_o.html | 8 +- functions_func_p.html | 7 +- functions_func_q.html | 2 +- functions_func_r.html | 2 +- functions_func_s.html | 2 +- functions_func_t.html | 2 +- functions_func_u.html | 11 +- functions_func_w.html | 2 +- functions_func_~.html | 165 --- functions_g.html | 2 +- functions_h.html | 2 +- functions_i.html | 2 +- functions_k.html | 2 +- functions_l.html | 2 +- functions_m.html | 2 +- functions_n.html | 2 +- functions_o.html | 8 +- functions_p.html | 7 +- functions_q.html | 2 +- functions_r.html | 2 +- functions_s.html | 4 +- functions_t.html | 2 +- functions_u.html | 11 +- functions_v.html | 2 +- functions_vars.html | 2 +- functions_w.html | 2 +- functions_~.html | 166 --- group__AudioPortHints.html | 2 +- group__BasePluginStructs.html | 2 +- group__BaseStructs.html | 108 -- group__EntryPoints.html | 2 +- group__MainClasses.html | 2 +- group__ParameterHints.html | 2 +- group__PluginMacros.html | 39 +- hierarchy.html | 59 +- index.html | 2 +- modules.html | 2 +- search/all_11.js | 2 +- search/all_13.js | 3 - search/all_2.js | 1 + search/all_3.js | 2 + search/all_d.js | 3 +- search/all_e.js | 1 + search/classes_b.js | 3 +- search/functions_13.js | 5 +- search/functions_2.js | 1 + search/functions_d.js | 3 +- search/functions_e.js | 1 + singletonCircle.html | 620 --------- singletonLine.html | 927 ------------- singletonRectangle.html | 1149 ----------------- singletonTriangle.html | 443 ------- structAudioPort-members.html | 2 +- structAudioPort.html | 2 +- structColor-members.html | 2 +- structColor.html | 2 +- structContainerDeletePolicy-members.html | 101 -- structContainerDeletePolicy.html | 118 -- structMidiEvent-members.html | 2 +- structMidiEvent.html | 2 +- structNanoVG_1_1GlyphPosition-members.html | 2 +- structNanoVG_1_1GlyphPosition.html | 2 +- structNanoVG_1_1Paint-members.html | 2 +- structNanoVG_1_1Paint.html | 2 +- structNanoVG_1_1TextRow-members.html | 2 +- structNanoVG_1_1TextRow.html | 2 +- structParameter-members.html | 2 +- structParameter.html | 2 +- structParameterEnumerationValue-members.html | 2 +- structParameterEnumerationValue.html | 2 +- structParameterEnumerationValues-members.html | 2 +- structParameterEnumerationValues.html | 2 +- structParameterRanges-members.html | 2 +- structParameterRanges.html | 2 +- structTimePosition-members.html | 9 +- structTimePosition.html | 31 +- ...ctTimePosition_1_1BarBeatTick-members.html | 9 +- structTimePosition_1_1BarBeatTick.html | 35 +- structWidget_1_1BaseEvent-members.html | 2 +- structWidget_1_1BaseEvent.html | 2 +- structWidget_1_1KeyboardEvent-members.html | 2 +- structWidget_1_1KeyboardEvent.html | 2 +- structWidget_1_1MotionEvent-members.html | 2 +- structWidget_1_1MotionEvent.html | 2 +- structWidget_1_1MouseEvent-members.html | 2 +- structWidget_1_1MouseEvent.html | 2 +- ...idget_1_1PositionChangedEvent-members.html | 83 ++ structWidget_1_1PositionChangedEvent.html | 130 ++ structWidget_1_1ResizeEvent-members.html | 2 +- structWidget_1_1ResizeEvent.html | 2 +- structWidget_1_1ScrollEvent-members.html | 2 +- structWidget_1_1ScrollEvent.html | 2 +- structWidget_1_1SpecialEvent-members.html | 2 +- structWidget_1_1SpecialEvent.html | 2 +- ...tWindow_1_1FileBrowserOptions-members.html | 2 +- structWindow_1_1FileBrowserOptions.html | 2 +- ...FileBrowserOptions_1_1Buttons-members.html | 2 +- ...ndow_1_1FileBrowserOptions_1_1Buttons.html | 2 +- 269 files changed, 1096 insertions(+), 10085 deletions(-) delete mode 100644 App_8hpp_source.html delete mode 100644 ImageAboutWindow_8hpp_source.html delete mode 100644 ImageButton_8hpp_source.html delete mode 100644 ImageKnob_8hpp_source.html delete mode 100644 ImageSlider_8hpp_source.html delete mode 100644 ImageSwitch_8hpp_source.html delete mode 100644 NanoWidgets_8hpp_source.html delete mode 100644 arrowdown.png delete mode 100644 arrowright.png delete mode 100644 classApp-members.html delete mode 100644 classApp.html delete mode 100644 classApp.png delete mode 100644 classBlendishButton-members.html delete mode 100644 classBlendishButton.html delete mode 100644 classBlendishButton.png delete mode 100644 classBlendishButton_1_1Callback-members.html delete mode 100644 classBlendishButton_1_1Callback.html delete mode 100644 classScopedLocker-members.html delete mode 100644 classScopedLocker.html delete mode 100644 classScopedUnlocker-members.html delete mode 100644 classScopedUnlocker.html delete mode 100644 classd__string-members.html delete mode 100644 classd__string.html delete mode 100644 d__leakdetector_8hpp_source.html delete mode 100644 d__mutex_8hpp_source.html delete mode 100644 d__scopedpointer_8hpp_source.html delete mode 100644 d__sleep_8hpp_source.html delete mode 100644 d__string_8hpp_source.html delete mode 100644 d__thread_8hpp_source.html delete mode 100644 doxygen_sqlite3.db delete mode 100644 ftv2blank.png delete mode 100644 ftv2cl.png delete mode 100644 ftv2doc.png delete mode 100644 ftv2folderclosed.png delete mode 100644 ftv2folderopen.png delete mode 100644 ftv2lastnode.png delete mode 100644 ftv2link.png delete mode 100644 ftv2mlastnode.png delete mode 100644 ftv2mnode.png delete mode 100644 ftv2mo.png delete mode 100644 ftv2node.png delete mode 100644 ftv2ns.png delete mode 100644 ftv2plastnode.png delete mode 100644 ftv2pnode.png delete mode 100644 ftv2splitbar.png delete mode 100644 ftv2vertline.png delete mode 100644 functions_func_~.html delete mode 100644 functions_~.html delete mode 100644 group__BaseStructs.html delete mode 100644 singletonCircle.html delete mode 100644 singletonLine.html delete mode 100644 singletonRectangle.html delete mode 100644 singletonTriangle.html delete mode 100644 structContainerDeletePolicy-members.html delete mode 100644 structContainerDeletePolicy.html create mode 100644 structWidget_1_1PositionChangedEvent-members.html create mode 100644 structWidget_1_1PositionChangedEvent.html diff --git a/App_8hpp_source.html b/App_8hpp_source.html deleted file mode 100644 index 4f748356..00000000 --- a/App_8hpp_source.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: dgl/App.hpp Source File - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - - - - -
- -
- - -
-
-
-
App.hpp
-
-
-
1 /*
-
2  * DISTRHO Plugin Framework (DPF)
-
3  * Copyright (C) 2012-2015 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 DGL_APP_HPP_INCLUDED
-
18 #define DGL_APP_HPP_INCLUDED
-
19 
-
20 #include "Base.hpp"
-
21 
-
22 START_NAMESPACE_DGL
-
23 
-
24 // -----------------------------------------------------------------------
-
25 // Forward class names
-
26 
-
27 class Window;
-
28 
-
29 // -----------------------------------------------------------------------
-
30 
-
31 /**
-
32  Base DGL Application class.
-
33 
-
34  One application instance is required for creating a window.
-
35  There's no single/global application instance in DGL, and multiple
-
36  windows can share the same app instance.
-
37 
-
38  In standalone mode an application will automatically quit its
-
39  event-loop when all its windows are closed.
-
40  */
-
41 class App
-
42 {
-
43 public:
-
44  /**
-
45  Constructor.
-
46  */
-
47  App();
-
48 
-
49  /**
-
50  Destructor.
-
51  */
-
52  ~App();
-
53 
-
54  /**
-
55  Idle function.
-
56  This runs the application event-loop once.
-
57  */
-
58  void idle();
-
59 
-
60  /**
-
61  Run the application event-loop until all Windows are closed.
-
62  idle() is called at regular intervals.
-
63  @note: This function is meant for standalones only, *never* call this from plugins.
-
64  */
-
65  void exec();
-
66 
-
67  /**
-
68  Quit the application.
-
69  This stops the event-loop and closes all Windows.
-
70  */
-
71  void quit();
-
72 
-
73  /**
-
74  Check if the application is about to quit.
-
75  Returning true means there's no event-loop running at the moment (or it's just about to stop).
-
76  */
-
77  bool isQuiting() const noexcept;
-
78 
-
79 private:
-
80  struct PrivateData;
-
81  PrivateData* const pData;
-
82  friend class Window;
-
83 
-
84  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(App)
-
85 };
-
86 
-
87 // -----------------------------------------------------------------------
-
88 
-
89 END_NAMESPACE_DGL
-
90 
-
91 #endif // DGL_APP_HPP_INCLUDED
- -
void exec()
-
Definition: Window.hpp:30
-
~App()
-
bool isQuiting() const noexcept
-
void quit()
-
void idle()
-
Definition: App.hpp:41
-
- - - - diff --git a/Application_8hpp_source.html b/Application_8hpp_source.html index 93064a5a..c0438e8f 100644 --- a/Application_8hpp_source.html +++ b/Application_8hpp_source.html @@ -69,7 +69,7 @@ $(function() {
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 
17 #ifndef DGL_APP_HPP_INCLUDED
18 #define DGL_APP_HPP_INCLUDED
19 
20 #include "Base.hpp"
21 
22 START_NAMESPACE_DGL
23 
24 // -----------------------------------------------------------------------
25 // Forward class names
26 
27 class Window;
28 
29 // -----------------------------------------------------------------------
30 
31 /**
32  Base DGL Application class.
33 
34  One application instance is required for creating a window.
35  There's no single/global application instance in DGL, and multiple
36  windows can share the same app instance.
37 
38  In standalone mode an application will automatically quit its
39  event-loop when all its windows are closed.
40  */
42 {
43 public:
44  /**
45  Constructor.
46  */
47  Application();
48 
49  /**
50  Destructor.
51  */
52  virtual ~Application();
53 
54  /**
55  Idle function.
56  This runs the application event-loop once.
57  */
58  void idle();
59 
60  /**
61  Run the application event-loop until all Windows are closed.
62  idle() is called at regular intervals.
63  @note This function is meant for standalones only, *never* call this from plugins.
64  */
65  void exec(int idleTime = 10);
66 
67  /**
68  Quit the application.
69  This stops the event-loop and closes all Windows.
70  */
71  void quit();
72 
73  /**
74  Check if the application is about to quit.
75  Returning true means there's no event-loop running at the moment (or it's just about to stop).
76  */
77  bool isQuiting() const noexcept;
78 
79 private:
80  struct PrivateData;
81  PrivateData* const pData;
82  friend class Window;
83 
84  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Application)
85 };
86 
87 // -----------------------------------------------------------------------
88 
89 END_NAMESPACE_DGL
90 
91 #endif // DGL_APP_HPP_INCLUDED
-
Definition: Window.hpp:34
+
Definition: Window.hpp:36
void exec(int idleTime=10)
bool isQuiting() const noexcept
virtual ~Application()
@@ -77,7 +77,7 @@ $(function() {
diff --git a/Base64_8hpp_source.html b/Base64_8hpp_source.html index 1dc67614..7b392c12 100644 --- a/Base64_8hpp_source.html +++ b/Base64_8hpp_source.html @@ -69,7 +69,7 @@ $(function() {
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 
17 #ifndef DISTRHO_BASE64_HPP_INCLUDED
18 #define DISTRHO_BASE64_HPP_INCLUDED
19 
20 #include "../DistrhoUtils.hpp"
21 
22 #include <cctype>
23 #include <vector>
24 
25 // -----------------------------------------------------------------------
26 // base64 stuff, based on http://www.adp-gmbh.ch/cpp/common/base64.html
27 
28 /*
29  Copyright (C) 2004-2008 RenĂ© Nyffenegger
30 
31  This source code is provided 'as-is', without any express or implied
32  warranty. In no event will the author be held liable for any damages
33  arising from the use of this software.
34 
35  Permission is granted to anyone to use this software for any purpose,
36  including commercial applications, and to alter it and redistribute it
37  freely, subject to the following restrictions:
38 
39  1. The origin of this source code must not be misrepresented; you must not
40  claim that you wrote the original source code. If you use this source code
41  in a product, an acknowledgment in the product documentation would be
42  appreciated but is not required.
43 
44  2. Altered source versions must be plainly marked as such, and must not be
45  misrepresented as being the original source code.
46 
47  3. This notice may not be removed or altered from any source distribution.
48 
49  RenĂ© Nyffenegger rene.nyffenegger@adp-gmbh.ch
50 */
51 
52 // -----------------------------------------------------------------------
53 // Helpers
54 
55 #ifndef DOXYGEN
56 namespace DistrhoBase64Helpers {
57 
58 static const char* const kBase64Chars =
59  "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
60  "abcdefghijklmnopqrstuvwxyz"
61  "0123456789+/";
62 
63 static inline
64 uint8_t findBase64CharIndex(const char c)
65 {
66  static const uint8_t kBase64CharsLen(static_cast<uint8_t>(std::strlen(kBase64Chars)));
67 
68  for (uint8_t i=0; i<kBase64CharsLen; ++i)
69  {
70  if (kBase64Chars[i] == c)
71  return i;
72  }
73 
74  d_stderr2("findBase64CharIndex('%c') - failed", c);
75  return 0;
76 }
77 
78 static inline
79 bool isBase64Char(const char c)
80 {
81  return (std::isalnum(c) || (c == '+') || (c == '/'));
82 }
83 
84 } // namespace DistrhoBase64Helpers
85 #endif
86 
87 // -----------------------------------------------------------------------
88 
89 static inline
90 std::vector<uint8_t> d_getChunkFromBase64String(const char* const base64string)
91 {
92  DISTRHO_SAFE_ASSERT_RETURN(base64string != nullptr, std::vector<uint8_t>());
93 
94  uint i=0, j=0;
95  uint charArray3[3], charArray4[4];
96 
97  std::vector<uint8_t> ret;
98  ret.reserve(std::strlen(base64string)*3/4 + 4);
99 
100  for (std::size_t l=0, len=std::strlen(base64string); l<len; ++l)
101  {
102  const char c = base64string[l];
103 
104  if (c == '\0' || c == '=')
105  break;
106  if (c == ' ' || c == '\n')
107  continue;
108 
109  DISTRHO_SAFE_ASSERT_CONTINUE(DistrhoBase64Helpers::isBase64Char(c));
110 
111  charArray4[i++] = static_cast<uint>(c);
112 
113  if (i == 4)
114  {
115  for (i=0; i<4; ++i)
116  charArray4[i] = DistrhoBase64Helpers::findBase64CharIndex(static_cast<char>(charArray4[i]));
117 
118  charArray3[0] = (charArray4[0] << 2) + ((charArray4[1] & 0x30) >> 4);
119  charArray3[1] = ((charArray4[1] & 0xf) << 4) + ((charArray4[2] & 0x3c) >> 2);
120  charArray3[2] = ((charArray4[2] & 0x3) << 6) + charArray4[3];
121 
122  for (i=0; i<3; ++i)
123  ret.push_back(static_cast<uint8_t>(charArray3[i]));
124 
125  i = 0;
126  }
127  }
128 
129  if (i != 0)
130  {
131  for (j=0; j<i && j<4; ++j)
132  charArray4[j] = DistrhoBase64Helpers::findBase64CharIndex(static_cast<char>(charArray4[j]));
133 
134  for (j=i; j<4; ++j)
135  charArray4[j] = 0;
136 
137  charArray3[0] = (charArray4[0] << 2) + ((charArray4[1] & 0x30) >> 4);
138  charArray3[1] = ((charArray4[1] & 0xf) << 4) + ((charArray4[2] & 0x3c) >> 2);
139  charArray3[2] = ((charArray4[2] & 0x3) << 6) + charArray4[3];
140 
141  for (j=0; i>0 && j<i-1; j++)
142  ret.push_back(static_cast<uint8_t>(charArray3[j]));
143  }
144 
145  return ret;
146 }
147 
148 // -----------------------------------------------------------------------
149 
150 #endif // DISTRHO_BASE64_HPP_INCLUDED
diff --git a/Base_8hpp_source.html b/Base_8hpp_source.html index f104e35a..8094a25a 100644 --- a/Base_8hpp_source.html +++ b/Base_8hpp_source.html @@ -71,7 +71,7 @@ $(function() { diff --git a/Color_8hpp_source.html b/Color_8hpp_source.html index c2e880b3..4749a2f7 100644 --- a/Color_8hpp_source.html +++ b/Color_8hpp_source.html @@ -76,7 +76,7 @@ $(function() { diff --git a/DistrhoInfo_8hpp_source.html b/DistrhoInfo_8hpp_source.html index 7fdab092..6d9eb498 100644 --- a/DistrhoInfo_8hpp_source.html +++ b/DistrhoInfo_8hpp_source.html @@ -66,10 +66,10 @@ $(function() {
DistrhoInfo.hpp
-
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 
17 #ifdef DOXYGEN
18 
19 #include "src/DistrhoDefines.h"
20 
21 START_NAMESPACE_DISTRHO
22 
23 /* ------------------------------------------------------------------------------------------------------------
24  * Intro */
25 
26 /**
27  @mainpage DISTRHO %Plugin Framework
28 
29  DISTRHO %Plugin Framework (or @b DPF for short)
30  is a plugin framework designed to make development of new plugins an easy and enjoyable task.@n
31  It allows developers to create plugins with custom UIs using a simple C++ API.@n
32  The framework facilitates exporting various different plugin formats from the same code-base.
33 
34  DPF can build for LADSPA, DSSI, LV2 and VST2 formats.@n
35  A JACK/Standalone mode is also available, allowing you to quickly test plugins.
36 
37  @section Macros
38  You start by creating a "DistrhoPluginInfo.h" file describing the plugin via macros, see @ref PluginMacros.@n
39  This file is included in the main DPF code to select which features to activate for each plugin format.
40 
41  For example, a plugin (with %UI) that use states will require LV2 hosts to support Atom and Worker extensions for
42  message passing from the %UI to the plugin.@n
43  If your plugin does not make use of states, the Worker extension is not set as a required feature.
44 
45  @section Plugin
46  The next step is to create your plugin code by subclassing DPF's Plugin class.@n
47  You need to pass the number of parameters in the constructor and also the number of programs and states, if any.
48 
49  Here's an example of an audio plugin that simply mutes the host output:
50  @code
51  class MutePlugin : public Plugin
52  {
53  public:
54  /**
55  Plugin class constructor.
56  */
57  MutePlugin()
58  : Plugin(0, 0, 0) // 0 parameters, 0 programs and 0 states
59  {
60  }
61 
62  protected:
63  /* ----------------------------------------------------------------------------------------
64  * Information */
65 
66  /**
67  Get the plugin label.
68  This label is a short restricted name consisting of only _, a-z, A-Z and 0-9 characters.
69  */
70  const char* getLabel() const override
71  {
72  return "Mute";
73  }
74 
75  /**
76  Get the plugin author/maker.
77  */
78  const char* getMaker() const override
79  {
80  return "DPF";
81  }
82 
83  /**
84  Get the plugin license name (a single line of text).
85  For commercial plugins this should return some short copyright information.
86  */
87  const char* getLicense() const override
88  {
89  return "MIT";
90  }
91 
92  /**
93  Get the plugin version, in hexadecimal.
94  */
95  uint32_t getVersion() const override
96  {
97  return d_version(1, 0, 0);
98  }
99 
100  /**
101  Get the plugin unique Id.
102  This value is used by LADSPA, DSSI and VST plugin formats.
103  */
104  int64_t getUniqueId() const override
105  {
106  return d_cconst('M', 'u', 't', 'e');
107  }
108 
109  /* ----------------------------------------------------------------------------------------
110  * This example has no parameters, so skip parameter stuff */
111 
112  void initParameter(uint32_t, Parameter&) override {}
113  float getParameterValue(uint32_t) const override { return 0.0f; }
114  void setParameterValue(uint32_t, float) override {}
115 
116  /* ----------------------------------------------------------------------------------------
117  * Audio/MIDI Processing */
118 
119  /**
120  Run/process function for plugins without MIDI input.
121  NOTE: Some parameters might be null if there are no audio inputs or outputs.
122  */
123  void run(const float**, float** outputs, uint32_t frames) override
124  {
125  // get the left and right audio outputs
126  float* const outL = outputs[0];
127  float* const outR = outputs[1];
128 
129  // mute audio
130  std::memset(outL, 0, sizeof(float)*frames);
131  std::memset(outR, 0, sizeof(float)*frames);
132  }
133 
134  };
135  @endcode
136 
137  See the Plugin class for more information and to understand what each function does.
138 
139  @section Parameters
140  A plugin is nothing without parameters.@n
141  In DPF parameters can be inputs or outputs.@n
142  They have hints to describe how they behave plus a name and a symbol identifying them.@n
143  Parameters also have 'ranges' – a minimum, maximum and default value.
144 
145  Input parameters are "read-only": the plugin can read them but not change them.
146  (the exception being when changing programs, more on that below)@n
147  It's the host responsibility to save, restore and set input parameters.
148 
149  Output parameters can be changed at anytime by the plugin.@n
150  The host will simply read their values and not change them.
151 
152  Here's an example of an audio plugin that has 1 input parameter:
153  @code
154  class GainPlugin : public Plugin
155  {
156  public:
157  /**
158  Plugin class constructor.
159  You must set all parameter values to their defaults, matching ParameterRanges::def.
160  */
161  GainPlugin()
162  : Plugin(1, 0, 0), // 1 parameter, 0 programs and 0 states
163  fGain(1.0f)
164  {
165  }
166 
167  protected:
168  /* ----------------------------------------------------------------------------------------
169  * Information */
170 
171  const char* getLabel() const override
172  {
173  return "Gain";
174  }
175 
176  const char* getMaker() const override
177  {
178  return "DPF";
179  }
180 
181  const char* getLicense() const override
182  {
183  return "MIT";
184  }
185 
186  uint32_t getVersion() const override
187  {
188  return d_version(1, 0, 0);
189  }
190 
191  int64_t getUniqueId() const override
192  {
193  return d_cconst('G', 'a', 'i', 'n');
194  }
195 
196  /* ----------------------------------------------------------------------------------------
197  * Init */
198 
199  /**
200  Initialize a parameter.
201  This function will be called once, shortly after the plugin is created.
202  */
203  void initParameter(uint32_t index, Parameter& parameter) override
204  {
205  // we only have one parameter so we can skip checking the index
206 
207  parameter.hints = kParameterIsAutomable;
208  parameter.name = "Gain";
209  parameter.symbol = "gain";
210  parameter.ranges.min = 0.0f;
211  parameter.ranges.max = 2.0f;
212  parameter.ranges.def = 1.0f;
213  }
214 
215  /* ----------------------------------------------------------------------------------------
216  * Internal data */
217 
218  /**
219  Get the current value of a parameter.
220  */
221  float getParameterValue(uint32_t index) const override
222  {
223  // same as before, ignore index check
224 
225  return fGain;
226  }
227 
228  /**
229  Change a parameter value.
230  */
231  void setParameterValue(uint32_t index, float value) override
232  {
233  // same as before, ignore index check
234 
235  fGain = value;
236  }
237 
238  /* ----------------------------------------------------------------------------------------
239  * Audio/MIDI Processing */
240 
241  void run(const float**, float** outputs, uint32_t frames) override
242  {
243  // get the mono input and output
244  const float* const in = inputs[0];
245  /* */ float* const out = outputs[0];
246 
247  // apply gain against all samples
248  for (uint32_t i=0; i < frames; ++i)
249  out[i] = in[i] * fGain;
250  }
251 
252  private:
253  float fGain;
254  };
255  @endcode
256 
257  See the Parameter struct for more information about parameters.
258 
259  @section Programs
260  Programs in DPF refer to plugin-side presets (usually called "factory presets"),
261  an initial set of presets provided by plugin authors included in the actual plugin.
262 
263  To use programs you must first enable them by setting @ref DISTRHO_PLUGIN_WANT_PROGRAMS to 1 in your DistrhoPluginInfo.h file.@n
264  When enabled you'll need to override 2 new function in your plugin code,
265  Plugin::initProgramName(uint32_t, String&) and Plugin::loadProgram(uint32_t).
266 
267  Here's an example of a plugin with a "default" program:
268  @code
269  class PluginWithPresets : public Plugin
270  {
271  public:
272  PluginWithPresets()
273  : Plugin(2, 1, 0), // 2 parameters, 1 program and 0 states
274  fGainL(1.0f),
275  fGainR(1.0f),
276  {
277  }
278 
279  protected:
280  /* ----------------------------------------------------------------------------------------
281  * Information */
282 
283  const char* getLabel() const override
284  {
285  return "Prog";
286  }
287 
288  const char* getMaker() const override
289  {
290  return "DPF";
291  }
292 
293  const char* getLicense() const override
294  {
295  return "MIT";
296  }
297 
298  uint32_t getVersion() const override
299  {
300  return d_version(1, 0, 0);
301  }
302 
303  int64_t getUniqueId() const override
304  {
305  return d_cconst('P', 'r', 'o', 'g');
306  }
307 
308  /* ----------------------------------------------------------------------------------------
309  * Init */
310 
311  /**
312  Initialize a parameter.
313  This function will be called once, shortly after the plugin is created.
314  */
315  void initParameter(uint32_t index, Parameter& parameter) override
316  {
317  parameter.hints = kParameterIsAutomable;
318  parameter.ranges.min = 0.0f;
319  parameter.ranges.max = 2.0f;
320  parameter.ranges.def = 1.0f;
321 
322  switch (index)
323  {
324  case 0;
325  parameter.name = "Gain Right";
326  parameter.symbol = "gainR";
327  break;
328  case 1;
329  parameter.name = "Gain Left";
330  parameter.symbol = "gainL";
331  break;
332  }
333  }
334 
335  /**
336  Set the name of the program @a index.
337  This function will be called once, shortly after the plugin is created.
338  */
339  void initProgramName(uint32_t index, String& programName)
340  {
341  switch(index)
342  {
343  case 0:
344  programName = "Default";
345  break;
346  }
347  }
348 
349  /* ----------------------------------------------------------------------------------------
350  * Internal data */
351 
352  /**
353  Get the current value of a parameter.
354  */
355  float getParameterValue(uint32_t index) const override
356  {
357  switch (index)
358  {
359  case 0;
360  return fGainL;
361  case 1;
362  return fGainR;
363  }
364  }
365 
366  /**
367  Change a parameter value.
368  */
369  void setParameterValue(uint32_t index, float value) override
370  {
371  switch (index)
372  {
373  case 0;
374  fGainL = value;
375  break;
376  case 1;
377  fGainR = value;
378  break;
379  }
380  }
381 
382  /**
383  Load a program.
384  */
385  void loadProgram(uint32_t index)
386  {
387  switch(index)
388  {
389  case 0:
390  fGainL = 1.0f;
391  fGainR = 1.0f;
392  break;
393  }
394  }
395 
396  /* ----------------------------------------------------------------------------------------
397  * Audio/MIDI Processing */
398 
399  void run(const float**, float** outputs, uint32_t frames) override
400  {
401  // get the left and right audio buffers
402  const float* const inL = inputs[0];
403  const float* const inR = inputs[0];
404  /* */ float* const outL = outputs[0];
405  /* */ float* const outR = outputs[0];
406 
407  // apply gain against all samples
408  for (uint32_t i=0; i < frames; ++i)
409  {
410  outL[i] = inL[i] * fGainL;
411  outR[i] = inR[i] * fGainR;
412  }
413  }
414 
415  private:
416  float fGainL, fGainR;
417  };
418  @endcode
419 
420  @section States
421  describe them
422 
423  @section MIDI
424  describe them
425 
426  @section Latency
427  describe it
428 
429  @section Time-Position
430  describe it
431 
432  @section UI
433  describe them
434 */
435 
436 /* ------------------------------------------------------------------------------------------------------------
437  * Plugin Macros */
438 
439 /**
440  @defgroup PluginMacros Plugin Macros
441 
442  C Macros that describe your plugin. (defined in the "DistrhoPluginInfo.h" file)
443 
444  With these macros you can tell the host what features your plugin requires.@n
445  Depending on which macros you enable, new functions will be available to call and/or override.
446 
447  All values are either integer or strings.@n
448  For boolean-like values 1 means 'on' and 0 means 'off'.
449 
450  The values defined in this group are for documentation purposes only.@n
451  All macros are disabled by default.
452 
453  Only 4 macros are required, they are:
454  - @ref DISTRHO_PLUGIN_NAME
455  - @ref DISTRHO_PLUGIN_NUM_INPUTS
456  - @ref DISTRHO_PLUGIN_NUM_OUTPUTS
457  - @ref DISTRHO_PLUGIN_URI
458  @{
459  */
460 
461 /**
462  The plugin name.@n
463  This is used to identify your plugin before a Plugin instance can be created.
464  @note This macro is required.
465  */
466 #define DISTRHO_PLUGIN_NAME "Plugin Name"
467 
468 /**
469  Number of audio inputs the plugin has.
470  @note This macro is required.
471  */
472 #define DISTRHO_PLUGIN_NUM_INPUTS 2
473 
474 /**
475  Number of audio outputs the plugin has.
476  @note This macro is required.
477  */
478 #define DISTRHO_PLUGIN_NUM_OUTPUTS 2
479 
480 /**
481  The plugin URI when exporting in LV2 format.
482  @note This macro is required.
483  */
484 #define DISTRHO_PLUGIN_URI "urn:distrho:name"
485 
486 /**
487  Wherever the plugin has a custom %UI.
488  @see DISTRHO_UI_USE_NANOVG
489  @see UI
490  */
491 #define DISTRHO_PLUGIN_HAS_UI 1
492 
493 /**
494  Wherever the plugin processing is realtime-safe.@n
495  TODO - list rtsafe requirements
496  */
497 #define DISTRHO_PLUGIN_IS_RT_SAFE 1
498 
499 /**
500  Wherever the plugin is a synth.@n
501  @ref DISTRHO_PLUGIN_WANT_MIDI_INPUT is automatically enabled when this is too.
502  @see DISTRHO_PLUGIN_WANT_MIDI_INPUT
503  */
504 #define DISTRHO_PLUGIN_IS_SYNTH 1
505 
506 /**
507  Enable direct access between the %UI and plugin code.
508  @see UI::getPluginInstancePointer()
509  @note DO NOT USE THIS UNLESS STRICTLY NECESSARY!!
510  Try to avoid it at all costs!
511  */
512 #define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0
513 
514 /**
515  Wherever the plugin introduces latency during audio or midi processing.
516  @see Plugin::setLatency(uint32_t)
517  */
518 #define DISTRHO_PLUGIN_WANT_LATENCY 1
519 
520 /**
521  Wherever the plugin wants MIDI input.@n
522  This is automatically enabled if @ref DISTRHO_PLUGIN_IS_SYNTH is true.
523  */
524 #define DISTRHO_PLUGIN_WANT_MIDI_INPUT 1
525 
526 /**
527  Wherever the plugin wants MIDI output.
528  @see Plugin::writeMidiEvent(const MidiEvent&)
529  */
530 #define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 1
531 
532 /**
533  Wherever the plugin provides its own internal programs.
534  @see Plugin::initProgramName(uint32_t, String&)
535  @see Plugin::loadProgram(uint32_t)
536  */
537 #define DISTRHO_PLUGIN_WANT_PROGRAMS 1
538 
539 /**
540  Wherever the plugin uses internal non-parameter data.
541  @see Plugin::initState(uint32_t, String&, String&)
542  @see Plugin::setState(const char*, const char*)
543  */
544 #define DISTRHO_PLUGIN_WANT_STATE 1
545 
546 /**
547  Wherever the plugin wants time position information from the host.
548  @see Plugin::getTimePosition()
549  */
550 #define DISTRHO_PLUGIN_WANT_TIMEPOS 1
551 
552 /**
553  Wherever the %UI uses NanoVG for drawing instead of the default raw OpenGL calls.@n
554  When enabled your %UI instance will subclass @ref NanoWidget instead of @ref Widget.
555  */
556 #define DISTRHO_UI_USE_NANOVG 1
557 
558 /**
559  The %UI URI when exporting in LV2 format.@n
560  By default this is set to @ref DISTRHO_PLUGIN_URI with "#UI" as suffix.
561  */
562 #define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI"
563 
564 /** @} */
565 
566 // -----------------------------------------------------------------------------------------------------------
567 
568 END_NAMESPACE_DISTRHO
569 
570 #endif // DOXYGEN
+
1 /*
2  * DISTRHO Plugin Framework (DPF)
3  * Copyright (C) 2012-2019 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 #ifdef DOXYGEN
18 
19 #include "src/DistrhoDefines.h"
20 
21 START_NAMESPACE_DISTRHO
22 
23 /* ------------------------------------------------------------------------------------------------------------
24  * Intro */
25 
26 /**
27  @mainpage DISTRHO %Plugin Framework
28 
29  DISTRHO %Plugin Framework (or @b DPF for short)
30  is a plugin framework designed to make development of new plugins an easy and enjoyable task.@n
31  It allows developers to create plugins with custom UIs using a simple C++ API.@n
32  The framework facilitates exporting various different plugin formats from the same code-base.
33 
34  DPF can build for LADSPA, DSSI, LV2 and VST2 formats.@n
35  A JACK/Standalone mode is also available, allowing you to quickly test plugins.
36 
37  @section Macros
38  You start by creating a "DistrhoPluginInfo.h" file describing the plugin via macros, see @ref PluginMacros.@n
39  This file is included in the main DPF code to select which features to activate for each plugin format.
40 
41  For example, a plugin (with %UI) that use states will require LV2 hosts to support Atom and Worker extensions for
42  message passing from the %UI to the plugin.@n
43  If your plugin does not make use of states, the Worker extension is not set as a required feature.
44 
45  @section Plugin
46  The next step is to create your plugin code by subclassing DPF's Plugin class.@n
47  You need to pass the number of parameters in the constructor and also the number of programs and states, if any.
48 
49  Here's an example of an audio plugin that simply mutes the host output:
50  @code
51  class MutePlugin : public Plugin
52  {
53  public:
54  /**
55  Plugin class constructor.
56  */
57  MutePlugin()
58  : Plugin(0, 0, 0) // 0 parameters, 0 programs and 0 states
59  {
60  }
61 
62  protected:
63  /* ----------------------------------------------------------------------------------------
64  * Information */
65 
66  /**
67  Get the plugin label.
68  This label is a short restricted name consisting of only _, a-z, A-Z and 0-9 characters.
69  */
70  const char* getLabel() const override
71  {
72  return "Mute";
73  }
74 
75  /**
76  Get the plugin author/maker.
77  */
78  const char* getMaker() const override
79  {
80  return "DPF";
81  }
82 
83  /**
84  Get the plugin license name (a single line of text).
85  For commercial plugins this should return some short copyright information.
86  */
87  const char* getLicense() const override
88  {
89  return "MIT";
90  }
91 
92  /**
93  Get the plugin version, in hexadecimal.
94  */
95  uint32_t getVersion() const override
96  {
97  return d_version(1, 0, 0);
98  }
99 
100  /**
101  Get the plugin unique Id.
102  This value is used by LADSPA, DSSI and VST plugin formats.
103  */
104  int64_t getUniqueId() const override
105  {
106  return d_cconst('M', 'u', 't', 'e');
107  }
108 
109  /* ----------------------------------------------------------------------------------------
110  * This example has no parameters, so skip parameter stuff */
111 
112  void initParameter(uint32_t, Parameter&) override {}
113  float getParameterValue(uint32_t) const override { return 0.0f; }
114  void setParameterValue(uint32_t, float) override {}
115 
116  /* ----------------------------------------------------------------------------------------
117  * Audio/MIDI Processing */
118 
119  /**
120  Run/process function for plugins without MIDI input.
121  NOTE: Some parameters might be null if there are no audio inputs or outputs.
122  */
123  void run(const float**, float** outputs, uint32_t frames) override
124  {
125  // get the left and right audio outputs
126  float* const outL = outputs[0];
127  float* const outR = outputs[1];
128 
129  // mute audio
130  std::memset(outL, 0, sizeof(float)*frames);
131  std::memset(outR, 0, sizeof(float)*frames);
132  }
133 
134  };
135  @endcode
136 
137  See the Plugin class for more information and to understand what each function does.
138 
139  @section Parameters
140  A plugin is nothing without parameters.@n
141  In DPF parameters can be inputs or outputs.@n
142  They have hints to describe how they behave plus a name and a symbol identifying them.@n
143  Parameters also have 'ranges' – a minimum, maximum and default value.
144 
145  Input parameters are "read-only": the plugin can read them but not change them.
146  (the exception being when changing programs, more on that below)@n
147  It's the host responsibility to save, restore and set input parameters.
148 
149  Output parameters can be changed at anytime by the plugin.@n
150  The host will simply read their values and not change them.
151 
152  Here's an example of an audio plugin that has 1 input parameter:
153  @code
154  class GainPlugin : public Plugin
155  {
156  public:
157  /**
158  Plugin class constructor.
159  You must set all parameter values to their defaults, matching ParameterRanges::def.
160  */
161  GainPlugin()
162  : Plugin(1, 0, 0), // 1 parameter, 0 programs and 0 states
163  fGain(1.0f)
164  {
165  }
166 
167  protected:
168  /* ----------------------------------------------------------------------------------------
169  * Information */
170 
171  const char* getLabel() const override
172  {
173  return "Gain";
174  }
175 
176  const char* getMaker() const override
177  {
178  return "DPF";
179  }
180 
181  const char* getLicense() const override
182  {
183  return "MIT";
184  }
185 
186  uint32_t getVersion() const override
187  {
188  return d_version(1, 0, 0);
189  }
190 
191  int64_t getUniqueId() const override
192  {
193  return d_cconst('G', 'a', 'i', 'n');
194  }
195 
196  /* ----------------------------------------------------------------------------------------
197  * Init */
198 
199  /**
200  Initialize a parameter.
201  This function will be called once, shortly after the plugin is created.
202  */
203  void initParameter(uint32_t index, Parameter& parameter) override
204  {
205  // we only have one parameter so we can skip checking the index
206 
207  parameter.hints = kParameterIsAutomable;
208  parameter.name = "Gain";
209  parameter.symbol = "gain";
210  parameter.ranges.min = 0.0f;
211  parameter.ranges.max = 2.0f;
212  parameter.ranges.def = 1.0f;
213  }
214 
215  /* ----------------------------------------------------------------------------------------
216  * Internal data */
217 
218  /**
219  Get the current value of a parameter.
220  */
221  float getParameterValue(uint32_t index) const override
222  {
223  // same as before, ignore index check
224 
225  return fGain;
226  }
227 
228  /**
229  Change a parameter value.
230  */
231  void setParameterValue(uint32_t index, float value) override
232  {
233  // same as before, ignore index check
234 
235  fGain = value;
236  }
237 
238  /* ----------------------------------------------------------------------------------------
239  * Audio/MIDI Processing */
240 
241  void run(const float**, float** outputs, uint32_t frames) override
242  {
243  // get the mono input and output
244  const float* const in = inputs[0];
245  /* */ float* const out = outputs[0];
246 
247  // apply gain against all samples
248  for (uint32_t i=0; i < frames; ++i)
249  out[i] = in[i] * fGain;
250  }
251 
252  private:
253  float fGain;
254  };
255  @endcode
256 
257  See the Parameter struct for more information about parameters.
258 
259  @section Programs
260  Programs in DPF refer to plugin-side presets (usually called "factory presets"),
261  an initial set of presets provided by plugin authors included in the actual plugin.
262 
263  To use programs you must first enable them by setting @ref DISTRHO_PLUGIN_WANT_PROGRAMS to 1 in your DistrhoPluginInfo.h file.@n
264  When enabled you'll need to override 2 new function in your plugin code,
265  Plugin::initProgramName(uint32_t, String&) and Plugin::loadProgram(uint32_t).
266 
267  Here's an example of a plugin with a "default" program:
268  @code
269  class PluginWithPresets : public Plugin
270  {
271  public:
272  PluginWithPresets()
273  : Plugin(2, 1, 0), // 2 parameters, 1 program and 0 states
274  fGainL(1.0f),
275  fGainR(1.0f),
276  {
277  }
278 
279  protected:
280  /* ----------------------------------------------------------------------------------------
281  * Information */
282 
283  const char* getLabel() const override
284  {
285  return "Prog";
286  }
287 
288  const char* getMaker() const override
289  {
290  return "DPF";
291  }
292 
293  const char* getLicense() const override
294  {
295  return "MIT";
296  }
297 
298  uint32_t getVersion() const override
299  {
300  return d_version(1, 0, 0);
301  }
302 
303  int64_t getUniqueId() const override
304  {
305  return d_cconst('P', 'r', 'o', 'g');
306  }
307 
308  /* ----------------------------------------------------------------------------------------
309  * Init */
310 
311  /**
312  Initialize a parameter.
313  This function will be called once, shortly after the plugin is created.
314  */
315  void initParameter(uint32_t index, Parameter& parameter) override
316  {
317  parameter.hints = kParameterIsAutomable;
318  parameter.ranges.min = 0.0f;
319  parameter.ranges.max = 2.0f;
320  parameter.ranges.def = 1.0f;
321 
322  switch (index)
323  {
324  case 0;
325  parameter.name = "Gain Right";
326  parameter.symbol = "gainR";
327  break;
328  case 1;
329  parameter.name = "Gain Left";
330  parameter.symbol = "gainL";
331  break;
332  }
333  }
334 
335  /**
336  Set the name of the program @a index.
337  This function will be called once, shortly after the plugin is created.
338  */
339  void initProgramName(uint32_t index, String& programName)
340  {
341  switch(index)
342  {
343  case 0:
344  programName = "Default";
345  break;
346  }
347  }
348 
349  /* ----------------------------------------------------------------------------------------
350  * Internal data */
351 
352  /**
353  Get the current value of a parameter.
354  */
355  float getParameterValue(uint32_t index) const override
356  {
357  switch (index)
358  {
359  case 0;
360  return fGainL;
361  case 1;
362  return fGainR;
363  }
364  }
365 
366  /**
367  Change a parameter value.
368  */
369  void setParameterValue(uint32_t index, float value) override
370  {
371  switch (index)
372  {
373  case 0;
374  fGainL = value;
375  break;
376  case 1;
377  fGainR = value;
378  break;
379  }
380  }
381 
382  /**
383  Load a program.
384  */
385  void loadProgram(uint32_t index)
386  {
387  switch(index)
388  {
389  case 0:
390  fGainL = 1.0f;
391  fGainR = 1.0f;
392  break;
393  }
394  }
395 
396  /* ----------------------------------------------------------------------------------------
397  * Audio/MIDI Processing */
398 
399  void run(const float**, float** outputs, uint32_t frames) override
400  {
401  // get the left and right audio buffers
402  const float* const inL = inputs[0];
403  const float* const inR = inputs[0];
404  /* */ float* const outL = outputs[0];
405  /* */ float* const outR = outputs[0];
406 
407  // apply gain against all samples
408  for (uint32_t i=0; i < frames; ++i)
409  {
410  outL[i] = inL[i] * fGainL;
411  outR[i] = inR[i] * fGainR;
412  }
413  }
414 
415  private:
416  float fGainL, fGainR;
417  };
418  @endcode
419 
420  @section States
421  describe them
422 
423  @section MIDI
424  describe them
425 
426  @section Latency
427  describe it
428 
429  @section Time-Position
430  describe it
431 
432  @section UI
433  describe them
434 */
435 
436 /* ------------------------------------------------------------------------------------------------------------
437  * Plugin Macros */
438 
439 /**
440  @defgroup PluginMacros Plugin Macros
441 
442  C Macros that describe your plugin. (defined in the "DistrhoPluginInfo.h" file)
443 
444  With these macros you can tell the host what features your plugin requires.@n
445  Depending on which macros you enable, new functions will be available to call and/or override.
446 
447  All values are either integer or strings.@n
448  For boolean-like values 1 means 'on' and 0 means 'off'.
449 
450  The values defined in this group are for documentation purposes only.@n
451  All macros are disabled by default.
452 
453  Only 4 macros are required, they are:
454  - @ref DISTRHO_PLUGIN_NAME
455  - @ref DISTRHO_PLUGIN_NUM_INPUTS
456  - @ref DISTRHO_PLUGIN_NUM_OUTPUTS
457  - @ref DISTRHO_PLUGIN_URI
458  @{
459  */
460 
461 /**
462  The plugin name.@n
463  This is used to identify your plugin before a Plugin instance can be created.
464  @note This macro is required.
465  */
466 #define DISTRHO_PLUGIN_NAME "Plugin Name"
467 
468 /**
469  Number of audio inputs the plugin has.
470  @note This macro is required.
471  */
472 #define DISTRHO_PLUGIN_NUM_INPUTS 2
473 
474 /**
475  Number of audio outputs the plugin has.
476  @note This macro is required.
477  */
478 #define DISTRHO_PLUGIN_NUM_OUTPUTS 2
479 
480 /**
481  The plugin URI when exporting in LV2 format.
482  @note This macro is required.
483  */
484 #define DISTRHO_PLUGIN_URI "urn:distrho:name"
485 
486 /**
487  Wherever the plugin has a custom %UI.
488  @see DISTRHO_UI_USE_NANOVG
489  @see UI
490  */
491 #define DISTRHO_PLUGIN_HAS_UI 1
492 
493 /**
494  Wherever the plugin processing is realtime-safe.@n
495  TODO - list rtsafe requirements
496  */
497 #define DISTRHO_PLUGIN_IS_RT_SAFE 1
498 
499 /**
500  Wherever the plugin is a synth.@n
501  @ref DISTRHO_PLUGIN_WANT_MIDI_INPUT is automatically enabled when this is too.
502  @see DISTRHO_PLUGIN_WANT_MIDI_INPUT
503  */
504 #define DISTRHO_PLUGIN_IS_SYNTH 1
505 
506 /**
507  Enable direct access between the %UI and plugin code.
508  @see UI::getPluginInstancePointer()
509  @note DO NOT USE THIS UNLESS STRICTLY NECESSARY!!
510  Try to avoid it at all costs!
511  */
512 #define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0
513 
514 /**
515  Wherever the plugin introduces latency during audio or midi processing.
516  @see Plugin::setLatency(uint32_t)
517  */
518 #define DISTRHO_PLUGIN_WANT_LATENCY 1
519 
520 /**
521  Wherever the plugin wants MIDI input.@n
522  This is automatically enabled if @ref DISTRHO_PLUGIN_IS_SYNTH is true.
523  */
524 #define DISTRHO_PLUGIN_WANT_MIDI_INPUT 1
525 
526 /**
527  Wherever the plugin wants MIDI output.
528  @see Plugin::writeMidiEvent(const MidiEvent&)
529  */
530 #define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 1
531 
532 /**
533  Wherever the plugin provides its own internal programs.
534  @see Plugin::initProgramName(uint32_t, String&)
535  @see Plugin::loadProgram(uint32_t)
536  */
537 #define DISTRHO_PLUGIN_WANT_PROGRAMS 1
538 
539 /**
540  Wherever the plugin uses internal non-parameter data.
541  @see Plugin::initState(uint32_t, String&, String&)
542  @see Plugin::setState(const char*, const char*)
543  */
544 #define DISTRHO_PLUGIN_WANT_STATE 1
545 
546 /**
547  Wherever the plugin implements the full state API.
548  When this macro is enabled, the plugin must implement a new getState(const char* key) function, which the host calls when saving its session/project.
549  This is useful for plugins that have custom internal values not exposed to the host as key-value state pairs or parameters.
550  Most simple effects and synths will not need this.
551  @note this macro is automatically enabled if a plugin has programs and state, as the key-value state pairs need to be updated when the current program changes.
552  @see Plugin::getState(const char*)
553  */
554 #define DISTRHO_PLUGIN_WANT_FULL_STATE 1
555 
556 /**
557  Wherever the plugin wants time position information from the host.
558  @see Plugin::getTimePosition()
559  */
560 #define DISTRHO_PLUGIN_WANT_TIMEPOS 1
561 
562 /**
563  Wherever the %UI uses NanoVG for drawing instead of the default raw OpenGL calls.@n
564  When enabled your %UI instance will subclass @ref NanoWidget instead of @ref Widget.
565  */
566 #define DISTRHO_UI_USE_NANOVG 1
567 
568 /**
569  Wherever the %UI is resizable to any size by the user.@n
570  By default this is false, and resizing is only allowed under the plugin UI control,@n
571  Enabling this options makes it possible for the user to resize the plugin UI at anytime.
572  @see UI::setGeometryConstraints(uint, uint, bool, bool)
573  */
574 #define DISTRHO_UI_USER_RESIZABLE 1
575 
576 /**
577  The %UI URI when exporting in LV2 format.@n
578  By default this is set to @ref DISTRHO_PLUGIN_URI with "#UI" as suffix.
579  */
580 #define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI"
581 
582 /** @} */
583 
584 // -----------------------------------------------------------------------------------------------------------
585 
586 END_NAMESPACE_DISTRHO
587 
588 #endif // DOXYGEN
diff --git a/DistrhoPlugin_8hpp_source.html b/DistrhoPlugin_8hpp_source.html index cf0f4e1b..c47846fc 100644 --- a/DistrhoPlugin_8hpp_source.html +++ b/DistrhoPlugin_8hpp_source.html @@ -66,10 +66,10 @@ $(function() {
DistrhoPlugin.hpp
-
1 /*
2  * DISTRHO Plugin Framework (DPF)
3  * Copyright (C) 2012-2018 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_PLUGIN_HPP_INCLUDED
18 #define DISTRHO_PLUGIN_HPP_INCLUDED
19 
20 #include "extra/String.hpp"
21 #include "extra/LeakDetector.hpp"
22 #include "src/DistrhoPluginChecks.h"
23 
24 START_NAMESPACE_DISTRHO
25 
26 /* ------------------------------------------------------------------------------------------------------------
27  * Audio Port Hints */
28 
29 /**
30  @defgroup AudioPortHints Audio Port Hints
31 
32  Various audio port hints.
33  @see AudioPort::hints
34  @{
35  */
36 
37 /**
38  Audio port can be used as control voltage (LV2 only).
39  */
40 static const uint32_t kAudioPortIsCV = 0x1;
41 
42 /**
43  Audio port should be used as sidechan (LV2 only).
44  */
45 static const uint32_t kAudioPortIsSidechain = 0x2;
46 
47 /** @} */
48 
49 /* ------------------------------------------------------------------------------------------------------------
50  * Parameter Hints */
51 
52 /**
53  @defgroup ParameterHints Parameter Hints
54 
55  Various parameter hints.
56  @see Parameter::hints
57  @{
58  */
59 
60 /**
61  Parameter is automable (real-time safe).
62  @see Plugin::setParameterValue(uint32_t, float)
63  */
64 static const uint32_t kParameterIsAutomable = 0x01;
65 
66 /**
67  Parameter value is boolean.@n
68  It's always at either minimum or maximum value.
69  */
70 static const uint32_t kParameterIsBoolean = 0x02;
71 
72 /**
73  Parameter value is integer.
74  */
75 static const uint32_t kParameterIsInteger = 0x04;
76 
77 /**
78  Parameter value is logarithmic.
79  */
80 static const uint32_t kParameterIsLogarithmic = 0x08;
81 
82 /**
83  Parameter is of output type.@n
84  When unset, parameter is assumed to be of input type.
85 
86  Parameter inputs are changed by the host and must not be changed by the plugin.@n
87  The only exception being when changing programs, see Plugin::loadProgram().@n
88  Outputs are changed by the plugin and never modified by the host.
89  */
90 static const uint32_t kParameterIsOutput = 0x10;
91 
92 /**
93  Parameter value is a trigger.@n
94  This means the value resets back to its default after each process/run call.@n
95  Cannot be used for output parameters.
96 
97  @note Only officially supported under LV2. For other formats DPF simulates the behaviour.
98 */
99 static const uint32_t kParameterIsTrigger = 0x20 | kParameterIsBoolean;
100 
101 /** @} */
102 
103 /* ------------------------------------------------------------------------------------------------------------
104  * Base Plugin structs */
105 
106 /**
107  @defgroup BasePluginStructs Base Plugin Structs
108  @{
109  */
110 
111 /**
112  Audio Port.
113  */
114 struct AudioPort {
115  /**
116  Hints describing this audio port.
117  @see AudioPortHints
118  */
119  uint32_t hints;
120 
121  /**
122  The name of this audio port.@n
123  An audio port name can contain any character, but hosts might have a hard time with non-ascii ones.@n
124  The name doesn't have to be unique within a plugin instance, but it's recommended.
125  */
127 
128  /**
129  The symbol of this audio port.@n
130  An audio port symbol is a short restricted name used as a machine and human readable identifier.@n
131  The first character must be one of _, a-z or A-Z and subsequent characters can be from _, a-z, A-Z and 0-9.
132  @note Audio port and parameter symbols MUST be unique within a plugin instance.
133  */
135 
136  /**
137  Default constructor for a regular audio port.
138  */
139  AudioPort() noexcept
140  : hints(0x0),
141  name(),
142  symbol() {}
143 };
144 
145 /**
146  Parameter designation.@n
147  Allows a parameter to be specially designated for a task, like bypass.
148 
149  Each designation is unique, there must be only one parameter that uses it.@n
150  The use of designated parameters is completely optional.
151 
152  @note Designated parameters have strict ranges.
153  @see ParameterRanges::adjustForDesignation()
154  */
156  /**
157  Null or unset designation.
158  */
160 
161  /**
162  Bypass designation.@n
163  When on (> 0.5f), it means the plugin must run in a bypassed state.
164  */
166 };
167 
168 /**
169  Parameter ranges.@n
170  This is used to set the default, minimum and maximum values of a parameter.
171 
172  By default a parameter has 0.0 as minimum, 1.0 as maximum and 0.0 as default.@n
173  When changing this struct values you must ensure maximum > minimum and default is within range.
174  */
176  /**
177  Default value.
178  */
179  float def;
180 
181  /**
182  Minimum value.
183  */
184  float min;
185 
186  /**
187  Maximum value.
188  */
189  float max;
190 
191  /**
192  Default constructor, using 0.0 as minimum, 1.0 as maximum and 0.0 as default.
193  */
194  ParameterRanges() noexcept
195  : def(0.0f),
196  min(0.0f),
197  max(1.0f) {}
198 
199  /**
200  Constructor using custom values.
201  */
202  ParameterRanges(float df, float mn, float mx) noexcept
203  : def(df),
204  min(mn),
205  max(mx) {}
206 
207  /**
208  Fix the default value within range.
209  */
210  void fixDefault() noexcept
211  {
212  fixValue(def);
213  }
214 
215  /**
216  Fix a value within range.
217  */
218  void fixValue(float& value) const noexcept
219  {
220  if (value < min)
221  value = min;
222  else if (value > max)
223  value = max;
224  }
225 
226  /**
227  Get a fixed value within range.
228  */
229  const float& getFixedValue(const float& value) const noexcept
230  {
231  if (value <= min)
232  return min;
233  if (value >= max)
234  return max;
235  return value;
236  }
237 
238  /**
239  Get a value normalized to 0.0<->1.0.
240  */
241  float getNormalizedValue(const float& value) const noexcept
242  {
243  const float normValue((value - min) / (max - min));
244 
245  if (normValue <= 0.0f)
246  return 0.0f;
247  if (normValue >= 1.0f)
248  return 1.0f;
249  return normValue;
250  }
251 
252  /**
253  Get a value normalized to 0.0<->1.0, fixed within range.
254  */
255  float getFixedAndNormalizedValue(const float& value) const noexcept
256  {
257  if (value <= min)
258  return 0.0f;
259  if (value >= max)
260  return 1.0f;
261 
262  const float normValue((value - min) / (max - min));
263 
264  if (normValue <= 0.0f)
265  return 0.0f;
266  if (normValue >= 1.0f)
267  return 1.0f;
268 
269  return normValue;
270  }
271 
272  /**
273  Get a proper value previously normalized to 0.0<->1.0.
274  */
275  float getUnnormalizedValue(const float& value) const noexcept
276  {
277  if (value <= 0.0f)
278  return min;
279  if (value >= 1.0f)
280  return max;
281 
282  return value * (max - min) + min;
283  }
284 };
285 
286 /**
287  Parameter enumeration value.@n
288  A string representation of a plugin parameter value.@n
289  Used together can be used to give meaning to parameter values, working as an enumeration.
290  */
292  /**
293  Parameter value.
294  */
295  float value;
296 
297  /**
298  String representation of this value.
299  */
301 
302  /**
303  Default constructor, using 0.0 as value and empty label.
304  */
306  : value(0.0f),
307  label() {}
308 
309  /**
310  Constructor using custom values.
311  */
312  ParameterEnumerationValue(float v, const char* l) noexcept
313  : value(v),
314  label(l) {}
315 };
316 
317 /**
318  Collection of parameter enumeration values.@n
319  Handy class to handle the lifetime and count of all enumeration values.
320  */
322  /**
323  Number of elements allocated in @values.
324  */
325  uint8_t count;
326 
327  /**
328  Wherever the host is to be restricted to only use enumeration values.
329 
330  @note This mode is only a hint! Not all hosts and plugin formats support this mode.
331  */
333 
334  /**
335  Array of @ParameterEnumerationValue items.@n
336  This pointer must be null or have been allocated on the heap with `new`.
337  */
339 
340  /**
341  Default constructor, for zero enumeration values.
342  */
344  : count(0),
345  restrictedMode(false),
346  values() {}
347 
348  /**
349  Constructor using custom values.@n
350  The pointer to @values must have been allocated on the heap with `new`.
351  */
352  ParameterEnumerationValues(uint32_t c, bool r, const ParameterEnumerationValue* v) noexcept
353  : count(c),
354  restrictedMode(r),
355  values(v) {}
356 
357  ~ParameterEnumerationValues() noexcept
358  {
359  count = 0;
360  restrictedMode = false;
361 
362  if (values != nullptr)
363  {
364  delete[] values;
365  values = nullptr;
366  }
367  }
368 };
369 
370 /**
371  Parameter.
372  */
373 struct Parameter {
374  /**
375  Hints describing this parameter.
376  @see ParameterHints
377  */
378  uint32_t hints;
379 
380  /**
381  The name of this parameter.@n
382  A parameter name can contain any character, but hosts might have a hard time with non-ascii ones.@n
383  The name doesn't have to be unique within a plugin instance, but it's recommended.
384  */
386 
387  /**
388  The symbol of this parameter.@n
389  A parameter symbol is a short restricted name used as a machine and human readable identifier.@n
390  The first character must be one of _, a-z or A-Z and subsequent characters can be from _, a-z, A-Z and 0-9.
391  @note Parameter symbols MUST be unique within a plugin instance.
392  */
394 
395  /**
396  The unit of this parameter.@n
397  This means something like "dB", "kHz" and "ms".@n
398  Can be left blank if a unit does not apply to this parameter.
399  */
401 
402  /**
403  Ranges of this parameter.@n
404  The ranges describe the default, minimum and maximum values.
405  */
407 
408  /**
409  Enumeration values.@n
410  Can be used to give meaning to parameter values, working as an enumeration.
411  */
413 
414  /**
415  Designation for this parameter.
416  */
418 
419  /**
420  MIDI CC to use by default on this parameter.@n
421  A value of 0 or 32 (bank change) is considered invalid.@n
422  Must also be less or equal to 120.
423  @note This value is only a hint! Hosts might map it automatically or completely ignore it.
424  */
425  uint8_t midiCC;
426 
427  /**
428  Default constructor for a null parameter.
429  */
430  Parameter() noexcept
431  : hints(0x0),
432  name(),
433  symbol(),
434  unit(),
435  ranges(),
436  enumValues(),
437  designation(kParameterDesignationNull),
438  midiCC(0) {}
439 
440  /**
441  Constructor using custom values.
442  */
443  Parameter(uint32_t h, const char* n, const char* s, const char* u, float def, float min, float max) noexcept
444  : hints(h),
445  name(n),
446  symbol(s),
447  unit(u),
448  ranges(def, min, max),
449  enumValues(),
450  designation(kParameterDesignationNull),
451  midiCC(0) {}
452 
453  /**
454  Initialize a parameter for a specific designation.
455  */
457  {
458  designation = d;
459 
460  switch (d)
461  {
463  break;
466  name = "Bypass";
467  symbol = "dpf_bypass";
468  unit = "";
469  midiCC = 0;
470  ranges.def = 0.0f;
471  ranges.min = 0.0f;
472  ranges.max = 1.0f;
473  break;
474  }
475  }
476 };
477 
478 /**
479  MIDI event.
480  */
481 struct MidiEvent {
482  /**
483  Size of internal data.
484  */
485  static const uint32_t kDataSize = 4;
486 
487  /**
488  Time offset in frames.
489  */
490  uint32_t frame;
491 
492  /**
493  Number of bytes used.
494  */
495  uint32_t size;
496 
497  /**
498  MIDI data.@n
499  If size > kDataSize, dataExt is used (otherwise null).
500  */
501  uint8_t data[kDataSize];
502  const uint8_t* dataExt;
503 };
504 
505 /**
506  Time position.@n
507  The @a playing and @a frame values are always valid.@n
508  BBT values are only valid when @a bbt.valid is true.
509 
510  This struct is inspired by the JACK Transport API.
511  */
512 struct TimePosition {
513  /**
514  Wherever the host transport is playing/rolling.
515  */
516  bool playing;
517 
518  /**
519  Current host transport position in frames.
520  */
521  uint64_t frame;
522 
523  /**
524  Bar-Beat-Tick time position.
525  */
526  struct BarBeatTick {
527  /**
528  Wherever the host transport is using BBT.@n
529  If false you must not read from this struct.
530  */
531  bool valid;
532 
533  /**
534  Current bar.@n
535  Should always be > 0.@n
536  The first bar is bar '1'.
537  */
538  int32_t bar;
539 
540  /**
541  Current beat within bar.@n
542  Should always be > 0 and <= @a beatsPerBar.@n
543  The first beat is beat '1'.
544  */
545  int32_t beat;
546 
547  /**
548  Current tick within beat.@n
549  Should always be > 0 and <= @a ticksPerBeat.@n
550  The first tick is tick '0'.
551  */
552  int32_t tick;
553 
554  /**
555  Number of ticks that have elapsed between frame 0 and the first beat of the current measure.
556  */
557  double barStartTick;
558 
559  /**
560  Time signature "numerator".
561  */
562  float beatsPerBar;
563 
564  /**
565  Time signature "denominator".
566  */
567  float beatType;
568 
569  /**
570  Number of ticks within a bar.@n
571  Usually a moderately large integer with many denominators, such as 1920.0.
572  */
573  double ticksPerBeat;
574 
575  /**
576  Number of beats per minute.
577  */
579 
580  /**
581  Default constructor for a null BBT time position.
582  */
583  BarBeatTick() noexcept
584  : valid(false),
585  bar(0),
586  beat(0),
587  tick(0),
588  barStartTick(0.0),
589  beatsPerBar(0.0f),
590  beatType(0.0f),
591  ticksPerBeat(0.0),
592  beatsPerMinute(0.0) {}
593  } bbt;
594 
595  /**
596  Default constructor for a time position.
597  */
598  TimePosition() noexcept
599  : playing(false),
600  frame(0),
601  bbt() {}
602 };
603 
604 /** @} */
605 
606 /* ------------------------------------------------------------------------------------------------------------
607  * DPF Plugin */
608 
609 /**
610  @defgroup MainClasses Main Classes
611  @{
612  */
613 
614 /**
615  DPF Plugin class from where plugin instances are created.
616 
617  The public methods (Host state) are called from the plugin to get or set host information.@n
618  They can be called from a plugin instance at anytime unless stated otherwise.@n
619  All other methods are to be implemented by the plugin and will be called by the host.
620 
621  Shortly after a plugin instance is created, the various init* functions will be called by the host.@n
622  Host will call activate() before run(), and deactivate() before the plugin instance is destroyed.@n
623  The host may call deactivate right after activate and vice-versa, but never activate/deactivate consecutively.@n
624  There is no limit on how many times run() is called, only that activate/deactivate will be called in between.
625 
626  The buffer size and sample rate values will remain constant between activate and deactivate.@n
627  Buffer size is only a hint though, the host might call run() with a higher or lower number of frames.
628 
629  Some of this class functions are only available according to some macros.
630 
631  DISTRHO_PLUGIN_WANT_PROGRAMS activates program related features.@n
632  When enabled you need to implement initProgramName() and loadProgram().
633 
634  DISTRHO_PLUGIN_WANT_STATE activates internal state features.@n
635  When enabled you need to implement initStateKey() and setState().
636 
637  The process function run() changes wherever DISTRHO_PLUGIN_WANT_MIDI_INPUT is enabled or not.@n
638  When enabled it provides midi input events.
639  */
640 class Plugin
641 {
642 public:
643  /**
644  Plugin class constructor.@n
645  You must set all parameter values to their defaults, matching ParameterRanges::def.
646  */
647  Plugin(uint32_t parameterCount, uint32_t programCount, uint32_t stateCount);
648 
649  /**
650  Destructor.
651  */
652  virtual ~Plugin();
653 
654  /* --------------------------------------------------------------------------------------------------------
655  * Host state */
656 
657  /**
658  Get the current buffer size that will probably be used during processing, in frames.@n
659  This value will remain constant between activate and deactivate.
660  @note This value is only a hint!@n
661  Hosts might call run() with a higher or lower number of frames.
662  @see bufferSizeChanged(uint32_t)
663  */
664  uint32_t getBufferSize() const noexcept;
665 
666  /**
667  Get the current sample rate that will be used during processing.@n
668  This value will remain constant between activate and deactivate.
669  @see sampleRateChanged(double)
670  */
671  double getSampleRate() const noexcept;
672 
673 #if DISTRHO_PLUGIN_WANT_TIMEPOS
674  /**
675  Get the current host transport time position.@n
676  This function should only be called during run().@n
677  You can call this during other times, but the returned position is not guaranteed to be in sync.
678  @note TimePosition is not supported in LADSPA and DSSI plugin formats.
679  */
680  const TimePosition& getTimePosition() const noexcept;
681 #endif
682 
683 #if DISTRHO_PLUGIN_WANT_LATENCY
684  /**
685  Change the plugin audio output latency to @a frames.@n
686  This function should only be called in the constructor, activate() and run().
687  @note This function is only available if DISTRHO_PLUGIN_WANT_LATENCY is enabled.
688  */
689  void setLatency(uint32_t frames) noexcept;
690 #endif
691 
692 #if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
693  /**
694  Write a MIDI output event.@n
695  This function must only be called during run().@n
696  Returns false when the host buffer is full, in which case do not call this again until the next run().
697  */
698  bool writeMidiEvent(const MidiEvent& midiEvent) noexcept;
699 #endif
700 
701 protected:
702  /* --------------------------------------------------------------------------------------------------------
703  * Information */
704 
705  /**
706  Get the plugin name.@n
707  Returns DISTRHO_PLUGIN_NAME by default.
708  */
709  virtual const char* getName() const { return DISTRHO_PLUGIN_NAME; }
710 
711  /**
712  Get the plugin label.@n
713  This label is a short restricted name consisting of only _, a-z, A-Z and 0-9 characters.
714  */
715  virtual const char* getLabel() const = 0;
716 
717  /**
718  Get an extensive comment/description about the plugin.@n
719  Optional, returns nothing by default.
720  */
721  virtual const char* getDescription() const { return ""; }
722 
723  /**
724  Get the plugin author/maker.
725  */
726  virtual const char* getMaker() const = 0;
727 
728  /**
729  Get the plugin homepage.@n
730  Optional, returns nothing by default.
731  */
732  virtual const char* getHomePage() const { return ""; }
733 
734  /**
735  Get the plugin license (a single line of text or a URL).@n
736  For commercial plugins this should return some short copyright information.
737  */
738  virtual const char* getLicense() const = 0;
739 
740  /**
741  Get the plugin version, in hexadecimal.
742  @see d_version()
743  */
744  virtual uint32_t getVersion() const = 0;
745 
746  /**
747  Get the plugin unique Id.@n
748  This value is used by LADSPA, DSSI and VST plugin formats.
749  @see d_cconst()
750  */
751  virtual int64_t getUniqueId() const = 0;
752 
753  /* --------------------------------------------------------------------------------------------------------
754  * Init */
755 
756  /**
757  Initialize the audio port @a index.@n
758  This function will be called once, shortly after the plugin is created.
759  */
760  virtual void initAudioPort(bool input, uint32_t index, AudioPort& port);
761 
762  /**
763  Initialize the parameter @a index.@n
764  This function will be called once, shortly after the plugin is created.
765  */
766  virtual void initParameter(uint32_t index, Parameter& parameter) = 0;
767 
768 #if DISTRHO_PLUGIN_WANT_PROGRAMS
769  /**
770  Set the name of the program @a index.@n
771  This function will be called once, shortly after the plugin is created.@n
772  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_PROGRAMS is enabled.
773  */
774  virtual void initProgramName(uint32_t index, String& programName) = 0;
775 #endif
776 
777 #if DISTRHO_PLUGIN_WANT_STATE
778  /**
779  Set the state key and default value of @a index.@n
780  This function will be called once, shortly after the plugin is created.@n
781  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_STATE is enabled.
782  */
783  virtual void initState(uint32_t index, String& stateKey, String& defaultStateValue) = 0;
784 #endif
785 
786  /* --------------------------------------------------------------------------------------------------------
787  * Internal data */
788 
789  /**
790  Get the current value of a parameter.@n
791  The host may call this function from any context, including realtime processing.
792  */
793  virtual float getParameterValue(uint32_t index) const = 0;
794 
795  /**
796  Change a parameter value.@n
797  The host may call this function from any context, including realtime processing.@n
798  When a parameter is marked as automable, you must ensure no non-realtime operations are performed.
799  @note This function will only be called for parameter inputs.
800  */
801  virtual void setParameterValue(uint32_t index, float value) = 0;
802 
803 #if DISTRHO_PLUGIN_WANT_PROGRAMS
804  /**
805  Load a program.@n
806  The host may call this function from any context, including realtime processing.@n
807  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_PROGRAMS is enabled.
808  */
809  virtual void loadProgram(uint32_t index) = 0;
810 #endif
811 
812 #if DISTRHO_PLUGIN_WANT_FULL_STATE
813  /**
814  Get the value of an internal state.@n
815  The host may call this function from any non-realtime context.@n
816  Must be implemented by your plugin class if DISTRHO_PLUGIN_WANT_FULL_STATE is enabled.
817  @note The use of this function breaks compatibility with the DSSI format.
818  */
819  virtual String getState(const char* key) const = 0;
820 #endif
821 
822 #if DISTRHO_PLUGIN_WANT_STATE
823  /**
824  Change an internal state @a key to @a value.@n
825  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_STATE is enabled.
826  */
827  virtual void setState(const char* key, const char* value) = 0;
828 #endif
829 
830  /* --------------------------------------------------------------------------------------------------------
831  * Audio/MIDI Processing */
832 
833  /**
834  Activate this plugin.
835  */
836  virtual void activate() {}
837 
838  /**
839  Deactivate this plugin.
840  */
841  virtual void deactivate() {}
842 
843 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
844  /**
845  Run/process function for plugins with MIDI input.
846  @note Some parameters might be null if there are no audio inputs/outputs or MIDI events.
847  */
848  virtual void run(const float** inputs, float** outputs, uint32_t frames,
849  const MidiEvent* midiEvents, uint32_t midiEventCount) = 0;
850 #else
851  /**
852  Run/process function for plugins without MIDI input.
853  @note Some parameters might be null if there are no audio inputs or outputs.
854  */
855  virtual void run(const float** inputs, float** outputs, uint32_t frames) = 0;
856 #endif
857 
858  /* --------------------------------------------------------------------------------------------------------
859  * Callbacks (optional) */
860 
861  /**
862  Optional callback to inform the plugin about a buffer size change.@n
863  This function will only be called when the plugin is deactivated.
864  @note This value is only a hint!@n
865  Hosts might call run() with a higher or lower number of frames.
866  @see getBufferSize()
867  */
868  virtual void bufferSizeChanged(uint32_t newBufferSize);
869 
870  /**
871  Optional callback to inform the plugin about a sample rate change.@n
872  This function will only be called when the plugin is deactivated.
873  @see getSampleRate()
874  */
875  virtual void sampleRateChanged(double newSampleRate);
876 
877  // -------------------------------------------------------------------------------------------------------
878 
879 private:
880  struct PrivateData;
881  PrivateData* const pData;
882  friend class PluginExporter;
883 
884  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Plugin)
885 };
886 
887 /** @} */
888 
889 /* ------------------------------------------------------------------------------------------------------------
890  * Create plugin, entry point */
891 
892 /**
893  @defgroup EntryPoints Entry Points
894  @{
895  */
896 
897 /**
898  TODO.
899  */
900 extern Plugin* createPlugin();
901 
902 /** @} */
903 
904 // -----------------------------------------------------------------------------------------------------------
905 
906 END_NAMESPACE_DISTRHO
907 
908 #endif // DISTRHO_PLUGIN_HPP_INCLUDED
float min
Definition: DistrhoPlugin.hpp:184
+
1 /*
2  * DISTRHO Plugin Framework (DPF)
3  * Copyright (C) 2012-2018 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_PLUGIN_HPP_INCLUDED
18 #define DISTRHO_PLUGIN_HPP_INCLUDED
19 
20 #include "extra/String.hpp"
21 #include "extra/LeakDetector.hpp"
22 #include "src/DistrhoPluginChecks.h"
23 
24 START_NAMESPACE_DISTRHO
25 
26 /* ------------------------------------------------------------------------------------------------------------
27  * Audio Port Hints */
28 
29 /**
30  @defgroup AudioPortHints Audio Port Hints
31 
32  Various audio port hints.
33  @see AudioPort::hints
34  @{
35  */
36 
37 /**
38  Audio port can be used as control voltage (LV2 only).
39  */
40 static const uint32_t kAudioPortIsCV = 0x1;
41 
42 /**
43  Audio port should be used as sidechan (LV2 only).
44  */
45 static const uint32_t kAudioPortIsSidechain = 0x2;
46 
47 /** @} */
48 
49 /* ------------------------------------------------------------------------------------------------------------
50  * Parameter Hints */
51 
52 /**
53  @defgroup ParameterHints Parameter Hints
54 
55  Various parameter hints.
56  @see Parameter::hints
57  @{
58  */
59 
60 /**
61  Parameter is automable (real-time safe).
62  @see Plugin::setParameterValue(uint32_t, float)
63  */
64 static const uint32_t kParameterIsAutomable = 0x01;
65 
66 /**
67  Parameter value is boolean.@n
68  It's always at either minimum or maximum value.
69  */
70 static const uint32_t kParameterIsBoolean = 0x02;
71 
72 /**
73  Parameter value is integer.
74  */
75 static const uint32_t kParameterIsInteger = 0x04;
76 
77 /**
78  Parameter value is logarithmic.
79  */
80 static const uint32_t kParameterIsLogarithmic = 0x08;
81 
82 /**
83  Parameter is of output type.@n
84  When unset, parameter is assumed to be of input type.
85 
86  Parameter inputs are changed by the host and must not be changed by the plugin.@n
87  The only exception being when changing programs, see Plugin::loadProgram().@n
88  Outputs are changed by the plugin and never modified by the host.
89  */
90 static const uint32_t kParameterIsOutput = 0x10;
91 
92 /**
93  Parameter value is a trigger.@n
94  This means the value resets back to its default after each process/run call.@n
95  Cannot be used for output parameters.
96 
97  @note Only officially supported under LV2. For other formats DPF simulates the behaviour.
98 */
99 static const uint32_t kParameterIsTrigger = 0x20 | kParameterIsBoolean;
100 
101 /** @} */
102 
103 /* ------------------------------------------------------------------------------------------------------------
104  * Base Plugin structs */
105 
106 /**
107  @defgroup BasePluginStructs Base Plugin Structs
108  @{
109  */
110 
111 /**
112  Audio Port.
113  */
114 struct AudioPort {
115  /**
116  Hints describing this audio port.
117  @see AudioPortHints
118  */
119  uint32_t hints;
120 
121  /**
122  The name of this audio port.@n
123  An audio port name can contain any character, but hosts might have a hard time with non-ascii ones.@n
124  The name doesn't have to be unique within a plugin instance, but it's recommended.
125  */
127 
128  /**
129  The symbol of this audio port.@n
130  An audio port symbol is a short restricted name used as a machine and human readable identifier.@n
131  The first character must be one of _, a-z or A-Z and subsequent characters can be from _, a-z, A-Z and 0-9.
132  @note Audio port and parameter symbols MUST be unique within a plugin instance.
133  */
135 
136  /**
137  Default constructor for a regular audio port.
138  */
139  AudioPort() noexcept
140  : hints(0x0),
141  name(),
142  symbol() {}
143 };
144 
145 /**
146  Parameter designation.@n
147  Allows a parameter to be specially designated for a task, like bypass.
148 
149  Each designation is unique, there must be only one parameter that uses it.@n
150  The use of designated parameters is completely optional.
151 
152  @note Designated parameters have strict ranges.
153  @see ParameterRanges::adjustForDesignation()
154  */
156  /**
157  Null or unset designation.
158  */
160 
161  /**
162  Bypass designation.@n
163  When on (> 0.5f), it means the plugin must run in a bypassed state.
164  */
166 };
167 
168 /**
169  Parameter ranges.@n
170  This is used to set the default, minimum and maximum values of a parameter.
171 
172  By default a parameter has 0.0 as minimum, 1.0 as maximum and 0.0 as default.@n
173  When changing this struct values you must ensure maximum > minimum and default is within range.
174  */
176  /**
177  Default value.
178  */
179  float def;
180 
181  /**
182  Minimum value.
183  */
184  float min;
185 
186  /**
187  Maximum value.
188  */
189  float max;
190 
191  /**
192  Default constructor, using 0.0 as minimum, 1.0 as maximum and 0.0 as default.
193  */
194  ParameterRanges() noexcept
195  : def(0.0f),
196  min(0.0f),
197  max(1.0f) {}
198 
199  /**
200  Constructor using custom values.
201  */
202  ParameterRanges(float df, float mn, float mx) noexcept
203  : def(df),
204  min(mn),
205  max(mx) {}
206 
207  /**
208  Fix the default value within range.
209  */
210  void fixDefault() noexcept
211  {
212  fixValue(def);
213  }
214 
215  /**
216  Fix a value within range.
217  */
218  void fixValue(float& value) const noexcept
219  {
220  if (value < min)
221  value = min;
222  else if (value > max)
223  value = max;
224  }
225 
226  /**
227  Get a fixed value within range.
228  */
229  const float& getFixedValue(const float& value) const noexcept
230  {
231  if (value <= min)
232  return min;
233  if (value >= max)
234  return max;
235  return value;
236  }
237 
238  /**
239  Get a value normalized to 0.0<->1.0.
240  */
241  float getNormalizedValue(const float& value) const noexcept
242  {
243  const float normValue((value - min) / (max - min));
244 
245  if (normValue <= 0.0f)
246  return 0.0f;
247  if (normValue >= 1.0f)
248  return 1.0f;
249  return normValue;
250  }
251 
252  /**
253  Get a value normalized to 0.0<->1.0, fixed within range.
254  */
255  float getFixedAndNormalizedValue(const float& value) const noexcept
256  {
257  if (value <= min)
258  return 0.0f;
259  if (value >= max)
260  return 1.0f;
261 
262  const float normValue((value - min) / (max - min));
263 
264  if (normValue <= 0.0f)
265  return 0.0f;
266  if (normValue >= 1.0f)
267  return 1.0f;
268 
269  return normValue;
270  }
271 
272  /**
273  Get a proper value previously normalized to 0.0<->1.0.
274  */
275  float getUnnormalizedValue(const float& value) const noexcept
276  {
277  if (value <= 0.0f)
278  return min;
279  if (value >= 1.0f)
280  return max;
281 
282  return value * (max - min) + min;
283  }
284 };
285 
286 /**
287  Parameter enumeration value.@n
288  A string representation of a plugin parameter value.@n
289  Used together can be used to give meaning to parameter values, working as an enumeration.
290  */
292  /**
293  Parameter value.
294  */
295  float value;
296 
297  /**
298  String representation of this value.
299  */
301 
302  /**
303  Default constructor, using 0.0 as value and empty label.
304  */
306  : value(0.0f),
307  label() {}
308 
309  /**
310  Constructor using custom values.
311  */
312  ParameterEnumerationValue(float v, const char* l) noexcept
313  : value(v),
314  label(l) {}
315 };
316 
317 /**
318  Collection of parameter enumeration values.@n
319  Handy class to handle the lifetime and count of all enumeration values.
320  */
322  /**
323  Number of elements allocated in @values.
324  */
325  uint8_t count;
326 
327  /**
328  Wherever the host is to be restricted to only use enumeration values.
329 
330  @note This mode is only a hint! Not all hosts and plugin formats support this mode.
331  */
333 
334  /**
335  Array of @ParameterEnumerationValue items.@n
336  This pointer must be null or have been allocated on the heap with `new`.
337  */
339 
340  /**
341  Default constructor, for zero enumeration values.
342  */
344  : count(0),
345  restrictedMode(false),
346  values() {}
347 
348  /**
349  Constructor using custom values.@n
350  The pointer to @values must have been allocated on the heap with `new`.
351  */
352  ParameterEnumerationValues(uint32_t c, bool r, const ParameterEnumerationValue* v) noexcept
353  : count(c),
354  restrictedMode(r),
355  values(v) {}
356 
357  ~ParameterEnumerationValues() noexcept
358  {
359  count = 0;
360  restrictedMode = false;
361 
362  if (values != nullptr)
363  {
364  delete[] values;
365  values = nullptr;
366  }
367  }
368 };
369 
370 /**
371  Parameter.
372  */
373 struct Parameter {
374  /**
375  Hints describing this parameter.
376  @see ParameterHints
377  */
378  uint32_t hints;
379 
380  /**
381  The name of this parameter.@n
382  A parameter name can contain any character, but hosts might have a hard time with non-ascii ones.@n
383  The name doesn't have to be unique within a plugin instance, but it's recommended.
384  */
386 
387  /**
388  The symbol of this parameter.@n
389  A parameter symbol is a short restricted name used as a machine and human readable identifier.@n
390  The first character must be one of _, a-z or A-Z and subsequent characters can be from _, a-z, A-Z and 0-9.
391  @note Parameter symbols MUST be unique within a plugin instance.
392  */
394 
395  /**
396  The unit of this parameter.@n
397  This means something like "dB", "kHz" and "ms".@n
398  Can be left blank if a unit does not apply to this parameter.
399  */
401 
402  /**
403  Ranges of this parameter.@n
404  The ranges describe the default, minimum and maximum values.
405  */
407 
408  /**
409  Enumeration values.@n
410  Can be used to give meaning to parameter values, working as an enumeration.
411  */
413 
414  /**
415  Designation for this parameter.
416  */
418 
419  /**
420  MIDI CC to use by default on this parameter.@n
421  A value of 0 or 32 (bank change) is considered invalid.@n
422  Must also be less or equal to 120.
423  @note This value is only a hint! Hosts might map it automatically or completely ignore it.
424  */
425  uint8_t midiCC;
426 
427  /**
428  Default constructor for a null parameter.
429  */
430  Parameter() noexcept
431  : hints(0x0),
432  name(),
433  symbol(),
434  unit(),
435  ranges(),
436  enumValues(),
437  designation(kParameterDesignationNull),
438  midiCC(0) {}
439 
440  /**
441  Constructor using custom values.
442  */
443  Parameter(uint32_t h, const char* n, const char* s, const char* u, float def, float min, float max) noexcept
444  : hints(h),
445  name(n),
446  symbol(s),
447  unit(u),
448  ranges(def, min, max),
449  enumValues(),
450  designation(kParameterDesignationNull),
451  midiCC(0) {}
452 
453  /**
454  Initialize a parameter for a specific designation.
455  */
457  {
458  designation = d;
459 
460  switch (d)
461  {
463  break;
466  name = "Bypass";
467  symbol = "dpf_bypass";
468  unit = "";
469  midiCC = 0;
470  ranges.def = 0.0f;
471  ranges.min = 0.0f;
472  ranges.max = 1.0f;
473  break;
474  }
475  }
476 };
477 
478 /**
479  MIDI event.
480  */
481 struct MidiEvent {
482  /**
483  Size of internal data.
484  */
485  static const uint32_t kDataSize = 4;
486 
487  /**
488  Time offset in frames.
489  */
490  uint32_t frame;
491 
492  /**
493  Number of bytes used.
494  */
495  uint32_t size;
496 
497  /**
498  MIDI data.@n
499  If size > kDataSize, dataExt is used (otherwise null).
500  */
501  uint8_t data[kDataSize];
502  const uint8_t* dataExt;
503 };
504 
505 /**
506  Time position.@n
507  The @a playing and @a frame values are always valid.@n
508  BBT values are only valid when @a bbt.valid is true.
509 
510  This struct is inspired by the JACK Transport API.
511  */
512 struct TimePosition {
513  /**
514  Wherever the host transport is playing/rolling.
515  */
516  bool playing;
517 
518  /**
519  Current host transport position in frames.
520  */
521  uint64_t frame;
522 
523  /**
524  Bar-Beat-Tick time position.
525  */
526  struct BarBeatTick {
527  /**
528  Wherever the host transport is using BBT.@n
529  If false you must not read from this struct.
530  */
531  bool valid;
532 
533  /**
534  Current bar.@n
535  Should always be > 0.@n
536  The first bar is bar '1'.
537  */
538  int32_t bar;
539 
540  /**
541  Current beat within bar.@n
542  Should always be > 0 and <= @a beatsPerBar.@n
543  The first beat is beat '1'.
544  */
545  int32_t beat;
546 
547  /**
548  Current tick within beat.@n
549  Should always be >= 0 and < @a ticksPerBeat.@n
550  The first tick is tick '0'.
551  */
552  int32_t tick;
553 
554  /**
555  Number of ticks that have elapsed between frame 0 and the first beat of the current measure.
556  */
557  double barStartTick;
558 
559  /**
560  Time signature "numerator".
561  */
562  float beatsPerBar;
563 
564  /**
565  Time signature "denominator".
566  */
567  float beatType;
568 
569  /**
570  Number of ticks within a beat.@n
571  Usually a moderately large integer with many denominators, such as 1920.0.
572  */
573  double ticksPerBeat;
574 
575  /**
576  Number of beats per minute.
577  */
579 
580  /**
581  Default constructor for a null BBT time position.
582  */
583  BarBeatTick() noexcept
584  : valid(false),
585  bar(0),
586  beat(0),
587  tick(0),
588  barStartTick(0.0),
589  beatsPerBar(0.0f),
590  beatType(0.0f),
591  ticksPerBeat(0.0),
592  beatsPerMinute(0.0) {}
593 
594  /**
595  Reinitialize this position using the default null initialization.
596  */
597  void clear() noexcept
598  {
599  valid = false;
600  bar = 0;
601  beat = 0;
602  tick = 0;
603  barStartTick = 0.0;
604  beatsPerBar = 0.0f;
605  beatType = 0.0f;
606  ticksPerBeat = 0.0;
607  beatsPerMinute = 0.0;
608  }
609  } bbt;
610 
611  /**
612  Default constructor for a time position.
613  */
614  TimePosition() noexcept
615  : playing(false),
616  frame(0),
617  bbt() {}
618 
619  /**
620  Reinitialize this position using the default null initialization.
621  */
622  void clear() noexcept
623  {
624  playing = false;
625  frame = 0;
626  bbt.clear();
627  }
628 };
629 
630 /** @} */
631 
632 /* ------------------------------------------------------------------------------------------------------------
633  * DPF Plugin */
634 
635 /**
636  @defgroup MainClasses Main Classes
637  @{
638  */
639 
640 /**
641  DPF Plugin class from where plugin instances are created.
642 
643  The public methods (Host state) are called from the plugin to get or set host information.@n
644  They can be called from a plugin instance at anytime unless stated otherwise.@n
645  All other methods are to be implemented by the plugin and will be called by the host.
646 
647  Shortly after a plugin instance is created, the various init* functions will be called by the host.@n
648  Host will call activate() before run(), and deactivate() before the plugin instance is destroyed.@n
649  The host may call deactivate right after activate and vice-versa, but never activate/deactivate consecutively.@n
650  There is no limit on how many times run() is called, only that activate/deactivate will be called in between.
651 
652  The buffer size and sample rate values will remain constant between activate and deactivate.@n
653  Buffer size is only a hint though, the host might call run() with a higher or lower number of frames.
654 
655  Some of this class functions are only available according to some macros.
656 
657  DISTRHO_PLUGIN_WANT_PROGRAMS activates program related features.@n
658  When enabled you need to implement initProgramName() and loadProgram().
659 
660  DISTRHO_PLUGIN_WANT_STATE activates internal state features.@n
661  When enabled you need to implement initStateKey() and setState().
662 
663  The process function run() changes wherever DISTRHO_PLUGIN_WANT_MIDI_INPUT is enabled or not.@n
664  When enabled it provides midi input events.
665  */
666 class Plugin
667 {
668 public:
669  /**
670  Plugin class constructor.@n
671  You must set all parameter values to their defaults, matching ParameterRanges::def.
672  */
673  Plugin(uint32_t parameterCount, uint32_t programCount, uint32_t stateCount);
674 
675  /**
676  Destructor.
677  */
678  virtual ~Plugin();
679 
680  /* --------------------------------------------------------------------------------------------------------
681  * Host state */
682 
683  /**
684  Get the current buffer size that will probably be used during processing, in frames.@n
685  This value will remain constant between activate and deactivate.
686  @note This value is only a hint!@n
687  Hosts might call run() with a higher or lower number of frames.
688  @see bufferSizeChanged(uint32_t)
689  */
690  uint32_t getBufferSize() const noexcept;
691 
692  /**
693  Get the current sample rate that will be used during processing.@n
694  This value will remain constant between activate and deactivate.
695  @see sampleRateChanged(double)
696  */
697  double getSampleRate() const noexcept;
698 
699 #if DISTRHO_PLUGIN_WANT_TIMEPOS
700  /**
701  Get the current host transport time position.@n
702  This function should only be called during run().@n
703  You can call this during other times, but the returned position is not guaranteed to be in sync.
704  @note TimePosition is not supported in LADSPA and DSSI plugin formats.
705  */
706  const TimePosition& getTimePosition() const noexcept;
707 #endif
708 
709 #if DISTRHO_PLUGIN_WANT_LATENCY
710  /**
711  Change the plugin audio output latency to @a frames.@n
712  This function should only be called in the constructor, activate() and run().
713  @note This function is only available if DISTRHO_PLUGIN_WANT_LATENCY is enabled.
714  */
715  void setLatency(uint32_t frames) noexcept;
716 #endif
717 
718 #if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
719  /**
720  Write a MIDI output event.@n
721  This function must only be called during run().@n
722  Returns false when the host buffer is full, in which case do not call this again until the next run().
723  */
724  bool writeMidiEvent(const MidiEvent& midiEvent) noexcept;
725 #endif
726 
727 protected:
728  /* --------------------------------------------------------------------------------------------------------
729  * Information */
730 
731  /**
732  Get the plugin name.@n
733  Returns DISTRHO_PLUGIN_NAME by default.
734  */
735  virtual const char* getName() const { return DISTRHO_PLUGIN_NAME; }
736 
737  /**
738  Get the plugin label.@n
739  This label is a short restricted name consisting of only _, a-z, A-Z and 0-9 characters.
740  */
741  virtual const char* getLabel() const = 0;
742 
743  /**
744  Get an extensive comment/description about the plugin.@n
745  Optional, returns nothing by default.
746  */
747  virtual const char* getDescription() const { return ""; }
748 
749  /**
750  Get the plugin author/maker.
751  */
752  virtual const char* getMaker() const = 0;
753 
754  /**
755  Get the plugin homepage.@n
756  Optional, returns nothing by default.
757  */
758  virtual const char* getHomePage() const { return ""; }
759 
760  /**
761  Get the plugin license (a single line of text or a URL).@n
762  For commercial plugins this should return some short copyright information.
763  */
764  virtual const char* getLicense() const = 0;
765 
766  /**
767  Get the plugin version, in hexadecimal.
768  @see d_version()
769  */
770  virtual uint32_t getVersion() const = 0;
771 
772  /**
773  Get the plugin unique Id.@n
774  This value is used by LADSPA, DSSI and VST plugin formats.
775  @see d_cconst()
776  */
777  virtual int64_t getUniqueId() const = 0;
778 
779  /* --------------------------------------------------------------------------------------------------------
780  * Init */
781 
782  /**
783  Initialize the audio port @a index.@n
784  This function will be called once, shortly after the plugin is created.
785  */
786  virtual void initAudioPort(bool input, uint32_t index, AudioPort& port);
787 
788  /**
789  Initialize the parameter @a index.@n
790  This function will be called once, shortly after the plugin is created.
791  */
792  virtual void initParameter(uint32_t index, Parameter& parameter) = 0;
793 
794 #if DISTRHO_PLUGIN_WANT_PROGRAMS
795  /**
796  Set the name of the program @a index.@n
797  This function will be called once, shortly after the plugin is created.@n
798  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_PROGRAMS is enabled.
799  */
800  virtual void initProgramName(uint32_t index, String& programName) = 0;
801 #endif
802 
803 #if DISTRHO_PLUGIN_WANT_STATE
804  /**
805  Set the state key and default value of @a index.@n
806  This function will be called once, shortly after the plugin is created.@n
807  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_STATE is enabled.
808  */
809  virtual void initState(uint32_t index, String& stateKey, String& defaultStateValue) = 0;
810 #endif
811 
812  /* --------------------------------------------------------------------------------------------------------
813  * Internal data */
814 
815  /**
816  Get the current value of a parameter.@n
817  The host may call this function from any context, including realtime processing.
818  */
819  virtual float getParameterValue(uint32_t index) const = 0;
820 
821  /**
822  Change a parameter value.@n
823  The host may call this function from any context, including realtime processing.@n
824  When a parameter is marked as automable, you must ensure no non-realtime operations are performed.
825  @note This function will only be called for parameter inputs.
826  */
827  virtual void setParameterValue(uint32_t index, float value) = 0;
828 
829 #if DISTRHO_PLUGIN_WANT_PROGRAMS
830  /**
831  Load a program.@n
832  The host may call this function from any context, including realtime processing.@n
833  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_PROGRAMS is enabled.
834  */
835  virtual void loadProgram(uint32_t index) = 0;
836 #endif
837 
838 #if DISTRHO_PLUGIN_WANT_FULL_STATE
839  /**
840  Get the value of an internal state.@n
841  The host may call this function from any non-realtime context.@n
842  Must be implemented by your plugin class if DISTRHO_PLUGIN_WANT_FULL_STATE is enabled.
843  @note The use of this function breaks compatibility with the DSSI format.
844  */
845  virtual String getState(const char* key) const = 0;
846 #endif
847 
848 #if DISTRHO_PLUGIN_WANT_STATE
849  /**
850  Change an internal state @a key to @a value.@n
851  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_STATE is enabled.
852  */
853  virtual void setState(const char* key, const char* value) = 0;
854 #endif
855 
856  /* --------------------------------------------------------------------------------------------------------
857  * Audio/MIDI Processing */
858 
859  /**
860  Activate this plugin.
861  */
862  virtual void activate() {}
863 
864  /**
865  Deactivate this plugin.
866  */
867  virtual void deactivate() {}
868 
869 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
870  /**
871  Run/process function for plugins with MIDI input.
872  @note Some parameters might be null if there are no audio inputs/outputs or MIDI events.
873  */
874  virtual void run(const float** inputs, float** outputs, uint32_t frames,
875  const MidiEvent* midiEvents, uint32_t midiEventCount) = 0;
876 #else
877  /**
878  Run/process function for plugins without MIDI input.
879  @note Some parameters might be null if there are no audio inputs or outputs.
880  */
881  virtual void run(const float** inputs, float** outputs, uint32_t frames) = 0;
882 #endif
883 
884  /* --------------------------------------------------------------------------------------------------------
885  * Callbacks (optional) */
886 
887  /**
888  Optional callback to inform the plugin about a buffer size change.@n
889  This function will only be called when the plugin is deactivated.
890  @note This value is only a hint!@n
891  Hosts might call run() with a higher or lower number of frames.
892  @see getBufferSize()
893  */
894  virtual void bufferSizeChanged(uint32_t newBufferSize);
895 
896  /**
897  Optional callback to inform the plugin about a sample rate change.@n
898  This function will only be called when the plugin is deactivated.
899  @see getSampleRate()
900  */
901  virtual void sampleRateChanged(double newSampleRate);
902 
903  // -------------------------------------------------------------------------------------------------------
904 
905 private:
906  struct PrivateData;
907  PrivateData* const pData;
908  friend class PluginExporter;
909 
910  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Plugin)
911 };
912 
913 /** @} */
914 
915 /* ------------------------------------------------------------------------------------------------------------
916  * Create plugin, entry point */
917 
918 /**
919  @defgroup EntryPoints Entry Points
920  @{
921  */
922 
923 /**
924  TODO.
925  */
926 extern Plugin* createPlugin();
927 
928 /** @} */
929 
930 // -----------------------------------------------------------------------------------------------------------
931 
932 END_NAMESPACE_DISTRHO
933 
934 #endif // DISTRHO_PLUGIN_HPP_INCLUDED
float min
Definition: DistrhoPlugin.hpp:184
Definition: DistrhoPlugin.hpp:114
ParameterDesignation designation
Definition: DistrhoPlugin.hpp:417
-
virtual void activate()
Definition: DistrhoPlugin.hpp:836
+
virtual void activate()
Definition: DistrhoPlugin.hpp:862
void initDesignation(ParameterDesignation d) noexcept
Definition: DistrhoPlugin.hpp:456
uint8_t midiCC
Definition: DistrhoPlugin.hpp:425
Parameter() noexcept
Definition: DistrhoPlugin.hpp:430
@@ -78,10 +78,11 @@ $(function() {
uint32_t size
Definition: DistrhoPlugin.hpp:495
String name
Definition: DistrhoPlugin.hpp:126
String symbol
Definition: DistrhoPlugin.hpp:393
+
void clear() noexcept
Definition: DistrhoPlugin.hpp:622
String symbol
Definition: DistrhoPlugin.hpp:134
void fixValue(float &value) const noexcept
Definition: DistrhoPlugin.hpp:218
ParameterEnumerationValue() noexcept
Definition: DistrhoPlugin.hpp:305
-
virtual void deactivate()
Definition: DistrhoPlugin.hpp:841
+
virtual void deactivate()
Definition: DistrhoPlugin.hpp:867
Definition: DistrhoPlugin.hpp:159
ParameterEnumerationValues(uint32_t c, bool r, const ParameterEnumerationValue *v) noexcept
Definition: DistrhoPlugin.hpp:352
double ticksPerBeat
Definition: DistrhoPlugin.hpp:573
@@ -98,14 +99,15 @@ $(function() {
uint8_t count
Definition: DistrhoPlugin.hpp:325
float value
Definition: DistrhoPlugin.hpp:295
uint32_t hints
Definition: DistrhoPlugin.hpp:378
-
Definition: DistrhoPlugin.hpp:640
+
void clear() noexcept
Definition: DistrhoPlugin.hpp:597
+
Definition: DistrhoPlugin.hpp:666
float getUnnormalizedValue(const float &value) const noexcept
Definition: DistrhoPlugin.hpp:275
bool playing
Definition: DistrhoPlugin.hpp:516
int32_t tick
Definition: DistrhoPlugin.hpp:552
float beatsPerBar
Definition: DistrhoPlugin.hpp:562
uint32_t hints
Definition: DistrhoPlugin.hpp:119
-
virtual const char * getHomePage() const
Definition: DistrhoPlugin.hpp:732
-
TimePosition() noexcept
Definition: DistrhoPlugin.hpp:598
+
virtual const char * getHomePage() const
Definition: DistrhoPlugin.hpp:758
+
TimePosition() noexcept
Definition: DistrhoPlugin.hpp:614
ParameterEnumerationValues enumValues
Definition: DistrhoPlugin.hpp:412
uint64_t frame
Definition: DistrhoPlugin.hpp:521
BarBeatTick() noexcept
Definition: DistrhoPlugin.hpp:583
@@ -120,13 +122,13 @@ $(function() {
ParameterRanges ranges
Definition: DistrhoPlugin.hpp:406
AudioPort() noexcept
Definition: DistrhoPlugin.hpp:139
int32_t beat
Definition: DistrhoPlugin.hpp:545
-
virtual const char * getName() const
Definition: DistrhoPlugin.hpp:709
+
virtual const char * getName() const
Definition: DistrhoPlugin.hpp:735
const float & getFixedValue(const float &value) const noexcept
Definition: DistrhoPlugin.hpp:229
static const uint32_t kParameterIsBoolean
Definition: DistrhoPlugin.hpp:70
float max
Definition: DistrhoPlugin.hpp:189
Definition: DistrhoPlugin.hpp:175
String label
Definition: DistrhoPlugin.hpp:300
-
virtual const char * getDescription() const
Definition: DistrhoPlugin.hpp:721
+
virtual const char * getDescription() const
Definition: DistrhoPlugin.hpp:747
String unit
Definition: DistrhoPlugin.hpp:400
static const uint32_t kParameterIsInteger
Definition: DistrhoPlugin.hpp:75
Definition: DistrhoPlugin.hpp:165
@@ -147,7 +149,7 @@ $(function() {
diff --git a/DistrhoUI_8hpp_source.html b/DistrhoUI_8hpp_source.html index df2024f1..f41aae03 100644 --- a/DistrhoUI_8hpp_source.html +++ b/DistrhoUI_8hpp_source.html @@ -66,10 +66,9 @@ $(function() {
DistrhoUI.hpp
-
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 
17 #ifndef DISTRHO_UI_HPP_INCLUDED
18 #define DISTRHO_UI_HPP_INCLUDED
19 
20 #include "extra/LeakDetector.hpp"
21 #include "src/DistrhoPluginChecks.h"
22 
23 #ifndef HAVE_DGL
24 # include "extra/ExternalWindow.hpp"
25 typedef DISTRHO_NAMESPACE::ExternalWindow UIWidget;
26 #elif DISTRHO_UI_USE_NANOVG
27 # include "../dgl/NanoVG.hpp"
28 typedef DGL_NAMESPACE::NanoWidget UIWidget;
29 #else
30 # include "../dgl/Widget.hpp"
31 typedef DGL_NAMESPACE::Widget UIWidget;
32 #endif
33 
34 START_NAMESPACE_DISTRHO
35 
36 /* ------------------------------------------------------------------------------------------------------------
37  * DPF UI */
38 
39 /**
40  @addtogroup MainClasses
41  @{
42  */
43 
44 /**
45  DPF UI class from where UI instances are created.
46 
47  @note You must call setSize during construction,
48  @TODO Detailed information about this class.
49  */
50 class UI : public UIWidget
51 {
52 public:
53  /**
54  UI class constructor.
55  The UI should be initialized to a default state that matches the plugin side.
56  */
57  UI(uint width = 0, uint height = 0);
58 
59  /**
60  Destructor.
61  */
62  virtual ~UI();
63 
64  /* --------------------------------------------------------------------------------------------------------
65  * Host state */
66 
67  /**
68  Get the current sample rate used in plugin processing.
69  @see sampleRateChanged(double)
70  */
71  double getSampleRate() const noexcept;
72 
73  /**
74  editParameter.
75  @TODO Document this.
76  */
77  void editParameter(uint32_t index, bool started);
78 
79  /**
80  setParameterValue.
81  @TODO Document this.
82  */
83  void setParameterValue(uint32_t index, float value);
84 
85 #if DISTRHO_PLUGIN_WANT_STATE
86  /**
87  setState.
88  @TODO Document this.
89  */
90  void setState(const char* key, const char* value);
91 #endif
92 
93 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
94  /**
95  sendNote.
96  @TODO Document this.
97  @note Work in progress. Implemented for DSSI and LV2 formats.
98  */
99  void sendNote(uint8_t channel, uint8_t note, uint8_t velocity);
100 #endif
101 
102 #if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
103  /* --------------------------------------------------------------------------------------------------------
104  * Direct DSP access - DO NOT USE THIS UNLESS STRICTLY NECESSARY!! */
105 
106  /**
107  getPluginInstancePointer.
108  @TODO Document this.
109  */
110  void* getPluginInstancePointer() const noexcept;
111 #endif
112 
113 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
114  /* --------------------------------------------------------------------------------------------------------
115  * External UI helpers */
116 
117  /**
118  Get the bundle path that will be used for the next UI.
119  @note: This function is only valid during createUI(),
120  it will return null when called from anywhere else.
121  */
122  static const char* getNextBundlePath() noexcept;
123 
124 # if DISTRHO_PLUGIN_HAS_EMBED_UI
125  /**
126  Get the Window Id that will be used for the next created window.
127  @note: This function is only valid during createUI(),
128  it will return 0 when called from anywhere else.
129  */
130  static uintptr_t getNextWindowId() noexcept;
131 # endif
132 #endif
133 
134 protected:
135  /* --------------------------------------------------------------------------------------------------------
136  * DSP/Plugin Callbacks */
137 
138  /**
139  A parameter has changed on the plugin side.@n
140  This is called by the host to inform the UI about parameter changes.
141  */
142  virtual void parameterChanged(uint32_t index, float value) = 0;
143 
144 #if DISTRHO_PLUGIN_WANT_PROGRAMS
145  /**
146  A program has been loaded on the plugin side.@n
147  This is called by the host to inform the UI about program changes.
148  */
149  virtual void programLoaded(uint32_t index) = 0;
150 #endif
151 
152 #if DISTRHO_PLUGIN_WANT_STATE
153  /**
154  A state has changed on the plugin side.@n
155  This is called by the host to inform the UI about state changes.
156  */
157  virtual void stateChanged(const char* key, const char* value) = 0;
158 #endif
159 
160  /* --------------------------------------------------------------------------------------------------------
161  * DSP/Plugin Callbacks (optional) */
162 
163  /**
164  Optional callback to inform the UI about a sample rate change on the plugin side.
165  @see getSampleRate()
166  */
167  virtual void sampleRateChanged(double newSampleRate);
168 
169 #ifdef HAVE_DGL
170  /* --------------------------------------------------------------------------------------------------------
171  * UI Callbacks (optional) */
172 
173  /**
174  uiIdle.
175  @TODO Document this.
176  */
177  virtual void uiIdle() {}
178 
179 #ifndef DGL_FILE_BROWSER_DISABLED
180  /**
181  File browser selected function.
182  @see Window::fileBrowserSelected(const char*)
183  */
184  virtual void uiFileBrowserSelected(const char* filename);
185 #endif
186 
187  /**
188  OpenGL window reshape function, called when parent window is resized.
189  You can reimplement this function for a custom OpenGL state.
190  @see Window::onReshape(uint,uint)
191  */
192  virtual void uiReshape(uint width, uint height);
193 
194  /* --------------------------------------------------------------------------------------------------------
195  * UI Resize Handling, internal */
196 
197  /**
198  OpenGL widget resize function, called when the widget is resized.
199  This is overriden here so the host knows when the UI is resized by you.
200  @see Widget::onResize(const ResizeEvent&)
201  */
202  void onResize(const ResizeEvent& ev) override;
203 #endif
204 
205  // -------------------------------------------------------------------------------------------------------
206 
207 private:
208  struct PrivateData;
209  PrivateData* const pData;
210  friend class UIExporter;
211  friend class UIExporterWindow;
212 
213 #ifdef HAVE_DGL
214  // these should not be used
215  void setAbsoluteX(int) const noexcept {}
216  void setAbsoluteY(int) const noexcept {}
217  void setAbsolutePos(int, int) const noexcept {}
218  void setAbsolutePos(const DGL_NAMESPACE::Point<int>&) const noexcept {}
219 #endif
220 
221  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(UI)
222 };
223 
224 /** @} */
225 
226 /* ------------------------------------------------------------------------------------------------------------
227  * Create UI, entry point */
228 
229 /**
230  @addtogroup EntryPoints
231  @{
232  */
233 
234 /**
235  createUI.
236  @TODO Document this.
237  */
238 extern UI* createUI();
239 
240 /** @} */
241 
242 // -----------------------------------------------------------------------------------------------------------
243 
244 END_NAMESPACE_DISTRHO
245 
246 #endif // DISTRHO_UI_HPP_INCLUDED
void editParameter(uint32_t index, bool started)
+
1 /*
2  * DISTRHO Plugin Framework (DPF)
3  * Copyright (C) 2012-2019 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_UI_HPP_INCLUDED
18 #define DISTRHO_UI_HPP_INCLUDED
19 
20 #include "extra/LeakDetector.hpp"
21 #include "src/DistrhoPluginChecks.h"
22 
23 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
24 # include "../dgl/Base.hpp"
25 # include "extra/ExternalWindow.hpp"
26 typedef DISTRHO_NAMESPACE::ExternalWindow UIWidget;
27 #elif DISTRHO_UI_USE_NANOVG
28 # include "../dgl/NanoVG.hpp"
29 typedef DGL_NAMESPACE::NanoWidget UIWidget;
30 #else
31 # include "../dgl/Widget.hpp"
32 typedef DGL_NAMESPACE::Widget UIWidget;
33 #endif
34 
35 START_NAMESPACE_DISTRHO
36 
37 /* ------------------------------------------------------------------------------------------------------------
38  * DPF UI */
39 
40 /**
41  @addtogroup MainClasses
42  @{
43  */
44 
45 /**
46  DPF UI class from where UI instances are created.
47 
48  @note You must call setSize during construction,
49  @TODO Detailed information about this class.
50  */
51 class UI : public UIWidget
52 {
53 public:
54  /**
55  UI class constructor.
56  The UI should be initialized to a default state that matches the plugin side.
57  */
58  UI(uint width = 0, uint height = 0);
59 
60  /**
61  Destructor.
62  */
63  virtual ~UI();
64 
65 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
66  /**
67  Set geometry constraints for the UI when resized by the user, and optionally scale UI automatically.
68  @see Window::setGeometryConstraints(uint,uint,bool)
69  @see Window::setScaling(double)
70  */
71  void setGeometryConstraints(uint minWidth, uint minHeight, bool keepAspectRatio, bool automaticallyScale = false);
72 #endif
73 
74  /* --------------------------------------------------------------------------------------------------------
75  * Host state */
76 
77  /**
78  Get the current sample rate used in plugin processing.
79  @see sampleRateChanged(double)
80  */
81  double getSampleRate() const noexcept;
82 
83  /**
84  editParameter.
85  @TODO Document this.
86  */
87  void editParameter(uint32_t index, bool started);
88 
89  /**
90  setParameterValue.
91  @TODO Document this.
92  */
93  void setParameterValue(uint32_t index, float value);
94 
95 #if DISTRHO_PLUGIN_WANT_STATE
96  /**
97  setState.
98  @TODO Document this.
99  */
100  void setState(const char* key, const char* value);
101 #endif
102 
103 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
104  /**
105  sendNote.
106  @TODO Document this.
107  @note Work in progress. Implemented for DSSI and LV2 formats.
108  */
109  void sendNote(uint8_t channel, uint8_t note, uint8_t velocity);
110 #endif
111 
112 #if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
113  /* --------------------------------------------------------------------------------------------------------
114  * Direct DSP access - DO NOT USE THIS UNLESS STRICTLY NECESSARY!! */
115 
116  /**
117  getPluginInstancePointer.
118  @TODO Document this.
119  */
120  void* getPluginInstancePointer() const noexcept;
121 #endif
122 
123 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
124  /* --------------------------------------------------------------------------------------------------------
125  * External UI helpers */
126 
127  /**
128  Get the bundle path that will be used for the next UI.
129  @note: This function is only valid during createUI(),
130  it will return null when called from anywhere else.
131  */
132  static const char* getNextBundlePath() noexcept;
133 
134 # if DISTRHO_PLUGIN_HAS_EMBED_UI
135  /**
136  Get the Window Id that will be used for the next created window.
137  @note: This function is only valid during createUI(),
138  it will return 0 when called from anywhere else.
139  */
140  static uintptr_t getNextWindowId() noexcept;
141 # endif
142 #endif
143 
144 protected:
145  /* --------------------------------------------------------------------------------------------------------
146  * DSP/Plugin Callbacks */
147 
148  /**
149  A parameter has changed on the plugin side.@n
150  This is called by the host to inform the UI about parameter changes.
151  */
152  virtual void parameterChanged(uint32_t index, float value) = 0;
153 
154 #if DISTRHO_PLUGIN_WANT_PROGRAMS
155  /**
156  A program has been loaded on the plugin side.@n
157  This is called by the host to inform the UI about program changes.
158  */
159  virtual void programLoaded(uint32_t index) = 0;
160 #endif
161 
162 #if DISTRHO_PLUGIN_WANT_STATE
163  /**
164  A state has changed on the plugin side.@n
165  This is called by the host to inform the UI about state changes.
166  */
167  virtual void stateChanged(const char* key, const char* value) = 0;
168 #endif
169 
170  /* --------------------------------------------------------------------------------------------------------
171  * DSP/Plugin Callbacks (optional) */
172 
173  /**
174  Optional callback to inform the UI about a sample rate change on the plugin side.
175  @see getSampleRate()
176  */
177  virtual void sampleRateChanged(double newSampleRate);
178 
179 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
180  /* --------------------------------------------------------------------------------------------------------
181  * UI Callbacks (optional) */
182 
183  /**
184  uiIdle.
185  @TODO Document this.
186  */
187  virtual void uiIdle() {}
188 
189 # ifndef DGL_FILE_BROWSER_DISABLED
190  /**
191  File browser selected function.
192  @see Window::fileBrowserSelected(const char*)
193  */
194  virtual void uiFileBrowserSelected(const char* filename);
195 # endif
196 
197  /**
198  OpenGL window reshape function, called when parent window is resized.
199  You can reimplement this function for a custom OpenGL state.
200  @see Window::onReshape(uint,uint)
201  */
202  virtual void uiReshape(uint width, uint height);
203 
204  /* --------------------------------------------------------------------------------------------------------
205  * UI Resize Handling, internal */
206 
207  /**
208  OpenGL widget resize function, called when the widget is resized.
209  This is overriden here so the host knows when the UI is resized by you.
210  @see Widget::onResize(const ResizeEvent&)
211  */
212  void onResize(const ResizeEvent& ev) override;
213 #endif
214 
215  // -------------------------------------------------------------------------------------------------------
216 
217 private:
218  struct PrivateData;
219  PrivateData* const pData;
220  friend class UIExporter;
221  friend class UIExporterWindow;
222 
223 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
224  // these should not be used
225  void setAbsoluteX(int) const noexcept {}
226  void setAbsoluteY(int) const noexcept {}
227  void setAbsolutePos(int, int) const noexcept {}
228  void setAbsolutePos(const DGL_NAMESPACE::Point<int>&) const noexcept {}
229 #endif
230 
231  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(UI)
232 };
233 
234 /** @} */
235 
236 /* ------------------------------------------------------------------------------------------------------------
237  * Create UI, entry point */
238 
239 /**
240  @addtogroup EntryPoints
241  @{
242  */
243 
244 /**
245  createUI.
246  @TODO Document this.
247  */
248 extern UI* createUI();
249 
250 /** @} */
251 
252 // -----------------------------------------------------------------------------------------------------------
253 
254 END_NAMESPACE_DISTRHO
255 
256 #endif // DISTRHO_UI_HPP_INCLUDED
void editParameter(uint32_t index, bool started)
virtual void parameterChanged(uint32_t index, float value)=0
static uintptr_t getNextWindowId() noexcept
-
void onResize(const ResizeEvent &ev) override
virtual ~UI()
void setParameterValue(uint32_t index, float value)
void * getPluginInstancePointer() const noexcept
@@ -82,14 +81,11 @@ $(function() {
virtual void stateChanged(const char *key, const char *value)=0
double getSampleRate() const noexcept
void setState(const char *key, const char *value)
-
virtual void uiFileBrowserSelected(const char *filename)
-
virtual void uiReshape(uint width, uint height)
-
Definition: DistrhoUI.hpp:50
-
virtual void uiIdle()
Definition: DistrhoUI.hpp:177
+
Definition: DistrhoUI.hpp:51
diff --git a/DistrhoUtils_8hpp_source.html b/DistrhoUtils_8hpp_source.html index a32ca1d6..0d9e7a9b 100644 --- a/DistrhoUtils_8hpp_source.html +++ b/DistrhoUtils_8hpp_source.html @@ -70,7 +70,7 @@ $(function() {
diff --git a/ExternalWindow_8hpp_source.html b/ExternalWindow_8hpp_source.html index 66a27b7d..7bf553a1 100644 --- a/ExternalWindow_8hpp_source.html +++ b/ExternalWindow_8hpp_source.html @@ -66,12 +66,12 @@ $(function() {
ExternalWindow.hpp
-
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 
17 #ifndef DISTRHO_EXTERNAL_WINDOW_HPP_INCLUDED
18 #define DISTRHO_EXTERNAL_WINDOW_HPP_INCLUDED
19 
20 #include "String.hpp"
21 
22 #ifdef DISTRHO_OS_WINDOWS
23 # error Unsupported platform!
24 #else
25 # include <cerrno>
26 # include <signal.h>
27 # include <sys/wait.h>
28 # include <unistd.h>
29 #endif
30 
31 START_NAMESPACE_DISTRHO
32 
33 // -----------------------------------------------------------------------
34 // ExternalWindow class
35 
37 {
38 public:
39  ExternalWindow(const uint w = 1, const uint h = 1, const char* const t = "")
40  : width(w),
41  height(h),
42  title(t),
43  pid(0) {}
44 
45  virtual ~ExternalWindow()
46  {
47  terminateAndWaitForProcess();
48  }
49 
50  uint getWidth() const noexcept
51  {
52  return width;
53  }
54 
55  uint getHeight() const noexcept
56  {
57  return height;
58  }
59 
60  const char* getTitle() const noexcept
61  {
62  return title;
63  }
64 
65  void setTitle(const char* const t) noexcept
66  {
67  title = t;
68  }
69 
70  bool isRunning() noexcept
71  {
72  if (pid <= 0)
73  return false;
74 
75  const pid_t p = ::waitpid(pid, nullptr, WNOHANG);
76 
77  if (p == pid || (p == -1 && errno == ECHILD))
78  {
79  printf("NOTICE: Child process exited while idle\n");
80  pid = 0;
81  return false;
82  }
83 
84  return true;
85  }
86 
87 protected:
88  bool startExternalProcess(const char* args[])
89  {
90  terminateAndWaitForProcess();
91 
92  pid = vfork();
93 
94  switch (pid)
95  {
96  case 0:
97  execvp(args[0], (char**)args);
98  _exit(1);
99  return false;
100 
101  case -1:
102  printf("Could not start external ui\n");
103  return false;
104 
105  default:
106  return true;
107  }
108  }
109 
110 private:
111  uint width;
112  uint height;
113  String title;
114  pid_t pid;
115 
116  friend class UIExporter;
117 
118  void terminateAndWaitForProcess()
119  {
120  if (pid <= 0)
121  return;
122 
123  printf("Waiting for previous process to stop,,,\n");
124 
125  bool sendTerm = true;
126 
127  for (pid_t p;;)
128  {
129  p = ::waitpid(pid, nullptr, WNOHANG);
130 
131  switch (p)
132  {
133  case 0:
134  if (sendTerm)
135  {
136  sendTerm = false;
137  ::kill(pid, SIGTERM);
138  }
139  break;
140 
141  case -1:
142  if (errno == ECHILD)
143  {
144  printf("Done! (no such process)\n");
145  pid = 0;
146  return;
147  }
148  break;
149 
150  default:
151  if (p == pid)
152  {
153  printf("Done! (clean wait)\n");
154  pid = 0;
155  return;
156  }
157  break;
158  }
159 
160  // 5 msec
161  usleep(5*1000);
162  }
163  }
164 
165  DISTRHO_DECLARE_NON_COPY_CLASS(ExternalWindow)
166 };
167 
168 // -----------------------------------------------------------------------
169 
170 END_NAMESPACE_DISTRHO
171 
172 #endif // DISTRHO_EXTERNAL_WINDOW_HPP_INCLUDED
Definition: ExternalWindow.hpp:36
+
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 
17 #ifndef DISTRHO_EXTERNAL_WINDOW_HPP_INCLUDED
18 #define DISTRHO_EXTERNAL_WINDOW_HPP_INCLUDED
19 
20 #include "String.hpp"
21 
22 #ifdef DISTRHO_OS_WINDOWS
23 # error Unsupported platform!
24 #else
25 # include <cerrno>
26 # include <signal.h>
27 # include <sys/wait.h>
28 # include <unistd.h>
29 #endif
30 
31 START_NAMESPACE_DISTRHO
32 
33 // -----------------------------------------------------------------------
34 // ExternalWindow class
35 
37 {
38 public:
39  ExternalWindow(const uint w = 1, const uint h = 1, const char* const t = "")
40  : width(w),
41  height(h),
42  title(t),
43  transientWinId(0),
44  visible(false),
45  pid(0) {}
46 
47  virtual ~ExternalWindow()
48  {
49  terminateAndWaitForProcess();
50  }
51 
52  uint getWidth() const noexcept
53  {
54  return width;
55  }
56 
57  uint getHeight() const noexcept
58  {
59  return height;
60  }
61 
62  const char* getTitle() const noexcept
63  {
64  return title;
65  }
66 
67  uintptr_t getTransientWinId() const noexcept
68  {
69  return transientWinId;
70  }
71 
72  bool isVisible() const noexcept
73  {
74  return visible;
75  }
76 
77  bool isRunning() noexcept
78  {
79  if (pid <= 0)
80  return false;
81 
82  const pid_t p = ::waitpid(pid, nullptr, WNOHANG);
83 
84  if (p == pid || (p == -1 && errno == ECHILD))
85  {
86  printf("NOTICE: Child process exited while idle\n");
87  pid = 0;
88  return false;
89  }
90 
91  return true;
92  }
93 
94  virtual void setSize(uint w, uint h)
95  {
96  width = w;
97  height = h;
98  }
99 
100  virtual void setTitle(const char* const t)
101  {
102  title = t;
103  }
104 
105  virtual void setTransientWinId(const uintptr_t winId)
106  {
107  transientWinId = winId;
108  }
109 
110  virtual void setVisible(const bool yesNo)
111  {
112  visible = yesNo;
113  }
114 
115 protected:
116  bool startExternalProcess(const char* args[])
117  {
118  terminateAndWaitForProcess();
119 
120  pid = vfork();
121 
122  switch (pid)
123  {
124  case 0:
125  execvp(args[0], (char**)args);
126  _exit(1);
127  return false;
128 
129  case -1:
130  printf("Could not start external ui\n");
131  return false;
132 
133  default:
134  return true;
135  }
136  }
137 
138  void terminateAndWaitForProcess()
139  {
140  if (pid <= 0)
141  return;
142 
143  printf("Waiting for previous process to stop,,,\n");
144 
145  bool sendTerm = true;
146 
147  for (pid_t p;;)
148  {
149  p = ::waitpid(pid, nullptr, WNOHANG);
150 
151  switch (p)
152  {
153  case 0:
154  if (sendTerm)
155  {
156  sendTerm = false;
157  ::kill(pid, SIGTERM);
158  }
159  break;
160 
161  case -1:
162  if (errno == ECHILD)
163  {
164  printf("Done! (no such process)\n");
165  pid = 0;
166  return;
167  }
168  break;
169 
170  default:
171  if (p == pid)
172  {
173  printf("Done! (clean wait)\n");
174  pid = 0;
175  return;
176  }
177  break;
178  }
179 
180  // 5 msec
181  usleep(5*1000);
182  }
183  }
184 
185 private:
186  uint width;
187  uint height;
188  String title;
189  uintptr_t transientWinId;
190  bool visible;
191  pid_t pid;
192 
193  friend class UIExporter;
194 
195  DISTRHO_DECLARE_NON_COPY_CLASS(ExternalWindow)
196 };
197 
198 // -----------------------------------------------------------------------
199 
200 END_NAMESPACE_DISTRHO
201 
202 #endif // DISTRHO_EXTERNAL_WINDOW_HPP_INCLUDED
Definition: ExternalWindow.hpp:36
Definition: String.hpp:29
diff --git a/Geometry_8hpp_source.html b/Geometry_8hpp_source.html index e3547acd..fa328ec3 100644 --- a/Geometry_8hpp_source.html +++ b/Geometry_8hpp_source.html @@ -84,7 +84,7 @@ $(function() {
diff --git a/ImageAboutWindow_8hpp_source.html b/ImageAboutWindow_8hpp_source.html deleted file mode 100644 index 0ad07839..00000000 --- a/ImageAboutWindow_8hpp_source.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: dgl/ImageAboutWindow.hpp Source File - - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - -
-
- - -
- -
- - -
-
-
-
ImageAboutWindow.hpp
-
-
-
1 /*
-
2  * DISTRHO Plugin Framework (DPF)
-
3  * Copyright (C) 2012-2015 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 DGL_IMAGE_ABOUT_WINDOW_HPP_INCLUDED
-
18 #define DGL_IMAGE_ABOUT_WINDOW_HPP_INCLUDED
-
19 
-
20 #warning This is a deprecated file, please include ImageWidgets.hpp instead.
-
21 #include "ImageWidgets.hpp"
-
22 
-
23 #endif // DGL_IMAGE_ABOUT_WINDOW_HPP_INCLUDED
-
- - - - diff --git a/ImageButton_8hpp_source.html b/ImageButton_8hpp_source.html deleted file mode 100644 index 42a4bda3..00000000 --- a/ImageButton_8hpp_source.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: dgl/ImageButton.hpp Source File - - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - -
-
- - -
- -
- - -
-
-
-
ImageButton.hpp
-
-
-
1 /*
-
2  * DISTRHO Plugin Framework (DPF)
-
3  * Copyright (C) 2012-2015 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 DGL_IMAGE_BUTTON_HPP_INCLUDED
-
18 #define DGL_IMAGE_BUTTON_HPP_INCLUDED
-
19 
-
20 #warning This is a deprecated file, please include ImageWidgets.hpp instead.
-
21 #include "ImageWidgets.hpp"
-
22 
-
23 #endif // DGL_IMAGE_BUTTON_HPP_INCLUDED
-
- - - - diff --git a/ImageKnob_8hpp_source.html b/ImageKnob_8hpp_source.html deleted file mode 100644 index 991d182d..00000000 --- a/ImageKnob_8hpp_source.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: dgl/ImageKnob.hpp Source File - - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - -
-
- - -
- -
- - -
-
-
-
ImageKnob.hpp
-
-
-
1 /*
-
2  * DISTRHO Plugin Framework (DPF)
-
3  * Copyright (C) 2012-2015 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 DGL_IMAGE_KNOB_HPP_INCLUDED
-
18 #define DGL_IMAGE_KNOB_HPP_INCLUDED
-
19 
-
20 #warning This is a deprecated file, please include ImageWidgets.hpp instead.
-
21 #include "ImageWidgets.hpp"
-
22 
-
23 #endif // DGL_IMAGE_KNOB_HPP_INCLUDED
-
- - - - diff --git a/ImageSlider_8hpp_source.html b/ImageSlider_8hpp_source.html deleted file mode 100644 index ab0dfa43..00000000 --- a/ImageSlider_8hpp_source.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: dgl/ImageSlider.hpp Source File - - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - -
-
- - -
- -
- - -
-
-
-
ImageSlider.hpp
-
-
-
1 /*
-
2  * DISTRHO Plugin Framework (DPF)
-
3  * Copyright (C) 2012-2015 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 DGL_IMAGE_SLIDER_HPP_INCLUDED
-
18 #define DGL_IMAGE_SLIDER_HPP_INCLUDED
-
19 
-
20 #warning This is a deprecated file, please include ImageWidgets.hpp instead.
-
21 #include "ImageWidgets.hpp"
-
22 
-
23 #endif // DGL_IMAGE_SLIDER_HPP_INCLUDED
-
- - - - diff --git a/ImageSwitch_8hpp_source.html b/ImageSwitch_8hpp_source.html deleted file mode 100644 index a490bd6b..00000000 --- a/ImageSwitch_8hpp_source.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: dgl/ImageSwitch.hpp Source File - - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - -
-
- - -
- -
- - -
-
-
-
ImageSwitch.hpp
-
-
-
1 /*
-
2  * DISTRHO Plugin Framework (DPF)
-
3  * Copyright (C) 2012-2015 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 DGL_IMAGE_SWITCH_HPP_INCLUDED
-
18 #define DGL_IMAGE_SWITCH_HPP_INCLUDED
-
19 
-
20 #warning This is a deprecated file, please include ImageWidgets.hpp instead.
-
21 #include "ImageWidgets.hpp"
-
22 
-
23 #endif // DGL_IMAGE_SWITCH_HPP_INCLUDED
-
- - - - diff --git a/ImageWidgets_8hpp_source.html b/ImageWidgets_8hpp_source.html index dd30b6e8..4f2256e3 100644 --- a/ImageWidgets_8hpp_source.html +++ b/ImageWidgets_8hpp_source.html @@ -66,36 +66,36 @@ $(function() {
ImageWidgets.hpp
-
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 
17 #ifndef DGL_IMAGE_WIDGETS_HPP_INCLUDED
18 #define DGL_IMAGE_WIDGETS_HPP_INCLUDED
19 
20 #include "Image.hpp"
21 #include "Widget.hpp"
22 #include "Window.hpp"
23 
24 START_NAMESPACE_DGL
25 
26 // -----------------------------------------------------------------------
27 
28 class ImageAboutWindow : public Window,
29  public Widget
30 {
31 public:
32  explicit ImageAboutWindow(Window& parent, const Image& image = Image());
33  explicit ImageAboutWindow(Widget* widget, const Image& image = Image());
34 
35  void setImage(const Image& image);
36 
37 protected:
38  void onDisplay() override;
39  bool onKeyboard(const KeyboardEvent&) override;
40  bool onMouse(const MouseEvent&) override;
41  void onReshape(uint width, uint height) override;
42 
43 private:
44  Image fImgBackground;
45 
46  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageAboutWindow)
47 };
48 
49 // -----------------------------------------------------------------------
50 
51 class ImageButton : public Widget
52 {
53 public:
54  class Callback
55  {
56  public:
57  virtual ~Callback() {}
58  virtual void imageButtonClicked(ImageButton* imageButton, int button) = 0;
59  };
60 
61  explicit ImageButton(Window& parent, const Image& image);
62  explicit ImageButton(Window& parent, const Image& imageNormal, const Image& imageDown);
63  explicit ImageButton(Window& parent, const Image& imageNormal, const Image& imageHover, const Image& imageDown);
64 
65  explicit ImageButton(Widget* widget, const Image& image);
66  explicit ImageButton(Widget* widget, const Image& imageNormal, const Image& imageDown);
67  explicit ImageButton(Widget* widget, const Image& imageNormal, const Image& imageHover, const Image& imageDown);
68 
69  ~ImageButton() override;
70 
71  void setCallback(Callback* callback) noexcept;
72 
73 protected:
74  void onDisplay() override;
75  bool onMouse(const MouseEvent&) override;
76  bool onMotion(const MotionEvent&) override;
77 
78 private:
79  struct PrivateData;
80  PrivateData* const pData;
81 
82  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageButton)
83 };
84 
85 // -----------------------------------------------------------------------
86 
87 class ImageKnob : public Widget
88 {
89 public:
90  enum Orientation {
91  Horizontal,
92  Vertical
93  };
94 
95  class Callback
96  {
97  public:
98  virtual ~Callback() {}
99  virtual void imageKnobDragStarted(ImageKnob* imageKnob) = 0;
100  virtual void imageKnobDragFinished(ImageKnob* imageKnob) = 0;
101  virtual void imageKnobValueChanged(ImageKnob* imageKnob, float value) = 0;
102  };
103 
104  explicit ImageKnob(Window& parent, const Image& image, Orientation orientation = Vertical) noexcept;
105  explicit ImageKnob(Widget* widget, const Image& image, Orientation orientation = Vertical) noexcept;
106  explicit ImageKnob(const ImageKnob& imageKnob);
107  ImageKnob& operator=(const ImageKnob& imageKnob);
108  ~ImageKnob() override;
109 
110  float getValue() const noexcept;
111 
112  void setDefault(float def) noexcept;
113  void setRange(float min, float max) noexcept;
114  void setStep(float step) noexcept;
115  void setValue(float value, bool sendCallback = false) noexcept;
116  void setUsingLogScale(bool yesNo) noexcept;
117 
118  void setCallback(Callback* callback) noexcept;
119  void setOrientation(Orientation orientation) noexcept;
120  void setRotationAngle(int angle);
121 
122  void setImageLayerCount(uint count) noexcept;
123 
124 protected:
125  void onDisplay() override;
126  bool onMouse(const MouseEvent&) override;
127  bool onMotion(const MotionEvent&) override;
128  bool onScroll(const ScrollEvent&) override;
129 
130 private:
131  Image fImage;
132  float fMinimum;
133  float fMaximum;
134  float fStep;
135  float fValue;
136  float fValueDef;
137  float fValueTmp;
138  bool fUsingDefault;
139  bool fUsingLog;
140  Orientation fOrientation;
141 
142  int fRotationAngle;
143  bool fDragging;
144  int fLastX;
145  int fLastY;
146 
147  Callback* fCallback;
148 
149  bool fIsImgVertical;
150  uint fImgLayerWidth;
151  uint fImgLayerHeight;
152  uint fImgLayerCount;
153  bool fIsReady;
154  GLuint fTextureId;
155 
156  float _logscale(float value) const;
157  float _invlogscale(float value) const;
158 
159  DISTRHO_LEAK_DETECTOR(ImageKnob)
160 };
161 
162 // -----------------------------------------------------------------------
163 
164 // note set range and step before setting the value
165 
166 class ImageSlider : public Widget
167 {
168 public:
169  class Callback
170  {
171  public:
172  virtual ~Callback() {}
173  virtual void imageSliderDragStarted(ImageSlider* imageSlider) = 0;
174  virtual void imageSliderDragFinished(ImageSlider* imageSlider) = 0;
175  virtual void imageSliderValueChanged(ImageSlider* imageSlider, float value) = 0;
176  };
177 
178  explicit ImageSlider(Window& parent, const Image& image) noexcept;
179  explicit ImageSlider(Widget* widget, const Image& image) noexcept;
180 
181  float getValue() const noexcept;
182  void setValue(float value, bool sendCallback = false) noexcept;
183 
184  void setStartPos(const Point<int>& startPos) noexcept;
185  void setStartPos(int x, int y) noexcept;
186  void setEndPos(const Point<int>& endPos) noexcept;
187  void setEndPos(int x, int y) noexcept;
188 
189  void setInverted(bool inverted) noexcept;
190  void setRange(float min, float max) noexcept;
191  void setStep(float step) noexcept;
192 
193  void setCallback(Callback* callback) noexcept;
194 
195 protected:
196  void onDisplay() override;
197  bool onMouse(const MouseEvent&) override;
198  bool onMotion(const MotionEvent&) override;
199 
200 private:
201  Image fImage;
202  float fMinimum;
203  float fMaximum;
204  float fStep;
205  float fValue;
206  float fValueTmp;
207 
208  bool fDragging;
209  bool fInverted;
210  bool fValueIsSet;
211  int fStartedX;
212  int fStartedY;
213 
214  Callback* fCallback;
215 
216  Point<int> fStartPos;
217  Point<int> fEndPos;
218  Rectangle<int> fSliderArea;
219 
220  void _recheckArea() noexcept;
221 
222  // these should not be used
223  void setAbsoluteX(int) const noexcept {}
224  void setAbsoluteY(int) const noexcept {}
225  void setAbsolutePos(int, int) const noexcept {}
226  void setAbsolutePos(const Point<int>&) const noexcept {}
227 
228  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageSlider)
229 };
230 
231 // -----------------------------------------------------------------------
232 
233 class ImageSwitch : public Widget
234 {
235 public:
236  class Callback
237  {
238  public:
239  virtual ~Callback() {}
240  virtual void imageSwitchClicked(ImageSwitch* imageButton, bool down) = 0;
241  };
242 
243  explicit ImageSwitch(Window& parent, const Image& imageNormal, const Image& imageDown) noexcept;
244  explicit ImageSwitch(Widget* widget, const Image& imageNormal, const Image& imageDown) noexcept;
245  explicit ImageSwitch(const ImageSwitch& imageSwitch) noexcept;
246  ImageSwitch& operator=(const ImageSwitch& imageSwitch) noexcept;
247 
248  bool isDown() const noexcept;
249  void setDown(bool down) noexcept;
250 
251  void setCallback(Callback* callback) noexcept;
252 
253 protected:
254  void onDisplay() override;
255  bool onMouse(const MouseEvent&) override;
256 
257 private:
258  Image fImageNormal;
259  Image fImageDown;
260  bool fIsDown;
261 
262  Callback* fCallback;
263 
264  DISTRHO_LEAK_DETECTOR(ImageSwitch)
265 };
266 
267 // -----------------------------------------------------------------------
268 
269 END_NAMESPACE_DGL
270 
271 #endif // DGL_IMAGE_WIDGETS_HPP_INCLUDED
Definition: ImageWidgets.hpp:28
+
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 
17 #ifndef DGL_IMAGE_WIDGETS_HPP_INCLUDED
18 #define DGL_IMAGE_WIDGETS_HPP_INCLUDED
19 
20 #include "Image.hpp"
21 #include "Widget.hpp"
22 #include "Window.hpp"
23 
24 START_NAMESPACE_DGL
25 
26 // -----------------------------------------------------------------------
27 
28 class ImageAboutWindow : public Window,
29  public Widget
30 {
31 public:
32  explicit ImageAboutWindow(Window& parent, const Image& image = Image());
33  explicit ImageAboutWindow(Widget* widget, const Image& image = Image());
34 
35  void setImage(const Image& image);
36 
37 protected:
38  void onDisplay() override;
39  bool onKeyboard(const KeyboardEvent&) override;
40  bool onMouse(const MouseEvent&) override;
41  void onReshape(uint width, uint height) override;
42 
43 private:
44  Image fImgBackground;
45 
46  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageAboutWindow)
47 };
48 
49 // -----------------------------------------------------------------------
50 
51 class ImageButton : public Widget
52 {
53 public:
54  class Callback
55  {
56  public:
57  virtual ~Callback() {}
58  virtual void imageButtonClicked(ImageButton* imageButton, int button) = 0;
59  };
60 
61  explicit ImageButton(Window& parent, const Image& image);
62  explicit ImageButton(Window& parent, const Image& imageNormal, const Image& imageDown);
63  explicit ImageButton(Window& parent, const Image& imageNormal, const Image& imageHover, const Image& imageDown);
64 
65  explicit ImageButton(Widget* widget, const Image& image);
66  explicit ImageButton(Widget* widget, const Image& imageNormal, const Image& imageDown);
67  explicit ImageButton(Widget* widget, const Image& imageNormal, const Image& imageHover, const Image& imageDown);
68 
69  ~ImageButton() override;
70 
71  void setCallback(Callback* callback) noexcept;
72 
73 protected:
74  void onDisplay() override;
75  bool onMouse(const MouseEvent&) override;
76  bool onMotion(const MotionEvent&) override;
77 
78 private:
79  struct PrivateData;
80  PrivateData* const pData;
81 
82  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageButton)
83 };
84 
85 // -----------------------------------------------------------------------
86 
87 class ImageKnob : public Widget
88 {
89 public:
90  enum Orientation {
91  Horizontal,
92  Vertical
93  };
94 
95  class Callback
96  {
97  public:
98  virtual ~Callback() {}
99  virtual void imageKnobDragStarted(ImageKnob* imageKnob) = 0;
100  virtual void imageKnobDragFinished(ImageKnob* imageKnob) = 0;
101  virtual void imageKnobValueChanged(ImageKnob* imageKnob, float value) = 0;
102  };
103 
104  explicit ImageKnob(Window& parent, const Image& image, Orientation orientation = Vertical) noexcept;
105  explicit ImageKnob(Widget* widget, const Image& image, Orientation orientation = Vertical) noexcept;
106  explicit ImageKnob(const ImageKnob& imageKnob);
107  ImageKnob& operator=(const ImageKnob& imageKnob);
108  ~ImageKnob() override;
109 
110  float getValue() const noexcept;
111 
112  void setDefault(float def) noexcept;
113  void setRange(float min, float max) noexcept;
114  void setStep(float step) noexcept;
115  void setValue(float value, bool sendCallback = false) noexcept;
116  void setUsingLogScale(bool yesNo) noexcept;
117 
118  void setCallback(Callback* callback) noexcept;
119  void setOrientation(Orientation orientation) noexcept;
120  void setRotationAngle(int angle);
121 
122  void setImageLayerCount(uint count) noexcept;
123 
124 protected:
125  void onDisplay() override;
126  bool onMouse(const MouseEvent&) override;
127  bool onMotion(const MotionEvent&) override;
128  bool onScroll(const ScrollEvent&) override;
129 
130 private:
131  Image fImage;
132  float fMinimum;
133  float fMaximum;
134  float fStep;
135  float fValue;
136  float fValueDef;
137  float fValueTmp;
138  bool fUsingDefault;
139  bool fUsingLog;
140  Orientation fOrientation;
141 
142  int fRotationAngle;
143  bool fDragging;
144  int fLastX;
145  int fLastY;
146 
147  Callback* fCallback;
148 
149  bool fIsImgVertical;
150  uint fImgLayerWidth;
151  uint fImgLayerHeight;
152  uint fImgLayerCount;
153  bool fIsReady;
154  GLuint fTextureId;
155 
156  float _logscale(float value) const;
157  float _invlogscale(float value) const;
158 
159  DISTRHO_LEAK_DETECTOR(ImageKnob)
160 };
161 
162 // -----------------------------------------------------------------------
163 
164 // note set range and step before setting the value
165 
166 class ImageSlider : public Widget
167 {
168 public:
169  class Callback
170  {
171  public:
172  virtual ~Callback() {}
173  virtual void imageSliderDragStarted(ImageSlider* imageSlider) = 0;
174  virtual void imageSliderDragFinished(ImageSlider* imageSlider) = 0;
175  virtual void imageSliderValueChanged(ImageSlider* imageSlider, float value) = 0;
176  };
177 
178  explicit ImageSlider(Window& parent, const Image& image) noexcept;
179  explicit ImageSlider(Widget* widget, const Image& image) noexcept;
180 
181  float getValue() const noexcept;
182  void setValue(float value, bool sendCallback = false) noexcept;
183  void setDefault(float def) noexcept;
184 
185  void setStartPos(const Point<int>& startPos) noexcept;
186  void setStartPos(int x, int y) noexcept;
187  void setEndPos(const Point<int>& endPos) noexcept;
188  void setEndPos(int x, int y) noexcept;
189 
190  void setInverted(bool inverted) noexcept;
191  void setRange(float min, float max) noexcept;
192  void setStep(float step) noexcept;
193 
194  void setCallback(Callback* callback) noexcept;
195 
196 protected:
197  void onDisplay() override;
198  bool onMouse(const MouseEvent&) override;
199  bool onMotion(const MotionEvent&) override;
200 
201 private:
202  Image fImage;
203  float fMinimum;
204  float fMaximum;
205  float fStep;
206  float fValue;
207  float fValueDef;
208  float fValueTmp;
209  bool fUsingDefault;
210 
211  bool fDragging;
212  bool fInverted;
213  bool fValueIsSet;
214  int fStartedX;
215  int fStartedY;
216 
217  Callback* fCallback;
218 
219  Point<int> fStartPos;
220  Point<int> fEndPos;
221  Rectangle<int> fSliderArea;
222 
223  void _recheckArea() noexcept;
224 
225  // these should not be used
226  void setAbsoluteX(int) const noexcept {}
227  void setAbsoluteY(int) const noexcept {}
228  void setAbsolutePos(int, int) const noexcept {}
229  void setAbsolutePos(const Point<int>&) const noexcept {}
230 
231  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageSlider)
232 };
233 
234 // -----------------------------------------------------------------------
235 
236 class ImageSwitch : public Widget
237 {
238 public:
239  class Callback
240  {
241  public:
242  virtual ~Callback() {}
243  virtual void imageSwitchClicked(ImageSwitch* imageSwitch, bool down) = 0;
244  };
245 
246  explicit ImageSwitch(Window& parent, const Image& imageNormal, const Image& imageDown) noexcept;
247  explicit ImageSwitch(Widget* widget, const Image& imageNormal, const Image& imageDown) noexcept;
248  explicit ImageSwitch(const ImageSwitch& imageSwitch) noexcept;
249  ImageSwitch& operator=(const ImageSwitch& imageSwitch) noexcept;
250 
251  bool isDown() const noexcept;
252  void setDown(bool down) noexcept;
253 
254  void setCallback(Callback* callback) noexcept;
255 
256 protected:
257  void onDisplay() override;
258  bool onMouse(const MouseEvent&) override;
259 
260 private:
261  Image fImageNormal;
262  Image fImageDown;
263  bool fIsDown;
264 
265  Callback* fCallback;
266 
267  DISTRHO_LEAK_DETECTOR(ImageSwitch)
268 };
269 
270 // -----------------------------------------------------------------------
271 
272 END_NAMESPACE_DGL
273 
274 #endif // DGL_IMAGE_WIDGETS_HPP_INCLUDED
Definition: ImageWidgets.hpp:28
virtual bool onScroll(const ScrollEvent &)
-
Definition: Window.hpp:34
+
Definition: Window.hpp:36
Definition: ImageWidgets.hpp:169
Definition: ImageWidgets.hpp:51
-
Definition: Widget.hpp:83
+
Definition: Widget.hpp:85
void setAbsolutePos(int x, int y) noexcept
void setAbsoluteX(int x) noexcept
Definition: ImageWidgets.hpp:95
bool onKeyboard(const KeyboardEvent &) override
-
Definition: Widget.hpp:136
+
Definition: Widget.hpp:138
void setAbsoluteY(int y) noexcept
void onDisplay() override
virtual bool onMotion(const MotionEvent &)
-
Definition: Widget.hpp:59
-
Definition: Widget.hpp:118
+
Definition: Widget.hpp:61
+
Definition: Widget.hpp:120
bool onMouse(const MouseEvent &) override
Definition: Image.hpp:38
Definition: ImageWidgets.hpp:87
-
Definition: Widget.hpp:151
+
Definition: Widget.hpp:153
Definition: ImageWidgets.hpp:54
-
Definition: ImageWidgets.hpp:236
+
Definition: ImageWidgets.hpp:239
Definition: ImageWidgets.hpp:166
-
Definition: ImageWidgets.hpp:233
+
Definition: ImageWidgets.hpp:236
diff --git a/Image_8hpp_source.html b/Image_8hpp_source.html index 23f48da6..bba373c5 100644 --- a/Image_8hpp_source.html +++ b/Image_8hpp_source.html @@ -84,7 +84,7 @@ $(function() {
diff --git a/LeakDetector_8hpp_source.html b/LeakDetector_8hpp_source.html index 3df5de02..eb5d7e54 100644 --- a/LeakDetector_8hpp_source.html +++ b/LeakDetector_8hpp_source.html @@ -71,7 +71,7 @@ $(function() { diff --git a/Mutex_8hpp_source.html b/Mutex_8hpp_source.html index 7c13b4ac..4928a2b6 100644 --- a/Mutex_8hpp_source.html +++ b/Mutex_8hpp_source.html @@ -75,7 +75,7 @@ $(function() { diff --git a/NanoVG_8hpp_source.html b/NanoVG_8hpp_source.html index 89c160d1..835588a2 100644 --- a/NanoVG_8hpp_source.html +++ b/NanoVG_8hpp_source.html @@ -70,7 +70,7 @@ $(function() {
Definition: NanoVG.hpp:288
Definition: NanoVG.hpp:47
Definition: NanoVG.hpp:875
-
Definition: Window.hpp:34
+
Definition: Window.hpp:36
Definition: Color.hpp:31
GLuint getTextureHandle() const
@@ -81,14 +81,14 @@ $(function() {
Size< uint > getSize() const noexcept
Definition: NanoVG.hpp:282
-
Definition: Widget.hpp:59
+
Definition: Widget.hpp:61
NanoImage & operator=(const Handle &handle)
bool isValid() const noexcept
CreateFlags
Definition: NanoVG.hpp:208
diff --git a/NanoWidgets_8hpp_source.html b/NanoWidgets_8hpp_source.html deleted file mode 100644 index 16c47414..00000000 --- a/NanoWidgets_8hpp_source.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: dgl/NanoWidgets.hpp Source File - - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - -
-
- - -
- -
- - -
-
-
-
NanoWidgets.hpp
-
-
-
1 /*
-
2  * DISTRHO Plugin Framework (DPF)
-
3  * Copyright (C) 2012-2015 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 DGL_NANO_WIDGETS_HPP_INCLUDED
-
18 #define DGL_NANO_WIDGETS_HPP_INCLUDED
-
19 
-
20 #include "NanoVG.hpp"
-
21 #include "../distrho/extra/String.hpp"
-
22 
-
23 START_NAMESPACE_DGL
-
24 
-
25 // -----------------------------------------------------------------------
-
26 
-
27 class BlendishButton : public NanoWidget
-
28 {
-
29 public:
-
30  class Callback
-
31  {
-
32  public:
-
33  virtual ~Callback() {}
-
34  virtual void blendishButtonClicked(BlendishButton* blendishButton, int button) = 0;
-
35  };
-
36 
-
37  explicit BlendishButton(Window& parent, const char* text = "", int iconId = -1);
-
38  explicit BlendishButton(NanoWidget* widget, const char* text = "", int iconId = -1);
-
39  ~BlendishButton() override;
-
40 
-
41  int getIconId() const noexcept;
-
42  void setIconId(int iconId) noexcept;
-
43 
-
44  const char* getText() const noexcept;
-
45  void setText(const char* text) noexcept;
-
46 
-
47  void setCallback(Callback* callback) noexcept;
-
48 
-
49 protected:
-
50  void onNanoDisplay() override;
-
51  bool onMouse(const MouseEvent&) override;
-
52  bool onMotion(const MotionEvent&) override;
-
53 
-
54 private:
-
55  struct PrivateData;
-
56  PrivateData* const pData;
-
57 
-
58  void _updateBounds();
-
59 
-
60  DISTRHO_LEAK_DETECTOR(BlendishButton)
-
61 };
-
62 
-
63 // -----------------------------------------------------------------------
-
64 
-
65 END_NAMESPACE_DGL
-
66 
-
67 #endif // DGL_NANO_WIDGETS_HPP_INCLUDED
-
bool onMouse(const MouseEvent &) override
-
Definition: NanoWidgets.hpp:30
-
Definition: NanoVG.hpp:862
-
Definition: Window.hpp:30
-
Definition: Widget.hpp:136
-
void onNanoDisplay() override
-
float text(float x, float y, const char *string, const char *end)
-
Definition: Widget.hpp:118
-
bool onMotion(const MotionEvent &) override
-
Definition: NanoWidgets.hpp:27
-
- - - - diff --git a/ScopedPointer_8hpp_source.html b/ScopedPointer_8hpp_source.html index 0c92d367..6f11efa0 100644 --- a/ScopedPointer_8hpp_source.html +++ b/ScopedPointer_8hpp_source.html @@ -80,7 +80,7 @@ $(function() { diff --git a/Sleep_8hpp_source.html b/Sleep_8hpp_source.html index ce0af567..849e7152 100644 --- a/Sleep_8hpp_source.html +++ b/Sleep_8hpp_source.html @@ -69,7 +69,7 @@ $(function() {
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 
17 #ifndef DISTRHO_SLEEP_HPP_INCLUDED
18 #define DISTRHO_SLEEP_HPP_INCLUDED
19 
20 #include "../DistrhoUtils.hpp"
21 
22 #ifdef DISTRHO_OS_WINDOWS
23 # include <winsock2.h>
24 # include <windows.h>
25 #else
26 # include <unistd.h>
27 #endif
28 
29 // -----------------------------------------------------------------------
30 // d_*sleep
31 
32 /*
33  * Sleep for 'secs' seconds.
34  */
35 static inline
36 void d_sleep(const uint secs) noexcept
37 {
38  DISTRHO_SAFE_ASSERT_RETURN(secs > 0,);
39 
40  try {
41 #ifdef DISTRHO_OS_WINDOWS
42  ::Sleep(secs * 1000);
43 #else
44  ::sleep(secs);
45 #endif
46  } DISTRHO_SAFE_EXCEPTION("d_sleep");
47 }
48 
49 /*
50  * Sleep for 'msecs' milliseconds.
51  */
52 static inline
53 void d_msleep(const uint msecs) noexcept
54 {
55  DISTRHO_SAFE_ASSERT_RETURN(msecs > 0,);
56 
57  try {
58 #ifdef DISTRHO_OS_WINDOWS
59  ::Sleep(msecs);
60 #else
61  ::usleep(msecs * 1000);
62 #endif
63  } DISTRHO_SAFE_EXCEPTION("d_msleep");
64 }
65 
66 // -----------------------------------------------------------------------
67 
68 #endif // DISTRHO_SLEEP_HPP_INCLUDED
diff --git a/StandaloneWindow_8hpp_source.html b/StandaloneWindow_8hpp_source.html index b2d79046..31538d7c 100644 --- a/StandaloneWindow_8hpp_source.html +++ b/StandaloneWindow_8hpp_source.html @@ -66,16 +66,16 @@ $(function() {
StandaloneWindow.hpp
-
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 
17 #ifndef DGL_STANDALONE_WINDOW_HPP_INCLUDED
18 #define DGL_STANDALONE_WINDOW_HPP_INCLUDED
19 
20 #include "Application.hpp"
21 #include "Widget.hpp"
22 #include "Window.hpp"
23 
24 START_NAMESPACE_DGL
25 
26 // -----------------------------------------------------------------------
27 
29  public Window
30 {
31 public:
32  /**
33  Constructor.
34  */
36 
37  /**
38  Show window and execute application.
39  */
40  void exec();
41 
42 private:
43  Widget* fWidget;
44 
45  /** @internal */
46  void onReshape(uint width, uint height) override;
47 
48  /** @internal */
49  void _addWidget(Widget* widget) override;
50 
51  /** @internal */
52  void _removeWidget(Widget* widget) override;
53 
54  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(StandaloneWindow)
55 };
56 
57 // -----------------------------------------------------------------------
58 
59 END_NAMESPACE_DGL
60 
61 #endif // DGL_STANDALONE_WINDOW_HPP_INCLUDED
Definition: Window.hpp:34
+
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 
17 #ifndef DGL_STANDALONE_WINDOW_HPP_INCLUDED
18 #define DGL_STANDALONE_WINDOW_HPP_INCLUDED
19 
20 #include "Application.hpp"
21 #include "Widget.hpp"
22 #include "Window.hpp"
23 
24 START_NAMESPACE_DGL
25 
26 // -----------------------------------------------------------------------
27 
29  public Window
30 {
31 public:
32  /**
33  Constructor.
34  */
36 
37  /**
38  Show window and execute application.
39  */
40  void exec();
41 
42 private:
43  Widget* fWidget;
44 
45  /** @internal */
46  void onReshape(uint width, uint height) override;
47 
48  /** @internal */
49  void _addWidget(Widget* widget) override;
50 
51  /** @internal */
52  void _removeWidget(Widget* widget) override;
53 
54  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(StandaloneWindow)
55 };
56 
57 // -----------------------------------------------------------------------
58 
59 END_NAMESPACE_DGL
60 
61 #endif // DGL_STANDALONE_WINDOW_HPP_INCLUDED
Definition: Window.hpp:36
Definition: StandaloneWindow.hpp:28
Definition: Application.hpp:41
-
Definition: Widget.hpp:59
+
Definition: Widget.hpp:61
diff --git a/String_8hpp_source.html b/String_8hpp_source.html index 165775ae..9f9f5e03 100644 --- a/String_8hpp_source.html +++ b/String_8hpp_source.html @@ -70,7 +70,7 @@ $(function() {
diff --git a/Thread_8hpp_source.html b/Thread_8hpp_source.html index 2bf7f7ad..5cf1f8fc 100644 --- a/Thread_8hpp_source.html +++ b/Thread_8hpp_source.html @@ -74,7 +74,7 @@ $(function() { diff --git a/Widget_8hpp_source.html b/Widget_8hpp_source.html index 9a1f9725..1eefa06e 100644 --- a/Widget_8hpp_source.html +++ b/Widget_8hpp_source.html @@ -66,26 +66,27 @@ $(function() {
Widget.hpp
-
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 
17 #ifndef DGL_WIDGET_HPP_INCLUDED
18 #define DGL_WIDGET_HPP_INCLUDED
19 
20 #include "Geometry.hpp"
21 
22 #include <vector>
23 
24 // -----------------------------------------------------------------------
25 // Forward class names
26 
27 START_NAMESPACE_DISTRHO
28 class UI;
29 END_NAMESPACE_DISTRHO
30 
31 START_NAMESPACE_DGL
32 
33 class Application;
34 class ImageSlider;
35 class NanoWidget;
36 class Window;
37 class StandaloneWindow;
38 
39 // -----------------------------------------------------------------------
40 
41 /**
42  Base DGL Widget class.
43 
44  This is the base Widget class, from which all widgets are built.
45 
46  All widgets have a parent Window where they'll be drawn.
47  This parent is never changed during the widget lifetime.
48 
49  Widgets receive events in relative coordinates.
50  (0, 0) means its top-left position.
51 
52  Windows paint widgets in the order they are constructed.
53  Early widgets are drawn first, at the bottom, then newer ones on top.
54  Events are sent in the inverse order so that the top-most widget gets
55  a chance to catch the event and stop its propagation.
56 
57  All widget event callbacks do nothing by default.
58  */
59 class Widget
60 {
61 public:
62  /**
63  Base event data.
64  @a mod The currently active keyboard modifiers, @see Modifier.
65  @a time The timestamp (if any).
66  */
67  struct BaseEvent {
68  uint mod;
69  uint32_t time;
70 
71  /** Constuctor */
72  BaseEvent() noexcept : mod(0x0), time(0) {}
73  /** Destuctor */
74  virtual ~BaseEvent() noexcept {}
75  };
76 
77  /**
78  Keyboard event.
79  @a press True if the key was pressed, false if released.
80  @a key Unicode point of the key pressed.
81  @see onKeyboard
82  */
84  bool press;
85  uint key;
86 
87  /** Constuctor */
88  KeyboardEvent() noexcept
89  : BaseEvent(),
90  press(false),
91  key(0) {}
92  };
93 
94  /**
95  Special keyboard event.
96  @a press True if the key was pressed, false if released.
97  @a key The key pressed.
98  @see onSpecial
99  */
101  bool press;
102  Key key;
103 
104  /** Constuctor */
105  SpecialEvent() noexcept
106  : BaseEvent(),
107  press(false),
108  key(Key(0)) {}
109  };
110 
111  /**
112  Mouse event.
113  @a button The button number (1 = left, 2 = middle, 3 = right).
114  @a press True if the button was pressed, false if released.
115  @a pos The widget-relative coordinates of the pointer.
116  @see onMouse
117  */
119  int button;
120  bool press;
121  Point<int> pos;
122 
123  /** Constuctor */
124  MouseEvent() noexcept
125  : BaseEvent(),
126  button(0),
127  press(false),
128  pos(0, 0) {}
129  };
130 
131  /**
132  Mouse motion event.
133  @a pos The widget-relative coordinates of the pointer.
134  @see onMotion
135  */
137  Point<int> pos;
138 
139  /** Constuctor */
140  MotionEvent() noexcept
141  : BaseEvent(),
142  pos(0, 0) {}
143  };
144 
145  /**
146  Mouse scroll event.
147  @a pos The widget-relative coordinates of the pointer.
148  @a delta The scroll distance.
149  @see onScroll
150  */
152  Point<int> pos;
153  Point<float> delta;
154 
155  /** Constuctor */
156  ScrollEvent() noexcept
157  : BaseEvent(),
158  pos(0, 0),
159  delta(0.0f, 0.0f) {}
160  };
161 
162  /**
163  Resize event.
164  @a size The new widget size.
165  @a oldSize The previous size, may be null.
166  @see onResize
167  */
168  struct ResizeEvent {
169  Size<uint> size;
170  Size<uint> oldSize;
171 
172  /** Constuctor */
173  ResizeEvent() noexcept
174  : size(0, 0),
175  oldSize(0, 0) {}
176  };
177 
178  /**
179  Constructor.
180  */
181  explicit Widget(Window& parent);
182 
183  /**
184  Constructor for a subwidget.
185  */
186  explicit Widget(Widget* groupWidget);
187 
188  /**
189  Destructor.
190  */
191  virtual ~Widget();
192 
193  /**
194  Check if this widget is visible within its parent window.
195  Invisible widgets do not receive events except resize.
196  */
197  bool isVisible() const noexcept;
198 
199  /**
200  Set widget visible (or not) according to @a yesNo.
201  */
202  void setVisible(bool yesNo);
203 
204  /**
205  Show widget.
206  This is the same as calling setVisible(true).
207  */
208  void show();
209 
210  /**
211  Hide widget.
212  This is the same as calling setVisible(false).
213  */
214  void hide();
215 
216  /**
217  Get width.
218  */
219  uint getWidth() const noexcept;
220 
221  /**
222  Get height.
223  */
224  uint getHeight() const noexcept;
225 
226  /**
227  Get size.
228  */
229  const Size<uint>& getSize() const noexcept;
230 
231  /**
232  Set width.
233  */
234  void setWidth(uint width) noexcept;
235 
236  /**
237  Set height.
238  */
239  void setHeight(uint height) noexcept;
240 
241  /**
242  Set size using @a width and @a height values.
243  */
244  void setSize(uint width, uint height) noexcept;
245 
246  /**
247  Set size.
248  */
249  void setSize(const Size<uint>& size) noexcept;
250 
251  /**
252  Get absolute X.
253  */
254  int getAbsoluteX() const noexcept;
255 
256  /**
257  Get absolute Y.
258  */
259  int getAbsoluteY() const noexcept;
260 
261  /**
262  Get absolute position.
263  */
264  const Point<int>& getAbsolutePos() const noexcept;
265 
266  /**
267  Set absolute X.
268  */
269  void setAbsoluteX(int x) noexcept;
270 
271  /**
272  Set absolute Y.
273  */
274  void setAbsoluteY(int y) noexcept;
275 
276  /**
277  Set absolute position using @a x and @a y values.
278  */
279  void setAbsolutePos(int x, int y) noexcept;
280 
281  /**
282  Set absolute position.
283  */
284  void setAbsolutePos(const Point<int>& pos) noexcept;
285 
286  /**
287  Get this widget's window application.
288  Same as calling getParentWindow().getApp().
289  */
290  Application& getParentApp() const noexcept;
291 
292  /**
293  Get parent window, as passed in the constructor.
294  */
295  Window& getParentWindow() const noexcept;
296 
297  /**
298  Check if this widget contains the point defined by @a x and @a y.
299  */
300  bool contains(int x, int y) const noexcept;
301 
302  /**
303  Check if this widget contains the point @a pos.
304  */
305  bool contains(const Point<int>& pos) const noexcept;
306 
307  /**
308  Tell this widget's window to repaint itself.
309  */
310  void repaint() noexcept;
311 
312  /**
313  Get the Id associated with this widget.
314  @see setId
315  */
316  uint getId() const noexcept;
317 
318  /**
319  Set an Id to be associated with this widget.
320  @see getId
321  */
322  void setId(uint id) noexcept;
323 
324 protected:
325  /**
326  A function called to draw the view contents with OpenGL.
327  */
328  virtual void onDisplay() = 0;
329 
330  /**
331  A function called when a key is pressed or released.
332  @return True to stop event propagation, false otherwise.
333  */
334  virtual bool onKeyboard(const KeyboardEvent&);
335 
336  /**
337  A function called when a special key is pressed or released.
338  @return True to stop event propagation, false otherwise.
339  */
340  virtual bool onSpecial(const SpecialEvent&);
341 
342  /**
343  A function called when a mouse button is pressed or released.
344  @return True to stop event propagation, false otherwise.
345  */
346  virtual bool onMouse(const MouseEvent&);
347 
348  /**
349  A function called when the pointer moves.
350  @return True to stop event propagation, false otherwise.
351  */
352  virtual bool onMotion(const MotionEvent&);
353 
354  /**
355  A function called on scrolling (e.g. mouse wheel or track pad).
356  @return True to stop event propagation, false otherwise.
357  */
358  virtual bool onScroll(const ScrollEvent&);
359 
360  /**
361  A function called when the widget is resized.
362  */
363  virtual void onResize(const ResizeEvent&);
364 
365 private:
366  struct PrivateData;
367  PrivateData* const pData;
368 
369  /** @internal */
370  explicit Widget(Widget* groupWidget, bool addToSubWidgets);
371 
372  friend class ImageSlider;
373  friend class NanoWidget;
374  friend class Window;
375  friend class StandaloneWindow;
376  friend class DISTRHO_NAMESPACE::UI;
377 
378  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Widget)
379 };
380 
381 // -----------------------------------------------------------------------
382 
383 END_NAMESPACE_DGL
384 
385 #endif // DGL_WIDGET_HPP_INCLUDED
Window & getParentWindow() const noexcept
+
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 
17 #ifndef DGL_WIDGET_HPP_INCLUDED
18 #define DGL_WIDGET_HPP_INCLUDED
19 
20 #include "Geometry.hpp"
21 
22 #include <vector>
23 
24 // -----------------------------------------------------------------------
25 // Forward class names
26 
27 #ifdef DISTRHO_DEFINES_H_INCLUDED
28 START_NAMESPACE_DISTRHO
29 class UI;
30 END_NAMESPACE_DISTRHO
31 #endif
32 
33 START_NAMESPACE_DGL
34 
35 class Application;
36 class ImageSlider;
37 class NanoWidget;
38 class Window;
39 class StandaloneWindow;
40 
41 // -----------------------------------------------------------------------
42 
43 /**
44  Base DGL Widget class.
45 
46  This is the base Widget class, from which all widgets are built.
47 
48  All widgets have a parent Window where they'll be drawn.
49  This parent is never changed during the widget lifetime.
50 
51  Widgets receive events in relative coordinates.
52  (0, 0) means its top-left position.
53 
54  Windows paint widgets in the order they are constructed.
55  Early widgets are drawn first, at the bottom, then newer ones on top.
56  Events are sent in the inverse order so that the top-most widget gets
57  a chance to catch the event and stop its propagation.
58 
59  All widget event callbacks do nothing by default.
60  */
61 class Widget
62 {
63 public:
64  /**
65  Base event data.
66  @a mod The currently active keyboard modifiers, @see Modifier.
67  @a time The timestamp (if any).
68  */
69  struct BaseEvent {
70  uint mod;
71  uint32_t time;
72 
73  /** Constuctor */
74  BaseEvent() noexcept : mod(0x0), time(0) {}
75  /** Destuctor */
76  virtual ~BaseEvent() noexcept {}
77  };
78 
79  /**
80  Keyboard event.
81  @a press True if the key was pressed, false if released.
82  @a key Unicode point of the key pressed.
83  @see onKeyboard
84  */
86  bool press;
87  uint key;
88 
89  /** Constuctor */
90  KeyboardEvent() noexcept
91  : BaseEvent(),
92  press(false),
93  key(0) {}
94  };
95 
96  /**
97  Special keyboard event.
98  @a press True if the key was pressed, false if released.
99  @a key The key pressed.
100  @see onSpecial
101  */
103  bool press;
104  Key key;
105 
106  /** Constuctor */
107  SpecialEvent() noexcept
108  : BaseEvent(),
109  press(false),
110  key(Key(0)) {}
111  };
112 
113  /**
114  Mouse event.
115  @a button The button number (1 = left, 2 = middle, 3 = right).
116  @a press True if the button was pressed, false if released.
117  @a pos The widget-relative coordinates of the pointer.
118  @see onMouse
119  */
121  int button;
122  bool press;
123  Point<int> pos;
124 
125  /** Constuctor */
126  MouseEvent() noexcept
127  : BaseEvent(),
128  button(0),
129  press(false),
130  pos(0, 0) {}
131  };
132 
133  /**
134  Mouse motion event.
135  @a pos The widget-relative coordinates of the pointer.
136  @see onMotion
137  */
139  Point<int> pos;
140 
141  /** Constuctor */
142  MotionEvent() noexcept
143  : BaseEvent(),
144  pos(0, 0) {}
145  };
146 
147  /**
148  Mouse scroll event.
149  @a pos The widget-relative coordinates of the pointer.
150  @a delta The scroll distance.
151  @see onScroll
152  */
154  Point<int> pos;
155  Point<float> delta;
156 
157  /** Constuctor */
158  ScrollEvent() noexcept
159  : BaseEvent(),
160  pos(0, 0),
161  delta(0.0f, 0.0f) {}
162  };
163 
164  /**
165  Resize event.
166  @a size The new widget size.
167  @a oldSize The previous size, may be null.
168  @see onResize
169  */
170  struct ResizeEvent {
171  Size<uint> size;
172  Size<uint> oldSize;
173 
174  /** Constuctor */
175  ResizeEvent() noexcept
176  : size(0, 0),
177  oldSize(0, 0) {}
178  };
179 
180  /**
181  Widget position changed event.
182  @a pos The new absolute position of the widget.
183  @a oldPos The previous absolute position of the widget.
184  @see onPositionChanged
185  */
187  Point<int> pos;
188  Point<int> oldPos;
189 
190  /** Constuctor */
192  : pos(0, 0),
193  oldPos(0, 0) {}
194  };
195 
196  /**
197  Constructor.
198  */
199  explicit Widget(Window& parent);
200 
201  /**
202  Constructor for a subwidget.
203  */
204  explicit Widget(Widget* groupWidget);
205 
206  /**
207  Destructor.
208  */
209  virtual ~Widget();
210 
211  /**
212  Check if this widget is visible within its parent window.
213  Invisible widgets do not receive events except resize.
214  */
215  bool isVisible() const noexcept;
216 
217  /**
218  Set widget visible (or not) according to @a yesNo.
219  */
220  void setVisible(bool yesNo);
221 
222  /**
223  Show widget.
224  This is the same as calling setVisible(true).
225  */
226  void show();
227 
228  /**
229  Hide widget.
230  This is the same as calling setVisible(false).
231  */
232  void hide();
233 
234  /**
235  Get width.
236  */
237  uint getWidth() const noexcept;
238 
239  /**
240  Get height.
241  */
242  uint getHeight() const noexcept;
243 
244  /**
245  Get size.
246  */
247  const Size<uint>& getSize() const noexcept;
248 
249  /**
250  Set width.
251  */
252  void setWidth(uint width) noexcept;
253 
254  /**
255  Set height.
256  */
257  void setHeight(uint height) noexcept;
258 
259  /**
260  Set size using @a width and @a height values.
261  */
262  void setSize(uint width, uint height) noexcept;
263 
264  /**
265  Set size.
266  */
267  void setSize(const Size<uint>& size) noexcept;
268 
269  /**
270  Get absolute X.
271  */
272  int getAbsoluteX() const noexcept;
273 
274  /**
275  Get absolute Y.
276  */
277  int getAbsoluteY() const noexcept;
278 
279  /**
280  Get absolute position.
281  */
282  const Point<int>& getAbsolutePos() const noexcept;
283 
284  /**
285  Set absolute X.
286  */
287  void setAbsoluteX(int x) noexcept;
288 
289  /**
290  Set absolute Y.
291  */
292  void setAbsoluteY(int y) noexcept;
293 
294  /**
295  Set absolute position using @a x and @a y values.
296  */
297  void setAbsolutePos(int x, int y) noexcept;
298 
299  /**
300  Set absolute position.
301  */
302  void setAbsolutePos(const Point<int>& pos) noexcept;
303 
304  /**
305  Get this widget's window application.
306  Same as calling getParentWindow().getApp().
307  */
308  Application& getParentApp() const noexcept;
309 
310  /**
311  Get parent window, as passed in the constructor.
312  */
313  Window& getParentWindow() const noexcept;
314 
315  /**
316  Check if this widget contains the point defined by @a x and @a y.
317  */
318  bool contains(int x, int y) const noexcept;
319 
320  /**
321  Check if this widget contains the point @a pos.
322  */
323  bool contains(const Point<int>& pos) const noexcept;
324 
325  /**
326  Tell this widget's window to repaint itself.
327  */
328  void repaint() noexcept;
329 
330  /**
331  Get the Id associated with this widget.
332  @see setId
333  */
334  uint getId() const noexcept;
335 
336  /**
337  Set an Id to be associated with this widget.
338  @see getId
339  */
340  void setId(uint id) noexcept;
341 
342 protected:
343  /**
344  A function called to draw the view contents with OpenGL.
345  */
346  virtual void onDisplay() = 0;
347 
348  /**
349  A function called when a key is pressed or released.
350  @return True to stop event propagation, false otherwise.
351  */
352  virtual bool onKeyboard(const KeyboardEvent&);
353 
354  /**
355  A function called when a special key is pressed or released.
356  @return True to stop event propagation, false otherwise.
357  */
358  virtual bool onSpecial(const SpecialEvent&);
359 
360  /**
361  A function called when a mouse button is pressed or released.
362  @return True to stop event propagation, false otherwise.
363  */
364  virtual bool onMouse(const MouseEvent&);
365 
366  /**
367  A function called when the pointer moves.
368  @return True to stop event propagation, false otherwise.
369  */
370  virtual bool onMotion(const MotionEvent&);
371 
372  /**
373  A function called on scrolling (e.g. mouse wheel or track pad).
374  @return True to stop event propagation, false otherwise.
375  */
376  virtual bool onScroll(const ScrollEvent&);
377 
378  /**
379  A function called when the widget is resized.
380  */
381  virtual void onResize(const ResizeEvent&);
382 
383  /**
384  A function called when the widget's absolute position is changed.
385  */
386  virtual void onPositionChanged(const PositionChangedEvent&);
387 
388 private:
389  struct PrivateData;
390  PrivateData* const pData;
391 
392  /** @internal */
393  explicit Widget(Widget* groupWidget, bool addToSubWidgets);
394 
395  friend class ImageSlider;
396  friend class NanoWidget;
397  friend class Window;
398  friend class StandaloneWindow;
399 #ifdef DISTRHO_DEFINES_H_INCLUDED
400  friend class DISTRHO_NAMESPACE::UI;
401 #endif
402 
403  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Widget)
404 };
405 
406 // -----------------------------------------------------------------------
407 
408 END_NAMESPACE_DGL
409 
410 #endif // DGL_WIDGET_HPP_INCLUDED
PositionChangedEvent() noexcept
Definition: Widget.hpp:191
+
Window & getParentWindow() const noexcept
const Point< int > & getAbsolutePos() const noexcept
virtual bool onSpecial(const SpecialEvent &)
virtual bool onScroll(const ScrollEvent &)
virtual bool onMouse(const MouseEvent &)
-
MouseEvent() noexcept
Definition: Widget.hpp:124
-
Definition: Widget.hpp:100
-
ScrollEvent() noexcept
Definition: Widget.hpp:156
-
ResizeEvent() noexcept
Definition: Widget.hpp:173
+
MouseEvent() noexcept
Definition: Widget.hpp:126
+
Definition: Widget.hpp:102
+
ScrollEvent() noexcept
Definition: Widget.hpp:158
+
ResizeEvent() noexcept
Definition: Widget.hpp:175
void setId(uint id) noexcept
Definition: NanoVG.hpp:875
-
Definition: Window.hpp:34
+
Definition: Window.hpp:36
virtual void onDisplay()=0
uint getWidth() const noexcept
-
MotionEvent() noexcept
Definition: Widget.hpp:140
+
MotionEvent() noexcept
Definition: Widget.hpp:142
bool contains(int x, int y) const noexcept
void setSize(uint width, uint height) noexcept
-
KeyboardEvent() noexcept
Definition: Widget.hpp:88
-
Definition: Widget.hpp:83
+
KeyboardEvent() noexcept
Definition: Widget.hpp:90
+
Definition: Widget.hpp:85
void setAbsolutePos(int x, int y) noexcept
virtual ~Widget()
int getAbsoluteX() const noexcept
@@ -93,28 +94,30 @@ $(function() {
Definition: StandaloneWindow.hpp:28
virtual void onResize(const ResizeEvent &)
-
Definition: Widget.hpp:136
+
Definition: Widget.hpp:138
void setAbsoluteY(int y) noexcept
void setHeight(uint height) noexcept
const Size< uint > & getSize() const noexcept
bool isVisible() const noexcept
void hide()
Definition: Application.hpp:41
-
Definition: Widget.hpp:168
-
Definition: Widget.hpp:67
-
BaseEvent() noexcept
Definition: Widget.hpp:72
+
Definition: Widget.hpp:170
+
Definition: Widget.hpp:69
+
BaseEvent() noexcept
Definition: Widget.hpp:74
virtual bool onMotion(const MotionEvent &)
-
Definition: Widget.hpp:59
+
Definition: Widget.hpp:61
virtual bool onKeyboard(const KeyboardEvent &)
-
Definition: Widget.hpp:118
-
virtual ~BaseEvent() noexcept
Definition: Widget.hpp:74
+
Definition: Widget.hpp:120
+
virtual void onPositionChanged(const PositionChangedEvent &)
+
virtual ~BaseEvent() noexcept
Definition: Widget.hpp:76
uint getId() const noexcept
uint getHeight() const noexcept
-
Definition: Widget.hpp:151
+
Definition: Widget.hpp:153
+
Definition: Widget.hpp:186
Widget(Window &parent)
void setWidth(uint width) noexcept
-
SpecialEvent() noexcept
Definition: Widget.hpp:105
-
Definition: DistrhoUI.hpp:50
+
SpecialEvent() noexcept
Definition: Widget.hpp:107
+
Definition: DistrhoUI.hpp:51
void repaint() noexcept
Definition: ImageWidgets.hpp:166
void show()
@@ -124,7 +127,7 @@ $(function() {
diff --git a/Window_8hpp_source.html b/Window_8hpp_source.html index 4662bb31..9e85767b 100644 --- a/Window_8hpp_source.html +++ b/Window_8hpp_source.html @@ -66,20 +66,20 @@ $(function() {
Window.hpp
-
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 
17 #ifndef DGL_WINDOW_HPP_INCLUDED
18 #define DGL_WINDOW_HPP_INCLUDED
19 
20 #include "Geometry.hpp"
21 
22 START_NAMESPACE_DISTRHO
23 class UIExporter;
24 END_NAMESPACE_DISTRHO
25 
26 START_NAMESPACE_DGL
27 
28 // -----------------------------------------------------------------------
29 
30 class Application;
31 class Widget;
32 class StandaloneWindow;
33 
34 class Window
35 {
36 public:
37 #ifndef DGL_FILE_BROWSER_DISABLED
38  /**
39  File browser options.
40  */
42  const char* startDir;
43  const char* title;
44  uint width;
45  uint height;
46 
47  /**
48  File browser buttons.
49 
50  0 means hidden.
51  1 means visible and unchecked.
52  2 means visible and checked.
53  */
54  struct Buttons {
55  uint listAllFiles;
56  uint showHidden;
57  uint showPlaces;
58 
59  /** Constuctor for default values */
61  : listAllFiles(2),
62  showHidden(1),
63  showPlaces(1) {}
64  } buttons;
65 
66  /** Constuctor for default values */
68  : startDir(nullptr),
69  title(nullptr),
70  width(0),
71  height(0),
72  buttons() {}
73  };
74 #endif // DGL_FILE_BROWSER_DISABLED
75 
76  explicit Window(Application& app);
77  explicit Window(Application& app, Window& parent);
78  explicit Window(Application& app, intptr_t parentId);
79  virtual ~Window();
80 
81  void show();
82  void hide();
83  void close();
84  void exec(bool lockWait = false);
85 
86  void focus();
87  void repaint() noexcept;
88 
89 #ifndef DGL_FILE_BROWSER_DISABLED
90  bool openFileBrowser(const FileBrowserOptions& options);
91 #endif
92 
93  bool isVisible() const noexcept;
94  void setVisible(bool yesNo);
95 
96  bool isResizable() const noexcept;
97  void setResizable(bool yesNo);
98 
99  uint getWidth() const noexcept;
100  uint getHeight() const noexcept;
101  Size<uint> getSize() const noexcept;
102  void setSize(uint width, uint height);
103  void setSize(Size<uint> size);
104 
105  const char* getTitle() const noexcept;
106  void setTitle(const char* title);
107 
108  void setTransientWinId(uintptr_t winId);
109 
110  Application& getApp() const noexcept;
111  intptr_t getWindowId() const noexcept;
112 
113  void addIdleCallback(IdleCallback* const callback);
114  void removeIdleCallback(IdleCallback* const callback);
115 
116 protected:
117  virtual void onDisplayBefore();
118  virtual void onDisplayAfter();
119  virtual void onReshape(uint width, uint height);
120  virtual void onClose();
121 
122 #ifndef DGL_FILE_BROWSER_DISABLED
123  virtual void fileBrowserSelected(const char* filename);
124 #endif
125 
126 private:
127  struct PrivateData;
128  PrivateData* const pData;
129  friend class Application;
130  friend class Widget;
131  friend class StandaloneWindow;
132  friend class DISTRHO_NAMESPACE::UIExporter;
133 
134  virtual void _addWidget(Widget* const widget);
135  virtual void _removeWidget(Widget* const widget);
136  void _idle();
137 
138  bool handlePluginKeyboard(const bool press, const uint key);
139  bool handlePluginSpecial(const bool press, const Key key);
140 
141  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Window)
142 };
143 
144 // -----------------------------------------------------------------------
145 
146 END_NAMESPACE_DGL
147 
148 #endif // DGL_WINDOW_HPP_INCLUDED
FileBrowserOptions()
Definition: Window.hpp:67
-
Definition: Window.hpp:34
-
Buttons()
Definition: Window.hpp:60
+
1 /*
2  * DISTRHO Plugin Framework (DPF)
3  * Copyright (C) 2012-2019 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 DGL_WINDOW_HPP_INCLUDED
18 #define DGL_WINDOW_HPP_INCLUDED
19 
20 #include "Geometry.hpp"
21 
22 #ifdef DISTRHO_DEFINES_H_INCLUDED
23 START_NAMESPACE_DISTRHO
24 class UIExporter;
25 END_NAMESPACE_DISTRHO
26 #endif
27 
28 START_NAMESPACE_DGL
29 
30 // -----------------------------------------------------------------------
31 
32 class Application;
33 class Widget;
34 class StandaloneWindow;
35 
36 class Window
37 {
38 public:
39 #ifndef DGL_FILE_BROWSER_DISABLED
40  /**
41  File browser options.
42  */
44  const char* startDir;
45  const char* title;
46  uint width;
47  uint height;
48 
49  /**
50  File browser buttons.
51 
52  0 means hidden.
53  1 means visible and unchecked.
54  2 means visible and checked.
55  */
56  struct Buttons {
57  uint listAllFiles;
58  uint showHidden;
59  uint showPlaces;
60 
61  /** Constuctor for default values */
63  : listAllFiles(2),
64  showHidden(1),
65  showPlaces(1) {}
66  } buttons;
67 
68  /** Constuctor for default values */
70  : startDir(nullptr),
71  title(nullptr),
72  width(0),
73  height(0),
74  buttons() {}
75  };
76 #endif // DGL_FILE_BROWSER_DISABLED
77 
78  explicit Window(Application& app);
79  explicit Window(Application& app, Window& parent);
80  explicit Window(Application& app, intptr_t parentId, bool resizable);
81  virtual ~Window();
82 
83  void show();
84  void hide();
85  void close();
86  void exec(bool lockWait = false);
87 
88  void focus();
89  void repaint() noexcept;
90 
91 #ifndef DGL_FILE_BROWSER_DISABLED
92  bool openFileBrowser(const FileBrowserOptions& options);
93 #endif
94 
95  bool isEmbed() const noexcept;
96 
97  bool isVisible() const noexcept;
98  void setVisible(bool yesNo);
99 
100  bool isResizable() const noexcept;
101  void setResizable(bool yesNo);
102 
103  uint getWidth() const noexcept;
104  uint getHeight() const noexcept;
105  Size<uint> getSize() const noexcept;
106  void setSize(uint width, uint height);
107  void setSize(Size<uint> size);
108 
109  const char* getTitle() const noexcept;
110  void setTitle(const char* title);
111 
112  void setGeometryConstraints(uint width, uint height, bool aspect);
113  void setTransientWinId(uintptr_t winId);
114 
115  double getScaling() const noexcept;
116  void setScaling(double scaling) noexcept;
117 
118  bool getIgnoringKeyRepeat() const noexcept;
119  void setIgnoringKeyRepeat(bool ignore) noexcept;
120 
121  Application& getApp() const noexcept;
122  intptr_t getWindowId() const noexcept;
123 
124  void addIdleCallback(IdleCallback* const callback);
125  void removeIdleCallback(IdleCallback* const callback);
126 
127 protected:
128  virtual void onDisplayBefore();
129  virtual void onDisplayAfter();
130  virtual void onReshape(uint width, uint height);
131  virtual void onClose();
132 
133 #ifndef DGL_FILE_BROWSER_DISABLED
134  virtual void fileBrowserSelected(const char* filename);
135 #endif
136 
137 private:
138  struct PrivateData;
139  PrivateData* const pData;
140  friend class Application;
141  friend class Widget;
142  friend class StandaloneWindow;
143 #ifdef DISTRHO_DEFINES_H_INCLUDED
144  friend class DISTRHO_NAMESPACE::UIExporter;
145 #endif
146 
147  virtual void _addWidget(Widget* const widget);
148  virtual void _removeWidget(Widget* const widget);
149  void _idle();
150 
151  bool handlePluginKeyboard(const bool press, const uint key);
152  bool handlePluginSpecial(const bool press, const Key key);
153 
154  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Window)
155 };
156 
157 // -----------------------------------------------------------------------
158 
159 END_NAMESPACE_DGL
160 
161 #endif // DGL_WINDOW_HPP_INCLUDED
FileBrowserOptions()
Definition: Window.hpp:69
+
Definition: Window.hpp:36
+
Buttons()
Definition: Window.hpp:62
Definition: StandaloneWindow.hpp:28
-
Definition: Window.hpp:41
+
Definition: Window.hpp:43
Definition: Base.hpp:178
-
Definition: Window.hpp:54
+
Definition: Window.hpp:56
Definition: Application.hpp:41
-
Definition: Widget.hpp:59
+
Definition: Widget.hpp:61
diff --git a/annotated.html b/annotated.html index 300539de..c2a08b40 100644 --- a/annotated.html +++ b/annotated.html @@ -116,18 +116,19 @@ $(function() {  CKeyboardEvent  CMotionEvent  CMouseEvent - CResizeEvent - CScrollEvent - CSpecialEvent - CWindow - CFileBrowserOptions - CButtons + CPositionChangedEvent + CResizeEvent + CScrollEvent + CSpecialEvent + CWindow + CFileBrowserOptions + CButtons
diff --git a/arrowdown.png b/arrowdown.png deleted file mode 100644 index 0b63f6d38c4b9ec907b820192ebe9724ed6eca22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 246 zcmVkw!R34#Lv2LOS^S2tZA31X++9RY}n zChwn@Z)Wz*WWHH{)HDtJnq&A2hk$b-y(>?@z0iHr41EKCGp#T5?07*qoM6N<$f(V3Pvj6}9 diff --git a/arrowright.png b/arrowright.png deleted file mode 100644 index c6ee22f937a07d1dbfc27c669d11f8ed13e2f152..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 229 zcmV^P)R?RzRoKvklcaQ%HF6%rK2&ZgO(-ihJ_C zzrKgp4jgO( fd_(yg|3PpEQb#9`a?Pz_00000NkvXXu0mjftR`5K diff --git a/classApp-members.html b/classApp-members.html deleted file mode 100644 index acf84340..00000000 --- a/classApp-members.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: Member List - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - - - - -
- -
- -
-
-
-
App Member List
-
-
- -

This is the complete list of members for App, including all inherited members.

- - - - - - - - -
App()App
exec()App
idle()App
isQuiting() const noexceptApp
quit()App
Window (defined in App)Appfriend
~App()App
- - - - diff --git a/classApp.html b/classApp.html deleted file mode 100644 index d6d76e5f..00000000 --- a/classApp.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: App Class Reference - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - - - - -
- -
- -
-
- -
-
App Class Reference
-
-
- -

#include <App.hpp>

-
-Inheritance diagram for App:
-
-
- - -StandaloneWindow - -
- - - - - - - - - - - - - - -

-Public Member Functions

 App ()
 
 ~App ()
 
void idle ()
 
void exec ()
 
void quit ()
 
bool isQuiting () const noexcept
 
- - - -

-Friends

-class Window
 
-

Detailed Description

-

Base DGL Application class.

-

One application instance is required for creating a window. There's no single/global application instance in DGL, and multiple windows can share the same app instance.

-

In standalone mode an application will automatically quit its event-loop when all its windows are closed.

-

Constructor & Destructor Documentation

- -
-
- - - - - - - -
App::App ()
-
-

Constructor.

- -
-
- -
-
- - - - - - - -
App::~App ()
-
-

Destructor.

- -
-
-

Member Function Documentation

- -
-
- - - - - - - -
void App::idle ()
-
-

Idle function. This runs the application event-loop once.

- -
-
- -
-
- - - - - - - -
void App::exec ()
-
-

Run the application event-loop until all Windows are closed. idle() is called at regular intervals.

Note
: This function is meant for standalones only, never call this from plugins.
- -
-
- -
-
- - - - - - - -
void App::quit ()
-
-

Quit the application. This stops the event-loop and closes all Windows.

- -
-
- -
-
- - - - - -
- - - - - - - -
bool App::isQuiting () const
-
-noexcept
-
-

Check if the application is about to quit. Returning true means there's no event-loop running at the moment (or it's just about to stop).

- -
-
-
The documentation for this class was generated from the following file: -
- - - - diff --git a/classApp.png b/classApp.png deleted file mode 100644 index ef4a557b676948b8ba01327c7d874551df302cc5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 470 zcmeAS@N?(olHy`uVBq!ia0vp^td|!&m{i(awzgNFkF!R&a~xuex<#9_SEmRYyWx6B<@NV5O304pbrswCng@hPQUyj)wfnB*0~Gn@ALXTpWCLr`poO|@3#H_tepNu zb^c@LmxokVSHHIXwDH{RCs)rObe))b&3s{DO8(yOzoT;w@7;c8g~gfIzjr?`p2U$J z6le5%$L_Ds)*osPpY-ctoM%>lwdzV+=DlfYe}6KiL`fXnCM)m&7zqrXu6{1-oD!M< DZe!vn diff --git a/classApplication-members.html b/classApplication-members.html index 5271a340..b9983d8d 100644 --- a/classApplication-members.html +++ b/classApplication-members.html @@ -75,7 +75,7 @@ $(function() { diff --git a/classApplication.html b/classApplication.html index eb4a4e83..20b1c485 100644 --- a/classApplication.html +++ b/classApplication.html @@ -236,7 +236,7 @@ class Window diff --git a/classBlendishButton-members.html b/classBlendishButton-members.html deleted file mode 100644 index a921d2ce..00000000 --- a/classBlendishButton-members.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: Member List - - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - -
-
- - -
- -
- -
-
-
-
BlendishButton Member List
-
-
- -

This is the complete list of members for BlendishButton, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Align enum name (defined in NanoVG)NanoVG
ALIGN_BASELINE enum value (defined in NanoVG)NanoVG
ALIGN_BOTTOM enum value (defined in NanoVG)NanoVG
ALIGN_CENTER enum value (defined in NanoVG)NanoVG
ALIGN_LEFT enum value (defined in NanoVG)NanoVG
ALIGN_MIDDLE enum value (defined in NanoVG)NanoVG
ALIGN_RIGHT enum value (defined in NanoVG)NanoVG
ALIGN_TOP enum value (defined in NanoVG)NanoVG
arc(float cx, float cy, float r, float a0, float a1, Winding dir)NanoVG
arcTo(float x1, float y1, float x2, float y2, float radius)NanoVG
beginPath()NanoVG
BEVEL enum value (defined in NanoVG)NanoVG
bezierTo(float c1x, float c1y, float c2x, float c2y, float x, float y)NanoVG
BlendishButton(Window &parent, const char *text="", int iconId=-1) (defined in BlendishButton)BlendishButtonexplicit
BlendishButton(NanoWidget *widget, const char *text="", int iconId=-1) (defined in BlendishButton)BlendishButtonexplicit
boxGradient(float x, float y, float w, float h, float r, float f, const Color &icol, const Color &ocol)NanoVG
BUTT enum value (defined in NanoVG)NanoVG
CCW enum value (defined in NanoVG)NanoVG
circle(float cx, float cy, float r)NanoVG
closePath()NanoVG
contains(int x, int y) const noexceptWidget
contains(const Point< int > &pos) const noexceptWidget
CREATE_ANTIALIAS enum valueNanoVG
CREATE_DEBUG enum valueNanoVG
CREATE_STENCIL_STROKES enum valueNanoVG
CreateFlags enum nameNanoVG
createFontFromFile(const char *name, const char *filename)NanoVG
createFontFromMemory(const char *name, const uchar *data, uint dataSize, bool freeData)NanoVG
createImageFromFile(const char *filename, ImageFlags imageFlags)NanoVG
createImageFromFile(const char *filename, int imageFlags)NanoVG
createImageFromMemory(uchar *data, uint dataSize, ImageFlags imageFlags)NanoVG
createImageFromMemory(uchar *data, uint dataSize, int imageFlags)NanoVG
createImageFromRGBA(uint w, uint h, const uchar *data, ImageFlags imageFlags)NanoVG
createImageFromRGBA(uint w, uint h, const uchar *data, int imageFlags)NanoVG
createImageFromTextureHandle(GLuint textureId, uint w, uint h, ImageFlags imageFlags, bool deleteTexture=false)NanoVG
createImageFromTextureHandle(GLuint textureId, uint w, uint h, int imageFlags, bool deleteTexture=false)NanoVG
currentTransform(float xform[6])NanoVG
CW enum value (defined in NanoVG)NanoVG
degToRad(float deg)NanoVGstatic
ellipse(float cx, float cy, float rx, float ry)NanoVG
fill()NanoVG
fillColor(const Color &color)NanoVG
fillColor(const int red, const int green, const int blue, const int alpha=255)NanoVG
fillColor(const float red, const float green, const float blue, const float alpha=1.0f)NanoVG
fillPaint(const Paint &paint)NanoVG
findFont(const char *name)NanoVG
fontBlur(float blur)NanoVG
fontFace(const char *font)NanoVG
fontFaceId(FontId font)NanoVG
FontId typedef (defined in NanoVG)NanoVG
fontSize(float size)NanoVG
getAbsolutePos() const noexceptWidget
getAbsoluteX() const noexceptWidget
getAbsoluteY() const noexceptWidget
getContext() const noexceptNanoVGinline
getHeight() const noexceptWidget
getIconId() const noexcept (defined in BlendishButton)BlendishButton
getId() const noexceptWidget
getParentApp() const noexceptWidget
getParentWindow() const noexceptWidget
getSize() const noexceptWidget
getText() const noexcept (defined in BlendishButton)BlendishButton
getWidth() const noexceptWidget
globalAlpha(float alpha)NanoVG
hide()Widget
HOLE enum value (defined in NanoVG)NanoVG
IMAGE_FLIP_Y enum value (defined in NanoVG)NanoVG
IMAGE_GENERATE_MIPMAPS enum value (defined in NanoVG)NanoVG
IMAGE_PREMULTIPLIED enum value (defined in NanoVG)NanoVG
IMAGE_REPEAT_X enum value (defined in NanoVG)NanoVG
IMAGE_REPEAT_Y enum value (defined in NanoVG)NanoVG
ImageFlags enum name (defined in NanoVG)NanoVG
imagePattern(float ox, float oy, float ex, float ey, float angle, const NanoImage &image, float alpha)NanoVG
intersectScissor(float x, float y, float w, float h)NanoVG
isVisible() const noexceptWidget
linearGradient(float sx, float sy, float ex, float ey, const Color &icol, const Color &ocol)NanoVG
lineCap(LineCap cap=BUTT)NanoVG
LineCap enum name (defined in NanoVG)NanoVG
lineJoin(LineCap join=MITER)NanoVG
lineTo(float x, float y)NanoVG
MITER enum value (defined in NanoVG)NanoVG
miterLimit(float limit)NanoVG
moveTo(float x, float y)NanoVG
NanoVG(int flags=CREATE_ANTIALIAS)NanoVG
NanoVG(NanoWidget *groupWidget)NanoVG
NanoWidget(Window &parent, int flags=CREATE_ANTIALIAS)NanoWidgetexplicit
NanoWidget(Widget *groupWidget, int flags=CREATE_ANTIALIAS)NanoWidgetexplicit
NanoWidget(NanoWidget *groupWidget)NanoWidgetexplicit
onKeyboard(const KeyboardEvent &)Widgetprotectedvirtual
onMotion(const MotionEvent &) overrideBlendishButtonprotectedvirtual
onMouse(const MouseEvent &) overrideBlendishButtonprotectedvirtual
onNanoDisplay() overrideBlendishButtonprotectedvirtual
onResize(const ResizeEvent &)Widgetprotectedvirtual
onScroll(const ScrollEvent &)Widgetprotectedvirtual
onSpecial(const SpecialEvent &)Widgetprotectedvirtual
pathWinding(Winding dir)NanoVG
quadTo(float cx, float cy, float x, float y)NanoVG
radialGradient(float cx, float cy, float inr, float outr, const Color &icol, const Color &ocol)NanoVG
radToDeg(float rad)NanoVGstatic
rect(float x, float y, float w, float h)NanoVG
repaint() noexceptWidget
reset()NanoVG
resetScissor()NanoVG
resetTransform()NanoVG
restore()NanoVG
rotate(float angle)NanoVG
ROUND enum value (defined in NanoVG)NanoVG
roundedRect(float x, float y, float w, float h, float r)NanoVG
save()NanoVG
scale(float x, float y)NanoVG
scissor(float x, float y, float w, float h)NanoVG
setAbsolutePos(int x, int y) noexceptWidget
setAbsolutePos(const Point< int > &pos) noexceptWidget
setAbsoluteX(int x) noexceptWidget
setAbsoluteY(int y) noexceptWidget
setCallback(Callback *callback) noexcept (defined in BlendishButton)BlendishButton
setHeight(uint height) noexceptWidget
setIconId(int iconId) noexcept (defined in BlendishButton)BlendishButton
setId(uint id) noexceptWidget
setSize(uint width, uint height) noexceptWidget
setSize(const Size< uint > &size) noexceptWidget
setText(const char *text) noexcept (defined in BlendishButton)BlendishButton
setVisible(bool yesNo)Widget
setWidth(uint width) noexceptWidget
show()Widget
skewX(float angle)NanoVG
skewY(float angle)NanoVG
SOLID enum value (defined in NanoVG)NanoVG
Solidity enum name (defined in NanoVG)NanoVG
SQUARE enum value (defined in NanoVG)NanoVG
stroke()NanoVG
strokeColor(const Color &color)NanoVG
strokeColor(const int red, const int green, const int blue, const int alpha=255)NanoVG
strokeColor(const float red, const float green, const float blue, const float alpha=1.0f)NanoVG
strokePaint(const Paint &paint)NanoVG
strokeWidth(float size)NanoVG
text(float x, float y, const char *string, const char *end)NanoVG
textAlign(Align align)NanoVG
textAlign(int align)NanoVG
textBounds(float x, float y, const char *string, const char *end, Rectangle< float > &bounds)NanoVG
textBox(float x, float y, float breakRowWidth, const char *string, const char *end=nullptr)NanoVG
textBoxBounds(float x, float y, float breakRowWidth, const char *string, const char *end, float bounds[4])NanoVG
textBreakLines(const char *string, const char *end, float breakRowWidth, TextRow &rows, int maxRows)NanoVG
textGlyphPositions(float x, float y, const char *string, const char *end, GlyphPosition &positions, int maxPositions)NanoVG
textLetterSpacing(float spacing)NanoVG
textLineHeight(float lineHeight)NanoVG
textMetrics(float *ascender, float *descender, float *lineh)NanoVG
transform(float a, float b, float c, float d, float e, float f)NanoVG
transformIdentity(float dst[6])NanoVGstatic
transformInverse(float dst[6], const float src[6])NanoVGstatic
transformMultiply(float dst[6], const float src[6])NanoVGstatic
transformPoint(float &dstx, float &dsty, const float xform[6], float srcx, float srcy)NanoVGstatic
transformPremultiply(float dst[6], const float src[6])NanoVGstatic
transformRotate(float dst[6], float a)NanoVGstatic
transformScale(float dst[6], float sx, float sy)NanoVGstatic
transformSkewX(float dst[6], float a)NanoVGstatic
transformSkewY(float dst[6], float a)NanoVGstatic
transformTranslate(float dst[6], float tx, float ty)NanoVGstatic
translate(float x, float y)NanoVG
Widget(Window &parent)Widgetexplicit
Widget(Widget *groupWidget)Widgetexplicit
Winding enum name (defined in NanoVG)NanoVG
~BlendishButton() override (defined in BlendishButton)BlendishButton
~NanoVG()NanoVGvirtual
~NanoWidget()NanoWidgetvirtual
~Widget()Widgetvirtual
- - - - diff --git a/classBlendishButton.html b/classBlendishButton.html deleted file mode 100644 index 937bd520..00000000 --- a/classBlendishButton.html +++ /dev/null @@ -1,550 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: BlendishButton Class Reference - - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - -
-
- - -
- -
- -
-
- -
-
BlendishButton Class Reference
-
-
-
-Inheritance diagram for BlendishButton:
-
-
- - -NanoWidget -Widget -NanoVG - -
- - - - -

-Classes

class  Callback
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

BlendishButton (Window &parent, const char *text="", int iconId=-1)
 
BlendishButton (NanoWidget *widget, const char *text="", int iconId=-1)
 
-int getIconId () const noexcept
 
-void setIconId (int iconId) noexcept
 
-const char * getText () const noexcept
 
-void setText (const char *text) noexcept
 
-void setCallback (Callback *callback) noexcept
 
- Public Member Functions inherited from NanoWidget
 NanoWidget (Window &parent, int flags=CREATE_ANTIALIAS)
 
 NanoWidget (Widget *groupWidget, int flags=CREATE_ANTIALIAS)
 
 NanoWidget (NanoWidget *groupWidget)
 
virtual ~NanoWidget ()
 
- Public Member Functions inherited from Widget
 Widget (Window &parent)
 
 Widget (Widget *groupWidget)
 
virtual ~Widget ()
 
bool isVisible () const noexcept
 
void setVisible (bool yesNo)
 
void show ()
 
void hide ()
 
uint getWidth () const noexcept
 
uint getHeight () const noexcept
 
const Size< uint > & getSize () const noexcept
 
void setWidth (uint width) noexcept
 
void setHeight (uint height) noexcept
 
void setSize (uint width, uint height) noexcept
 
void setSize (const Size< uint > &size) noexcept
 
int getAbsoluteX () const noexcept
 
int getAbsoluteY () const noexcept
 
const Point< int > & getAbsolutePos () const noexcept
 
void setAbsoluteX (int x) noexcept
 
void setAbsoluteY (int y) noexcept
 
void setAbsolutePos (int x, int y) noexcept
 
void setAbsolutePos (const Point< int > &pos) noexcept
 
ApplicationgetParentApp () const noexcept
 
WindowgetParentWindow () const noexcept
 
bool contains (int x, int y) const noexcept
 
bool contains (const Point< int > &pos) const noexcept
 
void repaint () noexcept
 
uint getId () const noexcept
 
void setId (uint id) noexcept
 
- Public Member Functions inherited from NanoVG
 NanoVG (int flags=CREATE_ANTIALIAS)
 
 NanoVG (NanoWidget *groupWidget)
 
virtual ~NanoVG ()
 
NVGcontext * getContext () const noexcept
 
void beginFrame (const uint width, const uint height, const float scaleFactor=1.0f)
 
void beginFrame (Widget *const widget)
 
void cancelFrame ()
 
void endFrame ()
 
void save ()
 
void restore ()
 
void reset ()
 
void strokeColor (const Color &color)
 
void strokeColor (const int red, const int green, const int blue, const int alpha=255)
 
void strokeColor (const float red, const float green, const float blue, const float alpha=1.0f)
 
void strokePaint (const Paint &paint)
 
void fillColor (const Color &color)
 
void fillColor (const int red, const int green, const int blue, const int alpha=255)
 
void fillColor (const float red, const float green, const float blue, const float alpha=1.0f)
 
void fillPaint (const Paint &paint)
 
void miterLimit (float limit)
 
void strokeWidth (float size)
 
void lineCap (LineCap cap=BUTT)
 
void lineJoin (LineCap join=MITER)
 
void globalAlpha (float alpha)
 
void resetTransform ()
 
void transform (float a, float b, float c, float d, float e, float f)
 
void translate (float x, float y)
 
void rotate (float angle)
 
void skewX (float angle)
 
void skewY (float angle)
 
void scale (float x, float y)
 
void currentTransform (float xform[6])
 
NanoImage::Handle createImageFromFile (const char *filename, ImageFlags imageFlags)
 
NanoImage::Handle createImageFromFile (const char *filename, int imageFlags)
 
NanoImage::Handle createImageFromMemory (uchar *data, uint dataSize, ImageFlags imageFlags)
 
NanoImage::Handle createImageFromMemory (uchar *data, uint dataSize, int imageFlags)
 
NanoImage::Handle createImageFromRGBA (uint w, uint h, const uchar *data, ImageFlags imageFlags)
 
NanoImage::Handle createImageFromRGBA (uint w, uint h, const uchar *data, int imageFlags)
 
NanoImage::Handle createImageFromTextureHandle (GLuint textureId, uint w, uint h, ImageFlags imageFlags, bool deleteTexture=false)
 
NanoImage::Handle createImageFromTextureHandle (GLuint textureId, uint w, uint h, int imageFlags, bool deleteTexture=false)
 
Paint linearGradient (float sx, float sy, float ex, float ey, const Color &icol, const Color &ocol)
 
Paint boxGradient (float x, float y, float w, float h, float r, float f, const Color &icol, const Color &ocol)
 
Paint radialGradient (float cx, float cy, float inr, float outr, const Color &icol, const Color &ocol)
 
Paint imagePattern (float ox, float oy, float ex, float ey, float angle, const NanoImage &image, float alpha)
 
void scissor (float x, float y, float w, float h)
 
void intersectScissor (float x, float y, float w, float h)
 
void resetScissor ()
 
void beginPath ()
 
void moveTo (float x, float y)
 
void lineTo (float x, float y)
 
void bezierTo (float c1x, float c1y, float c2x, float c2y, float x, float y)
 
void quadTo (float cx, float cy, float x, float y)
 
void arcTo (float x1, float y1, float x2, float y2, float radius)
 
void closePath ()
 
void pathWinding (Winding dir)
 
void arc (float cx, float cy, float r, float a0, float a1, Winding dir)
 
void rect (float x, float y, float w, float h)
 
void roundedRect (float x, float y, float w, float h, float r)
 
void ellipse (float cx, float cy, float rx, float ry)
 
void circle (float cx, float cy, float r)
 
void fill ()
 
void stroke ()
 
FontId createFontFromFile (const char *name, const char *filename)
 
FontId createFontFromMemory (const char *name, const uchar *data, uint dataSize, bool freeData)
 
FontId findFont (const char *name)
 
void fontSize (float size)
 
void fontBlur (float blur)
 
void textLetterSpacing (float spacing)
 
void textLineHeight (float lineHeight)
 
void textAlign (Align align)
 
void textAlign (int align)
 
void fontFaceId (FontId font)
 
void fontFace (const char *font)
 
float text (float x, float y, const char *string, const char *end)
 
void textBox (float x, float y, float breakRowWidth, const char *string, const char *end=nullptr)
 
float textBounds (float x, float y, const char *string, const char *end, Rectangle< float > &bounds)
 
void textBoxBounds (float x, float y, float breakRowWidth, const char *string, const char *end, float bounds[4])
 
int textGlyphPositions (float x, float y, const char *string, const char *end, GlyphPosition &positions, int maxPositions)
 
void textMetrics (float *ascender, float *descender, float *lineh)
 
int textBreakLines (const char *string, const char *end, float breakRowWidth, TextRow &rows, int maxRows)
 
- - - - - - - - - - - - - - - - -

-Protected Member Functions

void onNanoDisplay () override
 
bool onMouse (const MouseEvent &) override
 
bool onMotion (const MotionEvent &) override
 
- Protected Member Functions inherited from Widget
virtual bool onKeyboard (const KeyboardEvent &)
 
virtual bool onSpecial (const SpecialEvent &)
 
virtual bool onScroll (const ScrollEvent &)
 
virtual void onResize (const ResizeEvent &)
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Additional Inherited Members

- Public Types inherited from NanoVG
enum  CreateFlags { CREATE_ANTIALIAS = 1 << 0, -CREATE_STENCIL_STROKES = 1 << 1, -CREATE_DEBUG = 1 << 2 - }
 
enum  ImageFlags {
-  IMAGE_GENERATE_MIPMAPS = 1 << 0, -IMAGE_REPEAT_X = 1 << 1, -IMAGE_REPEAT_Y = 1 << 2, -IMAGE_FLIP_Y = 1 << 3, -
-  IMAGE_PREMULTIPLIED = 1 << 4 -
- }
 
enum  Align {
-  ALIGN_LEFT = 1 << 0, -ALIGN_CENTER = 1 << 1, -ALIGN_RIGHT = 1 << 2, -ALIGN_TOP = 1 << 3, -
-  ALIGN_MIDDLE = 1 << 4, -ALIGN_BOTTOM = 1 << 5, -ALIGN_BASELINE = 1 << 6 -
- }
 
enum  LineCap {
-  BUTT, -ROUND, -SQUARE, -BEVEL, -
-  MITER -
- }
 
enum  Solidity { SOLID = 1, -HOLE = 2 - }
 
enum  Winding { CCW = 1, -CW = 2 - }
 
-typedef int FontId
 
- Static Public Member Functions inherited from NanoVG
static void transformIdentity (float dst[6])
 
static void transformTranslate (float dst[6], float tx, float ty)
 
static void transformScale (float dst[6], float sx, float sy)
 
static void transformRotate (float dst[6], float a)
 
static void transformSkewX (float dst[6], float a)
 
static void transformSkewY (float dst[6], float a)
 
static void transformMultiply (float dst[6], const float src[6])
 
static void transformPremultiply (float dst[6], const float src[6])
 
static int transformInverse (float dst[6], const float src[6])
 
static void transformPoint (float &dstx, float &dsty, const float xform[6], float srcx, float srcy)
 
static float degToRad (float deg)
 
static float radToDeg (float rad)
 
-

Member Function Documentation

- -
-
- - - - - -
- - - - - - - -
void BlendishButton::onNanoDisplay ()
-
-overrideprotectedvirtual
-
-

New virtual onDisplay function.

See also
onDisplay
- -

Implements NanoWidget.

- -
-
- -
-
- - - - - -
- - - - - - - - -
bool BlendishButton::onMouse (const MouseEvent)
-
-overrideprotectedvirtual
-
-

A function called when a mouse button is pressed or released.

Returns
True to stop event propagation, false otherwise.
- -

Reimplemented from Widget.

- -
-
- -
-
- - - - - -
- - - - - - - - -
bool BlendishButton::onMotion (const MotionEvent)
-
-overrideprotectedvirtual
-
-

A function called when the pointer moves.

Returns
True to stop event propagation, false otherwise.
- -

Reimplemented from Widget.

- -
-
-
The documentation for this class was generated from the following file: -
- - - - diff --git a/classBlendishButton.png b/classBlendishButton.png deleted file mode 100644 index 889325a117a765586b960f17332ee5d031f18b56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 906 zcmeAS@N?(olHy`uVBq!ia0vp^CxEzvgBeIpy%%x-NJ#|vgt-3y{~ySF@#br3|Dg#$ z78oBmaDcV*jy#adQ4-`A%m7pb0#{Fk7%?y~OM1FEhEy=Vo%^tCwSoZK@&4kP|L*(L zq*#w|p}6wcKCz2aCNE*qRa&p~^7DI_XZz2nYpbmExhv&4 zE#cR%DUToi?>({S$G?<~>x)bEH{G#5$@%=Hd0g7jg+Ht(K6?I2^-^lD&dS#gD*uw~ z=SO8e(oR`x{yy)XyPW=+;s_J2&$*sjA1=@RtI|H>_D$7HcUPl5Z6|K3Rmci@t~%nX zvXWJN;u5YHmq}4GT%0%-%1`v*Q2fHYpjGgJ@RxTl^pqa|P@H^E_O5G6)!%fVs`3(P z!ShiJxjQ%cPL7ifDhknRmh>GdN!=*F-d5W?xh z231t)l2nN{kdGJUhXaGGt(#%aBPE7ho!GrWJ{zB}ELwa1mUvW6sDvVef9;GY}M>1rPb#`UQXV(nc3vA x62o#}L`dr~6?AnoY$=qVm?+U!$6)fApFPQT>XH;68DPd?@O1TaS?83{1OU@)ji3Mk diff --git a/classBlendishButton_1_1Callback-members.html b/classBlendishButton_1_1Callback-members.html deleted file mode 100644 index 9ffaac9c..00000000 --- a/classBlendishButton_1_1Callback-members.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: Member List - - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - -
-
- - -
- -
- - -
-
-
-
BlendishButton::Callback Member List
-
-
- -

This is the complete list of members for BlendishButton::Callback, including all inherited members.

- - - -
blendishButtonClicked(BlendishButton *blendishButton, int button)=0 (defined in BlendishButton::Callback)BlendishButton::Callbackpure virtual
~Callback() (defined in BlendishButton::Callback)BlendishButton::Callbackinlinevirtual
- - - - diff --git a/classBlendishButton_1_1Callback.html b/classBlendishButton_1_1Callback.html deleted file mode 100644 index 44213396..00000000 --- a/classBlendishButton_1_1Callback.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - -DISTRHO Plugin Framework: BlendishButton::Callback Class Reference - - - - - - - - - - -
-
- - - - - - -
-
DISTRHO Plugin Framework -
-
-
- - - - - - -
-
- - -
- -
- - -
-
- -
-
BlendishButton::Callback Class Referenceabstract
-
-
- - - - -

-Public Member Functions

-virtual void blendishButtonClicked (BlendishButton *blendishButton, int button)=0
 
-
The documentation for this class was generated from the following file: -
- - - - diff --git a/classCircle-members.html b/classCircle-members.html index de24501a..0e431b4a 100644 --- a/classCircle-members.html +++ b/classCircle-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classCircle.html b/classCircle.html index b455a354..bdef5c6d 100644 --- a/classCircle.html +++ b/classCircle.html @@ -622,7 +622,7 @@ template<typename T> diff --git a/classExternalWindow-members.html b/classExternalWindow-members.html index 701a2e78..60eb8c1e 100644 --- a/classExternalWindow-members.html +++ b/classExternalWindow-members.html @@ -68,16 +68,22 @@ $(function() { ExternalWindow(const uint w=1, const uint h=1, const char *const t="") (defined in ExternalWindow)ExternalWindowinline getHeight() const noexcept (defined in ExternalWindow)ExternalWindowinline getTitle() const noexcept (defined in ExternalWindow)ExternalWindowinline - getWidth() const noexcept (defined in ExternalWindow)ExternalWindowinline - isRunning() noexcept (defined in ExternalWindow)ExternalWindowinline - setTitle(const char *const t) noexcept (defined in ExternalWindow)ExternalWindowinline - startExternalProcess(const char *args[]) (defined in ExternalWindow)ExternalWindowinlineprotected + getTransientWinId() const noexcept (defined in ExternalWindow)ExternalWindowinline + getWidth() const noexcept (defined in ExternalWindow)ExternalWindowinline + isRunning() noexcept (defined in ExternalWindow)ExternalWindowinline + isVisible() const noexcept (defined in ExternalWindow)ExternalWindowinline + setSize(uint w, uint h) (defined in ExternalWindow)ExternalWindowinlinevirtual + setTitle(const char *const t) (defined in ExternalWindow)ExternalWindowinlinevirtual + setTransientWinId(const uintptr_t winId) (defined in ExternalWindow)ExternalWindowinlinevirtual + setVisible(const bool yesNo) (defined in ExternalWindow)ExternalWindowinlinevirtual + startExternalProcess(const char *args[]) (defined in ExternalWindow)ExternalWindowinlineprotected + terminateAndWaitForProcess() (defined in ExternalWindow)ExternalWindowinlineprotected UIExporter (defined in ExternalWindow)ExternalWindowfriend ~ExternalWindow() (defined in ExternalWindow)ExternalWindowinlinevirtual diff --git a/classExternalWindow.html b/classExternalWindow.html index 0fb1d498..784c5825 100644 --- a/classExternalWindow.html +++ b/classExternalWindow.html @@ -82,18 +82,36 @@ uint getHeight () cons const char * getTitle () const noexcept   - -void setTitle (const char *const t) noexcept -  + +uintptr_t getTransientWinId () const noexcept +  + +bool isVisible () const noexcept +  bool isRunning () noexcept   + +virtual void setSize (uint w, uint h) +  + +virtual void setTitle (const char *const t) +  + +virtual void setTransientWinId (const uintptr_t winId) +  + +virtual void setVisible (const bool yesNo) +  + +

Protected Member Functions

bool startExternalProcess (const char *args[])
 
+void terminateAndWaitForProcess ()
 
@@ -107,7 +125,7 @@ class < diff --git a/classIdleCallback-members.html b/classIdleCallback-members.html index 53ca6a5e..d37c34b7 100644 --- a/classIdleCallback-members.html +++ b/classIdleCallback-members.html @@ -70,7 +70,7 @@ $(function() {

Friends

UIExporter
diff --git a/classIdleCallback.html b/classIdleCallback.html index 64aff4cf..6cbc30df 100644 --- a/classIdleCallback.html +++ b/classIdleCallback.html @@ -82,7 +82,7 @@ virtual void idleCallback< diff --git a/classImage-members.html b/classImage-members.html index 4f90db7f..d83d9286 100644 --- a/classImage-members.html +++ b/classImage-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classImage.html b/classImage.html index 3102c712..7973e525 100644 --- a/classImage.html +++ b/classImage.html @@ -622,7 +622,7 @@ bool operator!= (const diff --git a/classImageAboutWindow-members.html b/classImageAboutWindow-members.html index 8d076e20..591af993 100644 --- a/classImageAboutWindow-members.html +++ b/classImageAboutWindow-members.html @@ -79,8 +79,10 @@ $(function() { getHeight() const noexcept (defined in Window)Window Widget::getHeight() const noexceptWidget getId() const noexceptWidget - getParentApp() const noexceptWidget - getParentWindow() const noexceptWidget + getIgnoringKeyRepeat() const noexcept (defined in Window)Window + getParentApp() const noexceptWidget + getParentWindow() const noexceptWidget + getScaling() const noexcept (defined in Window)Window getSize() const noexcept (defined in Window)Window Widget::getSize() const noexceptWidget getTitle() const noexcept (defined in Window)Window @@ -91,16 +93,18 @@ $(function() { Widget::hide()Widget ImageAboutWindow(Window &parent, const Image &image=Image()) (defined in ImageAboutWindow)ImageAboutWindowexplicit ImageAboutWindow(Widget *widget, const Image &image=Image()) (defined in ImageAboutWindow)ImageAboutWindowexplicit - isResizable() const noexcept (defined in Window)Window - isVisible() const noexcept (defined in Window)Window - Widget::isVisible() const noexceptWidget - onClose() (defined in Window)Windowprotectedvirtual - onDisplay() overrideImageAboutWindowprotectedvirtual - onDisplayAfter() (defined in Window)Windowprotectedvirtual - onDisplayBefore() (defined in Window)Windowprotectedvirtual - onKeyboard(const KeyboardEvent &) overrideImageAboutWindowprotectedvirtual - onMotion(const MotionEvent &)Widgetprotectedvirtual - onMouse(const MouseEvent &) overrideImageAboutWindowprotectedvirtual + isEmbed() const noexcept (defined in Window)Window + isResizable() const noexcept (defined in Window)Window + isVisible() const noexcept (defined in Window)Window + Widget::isVisible() const noexceptWidget + onClose() (defined in Window)Windowprotectedvirtual + onDisplay() overrideImageAboutWindowprotectedvirtual + onDisplayAfter() (defined in Window)Windowprotectedvirtual + onDisplayBefore() (defined in Window)Windowprotectedvirtual + onKeyboard(const KeyboardEvent &) overrideImageAboutWindowprotectedvirtual + onMotion(const MotionEvent &)Widgetprotectedvirtual + onMouse(const MouseEvent &) overrideImageAboutWindowprotectedvirtual + onPositionChanged(const PositionChangedEvent &)Widgetprotectedvirtual onReshape(uint width, uint height) override (defined in ImageAboutWindow)ImageAboutWindowprotectedvirtual onResize(const ResizeEvent &)Widgetprotectedvirtual onScroll(const ScrollEvent &)Widgetprotectedvirtual @@ -113,32 +117,35 @@ $(function() { setAbsolutePos(const Point< int > &pos) noexceptWidget setAbsoluteX(int x) noexceptWidget setAbsoluteY(int y) noexceptWidget - setHeight(uint height) noexceptWidget - setId(uint id) noexceptWidget + setGeometryConstraints(uint width, uint height, bool aspect) (defined in Window)Window + setHeight(uint height) noexceptWidget + setId(uint id) noexceptWidget + setIgnoringKeyRepeat(bool ignore) noexcept (defined in Window)Window setImage(const Image &image) (defined in ImageAboutWindow)ImageAboutWindow setResizable(bool yesNo) (defined in Window)Window - setSize(uint width, uint height) (defined in Window)Window - setSize(Size< uint > size) (defined in Window)Window - Widget::setSize(uint width, uint height) noexceptWidget - Widget::setSize(const Size< uint > &size) noexceptWidget - setTitle(const char *title) (defined in Window)Window - setTransientWinId(uintptr_t winId) (defined in Window)Window - setVisible(bool yesNo) (defined in Window)Window - Widget::setVisible(bool yesNo)Widget - setWidth(uint width) noexceptWidget - show() (defined in Window)Window - Widget::show()Widget - Widget(Window &parent)Widgetexplicit - Widget::Widget(Widget *groupWidget)Widgetexplicit - Window(Application &app) (defined in Window)Windowexplicit - Window(Application &app, Window &parent) (defined in Window)Windowexplicit - Window(Application &app, intptr_t parentId) (defined in Window)Windowexplicit - ~Widget()Widgetvirtual - ~Window() (defined in Window)Windowvirtual + setScaling(double scaling) noexcept (defined in Window)Window + setSize(uint width, uint height) (defined in Window)Window + setSize(Size< uint > size) (defined in Window)Window + Widget::setSize(uint width, uint height) noexceptWidget + Widget::setSize(const Size< uint > &size) noexceptWidget + setTitle(const char *title) (defined in Window)Window + setTransientWinId(uintptr_t winId) (defined in Window)Window + setVisible(bool yesNo) (defined in Window)Window + Widget::setVisible(bool yesNo)Widget + setWidth(uint width) noexceptWidget + show() (defined in Window)Window + Widget::show()Widget + Widget(Window &parent)Widgetexplicit + Widget::Widget(Widget *groupWidget)Widgetexplicit + Window(Application &app) (defined in Window)Windowexplicit + Window(Application &app, Window &parent) (defined in Window)Windowexplicit + Window(Application &app, intptr_t parentId, bool resizable) (defined in Window)Windowexplicit + ~Widget()Widgetvirtual + ~Window() (defined in Window)Windowvirtual diff --git a/classImageAboutWindow.html b/classImageAboutWindow.html index 3096a94a..ef951591 100644 --- a/classImageAboutWindow.html +++ b/classImageAboutWindow.html @@ -95,9 +95,9 @@ void setImage (const <  Window (Application &app, Window &parent)   -Window (Application &app, intptr_t parentId) -  +Window (Application &app, intptr_t parentId, bool resizable) +  void show ()   @@ -119,6 +119,9 @@ void repaint () noexce bool openFileBrowser (const FileBrowserOptions &options)   + +bool isEmbed () const noexcept +  bool isVisible () const noexcept   @@ -152,9 +155,24 @@ const char * getTitle void setTitle (const char *title)   + +void setGeometryConstraints (uint width, uint height, bool aspect) +  void setTransientWinId (uintptr_t winId)   + +double getScaling () const noexcept +  + +void setScaling (double scaling) noexcept +  + +bool getIgnoringKeyRepeat () const noexcept +  + +void setIgnoringKeyRepeat (bool ignore) noexcept +  ApplicationgetApp () const noexcept   @@ -258,6 +276,8 @@ virtual void fileBrowserSe   virtual void onResize (const ResizeEvent &)   +virtual void onPositionChanged (const PositionChangedEvent &) + 

Member Function Documentation

@@ -352,7 +372,7 @@ virtual void fileBrowserSe diff --git a/classImageButton-members.html b/classImageButton-members.html index 01267f61..f08d1242 100644 --- a/classImageButton-members.html +++ b/classImageButton-members.html @@ -88,30 +88,31 @@ $(function() { onKeyboard(const KeyboardEvent &)Widgetprotectedvirtual onMotion(const MotionEvent &) overrideImageButtonprotectedvirtual onMouse(const MouseEvent &) overrideImageButtonprotectedvirtual - onResize(const ResizeEvent &)Widgetprotectedvirtual - onScroll(const ScrollEvent &)Widgetprotectedvirtual - onSpecial(const SpecialEvent &)Widgetprotectedvirtual - repaint() noexceptWidget - setAbsolutePos(int x, int y) noexceptWidget - setAbsolutePos(const Point< int > &pos) noexceptWidget - setAbsoluteX(int x) noexceptWidget - setAbsoluteY(int y) noexceptWidget - setCallback(Callback *callback) noexcept (defined in ImageButton)ImageButton - setHeight(uint height) noexceptWidget - setId(uint id) noexceptWidget - setSize(uint width, uint height) noexceptWidget - setSize(const Size< uint > &size) noexceptWidget - setVisible(bool yesNo)Widget - setWidth(uint width) noexceptWidget - show()Widget - Widget(Window &parent)Widgetexplicit - Widget(Widget *groupWidget)Widgetexplicit - ~ImageButton() override (defined in ImageButton)ImageButton - ~Widget()Widgetvirtual + onPositionChanged(const PositionChangedEvent &)Widgetprotectedvirtual + onResize(const ResizeEvent &)Widgetprotectedvirtual + onScroll(const ScrollEvent &)Widgetprotectedvirtual + onSpecial(const SpecialEvent &)Widgetprotectedvirtual + repaint() noexceptWidget + setAbsolutePos(int x, int y) noexceptWidget + setAbsolutePos(const Point< int > &pos) noexceptWidget + setAbsoluteX(int x) noexceptWidget + setAbsoluteY(int y) noexceptWidget + setCallback(Callback *callback) noexcept (defined in ImageButton)ImageButton + setHeight(uint height) noexceptWidget + setId(uint id) noexceptWidget + setSize(uint width, uint height) noexceptWidget + setSize(const Size< uint > &size) noexceptWidget + setVisible(bool yesNo)Widget + setWidth(uint width) noexceptWidget + show()Widget + Widget(Window &parent)Widgetexplicit + Widget(Widget *groupWidget)Widgetexplicit + ~ImageButton() override (defined in ImageButton)ImageButton + ~Widget()Widgetvirtual diff --git a/classImageButton.html b/classImageButton.html index 3127b34f..c8c38d37 100644 --- a/classImageButton.html +++ b/classImageButton.html @@ -180,6 +180,8 @@ Protected Member Functions   virtual void onResize (const ResizeEvent &)   +virtual void onPositionChanged (const PositionChangedEvent &) + 

Member Function Documentation

@@ -274,7 +276,7 @@ Protected Member Functions diff --git a/classImageButton_1_1Callback-members.html b/classImageButton_1_1Callback-members.html index aa1e82ab..b2a0c926 100644 --- a/classImageButton_1_1Callback-members.html +++ b/classImageButton_1_1Callback-members.html @@ -74,7 +74,7 @@ $(function() { diff --git a/classImageButton_1_1Callback.html b/classImageButton_1_1Callback.html index 06db0032..e7829b8e 100644 --- a/classImageButton_1_1Callback.html +++ b/classImageButton_1_1Callback.html @@ -82,7 +82,7 @@ virtual void imageButtonCl diff --git a/classImageKnob-members.html b/classImageKnob-members.html index 480e7cc4..a8f4ad7e 100644 --- a/classImageKnob-members.html +++ b/classImageKnob-members.html @@ -87,41 +87,42 @@ $(function() { onKeyboard(const KeyboardEvent &)Widgetprotectedvirtual onMotion(const MotionEvent &) overrideImageKnobprotectedvirtual onMouse(const MouseEvent &) overrideImageKnobprotectedvirtual - onResize(const ResizeEvent &)Widgetprotectedvirtual - onScroll(const ScrollEvent &) overrideImageKnobprotectedvirtual - onSpecial(const SpecialEvent &)Widgetprotectedvirtual - operator=(const ImageKnob &imageKnob) (defined in ImageKnob)ImageKnob - Orientation enum name (defined in ImageKnob)ImageKnob - repaint() noexceptWidget - setAbsolutePos(int x, int y) noexceptWidget - setAbsolutePos(const Point< int > &pos) noexceptWidget - setAbsoluteX(int x) noexceptWidget - setAbsoluteY(int y) noexceptWidget - setCallback(Callback *callback) noexcept (defined in ImageKnob)ImageKnob - setDefault(float def) noexcept (defined in ImageKnob)ImageKnob - setHeight(uint height) noexceptWidget - setId(uint id) noexceptWidget - setImageLayerCount(uint count) noexcept (defined in ImageKnob)ImageKnob - setOrientation(Orientation orientation) noexcept (defined in ImageKnob)ImageKnob - setRange(float min, float max) noexcept (defined in ImageKnob)ImageKnob - setRotationAngle(int angle) (defined in ImageKnob)ImageKnob - setSize(uint width, uint height) noexceptWidget - setSize(const Size< uint > &size) noexceptWidget - setStep(float step) noexcept (defined in ImageKnob)ImageKnob - setUsingLogScale(bool yesNo) noexcept (defined in ImageKnob)ImageKnob - setValue(float value, bool sendCallback=false) noexcept (defined in ImageKnob)ImageKnob - setVisible(bool yesNo)Widget - setWidth(uint width) noexceptWidget - show()Widget - Vertical enum value (defined in ImageKnob)ImageKnob - Widget(Window &parent)Widgetexplicit - Widget(Widget *groupWidget)Widgetexplicit - ~ImageKnob() override (defined in ImageKnob)ImageKnob - ~Widget()Widgetvirtual + onPositionChanged(const PositionChangedEvent &)Widgetprotectedvirtual + onResize(const ResizeEvent &)Widgetprotectedvirtual + onScroll(const ScrollEvent &) overrideImageKnobprotectedvirtual + onSpecial(const SpecialEvent &)Widgetprotectedvirtual + operator=(const ImageKnob &imageKnob) (defined in ImageKnob)ImageKnob + Orientation enum name (defined in ImageKnob)ImageKnob + repaint() noexceptWidget + setAbsolutePos(int x, int y) noexceptWidget + setAbsolutePos(const Point< int > &pos) noexceptWidget + setAbsoluteX(int x) noexceptWidget + setAbsoluteY(int y) noexceptWidget + setCallback(Callback *callback) noexcept (defined in ImageKnob)ImageKnob + setDefault(float def) noexcept (defined in ImageKnob)ImageKnob + setHeight(uint height) noexceptWidget + setId(uint id) noexceptWidget + setImageLayerCount(uint count) noexcept (defined in ImageKnob)ImageKnob + setOrientation(Orientation orientation) noexcept (defined in ImageKnob)ImageKnob + setRange(float min, float max) noexcept (defined in ImageKnob)ImageKnob + setRotationAngle(int angle) (defined in ImageKnob)ImageKnob + setSize(uint width, uint height) noexceptWidget + setSize(const Size< uint > &size) noexceptWidget + setStep(float step) noexcept (defined in ImageKnob)ImageKnob + setUsingLogScale(bool yesNo) noexcept (defined in ImageKnob)ImageKnob + setValue(float value, bool sendCallback=false) noexcept (defined in ImageKnob)ImageKnob + setVisible(bool yesNo)Widget + setWidth(uint width) noexceptWidget + show()Widget + Vertical enum value (defined in ImageKnob)ImageKnob + Widget(Window &parent)Widgetexplicit + Widget(Widget *groupWidget)Widgetexplicit + ~ImageKnob() override (defined in ImageKnob)ImageKnob + ~Widget()Widgetvirtual diff --git a/classImageKnob.html b/classImageKnob.html index 70c6b489..864261cf 100644 --- a/classImageKnob.html +++ b/classImageKnob.html @@ -209,6 +209,8 @@ Protected Member Functions   virtual void onResize (const ResizeEvent &)   +virtual void onPositionChanged (const PositionChangedEvent &) + 

Member Function Documentation

@@ -332,7 +334,7 @@ Protected Member Functions diff --git a/classImageKnob_1_1Callback-members.html b/classImageKnob_1_1Callback-members.html index 537d2bf2..aaf760c0 100644 --- a/classImageKnob_1_1Callback-members.html +++ b/classImageKnob_1_1Callback-members.html @@ -76,7 +76,7 @@ $(function() { diff --git a/classImageKnob_1_1Callback.html b/classImageKnob_1_1Callback.html index 7ac0f1ad..cd92972a 100644 --- a/classImageKnob_1_1Callback.html +++ b/classImageKnob_1_1Callback.html @@ -88,7 +88,7 @@ virtual void imageKnobValu diff --git a/classImageSlider-members.html b/classImageSlider-members.html index 7efb0343..8abf4039 100644 --- a/classImageSlider-members.html +++ b/classImageSlider-members.html @@ -85,15 +85,17 @@ $(function() { onKeyboard(const KeyboardEvent &)Widgetprotectedvirtual onMotion(const MotionEvent &) overrideImageSliderprotectedvirtual onMouse(const MouseEvent &) overrideImageSliderprotectedvirtual - onResize(const ResizeEvent &)Widgetprotectedvirtual - onScroll(const ScrollEvent &)Widgetprotectedvirtual - onSpecial(const SpecialEvent &)Widgetprotectedvirtual - repaint() noexceptWidget - Widget::setAbsolutePos(int x, int y) noexceptWidget - Widget::setAbsolutePos(const Point< int > &pos) noexceptWidget - Widget::setAbsoluteX(int x) noexceptWidget - Widget::setAbsoluteY(int y) noexceptWidget - setCallback(Callback *callback) noexcept (defined in ImageSlider)ImageSlider + onPositionChanged(const PositionChangedEvent &)Widgetprotectedvirtual + onResize(const ResizeEvent &)Widgetprotectedvirtual + onScroll(const ScrollEvent &)Widgetprotectedvirtual + onSpecial(const SpecialEvent &)Widgetprotectedvirtual + repaint() noexceptWidget + Widget::setAbsolutePos(int x, int y) noexceptWidget + Widget::setAbsolutePos(const Point< int > &pos) noexceptWidget + Widget::setAbsoluteX(int x) noexceptWidget + Widget::setAbsoluteY(int y) noexceptWidget + setCallback(Callback *callback) noexcept (defined in ImageSlider)ImageSlider + setDefault(float def) noexcept (defined in ImageSlider)ImageSlider setEndPos(const Point< int > &endPos) noexcept (defined in ImageSlider)ImageSlider setEndPos(int x, int y) noexcept (defined in ImageSlider)ImageSlider setHeight(uint height) noexceptWidget @@ -115,7 +117,7 @@ $(function() { diff --git a/classImageSlider.html b/classImageSlider.html index 47f417f6..e4da80ad 100644 --- a/classImageSlider.html +++ b/classImageSlider.html @@ -96,6 +96,9 @@ float getValue () cons void setValue (float value, bool sendCallback=false) noexcept   + +void setDefault (float def) noexcept +  void setStartPos (const Point< int > &startPos) noexcept   @@ -195,6 +198,8 @@ Protected Member Functions   virtual void onResize (const ResizeEvent &)   +virtual void onPositionChanged (const PositionChangedEvent &) + 

Member Function Documentation

@@ -289,7 +294,7 @@ Protected Member Functions diff --git a/classImageSlider_1_1Callback-members.html b/classImageSlider_1_1Callback-members.html index 87fba8da..6d0fae77 100644 --- a/classImageSlider_1_1Callback-members.html +++ b/classImageSlider_1_1Callback-members.html @@ -76,7 +76,7 @@ $(function() { diff --git a/classImageSlider_1_1Callback.html b/classImageSlider_1_1Callback.html index 29ec7dd4..d6e9cd4c 100644 --- a/classImageSlider_1_1Callback.html +++ b/classImageSlider_1_1Callback.html @@ -88,7 +88,7 @@ virtual void imageSliderVa diff --git a/classImageSwitch-members.html b/classImageSwitch-members.html index 2bb2acbf..597edf2d 100644 --- a/classImageSwitch-members.html +++ b/classImageSwitch-members.html @@ -86,31 +86,32 @@ $(function() { onKeyboard(const KeyboardEvent &)Widgetprotectedvirtual onMotion(const MotionEvent &)Widgetprotectedvirtual onMouse(const MouseEvent &) overrideImageSwitchprotectedvirtual - onResize(const ResizeEvent &)Widgetprotectedvirtual - onScroll(const ScrollEvent &)Widgetprotectedvirtual - onSpecial(const SpecialEvent &)Widgetprotectedvirtual - operator=(const ImageSwitch &imageSwitch) noexcept (defined in ImageSwitch)ImageSwitch - repaint() noexceptWidget - setAbsolutePos(int x, int y) noexceptWidget - setAbsolutePos(const Point< int > &pos) noexceptWidget - setAbsoluteX(int x) noexceptWidget - setAbsoluteY(int y) noexceptWidget - setCallback(Callback *callback) noexcept (defined in ImageSwitch)ImageSwitch - setDown(bool down) noexcept (defined in ImageSwitch)ImageSwitch - setHeight(uint height) noexceptWidget - setId(uint id) noexceptWidget - setSize(uint width, uint height) noexceptWidget - setSize(const Size< uint > &size) noexceptWidget - setVisible(bool yesNo)Widget - setWidth(uint width) noexceptWidget - show()Widget - Widget(Window &parent)Widgetexplicit - Widget(Widget *groupWidget)Widgetexplicit - ~Widget()Widgetvirtual + onPositionChanged(const PositionChangedEvent &)Widgetprotectedvirtual + onResize(const ResizeEvent &)Widgetprotectedvirtual + onScroll(const ScrollEvent &)Widgetprotectedvirtual + onSpecial(const SpecialEvent &)Widgetprotectedvirtual + operator=(const ImageSwitch &imageSwitch) noexcept (defined in ImageSwitch)ImageSwitch + repaint() noexceptWidget + setAbsolutePos(int x, int y) noexceptWidget + setAbsolutePos(const Point< int > &pos) noexceptWidget + setAbsoluteX(int x) noexceptWidget + setAbsoluteY(int y) noexceptWidget + setCallback(Callback *callback) noexcept (defined in ImageSwitch)ImageSwitch + setDown(bool down) noexcept (defined in ImageSwitch)ImageSwitch + setHeight(uint height) noexceptWidget + setId(uint id) noexceptWidget + setSize(uint width, uint height) noexceptWidget + setSize(const Size< uint > &size) noexceptWidget + setVisible(bool yesNo)Widget + setWidth(uint width) noexceptWidget + show()Widget + Widget(Window &parent)Widgetexplicit + Widget(Widget *groupWidget)Widgetexplicit + ~Widget()Widgetvirtual diff --git a/classImageSwitch.html b/classImageSwitch.html index 3dfb9577..2d92b7a4 100644 --- a/classImageSwitch.html +++ b/classImageSwitch.html @@ -180,6 +180,8 @@ Protected Member Functions   virtual void onResize (const ResizeEvent &)   +virtual void onPositionChanged (const PositionChangedEvent &) + 

Member Function Documentation

@@ -245,7 +247,7 @@ Protected Member Functions diff --git a/classImageSwitch_1_1Callback-members.html b/classImageSwitch_1_1Callback-members.html index 33f34a9b..aceb12fc 100644 --- a/classImageSwitch_1_1Callback-members.html +++ b/classImageSwitch_1_1Callback-members.html @@ -69,12 +69,12 @@ $(function() {

This is the complete list of members for ImageSwitch::Callback, including all inherited members.

- +
imageSwitchClicked(ImageSwitch *imageButton, bool down)=0 (defined in ImageSwitch::Callback)ImageSwitch::Callbackpure virtual
imageSwitchClicked(ImageSwitch *imageSwitch, bool down)=0 (defined in ImageSwitch::Callback)ImageSwitch::Callbackpure virtual
~Callback() (defined in ImageSwitch::Callback)ImageSwitch::Callbackinlinevirtual
diff --git a/classImageSwitch_1_1Callback.html b/classImageSwitch_1_1Callback.html index 9120d049..365b8246 100644 --- a/classImageSwitch_1_1Callback.html +++ b/classImageSwitch_1_1Callback.html @@ -72,9 +72,9 @@ $(function() { - - + +

Public Member Functions

-virtual void imageSwitchClicked (ImageSwitch *imageButton, bool down)=0
 
+virtual void imageSwitchClicked (ImageSwitch *imageSwitch, bool down)=0
 

The documentation for this class was generated from the following file: