commit bdc8c4e0629b2e694e711b290be897f85e9ce08f from: Omar Polo date: Fri Jul 08 18:53:57 2022 UTC print the duration and position commit - ff06024f86fb68ea11b030f669b162794eb5bc19 commit + bdc8c4e0629b2e694e711b290be897f85e9ce08f blob - 20c6f9bfe65edbb6d0a7c4813b069a2ac910bb53 blob + 3b6bd10646bbe9db057405651be80a5bbf8d72df --- ctl.c +++ ctl.c @@ -275,6 +275,26 @@ imsg_name(int type) default: return "unknown"; } +} + +static void +print_time(const char *label, int64_t seconds) +{ + int hours, minutes; + + if (seconds < 0) + seconds = 0; + + hours = seconds / 3600; + seconds -= hours * 3600; + + minutes = seconds / 60; + seconds -= minutes * 60; + + printf("%s ", label); + if (hours != 0) + printf("%02d:", hours); + printf("%02d:%02lld\n", minutes, (long long)seconds); } static int @@ -473,6 +493,10 @@ ctlaction(struct parse_result *res) printf("unknown "); puts(ps.path); + + print_time("position", ps.position); + print_time("duration", ps.duration); + printf("repat one %s\nrepeat all %s\n", ps.rp.repeat_one ? "on" : "off", ps.rp.repeat_all ? "on" : "off");