From 2ff72f033af3f24ffb816bc19a34fc794f585775 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 5 Mar 2017 17:23:33 +0100 Subject: Implement statusBar Display in statusBar: * viewMode * number of files in playlist * length of playlist in h:m:s * player status (Stopped, Playing, Paused) --- helper.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'helper.cpp') diff --git a/helper.cpp b/helper.cpp index 91e4d7f..eaf0dda 100644 --- a/helper.cpp +++ b/helper.cpp @@ -3,6 +3,9 @@ #include #include +#include +#include + #include "helper.h" namespace Helper { @@ -23,4 +26,13 @@ namespace Helper { a->setSeparator(true); return a; } + + quint64 lengthInSeconds(const QString &file){ + TagLib::FileRef f(QString(file).toUtf8()); + if(f.isNull()){ + return 0; + } + TagLib::AudioProperties *props = f.audioProperties(); + return props->lengthInSeconds(); + } } -- cgit v1.2.3-70-g09d2