summaryrefslogtreecommitdiffstats
path: root/profile-widget/profilewidget2.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-07-15 17:56:18 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-23 15:58:55 -0700
commitb3feaa80e26510928c73e92049ec346841f6093a (patch)
tree1a1f002959ea09aa5a16a5cc04ace06326941377 /profile-widget/profilewidget2.h
parentc7428859840bfcf973a14f27c6376e39e915cb29 (diff)
downloadsubsurface-b3feaa80e26510928c73e92049ec346841f6093a.tar.gz
Dive video: paint duration-bar above thumbnail in profile plot
Paint a rectangle on top of thumbnails indicating the run-time of the video. Use the z=100.0-101.0 range for painting the thumbnails, whereby the z-value increases uniformly from first to last thumbnail (sorted by timestamp). The duration-bars are placed at z-values midway between those of the thumbnails. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/profilewidget2.h')
-rw-r--r--profile-widget/profilewidget2.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index 2640fb85a..bbad5b7cc 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -74,6 +74,7 @@ public:
ProfileWidget2(QWidget *parent = 0);
void resetZoom();
+ void scale(qreal sx, qreal sy);
void plotDive(struct dive *d = 0, bool force = false, bool clearPictures = false);
void setupItem(AbstractProfilePolygonItem *item, DiveCartesianAxis *vAxis, int vData, int hData, int zValue);
void setPrintMode(bool mode, bool grayscale = false);
@@ -127,7 +128,7 @@ slots: // Necessary to call from QAction's signals.
void deleteCurrentDC();
void pointInserted(const QModelIndex &parent, int start, int end);
void pointsRemoved(const QModelIndex &, int start, int end);
- void updateThumbnail(QString filename, QImage thumbnail);
+ void updateThumbnail(QString filename, QImage thumbnail, duration_t duration);
/* this is called for every move on the handlers. maybe we can speed up this a bit? */
void recreatePlannedDive();
@@ -234,14 +235,19 @@ private:
// Pictures that are outside of the dive time are not shown.
struct PictureEntry {
offset_t offset;
+ duration_t duration;
QString filename;
std::unique_ptr<DivePictureItem> thumbnail;
+ // For videos with known duration, we represent the duration of the video by a line
+ std::unique_ptr<QGraphicsRectItem> durationLine;
PictureEntry (offset_t offsetIn, const QString &filenameIn, QGraphicsScene *scene);
bool operator< (const PictureEntry &e) const;
};
void updateThumbnailXPos(PictureEntry &e);
std::vector<PictureEntry> pictures;
void calculatePictureYPositions();
+ void updateDurationLine(PictureEntry &e);
+ void updateThumbnailPaintOrder();
QList<DiveHandler *> handles;
void repositionDiveHandlers();