Mercurial > hg > svcore
diff base/RealTime.cpp @ 1037:bf0e5944289b cxx11
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 03 Mar 2015 09:33:59 +0000 |
parents | 344c9ea90181 |
children | cc27f35aa75c |
line wrap: on
line diff
--- a/base/RealTime.cpp Mon Feb 09 10:31:07 2015 +0000 +++ b/base/RealTime.cpp Tue Mar 03 09:33:59 2015 +0000 @@ -274,19 +274,25 @@ std::stringstream out; - if (sec >= 3600) { - out << (sec / 3600) << ":"; + if (p->getShowHMS()) { + + if (sec >= 3600) { + out << (sec / 3600) << ":"; + } + + if (sec >= 60) { + out << (sec % 3600) / 60 << ":"; + } + + if (sec >= 10) { + out << ((sec % 60) / 10); + } + + out << (sec % 10); + + } else { + out << sec; } - - if (sec >= 60) { - out << (sec % 3600) / 60 << ":"; - } - - if (sec >= 10) { - out << ((sec % 60) / 10); - } - - out << (sec % 10); int ms = msec(); @@ -319,21 +325,29 @@ { if (*this < RealTime::zeroTime) return "-" + (-*this).toFrameText(fps); + Preferences *p = Preferences::getInstance(); + std::stringstream out; - if (sec >= 3600) { - out << (sec / 3600) << ":"; + if (p->getShowHMS()) { + + if (sec >= 3600) { + out << (sec / 3600) << ":"; + } + + if (sec >= 60) { + out << (sec % 3600) / 60 << ":"; + } + + if (sec >= 10) { + out << ((sec % 60) / 10); + } + + out << (sec % 10); + + } else { + out << sec; } - - if (sec >= 60) { - out << (sec % 3600) / 60 << ":"; - } - - if (sec >= 10) { - out << ((sec % 60) / 10); - } - - out << (sec % 10); int f = nsec / (ONE_BILLION / fps);