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

Function onNanoDisplay

examples/Info/InfoExampleUI.cpp:101–198  ·  view source on GitHub ↗

The NanoVG drawing function. */

Source from the content-addressed store, hash-verified

99 The NanoVG drawing function.
100 */
101 void onNanoDisplay() override
102 {
103 const float lineHeight = 20 * fScale;
104
105 fontSize(15.0f * fScale);
106 textLineHeight(lineHeight);
107
108 float x = 0.0f * fScale;
109 float y = 15.0f * fScale;
110
111 // buffer size
112 drawLeft(x, y, "Buffer Size:");
113 drawRight(x, y, getTextBufInt(fParameters[kParameterBufferSize]));
114 y+=lineHeight;
115
116 // sample rate
117 drawLeft(x, y, "Sample Rate:");
118 drawRight(x, y, getTextBufFloat(fSampleRate));
119 y+=lineHeight;
120
121 // separator
122 y+=lineHeight;
123
124 // time stuff
125 drawLeft(x, y, "Playing:");
126 drawRight(x, y, (fParameters[kParameterTimePlaying] > 0.5f) ? "Yes" : "No");
127 y+=lineHeight;
128
129 drawLeft(x, y, "Frame:");
130 drawRight(x, y, getTextBufInt(fParameters[kParameterTimeFrame]));
131 y+=lineHeight;
132
133 drawLeft(x, y, "Time:");
134 drawRight(x, y, getTextBufTime(fParameters[kParameterTimeFrame]));
135 y+=lineHeight;
136
137 // separator
138 y+=lineHeight;
139
140 // param changes
141 drawLeft(x, y, "Param Changes:", 20);
142 drawRight(x, y, (fParameters[kParameterCanRequestParameterValueChanges] > 0.5f) ? "Yes" : "No", 40);
143 y+=lineHeight;
144
145 // resizable
146 drawLeft(x, y, "Host resizable:", 20);
147 drawRight(x, y, fResizable ? "Yes" : "No", 40);
148 y+=lineHeight;
149
150 // host scale factor
151 drawLeft(x, y, "Host scale factor:", 20);
152 drawRight(x, y, getTextBufFloat(fScaleFactor), 40);
153 y+=lineHeight;
154
155 // BBT
156 x = 200.0f * fScale;
157 y = 15.0f * fScale;
158

Callers 1

onDisplayMethod · 0.50

Calls 6

getTextBufIntFunction · 0.85
getTextBufFloatFunction · 0.85
getTextBufTimeFunction · 0.85
getTextBufFloatExtraFunction · 0.85
drawLeftFunction · 0.70
drawRightFunction · 0.70

Tested by

no test coverage detected