summaryrefslogtreecommitdiffstats
path: root/helper.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2017-03-05 17:23:33 +0100
committerArno <arno@disconnect.de>2017-03-05 17:23:33 +0100
commit2ff72f033af3f24ffb816bc19a34fc794f585775 (patch)
treebe21b99d6ac7ebf60d398daca79567bb6e5b0565 /helper.cpp
parent51990db36b7b4c1ff8ca72ff16ded36c72be24b9 (diff)
downloadBeetPlayer-2ff72f033af3f24ffb816bc19a34fc794f585775.tar.gz
BeetPlayer-2ff72f033af3f24ffb816bc19a34fc794f585775.tar.bz2
BeetPlayer-2ff72f033af3f24ffb816bc19a34fc794f585775.zip
Implement statusBar
Display in statusBar: * viewMode * number of files in playlist * length of playlist in h:m:s * player status (Stopped, Playing, Paused)
Diffstat (limited to 'helper.cpp')
-rw-r--r--helper.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/helper.cpp b/helper.cpp
index 91e4d7f..eaf0dda 100644
--- a/helper.cpp
+++ b/helper.cpp
@@ -3,6 +3,9 @@
#include <QAction>
#include <QApplication>
+#include <taglib/fileref.h>
+#include <taglib/audioproperties.h>
+
#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();
+ }
}