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

Function getTextBufFileSize

examples/FileHandling/FileHandlingUI.cpp:238–247  ·  view source on GitHub ↗

helpers for putting text into fStrBuf and returning it

Source from the content-addressed store, hash-verified

236
237 // helpers for putting text into fStrBuf and returning it
238 const char* getTextBufFileSize(const float value)
239 {
240 /**/ if (value > 1024*1024)
241 std::snprintf(fStrBuf, 0xfe, "%.2f GiB", value/(1024*1024));
242 else if (value > 1024)
243 std::snprintf(fStrBuf, 0xfe, "%.2f MiB", value/1024);
244 else
245 std::snprintf(fStrBuf, 0xfe, "%.2f KiB", value);
246 return fStrBuf;
247 }
248
249 // helpers for drawing text
250 void drawLeft(const float x, const float y, const char* const text)

Callers 1

onNanoDisplayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected