summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-01-21 15:08:13 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-01-21 21:40:20 +0100
commite2d46da076f43a7c0d56fc486b9f15339243f7c9 (patch)
tree4519509c29cec2aa9c6e1b6fca3275d97a186d96 /avmedia
parent9fd193168fe092bf15edbc81b8b1a15ca6d7c032 (diff)
avmedia: add doc model for bitmap fill of slide narrations
This allows specifying a custom bitmap for a media shape. It's mostly useful for audio-only streams where the additional bitmap may be e.g. a speaker icon to indicate this a narration. Change-Id: I21c1b492ac09b631cf6e3ec8120be8b82c01c26d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109763 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/framework/mediaitem.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/avmedia/source/framework/mediaitem.cxx b/avmedia/source/framework/mediaitem.cxx
index f42065e8e81e..54db2e3bc6bf 100644
--- a/avmedia/source/framework/mediaitem.cxx
+++ b/avmedia/source/framework/mediaitem.cxx
@@ -40,6 +40,7 @@
#include <mediamisc.hxx>
#include <osl/file.hxx>
#include <tools/diagnose_ex.h>
+#include <vcl/graph.hxx>
using namespace ::com::sun::star;
@@ -62,6 +63,7 @@ struct MediaItem::Impl
bool m_bLoop;
bool m_bMute;
css::media::ZoomLevel m_eZoom;
+ Graphic m_aGraphic;
explicit Impl(AVMediaSetMask nMaskSet)
: m_nMaskSet( nMaskSet )
@@ -104,6 +106,7 @@ bool MediaItem::operator==( const SfxPoolItem& rItem ) const
&& m_pImpl->m_URL == rOther.m_pImpl->m_URL
&& m_pImpl->m_Referer == rOther.m_pImpl->m_Referer
&& m_pImpl->m_sMimeType == rOther.m_pImpl->m_sMimeType
+ && m_pImpl->m_aGraphic == rOther.m_pImpl->m_aGraphic
&& m_pImpl->m_eState == rOther.m_pImpl->m_eState
&& m_pImpl->m_fDuration == rOther.m_pImpl->m_fDuration
&& m_pImpl->m_fTime == rOther.m_pImpl->m_fTime
@@ -188,6 +191,9 @@ void MediaItem::merge( const MediaItem& rMediaItem )
if( AVMediaSetMask::MIME_TYPE & nMaskSet )
setMimeType( rMediaItem.getMimeType() );
+ if (nMaskSet & AVMediaSetMask::GRAPHIC)
+ setGraphic(rMediaItem.getGraphic());
+
if( AVMediaSetMask::STATE & nMaskSet )
setState( rMediaItem.getState() );
@@ -256,6 +262,13 @@ OUString MediaItem::getMimeType() const
return !m_pImpl->m_sMimeType.isEmpty() ? m_pImpl->m_sMimeType : AVMEDIA_MIMETYPE_COMMON;
}
+void MediaItem::setGraphic(const Graphic& rGraphic)
+{
+ m_pImpl->m_nMaskSet |= AVMediaSetMask::GRAPHIC;
+ m_pImpl->m_aGraphic = rGraphic;
+}
+
+Graphic MediaItem::getGraphic() const { return m_pImpl->m_aGraphic; }
void MediaItem::setState( MediaState eState )
{