comparison src/core/time.cpp @ 64:fe719c109dbc

*: update 1. add media tracking ability, and it displays info on the `now playing` page 2. the `now playing` page now actually shows something 3. renamed every page class to be more accurate to what it is 4. ...
author Paper <mrpapersonic@gmail.com>
date Sun, 01 Oct 2023 23:15:43 -0400
parents 5c0397762b53
children
comparison
equal deleted inserted replaced
63:3d2decf093bb 64:fe719c109dbc
42 int64_t Duration::InSeconds() { 42 int64_t Duration::InSeconds() {
43 return length; 43 return length;
44 } 44 }
45 45
46 int64_t Duration::InMinutes() { 46 int64_t Duration::InMinutes() {
47 return std::llround((double)length / 60.0); 47 return std::llround(static_cast<double>(length) / 60.0);
48 } 48 }
49 49
50 int64_t Duration::InHours() { 50 int64_t Duration::InHours() {
51 return std::llround((double)length / 3600.0); 51 return std::llround(static_cast<double>(length) / 3600.0);
52 } 52 }
53 53
54 int64_t Duration::InDays() { 54 int64_t Duration::InDays() {
55 return std::llround((double)length / 86400.0); 55 return std::llround(static_cast<double>(length) / 86400.0);
56 } 56 }
57 57
58 int64_t GetSystemTime() { 58 int64_t GetSystemTime() {
59 assert(sizeof(int64_t) >= sizeof(time_t)); 59 assert(sizeof(int64_t) >= sizeof(time_t));
60 time_t t = std::time(nullptr); 60 time_t t = std::time(nullptr);