From 17312e88ab30560c40b753dd434d39c314068cee Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 3 Sep 2016 13:36:27 -0400 Subject: [PATCH] Fixed type testing of media items (qgraphicsitem_cast couldn't tell the difference between audio and video items) --- src/core/UB.h | 2 ++ src/domain/UBGraphicsMediaItem.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/core/UB.h b/src/core/UB.h index 651ac139..6b218858 100644 --- a/src/core/UB.h +++ b/src/core/UB.h @@ -151,6 +151,8 @@ struct UBGraphicsItemType SvgItemType, DelegateButtonType, MediaItemType, + VideoItemType, + AudioItemType, PDFItemType, TextItemType, CurtainItemType, diff --git a/src/domain/UBGraphicsMediaItem.h b/src/domain/UBGraphicsMediaItem.h index 34b70b95..f08a5ae5 100644 --- a/src/domain/UBGraphicsMediaItem.h +++ b/src/domain/UBGraphicsMediaItem.h @@ -160,6 +160,11 @@ class UBGraphicsAudioItem: public UBGraphicsMediaItem Q_OBJECT public: + enum { Type = UBGraphicsItemType::AudioItemType}; + virtual int type() const + { + return Type; + } UBGraphicsAudioItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent = 0); mediaType getMediaType() const { return mediaType_Audio; } @@ -172,6 +177,11 @@ class UBGraphicsVideoItem: public UBGraphicsMediaItem Q_OBJECT public: + enum { Type = UBGraphicsItemType::VideoItemType}; + virtual int type() const + { + return Type; + } UBGraphicsVideoItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent = 0);