X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=clip_list.cpp;h=75f4a9f46b6be66e0f72523528600262aab20350;hb=0c3bfa8f2fb956efce124dea05e006231603c333;hp=3c9637258f60c8b002cee6b23321a318f9734972;hpb=498d1082773a5f394cb4fbd15b1084a4751f1409;p=nageru diff --git a/clip_list.cpp b/clip_list.cpp index 3c96372..75f4a9f 100644 --- a/clip_list.cpp +++ b/clip_list.cpp @@ -5,14 +5,14 @@ #include #include "clip_list.h" +#include "timebase.h" #include "ui_mainwindow.h" using namespace std; string pts_to_string(int64_t pts) { - // FIXME: This depends on a fixed timebase. - int64_t t = lrint((pts / 12800.0) * 1e3); // In milliseconds. + int64_t t = lrint((pts / double(TIMEBASE)) * 1e3); // In milliseconds. int ms = t % 1000; t /= 1000; int sec = t % 60; @@ -28,8 +28,7 @@ string pts_to_string(int64_t pts) string duration_to_string(int64_t pts_diff) { - // FIXME: This depends on a fixed timebase. - int64_t t = lrint((pts_diff / 12800.0) * 1e3); // In milliseconds. + int64_t t = lrint((pts_diff / double(TIMEBASE)) * 1e3); // In milliseconds. int ms = t % 1000; t /= 1000; int sec = t % 60; @@ -79,7 +78,7 @@ QVariant ClipList::data(const QModelIndex &parent, int role) const { } } - if (role != Qt::DisplayRole) + if (role != Qt::DisplayRole && role != Qt::EditRole) return QVariant(); switch (Column(column)) { @@ -131,7 +130,7 @@ QVariant PlayList::data(const QModelIndex &parent, int role) const { } } - if (role != Qt::DisplayRole) + if (role != Qt::DisplayRole && role != Qt::EditRole) return QVariant(); switch (Column(column)) {