DISTRHO Plugin Framework
 All Classes Functions Variables Enumerations Enumerator Groups Pages
VstGuiWidget.hpp
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_VSTGUI_HPP_INCLUDED
18 #define DISTRHO_VSTGUI_HPP_INCLUDED
19 
20 #include "Base.hpp"
21 #include "../distrho/extra/String.hpp"
22 
23 START_NAMESPACE_DGL
24 
25 // -----------------------------------------------------------------------
26 
28 {
29 public:
30  VstGuiWidget(const uint w = 1, const uint h = 1, const char* const t = "")
31  : width(w),
32  height(h),
33  title(t),
34  transientWinId(0),
35  visible(false) {}
36 
37  virtual ~VstGuiWidget()
38  {
39  }
40 
41  uint getWidth() const noexcept
42  {
43  return width;
44  }
45 
46  uint getHeight() const noexcept
47  {
48  return height;
49  }
50 
51  const char* getTitle() const noexcept
52  {
53  return title;
54  }
55 
56  uintptr_t getTransientWinId() const noexcept
57  {
58  return transientWinId;
59  }
60 
61  bool isVisible() const noexcept
62  {
63  return visible;
64  }
65 
66  bool isRunning() noexcept
67  {
68  return visible;
69  }
70 
71  virtual void idle() {}
72 
73  virtual void setSize(uint w, uint h)
74  {
75  width = w;
76  height = h;
77  }
78 
79  virtual void setTitle(const char* const t)
80  {
81  title = t;
82  }
83 
84  virtual void setTransientWinId(const uintptr_t winId)
85  {
86  transientWinId = winId;
87  }
88 
89  virtual void setVisible(const bool yesNo)
90  {
91  visible = yesNo;
92  }
93 
94 private:
95  uint width;
96  uint height;
97  DISTRHO_NAMESPACE::String title;
98  uintptr_t transientWinId;
99  bool visible;
100 };
101 
102 // -----------------------------------------------------------------------
103 
104 END_NAMESPACE_DGL
105 
106 #endif // DISTRHO_VSTGUI_HPP_INCLUDED
Definition: VstGuiWidget.hpp:27