MCPcopy Create free account
hub / github.com/DISTRHO/DPF / getSize

Method getSize

distrho/src/DistrhoPluginCLAP.cpp:266–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264 #endif
265
266 bool getSize(uint32_t* const width, uint32_t* const height) const
267 {
268 if (UIExporter* const ui = fUI.get())
269 {
270 *width = ui->getWidth();
271 *height = ui->getHeight();
272 #ifdef DISTRHO_OS_MAC
273 const double scaleFactor = ui->getScaleFactor();
274 *width /= scaleFactor;
275 *height /= scaleFactor;
276 #endif
277 return true;
278 }
279
280 double scaleFactor = fScaleFactor;
281 #if defined(DISTRHO_UI_DEFAULT_WIDTH) && defined(DISTRHO_UI_DEFAULT_HEIGHT)
282 if (d_isZero(scaleFactor))
283 scaleFactor = 1.0;
284 *width = DISTRHO_UI_DEFAULT_WIDTH * scaleFactor;
285 *height = DISTRHO_UI_DEFAULT_HEIGHT * scaleFactor;
286 #else
287 UIExporter tmpUI(nullptr, 0, fPlugin.getSampleRate(),
288 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, d_nextBundlePath,
289 fPlugin.getInstancePointer(), scaleFactor, DGL_NAMESPACE::Application::kTypeClassic);
290 *width = tmpUI.getWidth();
291 *height = tmpUI.getHeight();
292 scaleFactor = tmpUI.getScaleFactor();
293 tmpUI.quit();
294 #endif
295
296 #ifdef DISTRHO_OS_MAC
297 *width /= scaleFactor;
298 *height /= scaleFactor;
299 #endif
300
301 return true;
302 }
303
304 bool canResize() const noexcept
305 {

Callers 2

get_sizeMethod · 0.45
clap_gui_get_sizeFunction · 0.45

Calls 6

d_isZeroFunction · 0.85
getWidthMethod · 0.45
getHeightMethod · 0.45
getScaleFactorMethod · 0.45
getSampleRateMethod · 0.45
quitMethod · 0.45

Tested by

no test coverage detected