2 #include <QApplication>
7 #include <pluginterfaces/gui/iplugview.h>
13 inline const char* currentPlatform()
15 #if defined(__APPLE__)
16 return Steinberg::kPlatformTypeNSView;
17 #elif defined(__linux__)
18 return Steinberg::kPlatformTypeX11EmbedWindowID;
20 return Steinberg::kPlatformTypeHWND;
30 vst3::PlugFrame* frame{};
32 double qtScaleFactor{1.};
36 double r = qEnvironmentVariable(
"QT_SCALE_FACTOR").toDouble();
39 qtScaleFactor = 1. / r;
44 Steinberg::IPlugView& view,
const Steinberg::ViewRect& r,
45 QDialog& parentWindow)
const
48 int h = r.getHeight();
49 int qw = r.getWidth() * qtScaleFactor;
50 int qh = r.getHeight() * qtScaleFactor;
54 return std::make_pair(w, h);
57 if(view.canResize() == Steinberg::kResultTrue)
59 parentWindow.resize(QSize{qw, qh});
63 parentWindow.setFixedSize(QSize{qw, qh});
67 qwindow->resize(qw, qh);
71 container->move(0, 0);
72 container->setFixedSize(qw, qh);
75 return std::make_pair(w, h);
79 setSizeFromUser(Steinberg::IPlugView& view,
const QSize& sz, QDialog& parentWindow)
81 if(view.canResize() != Steinberg::kResultTrue)
84 Steinberg::ViewRect r;
88 r.bottom = sz.height();
89 view.checkSizeConstraint(&r);
91 int qw = r.getWidth() * qtScaleFactor;
92 int qh = r.getHeight() * qtScaleFactor;
94 parentWindow.resize(QSize(qw, qh));
98 qwindow->resize(qw, qh);
103 container->move(0, 0);
104 container->setFixedSize(qw, qh);
111 Steinberg::IPlugView& view, Steinberg::ViewRect& r, QDialog& parentWindow)
113 int w = r.getWidth();
114 int h = r.getHeight();
115 int qw = r.getWidth() * qtScaleFactor;
116 int qh = r.getHeight() * qtScaleFactor;
121 return std::make_pair(qw, qh);
124 if(view.canResize() == Steinberg::kResultTrue)
126 parentWindow.resize(QSize{qw, qh});
130 parentWindow.setFixedSize(QSize{qw, qh});
135 qwindow->resize(qw, qh);
139 container->move(0, 0);
140 container->setFixedSize(qw, qh);
145 return std::make_pair(qw, qh);
Definition: plugins/score-plugin-vst3/Vst3/UI/Window.hpp:21
Definition: WindowContainer.hpp:26