loplugin:mergeclasses SoundHandler
replace ThreadHelpBase with MutexHelper Change-Id: If971a701261164ff4d3871eab5dfebd2c5d5b89f Reviewed-on: https://gerrit.libreoffice.org/84111 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -119,11 +119,8 @@ css::uno::Sequence< OUString > SAL_CALL SoundHandler::getSupportedServiceNames()
|
||||
@threadsafe yes
|
||||
*//*-*************************************************************************************************************/
|
||||
SoundHandler::SoundHandler()
|
||||
// Init baseclasses first
|
||||
: ThreadHelpBase ( )
|
||||
, ::cppu::OWeakObject ( )
|
||||
// Init member
|
||||
, m_bError ( false )
|
||||
: m_bError ( false )
|
||||
, m_aUpdateIdle ( "avmedia SoundHandler Update" )
|
||||
{
|
||||
m_aUpdateIdle.SetInvokeHandler(LINK(this, SoundHandler, implts_PlayerNotify));
|
||||
@@ -168,7 +165,7 @@ void SAL_CALL SoundHandler::dispatchWithNotification(const css::util::URL&
|
||||
const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
|
||||
{
|
||||
// SAFE {
|
||||
const ::osl::MutexGuard aLock( m_aLock );
|
||||
const ::osl::MutexGuard aLock( GetMutex() );
|
||||
|
||||
utl::MediaDescriptor aDescriptor(lDescriptor);
|
||||
|
||||
@@ -280,7 +277,7 @@ OUString SAL_CALL SoundHandler::detect( css::uno::Sequence< css::beans::Property
|
||||
IMPL_LINK_NOARG(SoundHandler, implts_PlayerNotify, Timer *, void)
|
||||
{
|
||||
// SAFE {
|
||||
::osl::ClearableMutexGuard aLock( m_aLock );
|
||||
::osl::ClearableMutexGuard aLock( GetMutex() );
|
||||
|
||||
if (m_xPlayer.is() && m_xPlayer->isPlaying() && m_xPlayer->getMediaTime() < m_xPlayer->getDuration())
|
||||
{
|
||||
|
@@ -36,17 +36,12 @@
|
||||
#include <vcl/timer.hxx>
|
||||
#include <vcl/idle.hxx>
|
||||
#include <tools/link.hxx>
|
||||
#include <toolkit/helper/mutexhelper.hxx>
|
||||
#include <avmedia/mediawindow.hxx>
|
||||
#include <osl/mutex.hxx>
|
||||
|
||||
namespace avmedia{
|
||||
|
||||
struct ThreadHelpBase
|
||||
{
|
||||
public:
|
||||
mutable ::osl::Mutex m_aLock;
|
||||
};
|
||||
|
||||
/*-************************************************************************************************************
|
||||
@short handler to detect and play sounds ("wav" and "au" only!)
|
||||
@descr Register this implementation as a content handler to detect and/or play wav- and au-sounds.
|
||||
@@ -65,7 +60,7 @@ class SoundHandler : // interfaces
|
||||
, public css::document::XExtendedFilterDetection
|
||||
// baseclasses
|
||||
// Order is necessary for right initialization!
|
||||
, private ThreadHelpBase
|
||||
, private MutexHelper
|
||||
, public ::cppu::OWeakObject
|
||||
{
|
||||
// public methods
|
||||
|
Reference in New Issue
Block a user