summaryrefslogtreecommitdiff
path: root/avmedia/source/framework
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-12-03 00:10:10 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-03 00:48:16 +0100
commit59307a7164e35396f34bf621ad7e9d2f265b1c7f (patch)
tree3282a95522303ff1553e0b4f3fda8f1978ce4830 /avmedia/source/framework
parent116ad02ae89a0036a223ef943352587119a47f65 (diff)
actually play embedded media:
In order to do this, the media is written to a temp file by avmedia::MediaWindowBaseImpl. This requires some rather ugly hacks to transport the Storage that contains the media to the avmedia stuff, including adding a XModel reference to avmedia::MediaItem.
Diffstat (limited to 'avmedia/source/framework')
-rw-r--r--avmedia/source/framework/mediacontrol.cxx2
-rw-r--r--avmedia/source/framework/mediaitem.cxx19
2 files changed, 18 insertions, 3 deletions
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index 291906992911..ceb375ed24f8 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -506,7 +506,7 @@ IMPL_LINK( MediaControl, implSelectHdl, ToolBox*, p )
::avmedia::MediaWindow::executeFormatErrorBox( this );
else
{
- aExecItem.setURL( aURL );
+ aExecItem.setURL( aURL, 0 );
aExecItem.setState( MEDIASTATE_PLAY );
}
}
diff --git a/avmedia/source/framework/mediaitem.cxx b/avmedia/source/framework/mediaitem.cxx
index afda0ab81651..d38548afc561 100644
--- a/avmedia/source/framework/mediaitem.cxx
+++ b/avmedia/source/framework/mediaitem.cxx
@@ -27,6 +27,8 @@
************************************************************************/
#include <avmedia/mediaitem.hxx>
+
+#include <cppuhelper/weakref.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -59,6 +61,8 @@ TYPEINIT1_AUTOFACTORY( MediaItem, ::SfxPoolItem );
struct MediaItem::Impl
{
::rtl::OUString m_URL;
+ // store a weak ref to the model so we can get at embedded media
+ uno::WeakReference<frame::XModel> m_wModel;
sal_uInt32 m_nMaskSet;
MediaState m_eState;
double m_fTime;
@@ -81,6 +85,7 @@ struct MediaItem::Impl
}
Impl(Impl const& rOther)
: m_URL( rOther.m_URL )
+ , m_wModel( rOther.m_wModel )
, m_nMaskSet( rOther.m_nMaskSet )
, m_eState( rOther.m_eState )
, m_fTime( rOther.m_fTime )
@@ -207,7 +212,7 @@ void MediaItem::merge( const MediaItem& rMediaItem )
const sal_uInt32 nMaskSet = rMediaItem.getMaskSet();
if( AVMEDIA_SETMASK_URL & nMaskSet )
- setURL( rMediaItem.getURL() );
+ setURL( rMediaItem.getURL(), rMediaItem.getModel() );
if( AVMEDIA_SETMASK_STATE & nMaskSet )
setState( rMediaItem.getState() );
@@ -240,10 +245,15 @@ sal_uInt32 MediaItem::getMaskSet() const
//------------------------------------------------------------------------
-void MediaItem::setURL( const ::rtl::OUString& rURL )
+void MediaItem::setURL( const ::rtl::OUString& rURL,
+ uno::Reference<frame::XModel> const & xModel)
{
m_pImpl->m_URL = rURL;
m_pImpl->m_nMaskSet |= AVMEDIA_SETMASK_URL;
+ if (xModel.is())
+ {
+ m_pImpl->m_wModel = xModel;
+ }
}
//------------------------------------------------------------------------
@@ -253,6 +263,11 @@ const ::rtl::OUString& MediaItem::getURL() const
return m_pImpl->m_URL;
}
+uno::Reference<frame::XModel> MediaItem::getModel() const
+{
+ return m_pImpl->m_wModel;
+}
+
//------------------------------------------------------------------------
void MediaItem::setState( MediaState eState )