From 10ed09bf281e7b97ff5389a5aad3ab78379b93ae Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 12 Dec 2011 23:13:20 +0100 Subject: [PATCH] slideshow: play back embedded media: The slideshow uses the UNO API to access the drawing objects, so add a property to get the temp file URL from the media object. (cherry picked from commit 5924454a867bd500fdc696bb9939c84425c5e025) --- slideshow/source/engine/shapes/viewmediashape.cxx | 18 ++++++++++++++---- svl/inc/svl/solar.hrc | 2 +- svx/inc/svx/unoshprp.hxx | 6 +++++- svx/source/unodraw/unoprov.cxx | 3 ++- svx/source/unodraw/unoshap4.cxx | 9 +++++++-- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index ebd4343d4ed9..5957cf6bf097 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -286,11 +286,21 @@ namespace slideshow xPropSet.set( mxShape, uno::UNO_QUERY ); // create Player - if( xPropSet.is() && - ( xPropSet->getPropertyValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaURL" ) ) ) >>=aURL ) ) + if (xPropSet.is()) { - implInitializeMediaPlayer( aURL ); + if ((xPropSet->getPropertyValue( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "PrivateTempFileURL"))) >>= aURL) + && aURL.getLength()) + { + implInitializeMediaPlayer( aURL ); + } + else if (xPropSet->getPropertyValue( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "MediaURL"))) >>= aURL) + { + implInitializeMediaPlayer( aURL ); + } } // create visible object diff --git a/svl/inc/svl/solar.hrc b/svl/inc/svl/solar.hrc index 6d13d46ec759..3dc33639b907 100644 --- a/svl/inc/svl/solar.hrc +++ b/svl/inc/svl/solar.hrc @@ -31,7 +31,7 @@ // defines ------------------------------------------------------------------ #define OWN_ATTR_VALUE_START 3900 -#define OWN_ATTR_VALUE_END 3988 +#define OWN_ATTR_VALUE_END 3990 #define CREATERESMGR_NAME( Name ) #Name #define CREATERESMGR( Name ) ResMgr::CreateResMgr( CREATERESMGR_NAME( Name ) ) diff --git a/svx/inc/svx/unoshprp.hxx b/svx/inc/svx/unoshprp.hxx index 5e4bdf568ba2..6cf3619cb0d1 100644 --- a/svx/inc/svx/unoshprp.hxx +++ b/svx/inc/svx/unoshprp.hxx @@ -187,7 +187,11 @@ #define OWN_ATTR_STYLE (OWN_ATTR_VALUE_START+87) -#define OWN_ATTR_EDGE_POLYPOLYGONBEZIER (OWN_ATTR_VALUE_START+88) // maximum is OWN_ATTR_VALUE_START+88, see svl/inc/svl/solar.hrc +#define OWN_ATTR_EDGE_POLYPOLYGONBEZIER (OWN_ATTR_VALUE_START+88) + +#define OWN_ATTR_MEDIA_STREAM (OWN_ATTR_VALUE_START+89) +#define OWN_ATTR_MEDIA_TEMPFILEURL (OWN_ATTR_VALUE_START+90) +// ATTENTION: maximum is OWN_ATTR_VALUE_START+90, see svl/inc/svl/solar.hrc // #FontWork# #define FONTWORK_PROPERTIES \ diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index f800afba3c34..c46967269c38 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -761,7 +761,8 @@ SfxItemPropertyMapEntry* ImplGetSvxMediaShapePropertyMap() // #i68101# { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_TITLE), OWN_ATTR_MISC_OBJ_TITLE , &::getCppuType((const ::rtl::OUString*)0), 0, 0}, { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_DESCRIPTION), OWN_ATTR_MISC_OBJ_DESCRIPTION , &::getCppuType((const ::rtl::OUString*)0), 0, 0}, - {MAP_CHAR_LEN("PrivateStream"), OWN_ATTR_GRAPHIC_STREAM, &::com::sun::star::io::XInputStream::static_type(), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, + {MAP_CHAR_LEN("PrivateStream"), OWN_ATTR_MEDIA_STREAM, &::com::sun::star::io::XInputStream::static_type(), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, + {MAP_CHAR_LEN("PrivateTempFileURL"), OWN_ATTR_MEDIA_TEMPFILEURL, &::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0}, {0,0,0,0,0,0} }; diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index c4c7e687df2c..ad517c25a17e 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -955,7 +955,8 @@ bool SvxMediaShape::getPropertyValueImpl( const ::rtl::OUString& rName, const Sf { if ( ((pProperty->nWID >= OWN_ATTR_MEDIA_URL) && (pProperty->nWID <= OWN_ATTR_MEDIA_ZOOM)) - || (pProperty->nWID == OWN_ATTR_GRAPHIC_STREAM)) + || (pProperty->nWID == OWN_ATTR_MEDIA_STREAM) + || (pProperty->nWID == OWN_ATTR_MEDIA_TEMPFILEURL)) { SdrMediaObj* pMedia = static_cast< SdrMediaObj* >( mpObj.get() ); const ::avmedia::MediaItem aItem( pMedia->getMediaProperties() ); @@ -982,10 +983,14 @@ bool SvxMediaShape::getPropertyValueImpl( const ::rtl::OUString& rName, const Sf rValue <<= aItem.getZoom(); break; - case OWN_ATTR_GRAPHIC_STREAM: + case OWN_ATTR_MEDIA_STREAM: rValue <<= pMedia->GetInputStream(); break; + case OWN_ATTR_MEDIA_TEMPFILEURL: + rValue <<= aItem.getTempURL(); + break; + default: OSL_FAIL("SvxMediaShape::getPropertyValueImpl(), unknown property!"); } -- 2.11.4.GIT