MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / timecodeString

Function timecodeString

Gui/TimeLineGui.cpp:122–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120typedef std::set<CachedFrame, CachedFrame_compare_time> CachedFrames;
121
122static
123QString
124timecodeString(double value, double fps)
125{
126 QString sign;
127 if (value < 0) {
128 value = -value;
129 sign = QLatin1Char('-');
130 }
131 long rvalue = (long)value;
132 int rfps = (int)std::ceil(fps);
133
134 int f = rvalue % rfps;
135 rvalue /= rfps;
136 int s = rvalue % 60;
137 rvalue /= 60;
138 int m = rvalue % 60;
139 int h = rvalue / 60;
140 return sign + QString::fromUtf8("%1:%2:%3:%4")
141 .arg(h, 2, 10, QLatin1Char('0'))
142 .arg(m, 2, 10, QLatin1Char('0'))
143 .arg(s, 2, 10, QLatin1Char('0'))
144 .arg(f, 2, 10, QLatin1Char('0'));
145}
146
147NATRON_NAMESPACE_ANONYMOUS_EXIT
148

Callers 1

paintGLMethod · 0.85

Calls 1

ceilFunction · 0.50

Tested by

no test coverage detected