diff options
Diffstat (limited to 'Examples/WhisperDesktop/Utils/logger.cpp')
| -rw-r--r-- | Examples/WhisperDesktop/Utils/logger.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Examples/WhisperDesktop/Utils/logger.cpp b/Examples/WhisperDesktop/Utils/logger.cpp index 5c7c257..712835b 100644 --- a/Examples/WhisperDesktop/Utils/logger.cpp +++ b/Examples/WhisperDesktop/Utils/logger.cpp @@ -24,14 +24,17 @@ namespace } } -void printTimeStamp( CStringA& rdi, Whisper::sTimeSpan ts ) +void printTime( CStringA& rdi, Whisper::sTimeSpan time, bool comma ) { - sTimeSpanFields fields = ts; - uint32_t msec = fields.ticks / 10'000; - uint32_t hr = fields.days * 24 + fields.hours; - uint32_t min = fields.minutes; - uint32_t sec = fields.seconds; - rdi.AppendFormat( "%02d:%02d:%02d.%03d", hr, min, sec, msec ); + Whisper::sTimeSpanFields fields = time; + const uint32_t hours = fields.days * 24 + fields.hours; + const char separator = comma ? ',' : '.'; + rdi.AppendFormat( "%02d:%02d:%02d%c%03d", + (int)hours, + (int)fields.minutes, + (int)fields.seconds, + separator, + fields.ticks / 10'000 ); } HRESULT logNewSegments( const iTranscribeResult* results, size_t newSegments, bool printSpecial ) @@ -50,9 +53,9 @@ HRESULT logNewSegments( const iTranscribeResult* results, size_t newSegments, bo { const sSegment& seg = segments[ i ]; str = "["; - printTimeStamp( str, seg.time.begin ); + printTime( str, seg.time.begin ); str += " --> "; - printTimeStamp( str, seg.time.end ); + printTime( str, seg.time.end ); str += "] "; for( uint32_t j = 0; j < seg.countTokens; j++ ) |
