diff options
author | Arno <am@disconnect.de> | 2013-07-27 03:59:47 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-07-27 04:02:21 +0200 |
commit | 0afebd0e3cb3da831cd5ffba1eefbe9e61e408a1 (patch) | |
tree | e92bd13b2ddda3af1af51d25c22d5042fb635139 /newmoviewizard.cpp | |
parent | 46a552d89c70895abc75d94f3c647be29873afd9 (diff) | |
download | SheMov-0afebd0e3cb3da831cd5ffba1eefbe9e61e408a1.tar.gz SheMov-0afebd0e3cb3da831cd5ffba1eefbe9e61e408a1.tar.bz2 SheMov-0afebd0e3cb3da831cd5ffba1eefbe9e61e408a1.zip |
Read JSON from ffprobe
Use JSON output from ffprobe instead of string parsing to get some kind
of type safety.
For doing that, some changes were needed in FileView: Use delegates for
displaying Duration and Bitrate instead of mangling output in
Qt::Displayrole.
To reuse code, move all delegates from the new Archive to a separate
file.
And, of course, the initial objective: Show the accumulated size and
duration of selected files in the status bar from the experimental
archive.
Diffstat (limited to 'newmoviewizard.cpp')
-rw-r--r-- | newmoviewizard.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/newmoviewizard.cpp b/newmoviewizard.cpp index 9447a6c..a5df22a 100644 --- a/newmoviewizard.cpp +++ b/newmoviewizard.cpp @@ -31,6 +31,7 @@ #include "mappingtablemodel.h" #include "seriesmetadatamodel.h" #include "filestreemodel.h" +#include "delegates.h" #include "helper.h" #include "pictureviewer2.h" #include "archivemodel.h" @@ -124,13 +125,12 @@ void NewMovieWizard::accept(){ qint64 size = fi.size(); QString md5 = Helper::md5Sum(fullPath); md5Sums.insert(fullPath, md5); - int secs = 0; + qint64 secs = 0; QString picSize; int type = fData.value(WizardTreeModel::FileType).toInt(); if(type == ArchiveFilesModel::Movie){ - QVariant v = Helper::duration(fullPath).value(0); - Helper::Duration dur = v.value<Helper::Duration>(); - secs = dur.toSeconds(); + QVariantMap m = Helper::ffmpegData(fullPath); + secs = m.value("duration").toInt(); }else{ QPixmap pix(fullPath); picSize = QString("%1x%2").arg(QString::number(pix.width())).arg(QString::number(pix.height())); |