diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-12-12 19:40:38 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-12-12 21:53:46 +0100 |
commit | 5924454a867bd500fdc696bb9939c84425c5e025 (patch) | |
tree | ab99a45ad189265259385d68a089a5de62004b7c | |
parent | 41927a4f2fe824dd1588c4ed0e14de0f2220c039 (diff) |
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.
-rw-r--r-- | slideshow/source/engine/shapes/viewmediashape.cxx | 18 | ||||
-rw-r--r-- | svl/inc/svl/solar.hrc | 2 | ||||
-rw-r--r-- | svx/inc/svx/unoshprp.hxx | 6 | ||||
-rw-r--r-- | svx/source/unodraw/unoprov.cxx | 3 | ||||
-rw-r--r-- | 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!"); } |