MCPcopy Create free account
hub / github.com/Tracktion/tracktion_engine / timeToTimecodeString

Function timeToTimecodeString

examples/common/Utilities.h:46–56  ·  view source on GitHub ↗

Quick-and-dirty function to format a timecode string

Source from the content-addressed store, hash-verified

44{
45 // Quick-and-dirty function to format a timecode string
46 static inline String timeToTimecodeString (double seconds)
47 {
48 auto millisecs = roundToInt (seconds * 1000.0);
49 auto absMillisecs = std::abs (millisecs);
50
51 return String::formatted ("%02d:%02d:%02d.%03d",
52 millisecs / 3600000,
53 (absMillisecs / 60000) % 60,
54 (absMillisecs / 1000) % 60,
55 absMillisecs % 1000);
56 }
57
58 // Quick-and-dirty function to format a bars/beats string
59 static inline String quarterNotePositionToBarsBeatsString (double quarterNotes, int numerator, int denominator)

Callers 1

getTimecodeDisplayFunction · 0.85

Calls 1

absFunction · 0.85

Tested by

no test coverage detected