diff options
author | Arno <arno@disconnect.de> | 2017-03-05 17:23:33 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2017-03-05 17:23:33 +0100 |
commit | 2ff72f033af3f24ffb816bc19a34fc794f585775 (patch) | |
tree | be21b99d6ac7ebf60d398daca79567bb6e5b0565 /helper.cpp | |
parent | 51990db36b7b4c1ff8ca72ff16ded36c72be24b9 (diff) | |
download | BeetPlayer-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.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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(); + } } |