2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-09-24 18:14:43 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
2004-08-23 08:04:42 +00:00
|
|
|
*
|
2012-09-24 18:14:43 +01:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2004-08-23 08:04:42 +00:00
|
|
|
*
|
2012-09-24 18:14:43 +01:00
|
|
|
* This file incorporates work covered by the following license notice:
|
2004-08-23 08:04:42 +00:00
|
|
|
*
|
2012-09-24 18:14:43 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2014-06-11 12:36:26 +02:00
|
|
|
|
|
|
|
#include <config_features.h>
|
|
|
|
|
2013-09-23 21:55:02 +03:00
|
|
|
#include <iostream>
|
2004-08-23 08:04:42 +00:00
|
|
|
#include "mediawindow_impl.hxx"
|
|
|
|
#include "mediaevent_impl.hxx"
|
|
|
|
#include "mediamisc.hxx"
|
|
|
|
#include "mediawindow.hrc"
|
2004-11-03 14:54:55 +00:00
|
|
|
#include "helpids.hrc"
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <cmath>
|
2013-11-18 16:01:12 +01:00
|
|
|
|
|
|
|
#include <comphelper/processfactory.hxx>
|
2004-08-23 08:04:42 +00:00
|
|
|
#include <osl/mutex.hxx>
|
2013-11-18 16:01:12 +01:00
|
|
|
#include <tools/urlobj.hxx>
|
2013-11-20 14:43:45 +01:00
|
|
|
#include <unotools/securityoptions.hxx>
|
2004-08-23 08:04:42 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
|
2012-06-21 17:39:01 +01:00
|
|
|
#include <com/sun/star/awt/SystemPointer.hpp>
|
|
|
|
#include <com/sun/star/lang/XComponent.hpp>
|
2013-11-18 16:01:12 +01:00
|
|
|
#include <com/sun/star/media/XManager.hpp>
|
2014-04-27 12:14:18 +02:00
|
|
|
#include <vcl/sysdata.hxx>
|
|
|
|
#include <vcl/opengl/OpenGLContext.hxx>
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
|
|
|
namespace avmedia { namespace priv {
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
// - MediaWindowControl -
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
MediaWindowControl::MediaWindowControl( vcl::Window* pParent ) :
|
2004-08-23 08:04:42 +00:00
|
|
|
MediaControl( pParent, MEDIACONTROLSTYLE_MULTILINE )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowControl::update()
|
|
|
|
{
|
|
|
|
MediaItem aItem;
|
|
|
|
|
|
|
|
static_cast< MediaWindowImpl* >( GetParent() )->updateMediaItem( aItem );
|
|
|
|
setState( aItem );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowControl::execute( const MediaItem& rItem )
|
|
|
|
{
|
|
|
|
static_cast< MediaWindowImpl* >( GetParent() )->executeMediaItem( rItem );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
// - MediaChildWindow -
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
MediaChildWindow::MediaChildWindow( vcl::Window* pParent ) :
|
2010-09-16 15:17:37 +02:00
|
|
|
SystemChildWindow( pParent, WB_CLIPCHILDREN )
|
2004-08-23 08:04:42 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-06-11 12:36:26 +02:00
|
|
|
#if HAVE_FEATURE_GLTF
|
2014-09-23 11:20:40 +02:00
|
|
|
MediaChildWindow::MediaChildWindow( vcl::Window* pParent, SystemWindowData* pData ) :
|
2014-05-06 02:31:42 +02:00
|
|
|
SystemChildWindow( pParent, WB_CLIPCHILDREN, pData )
|
2014-04-27 12:14:18 +02:00
|
|
|
{
|
|
|
|
}
|
2014-06-11 12:36:26 +02:00
|
|
|
#endif
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaChildWindow::MouseMove( const MouseEvent& rMEvt )
|
|
|
|
{
|
|
|
|
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
|
|
|
|
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
|
|
|
|
|
2010-09-16 15:17:37 +02:00
|
|
|
SystemChildWindow::MouseMove( rMEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
GetParent()->MouseMove( aTransformedEvent );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaChildWindow::MouseButtonDown( const MouseEvent& rMEvt )
|
|
|
|
{
|
|
|
|
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
|
|
|
|
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
|
|
|
|
|
2010-09-16 15:17:37 +02:00
|
|
|
SystemChildWindow::MouseButtonDown( rMEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
GetParent()->MouseButtonDown( aTransformedEvent );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt )
|
|
|
|
{
|
|
|
|
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
|
|
|
|
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
|
|
|
|
|
2010-09-16 15:17:37 +02:00
|
|
|
SystemChildWindow::MouseButtonUp( rMEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
GetParent()->MouseButtonUp( aTransformedEvent );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaChildWindow::KeyInput( const KeyEvent& rKEvt )
|
|
|
|
{
|
2010-09-16 15:17:37 +02:00
|
|
|
SystemChildWindow::KeyInput( rKEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
GetParent()->KeyInput( rKEvt );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaChildWindow::KeyUp( const KeyEvent& rKEvt )
|
|
|
|
{
|
2010-09-16 15:17:37 +02:00
|
|
|
SystemChildWindow::KeyUp( rKEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
GetParent()->KeyUp( rKEvt );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaChildWindow::Command( const CommandEvent& rCEvt )
|
|
|
|
{
|
|
|
|
const CommandEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ),
|
2015-01-14 10:50:58 +00:00
|
|
|
rCEvt.GetCommand(), rCEvt.IsMouseEvent(), rCEvt.GetEventData() );
|
2004-08-23 08:04:42 +00:00
|
|
|
|
2010-09-16 15:17:37 +02:00
|
|
|
SystemChildWindow::Command( rCEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
GetParent()->Command( aTransformedEvent );
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
// - MediaWindowImpl -
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
MediaWindowImpl::MediaWindowImpl( vcl::Window* pParent, MediaWindow* pMediaWindow, bool bInternalMediaControl ) :
|
2004-08-23 08:04:42 +00:00
|
|
|
Control( pParent ),
|
|
|
|
DropTargetHelper( this ),
|
|
|
|
DragSourceHelper( this ),
|
2013-11-18 16:01:12 +01:00
|
|
|
mpMediaWindow( pMediaWindow ),
|
2014-04-29 11:32:05 +01:00
|
|
|
mpEvents( NULL ),
|
2014-05-13 00:07:48 +02:00
|
|
|
mbEventTransparent(true),
|
2015-04-16 21:04:34 +01:00
|
|
|
mpMediaWindowControl( bInternalMediaControl ? VclPtr<MediaWindowControl>::Create( this ) : nullptr ),
|
2004-08-23 08:04:42 +00:00
|
|
|
mpEmptyBmpEx( NULL ),
|
|
|
|
mpAudioBmpEx( NULL )
|
|
|
|
{
|
|
|
|
if( mpMediaWindowControl )
|
|
|
|
{
|
|
|
|
mpMediaWindowControl->SetSizePixel( mpMediaWindowControl->getMinSizePixel() );
|
|
|
|
mpMediaWindowControl->Show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
MediaWindowImpl::~MediaWindowImpl()
|
2015-01-13 14:50:37 +02:00
|
|
|
{
|
2015-03-10 09:07:06 +02:00
|
|
|
disposeOnce();
|
2015-01-13 14:50:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void MediaWindowImpl::dispose()
|
2004-08-23 08:04:42 +00:00
|
|
|
{
|
2014-05-23 15:34:14 +02:00
|
|
|
if( mpEvents )
|
|
|
|
mpEvents->cleanUp();
|
2004-08-23 08:04:42 +00:00
|
|
|
|
2013-11-18 18:04:37 +01:00
|
|
|
if( mxPlayerWindow.is() )
|
2004-08-23 08:04:42 +00:00
|
|
|
{
|
2013-11-18 18:04:37 +01:00
|
|
|
mxPlayerWindow->removeKeyListener( uno::Reference< awt::XKeyListener >( mxEventsIf, uno::UNO_QUERY ) );
|
|
|
|
mxPlayerWindow->removeMouseListener( uno::Reference< awt::XMouseListener >( mxEventsIf, uno::UNO_QUERY ) );
|
|
|
|
mxPlayerWindow->removeMouseMotionListener( uno::Reference< awt::XMouseMotionListener >( mxEventsIf, uno::UNO_QUERY ) );
|
2004-08-23 08:04:42 +00:00
|
|
|
|
2013-11-18 18:04:37 +01:00
|
|
|
uno::Reference< lang::XComponent > xComponent( mxPlayerWindow, uno::UNO_QUERY );
|
2004-08-23 08:04:42 +00:00
|
|
|
if( xComponent.is() )
|
|
|
|
xComponent->dispose();
|
2004-11-26 20:07:14 +00:00
|
|
|
|
2013-11-18 18:04:37 +01:00
|
|
|
mxPlayerWindow.clear();
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2013-11-18 16:01:12 +01:00
|
|
|
uno::Reference< lang::XComponent > xComponent( mxPlayer, uno::UNO_QUERY );
|
|
|
|
if( xComponent.is() ) // this stops the player
|
|
|
|
xComponent->dispose();
|
|
|
|
|
|
|
|
mxPlayer.clear();
|
|
|
|
|
|
|
|
mpMediaWindow = NULL;
|
2013-11-18 17:01:35 +01:00
|
|
|
|
|
|
|
delete mpEmptyBmpEx;
|
2015-03-02 22:02:19 +00:00
|
|
|
mpEmptyBmpEx = NULL;
|
2013-11-18 17:01:35 +01:00
|
|
|
delete mpAudioBmpEx;
|
2015-03-02 22:02:19 +00:00
|
|
|
mpAudioBmpEx = NULL;
|
2015-03-16 12:17:44 +02:00
|
|
|
mpMediaWindowControl.disposeAndClear();
|
|
|
|
mpChildWindow.disposeAndClear();
|
|
|
|
|
2015-01-13 14:50:37 +02:00
|
|
|
Control::dispose();
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-04-20 18:00:33 +02:00
|
|
|
uno::Reference< media::XPlayer > MediaWindowImpl::createPlayer( const OUString& rURL, const OUString& rReferer, const OUString* pMimeType )
|
2013-11-18 16:01:12 +01:00
|
|
|
{
|
2014-04-04 13:14:45 +02:00
|
|
|
|
2013-11-18 16:01:12 +01:00
|
|
|
uno::Reference< media::XPlayer > xPlayer;
|
2014-07-18 15:58:44 +02:00
|
|
|
|
|
|
|
if( rURL.isEmpty() )
|
|
|
|
return xPlayer;
|
|
|
|
|
2013-11-20 14:43:45 +01:00
|
|
|
if (SvtSecurityOptions().isUntrustedReferer(rReferer)) {
|
|
|
|
return xPlayer;
|
|
|
|
}
|
2013-11-18 16:01:12 +01:00
|
|
|
uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
|
|
|
|
|
2014-04-04 13:14:45 +02:00
|
|
|
if ( !pMimeType || *pMimeType == AVMEDIA_MIMETYPE_COMMON )
|
|
|
|
{
|
|
|
|
|
|
|
|
static const char * aServiceManagers[] = {
|
|
|
|
AVMEDIA_MANAGER_SERVICE_PREFERRED,
|
|
|
|
AVMEDIA_MANAGER_SERVICE_NAME,
|
2013-11-18 16:01:12 +01:00
|
|
|
// a fallback path just for gstreamer which has
|
|
|
|
// two significant versions deployed at once ...
|
|
|
|
#ifdef AVMEDIA_MANAGER_SERVICE_NAME_OLD
|
2014-04-04 13:14:45 +02:00
|
|
|
AVMEDIA_MANAGER_SERVICE_NAME_OLD
|
2014-05-15 16:41:49 +03:00
|
|
|
#endif
|
|
|
|
// fallback to AVMedia framework on OS X
|
|
|
|
#ifdef AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1
|
|
|
|
AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1
|
2013-11-18 16:01:12 +01:00
|
|
|
#endif
|
2014-04-04 13:14:45 +02:00
|
|
|
};
|
2013-11-18 16:01:12 +01:00
|
|
|
|
2014-04-04 13:14:45 +02:00
|
|
|
for( sal_uInt32 i = 0; !xPlayer.is() && i < SAL_N_ELEMENTS( aServiceManagers ); ++i )
|
|
|
|
{
|
|
|
|
const OUString aServiceName( aServiceManagers[ i ],
|
|
|
|
strlen( aServiceManagers[ i ] ),
|
|
|
|
RTL_TEXTENCODING_ASCII_US );
|
|
|
|
|
|
|
|
xPlayer = createPlayer(rURL, aServiceName, xContext);
|
2013-11-18 16:01:12 +01:00
|
|
|
}
|
|
|
|
}
|
2014-06-11 12:36:26 +02:00
|
|
|
#if HAVE_FEATURE_GLTF
|
2014-04-04 13:14:45 +02:00
|
|
|
else if ( *pMimeType == AVMEDIA_MIMETYPE_JSON )
|
|
|
|
{
|
|
|
|
xPlayer = createPlayer(rURL, AVMEDIA_OPENGL_MANAGER_SERVICE_NAME, xContext);
|
|
|
|
}
|
2014-06-11 12:36:26 +02:00
|
|
|
#endif
|
2013-11-18 16:01:12 +01:00
|
|
|
|
|
|
|
return xPlayer;
|
|
|
|
}
|
|
|
|
|
2014-04-04 13:14:45 +02:00
|
|
|
uno::Reference< media::XPlayer > MediaWindowImpl::createPlayer(
|
|
|
|
const OUString& rURL, const OUString& rManagerServName,
|
|
|
|
uno::Reference< uno::XComponentContext > xContext)
|
|
|
|
{
|
|
|
|
uno::Reference< media::XPlayer > xPlayer;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
uno::Reference< media::XManager > xManager (
|
|
|
|
xContext->getServiceManager()->createInstanceWithContext(rManagerServName, xContext),
|
|
|
|
uno::UNO_QUERY );
|
|
|
|
if( xManager.is() )
|
|
|
|
xPlayer = uno::Reference< media::XPlayer >( xManager->createPlayer( rURL ), uno::UNO_QUERY );
|
|
|
|
else
|
|
|
|
SAL_WARN( "avmedia", "failed to create media player service " << rManagerServName );
|
|
|
|
} catch ( const uno::Exception &e )
|
|
|
|
{
|
|
|
|
SAL_WARN( "avmedia", "couldn't create media player " << rManagerServName
|
|
|
|
<< ", exception '" << e.Message << '\'');
|
|
|
|
}
|
|
|
|
return xPlayer;
|
|
|
|
}
|
|
|
|
|
2013-11-18 16:01:12 +01:00
|
|
|
void MediaWindowImpl::setURL( const OUString& rURL,
|
2013-11-20 14:43:45 +01:00
|
|
|
OUString const& rTempURL, OUString const& rReferer)
|
2013-11-18 16:01:12 +01:00
|
|
|
{
|
2013-11-20 17:54:15 +01:00
|
|
|
maReferer = rReferer;
|
2013-11-18 16:01:12 +01:00
|
|
|
if( rURL != getURL() )
|
|
|
|
{
|
|
|
|
if( mxPlayer.is() )
|
|
|
|
mxPlayer->stop();
|
|
|
|
|
|
|
|
if( mxPlayerWindow.is() )
|
|
|
|
{
|
|
|
|
mxPlayerWindow->setVisible( false );
|
|
|
|
mxPlayerWindow.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
mxPlayer.clear();
|
2014-11-12 14:24:10 +05:30
|
|
|
mTempFileURL.clear();
|
2013-11-18 16:01:12 +01:00
|
|
|
|
|
|
|
if (!rTempURL.isEmpty())
|
|
|
|
{
|
|
|
|
maFileURL = rURL;
|
|
|
|
mTempFileURL = rTempURL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
INetURLObject aURL( rURL );
|
|
|
|
|
2015-04-02 18:32:36 +02:00
|
|
|
if (aURL.GetProtocol() != INetProtocol::NotValid)
|
2013-11-18 16:01:12 +01:00
|
|
|
maFileURL = aURL.GetMainURL(INetURLObject::DECODE_UNAMBIGUOUS);
|
|
|
|
else
|
|
|
|
maFileURL = rURL;
|
|
|
|
}
|
|
|
|
|
2014-04-04 13:14:45 +02:00
|
|
|
mxPlayer = createPlayer((!mTempFileURL.isEmpty()) ? mTempFileURL : maFileURL, rReferer, &m_sMimeType );
|
2013-11-18 16:01:12 +01:00
|
|
|
onURLChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const OUString& MediaWindowImpl::getURL() const
|
|
|
|
{
|
|
|
|
return maFileURL;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MediaWindowImpl::isValid() const
|
|
|
|
{
|
2013-11-18 18:04:37 +01:00
|
|
|
return( mxPlayer.is() );
|
2013-11-18 16:01:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Size MediaWindowImpl::getPreferredSize() const
|
|
|
|
{
|
|
|
|
Size aRet;
|
|
|
|
|
|
|
|
if( mxPlayer.is() )
|
|
|
|
{
|
|
|
|
awt::Size aPrefSize( mxPlayer->getPreferredPlayerWindowSize() );
|
|
|
|
|
|
|
|
aRet.Width() = aPrefSize.Width;
|
|
|
|
aRet.Height() = aPrefSize.Height;
|
|
|
|
}
|
|
|
|
|
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MediaWindowImpl::start()
|
|
|
|
{
|
2014-05-02 15:42:25 +02:00
|
|
|
return mxPlayer.is() && ( mxPlayer->start(), true );
|
2013-11-18 16:01:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MediaWindowImpl::updateMediaItem( MediaItem& rItem ) const
|
|
|
|
{
|
|
|
|
if( isPlaying() )
|
2014-05-23 16:14:30 +02:00
|
|
|
rItem.setState( MEDIASTATE_PLAY );
|
2013-11-18 16:01:12 +01:00
|
|
|
else
|
|
|
|
rItem.setState( ( 0.0 == getMediaTime() ) ? MEDIASTATE_STOP : MEDIASTATE_PAUSE );
|
|
|
|
|
|
|
|
rItem.setDuration( getDuration() );
|
|
|
|
rItem.setTime( getMediaTime() );
|
|
|
|
rItem.setLoop( isPlaybackLoop() );
|
|
|
|
rItem.setMute( isMute() );
|
|
|
|
rItem.setVolumeDB( getVolumeDB() );
|
|
|
|
rItem.setZoom( getZoom() );
|
2013-11-20 17:54:15 +01:00
|
|
|
rItem.setURL( getURL(), mTempFileURL, maReferer );
|
2013-11-18 16:01:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MediaWindowImpl::executeMediaItem( const MediaItem& rItem )
|
|
|
|
{
|
2015-03-26 15:19:45 +02:00
|
|
|
const AVMediaSetMask nMaskSet = rItem.getMaskSet();
|
2013-11-18 16:01:12 +01:00
|
|
|
|
|
|
|
// set URL first
|
2015-03-26 15:19:45 +02:00
|
|
|
if( nMaskSet & AVMediaSetMask::URL )
|
2014-04-04 13:14:45 +02:00
|
|
|
{
|
|
|
|
m_sMimeType = rItem.getMimeType();
|
2013-11-20 14:43:45 +01:00
|
|
|
setURL( rItem.getURL(), rItem.getTempURL(), rItem.getReferer() );
|
2014-04-04 13:14:45 +02:00
|
|
|
}
|
2013-11-18 16:01:12 +01:00
|
|
|
|
|
|
|
// set different states next
|
2015-03-26 15:19:45 +02:00
|
|
|
if( nMaskSet & AVMediaSetMask::TIME )
|
2013-11-18 16:01:12 +01:00
|
|
|
setMediaTime( ::std::min( rItem.getTime(), getDuration() ) );
|
|
|
|
|
2015-03-26 15:19:45 +02:00
|
|
|
if( nMaskSet & AVMediaSetMask::LOOP )
|
2013-11-18 16:01:12 +01:00
|
|
|
setPlaybackLoop( rItem.isLoop() );
|
|
|
|
|
2015-03-26 15:19:45 +02:00
|
|
|
if( nMaskSet & AVMediaSetMask::MUTE )
|
2013-11-18 16:01:12 +01:00
|
|
|
setMute( rItem.isMute() );
|
|
|
|
|
2015-03-26 15:19:45 +02:00
|
|
|
if( nMaskSet & AVMediaSetMask::VOLUMEDB )
|
2013-11-18 16:01:12 +01:00
|
|
|
setVolumeDB( rItem.getVolumeDB() );
|
|
|
|
|
2015-03-26 15:19:45 +02:00
|
|
|
if( nMaskSet & AVMediaSetMask::ZOOM )
|
2013-11-18 16:01:12 +01:00
|
|
|
setZoom( rItem.getZoom() );
|
|
|
|
|
|
|
|
// set play state at last
|
2015-03-26 15:19:45 +02:00
|
|
|
if( nMaskSet & AVMediaSetMask::STATE )
|
2013-11-18 16:01:12 +01:00
|
|
|
{
|
|
|
|
switch( rItem.getState() )
|
|
|
|
{
|
|
|
|
case( MEDIASTATE_PLAY ):
|
|
|
|
{
|
|
|
|
|
|
|
|
if( !isPlaying() )
|
|
|
|
start();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case( MEDIASTATE_PAUSE ):
|
|
|
|
{
|
|
|
|
if( isPlaying() )
|
|
|
|
stop();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case( MEDIASTATE_STOP ):
|
|
|
|
{
|
|
|
|
if( isPlaying() )
|
|
|
|
{
|
|
|
|
setMediaTime( 0.0 );
|
|
|
|
stop();
|
|
|
|
setMediaTime( 0.0 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MediaWindowImpl::setZoom( ::com::sun::star::media::ZoomLevel eLevel )
|
|
|
|
{
|
2014-05-02 15:42:25 +02:00
|
|
|
return mxPlayerWindow.is() && mxPlayerWindow->setZoomLevel( eLevel );
|
2013-11-18 16:01:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
::com::sun::star::media::ZoomLevel MediaWindowImpl::getZoom() const
|
|
|
|
{
|
|
|
|
return( mxPlayerWindow.is() ? mxPlayerWindow->getZoomLevel() : media::ZoomLevel_NOT_AVAILABLE );
|
|
|
|
}
|
|
|
|
|
|
|
|
void MediaWindowImpl::stop()
|
|
|
|
{
|
|
|
|
if( mxPlayer.is() )
|
|
|
|
mxPlayer->stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MediaWindowImpl::isPlaying() const
|
|
|
|
{
|
|
|
|
return( mxPlayer.is() && mxPlayer->isPlaying() );
|
|
|
|
}
|
|
|
|
|
|
|
|
double MediaWindowImpl::getDuration() const
|
|
|
|
{
|
|
|
|
return( mxPlayer.is() ? mxPlayer->getDuration() : 0.0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
void MediaWindowImpl::setMediaTime( double fTime )
|
|
|
|
{
|
|
|
|
if( mxPlayer.is() )
|
|
|
|
mxPlayer->setMediaTime( fTime );
|
|
|
|
}
|
|
|
|
|
|
|
|
double MediaWindowImpl::getMediaTime() const
|
|
|
|
{
|
|
|
|
return( mxPlayer.is() ? mxPlayer->getMediaTime() : 0.0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
void MediaWindowImpl::setPlaybackLoop( bool bSet )
|
|
|
|
{
|
|
|
|
if( mxPlayer.is() )
|
|
|
|
mxPlayer->setPlaybackLoop( bSet );
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MediaWindowImpl::isPlaybackLoop() const
|
|
|
|
{
|
2014-05-02 15:42:25 +02:00
|
|
|
return mxPlayer.is() && mxPlayer->isPlaybackLoop();
|
2013-11-18 16:01:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MediaWindowImpl::setMute( bool bSet )
|
|
|
|
{
|
|
|
|
if( mxPlayer.is() )
|
|
|
|
mxPlayer->setMute( bSet );
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MediaWindowImpl::isMute() const
|
|
|
|
{
|
2014-05-02 15:42:25 +02:00
|
|
|
return mxPlayer.is() && mxPlayer->isMute();
|
2013-11-18 16:01:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MediaWindowImpl::setVolumeDB( sal_Int16 nVolumeDB )
|
|
|
|
{
|
|
|
|
if( mxPlayer.is() )
|
|
|
|
mxPlayer->setVolumeDB( nVolumeDB );
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int16 MediaWindowImpl::getVolumeDB() const
|
|
|
|
{
|
|
|
|
return( mxPlayer.is() ? mxPlayer->getVolumeDB() : 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
void MediaWindowImpl::stopPlayingInternal( bool bStop )
|
|
|
|
{
|
|
|
|
if( isPlaying() )
|
|
|
|
{
|
|
|
|
bStop ? mxPlayer->stop() : mxPlayer->start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
void MediaWindowImpl::onURLChanged()
|
|
|
|
{
|
2014-04-27 12:14:18 +02:00
|
|
|
if( m_sMimeType == AVMEDIA_MIMETYPE_COMMON )
|
|
|
|
{
|
2015-03-18 13:51:37 +00:00
|
|
|
mpChildWindow.disposeAndClear();
|
2015-04-16 21:04:34 +01:00
|
|
|
mpChildWindow.reset(VclPtr<MediaChildWindow>::Create(this) );
|
2014-04-27 12:14:18 +02:00
|
|
|
}
|
2014-06-11 12:36:26 +02:00
|
|
|
#if HAVE_FEATURE_GLTF
|
2014-04-27 12:14:18 +02:00
|
|
|
else if ( m_sMimeType == AVMEDIA_MIMETYPE_JSON )
|
|
|
|
{
|
2014-09-02 00:20:37 +02:00
|
|
|
SystemWindowData aWinData = OpenGLContext::generateWinData(this, false);
|
2015-03-18 13:51:37 +00:00
|
|
|
mpChildWindow.disposeAndClear();
|
2015-04-16 21:04:34 +01:00
|
|
|
mpChildWindow.reset(VclPtr<MediaChildWindow>::Create(this,&aWinData));
|
2014-05-13 00:07:48 +02:00
|
|
|
mbEventTransparent = false;
|
2014-04-27 12:14:18 +02:00
|
|
|
}
|
2014-06-11 12:36:26 +02:00
|
|
|
#endif
|
2014-04-27 12:14:18 +02:00
|
|
|
if( !mpChildWindow )
|
|
|
|
return;
|
|
|
|
mpChildWindow->SetHelpId( HID_AVMEDIA_PLAYERWINDOW );
|
2014-05-25 15:38:03 +02:00
|
|
|
mxEventsIf.set( static_cast< ::cppu::OWeakObject* >( mpEvents = new MediaEventListenersImpl( *mpChildWindow.get() ) ) );
|
2014-04-27 12:14:18 +02:00
|
|
|
|
2013-11-18 18:04:37 +01:00
|
|
|
if( mxPlayer.is() )
|
2004-08-23 08:04:42 +00:00
|
|
|
{
|
2014-05-25 15:36:21 +02:00
|
|
|
Resize();
|
2010-09-16 15:17:37 +02:00
|
|
|
uno::Sequence< uno::Any > aArgs( 3 );
|
2004-11-03 14:54:55 +00:00
|
|
|
uno::Reference< media::XPlayerWindow > xPlayerWindow;
|
|
|
|
const Point aPoint;
|
2014-04-27 12:14:18 +02:00
|
|
|
const Size aSize( mpChildWindow->GetSizePixel() );
|
2004-08-23 08:04:42 +00:00
|
|
|
|
2014-05-08 18:33:56 +02:00
|
|
|
aArgs[ 0 ] = uno::makeAny( mpChildWindow->GetParentWindowHandle() );
|
2004-08-23 08:04:42 +00:00
|
|
|
aArgs[ 1 ] = uno::makeAny( awt::Rectangle( aPoint.X(), aPoint.Y(), aSize.Width(), aSize.Height() ) );
|
2014-04-27 12:14:18 +02:00
|
|
|
aArgs[ 2 ] = uno::makeAny( reinterpret_cast< sal_IntPtr >( mpChildWindow.get() ) );
|
2004-08-23 08:04:42 +00:00
|
|
|
|
2005-10-13 08:42:40 +00:00
|
|
|
try
|
|
|
|
{
|
2013-11-18 18:04:37 +01:00
|
|
|
xPlayerWindow = mxPlayer->createPlayerWindow( aArgs );
|
2005-10-13 08:42:40 +00:00
|
|
|
}
|
2014-11-14 17:17:50 +00:00
|
|
|
catch( const uno::RuntimeException& )
|
2005-10-13 08:42:40 +00:00
|
|
|
{
|
|
|
|
// happens eg, on MacOSX where Java frames cannot be created from X11 window handles
|
|
|
|
}
|
2004-11-03 14:54:55 +00:00
|
|
|
|
2013-11-18 18:04:37 +01:00
|
|
|
mxPlayerWindow = xPlayerWindow;
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
if( xPlayerWindow.is() )
|
|
|
|
{
|
|
|
|
xPlayerWindow->addKeyListener( uno::Reference< awt::XKeyListener >( mxEventsIf, uno::UNO_QUERY ) );
|
|
|
|
xPlayerWindow->addMouseListener( uno::Reference< awt::XMouseListener >( mxEventsIf, uno::UNO_QUERY ) );
|
|
|
|
xPlayerWindow->addMouseMotionListener( uno::Reference< awt::XMouseMotionListener >( mxEventsIf, uno::UNO_QUERY ) );
|
|
|
|
xPlayerWindow->addFocusListener( uno::Reference< awt::XFocusListener >( mxEventsIf, uno::UNO_QUERY ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2013-11-18 18:04:37 +01:00
|
|
|
mxPlayerWindow.clear();
|
2004-08-23 08:04:42 +00:00
|
|
|
|
2013-11-18 18:04:37 +01:00
|
|
|
if( mxPlayerWindow.is() )
|
2014-04-27 12:14:18 +02:00
|
|
|
mpChildWindow->Show();
|
2004-08-23 08:04:42 +00:00
|
|
|
else
|
2014-04-27 12:14:18 +02:00
|
|
|
mpChildWindow->Hide();
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
if( mpMediaWindowControl )
|
|
|
|
{
|
|
|
|
MediaItem aItem;
|
|
|
|
|
|
|
|
updateMediaItem( aItem );
|
|
|
|
mpMediaWindowControl->setState( aItem );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::setPosSize( const Rectangle& rRect )
|
|
|
|
{
|
2010-06-09 07:07:59 +02:00
|
|
|
SetPosSizePixel( rRect.TopLeft(), rRect.GetSize() );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::setPointer( const Pointer& rPointer )
|
|
|
|
{
|
|
|
|
SetPointer( rPointer );
|
2014-04-27 12:14:18 +02:00
|
|
|
if( mpChildWindow )
|
|
|
|
mpChildWindow->SetPointer( rPointer );
|
2004-08-23 08:04:42 +00:00
|
|
|
|
2013-11-18 18:04:37 +01:00
|
|
|
if( mxPlayerWindow.is() )
|
2004-08-23 08:04:42 +00:00
|
|
|
{
|
|
|
|
long nPointer;
|
|
|
|
|
|
|
|
switch( rPointer.GetStyle() )
|
|
|
|
{
|
|
|
|
case( POINTER_CROSS ): nPointer = awt::SystemPointer::CROSS; break;
|
|
|
|
case( POINTER_HAND ): nPointer = awt::SystemPointer::HAND; break;
|
|
|
|
case( POINTER_MOVE ): nPointer = awt::SystemPointer::MOVE; break;
|
|
|
|
case( POINTER_WAIT ): nPointer = awt::SystemPointer::WAIT; break;
|
|
|
|
|
|
|
|
default: nPointer = awt::SystemPointer::ARROW; break;
|
|
|
|
}
|
|
|
|
|
2013-11-18 18:04:37 +01:00
|
|
|
mxPlayerWindow->setPointerType( nPointer );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::Resize()
|
|
|
|
{
|
|
|
|
const Size aCurSize( GetOutputSizePixel() );
|
|
|
|
const sal_Int32 nOffset( mpMediaWindowControl ? AVMEDIA_CONTROLOFFSET : 0 );
|
|
|
|
Size aPlayerWindowSize( aCurSize.Width() - ( nOffset << 1 ),
|
|
|
|
aCurSize.Height() - ( nOffset << 1 ) );
|
|
|
|
|
|
|
|
if( mpMediaWindowControl )
|
|
|
|
{
|
|
|
|
const sal_Int32 nControlHeight = mpMediaWindowControl->GetSizePixel().Height();
|
|
|
|
const sal_Int32 nControlY = ::std::max( aCurSize.Height() - nControlHeight - nOffset, 0L );
|
|
|
|
|
|
|
|
aPlayerWindowSize.Height() = ( nControlY - ( nOffset << 1 ) );
|
|
|
|
mpMediaWindowControl->SetPosSizePixel( Point( nOffset, nControlY ), Size( aCurSize.Width() - ( nOffset << 1 ), nControlHeight ) );
|
|
|
|
}
|
2014-04-27 12:14:18 +02:00
|
|
|
if( mpChildWindow )
|
|
|
|
mpChildWindow->SetPosSizePixel( Point( 0, 0 ), aPlayerWindowSize );
|
2014-04-28 15:42:32 +02:00
|
|
|
|
|
|
|
if( mxPlayerWindow.is() )
|
|
|
|
mxPlayerWindow->setPosSize( 0, 0, aPlayerWindowSize.Width(), aPlayerWindowSize.Height(), 0 );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::StateChanged( StateChangedType eType )
|
|
|
|
{
|
2013-11-18 18:04:37 +01:00
|
|
|
if( mxPlayerWindow.is() )
|
2004-08-23 08:04:42 +00:00
|
|
|
{
|
|
|
|
// stop playing when going disabled or hidden
|
|
|
|
switch( eType )
|
|
|
|
{
|
2014-10-07 16:08:25 +02:00
|
|
|
case StateChangedType::VISIBLE:
|
2004-08-23 08:04:42 +00:00
|
|
|
{
|
|
|
|
stopPlayingInternal( !IsVisible() );
|
2013-11-18 18:04:37 +01:00
|
|
|
mxPlayerWindow->setVisible( IsVisible() );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2014-10-07 16:08:25 +02:00
|
|
|
case StateChangedType::ENABLE:
|
2004-08-23 08:04:42 +00:00
|
|
|
{
|
|
|
|
stopPlayingInternal( !IsEnabled() );
|
2013-11-18 18:04:37 +01:00
|
|
|
mxPlayerWindow->setEnable( IsEnabled() );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::Paint( const Rectangle& )
|
|
|
|
{
|
2014-04-28 15:42:32 +02:00
|
|
|
if( mxPlayerWindow.is() )
|
|
|
|
mxPlayerWindow->update();
|
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
BitmapEx* pLogo = NULL;
|
|
|
|
|
2013-11-18 18:04:37 +01:00
|
|
|
if( !mxPlayer.is() )
|
2004-08-23 08:04:42 +00:00
|
|
|
{
|
|
|
|
if( !mpEmptyBmpEx )
|
|
|
|
mpEmptyBmpEx = new BitmapEx( AVMEDIA_RESID( AVMEDIA_BMP_EMPTYLOGO ) );
|
|
|
|
|
|
|
|
pLogo = mpEmptyBmpEx;
|
|
|
|
}
|
2013-11-18 18:04:37 +01:00
|
|
|
else if( !mxPlayerWindow.is() )
|
2004-08-23 08:04:42 +00:00
|
|
|
{
|
|
|
|
if( !mpAudioBmpEx )
|
|
|
|
mpAudioBmpEx = new BitmapEx( AVMEDIA_RESID( AVMEDIA_BMP_AUDIOLOGO ) );
|
|
|
|
|
|
|
|
pLogo = mpAudioBmpEx;
|
|
|
|
}
|
|
|
|
|
2014-04-27 12:14:18 +02:00
|
|
|
if( !mpChildWindow )
|
|
|
|
return;
|
|
|
|
const Point aBasePos( mpChildWindow->GetPosPixel() );
|
|
|
|
const Rectangle aVideoRect( aBasePos, mpChildWindow->GetSizePixel() );
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
if( pLogo && !pLogo->IsEmpty() && ( aVideoRect.GetWidth() > 0 ) && ( aVideoRect.GetHeight() > 0 ) )
|
|
|
|
{
|
|
|
|
Size aLogoSize( pLogo->GetSizePixel() );
|
2013-09-20 20:14:11 +03:00
|
|
|
const Color aBackgroundColor( 67, 67, 67 );
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
SetLineColor( aBackgroundColor );
|
|
|
|
SetFillColor( aBackgroundColor );
|
|
|
|
DrawRect( aVideoRect );
|
|
|
|
|
|
|
|
if( ( aLogoSize.Width() > aVideoRect.GetWidth() || aLogoSize.Height() > aVideoRect.GetHeight() ) &&
|
|
|
|
( aLogoSize.Height() > 0 ) )
|
|
|
|
{
|
|
|
|
const double fLogoWH = (double) aLogoSize.Width() / aLogoSize.Height();
|
|
|
|
|
|
|
|
if( fLogoWH < ( (double) aVideoRect.GetWidth() / aVideoRect.GetHeight() ) )
|
|
|
|
{
|
|
|
|
aLogoSize.Width() = (long) ( aVideoRect.GetHeight() * fLogoWH );
|
|
|
|
aLogoSize.Height()= aVideoRect.GetHeight();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aLogoSize.Width() = aVideoRect.GetWidth();
|
|
|
|
aLogoSize.Height()= (long) ( aVideoRect.GetWidth() / fLogoWH );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DrawBitmapEx( Point( aBasePos.X() + ( ( aVideoRect.GetWidth() - aLogoSize.Width() ) >> 1 ),
|
|
|
|
aBasePos.Y() + ( ( aVideoRect.GetHeight() - aLogoSize.Height() ) >> 1 ) ),
|
|
|
|
aLogoSize, *pLogo );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::GetFocus()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::MouseMove( const MouseEvent& rMEvt )
|
|
|
|
{
|
2014-05-13 00:07:48 +02:00
|
|
|
if( mpMediaWindow && mbEventTransparent )
|
2013-11-18 18:04:37 +01:00
|
|
|
mpMediaWindow->MouseMove( rMEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::MouseButtonDown( const MouseEvent& rMEvt )
|
|
|
|
{
|
2014-05-13 00:07:48 +02:00
|
|
|
if( mpMediaWindow && mbEventTransparent )
|
2013-11-18 18:04:37 +01:00
|
|
|
mpMediaWindow->MouseButtonDown( rMEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::MouseButtonUp( const MouseEvent& rMEvt )
|
|
|
|
{
|
2014-05-13 00:07:48 +02:00
|
|
|
if( mpMediaWindow && mbEventTransparent )
|
2013-11-18 18:04:37 +01:00
|
|
|
mpMediaWindow->MouseButtonUp( rMEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::KeyInput( const KeyEvent& rKEvt )
|
|
|
|
{
|
2014-05-13 00:07:48 +02:00
|
|
|
if( mpMediaWindow && mbEventTransparent )
|
2013-11-18 18:04:37 +01:00
|
|
|
mpMediaWindow->KeyInput( rKEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::KeyUp( const KeyEvent& rKEvt )
|
|
|
|
{
|
2014-05-13 00:07:48 +02:00
|
|
|
if( mpMediaWindow && mbEventTransparent )
|
2013-11-18 18:04:37 +01:00
|
|
|
mpMediaWindow->KeyUp( rKEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::Command( const CommandEvent& rCEvt )
|
|
|
|
{
|
2014-05-13 00:07:48 +02:00
|
|
|
if( mpMediaWindow && mbEventTransparent )
|
2013-11-18 18:04:37 +01:00
|
|
|
mpMediaWindow->Command( rCEvt );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
sal_Int8 MediaWindowImpl::AcceptDrop( const AcceptDropEvent& rEvt )
|
|
|
|
{
|
2014-05-13 00:07:48 +02:00
|
|
|
return( mpMediaWindow && mbEventTransparent ? mpMediaWindow->AcceptDrop( rEvt ) : 0 );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
sal_Int8 MediaWindowImpl::ExecuteDrop( const ExecuteDropEvent& rEvt )
|
|
|
|
{
|
2014-05-13 00:07:48 +02:00
|
|
|
return( mpMediaWindow && mbEventTransparent ? mpMediaWindow->ExecuteDrop( rEvt ) : 0 );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-23 08:04:42 +00:00
|
|
|
|
|
|
|
void MediaWindowImpl::StartDrag( sal_Int8 nAction, const Point& rPosPixel )
|
|
|
|
{
|
2014-05-13 00:07:48 +02:00
|
|
|
if( mpMediaWindow && mbEventTransparent )
|
2013-11-18 18:04:37 +01:00
|
|
|
mpMediaWindow->StartDrag( nAction, rPosPixel );
|
2004-08-23 08:04:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace priv
|
|
|
|
} // namespace avmedia
|
2010-10-12 15:53:47 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|