MCPcopy Create free account
hub / github.com/GrapheneCt/NetStream / ConvertSecondsToString

Method ConvertSecondsToString

NetStream/source/utils.cpp:93–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void utils::ConvertSecondsToString(string& string, uint64_t seconds, bool needSeparator)
94{
95 int32_t h = 0, m = 0, s = 0;
96 h = (seconds / 3600);
97 m = (seconds - (3600 * h)) / 60;
98 s = (seconds - (3600 * h) - (m * 60));
99
100 string.clear();
101
102 if (needSeparator) {
103 if (h > 0) {
104 string = common::FormatString("%02d:%02d:%02d / ", h, m, s);
105 }
106 else {
107 string = common::FormatString("%02d:%02d / ", m, s);
108 }
109 }
110 else {
111 if (h > 0) {
112 string = common::FormatString("%02d:%02d:%02d", h, m, s);
113 }
114 else {
115 string = common::FormatString("%02d:%02d", m, s);
116 }
117 }
118}
119
120void utils::SetDisplayResolution(uint32_t resolution)
121{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected