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

Function InfoExampleUI

examples/Info/InfoExampleUI.cpp:30–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28{
29public:
30 InfoExampleUI()
31 : UI(DISTRHO_UI_DEFAULT_WIDTH, DISTRHO_UI_DEFAULT_HEIGHT),
32 fSampleRate(getSampleRate()),
33 fResizable(isResizable()),
34 fScale(1.0f),
35 fScaleFactor(getScaleFactor()),
36 fResizeHandle(this)
37 {
38 std::memset(fParameters, 0, sizeof(float)*kParameterCount);
39 std::memset(fStrBuf, 0, sizeof(char)*(0xff+1));
40
41 #ifdef DGL_NO_SHARED_RESOURCES
42 createFontFromFile("sans", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");
43 #else
44 loadSharedResources();
45 #endif
46
47 if (d_isNotEqual(fScaleFactor, 1.0))
48 {
49 const uint width = DISTRHO_UI_DEFAULT_WIDTH * fScaleFactor;
50 const uint height = DISTRHO_UI_DEFAULT_HEIGHT * fScaleFactor;
51 setGeometryConstraints(width, height, true);
52 setSize(width, height);
53 }
54 else
55 {
56 setGeometryConstraints(DISTRHO_UI_DEFAULT_WIDTH, DISTRHO_UI_DEFAULT_HEIGHT, true);
57 }
58
59 // no need to show resize handle if window is user-resizable
60 if (fResizable)
61 fResizeHandle.hide();
62 }
63
64protected:
65 /* --------------------------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 7

isResizableFunction · 0.85
d_isNotEqualFunction · 0.85
getSampleRateFunction · 0.50
getScaleFactorFunction · 0.50
setGeometryConstraintsFunction · 0.50
setSizeFunction · 0.50
hideMethod · 0.45

Tested by

no test coverage detected