Kaydet (Commit) a66fd8a9 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert animations::Audio and IterateContainer to new style

The services already existed, they just needed IDL files

Change-Id: I4e3389abb2cb0e41c9bab112cda2a7e896eb271d
üst 725d23be
......@@ -38,6 +38,8 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/accessibil
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/animations,\
AnimateColor \
AnimateSet \
Audio \
IterateContainer \
ParallelTimeContainer \
SequenceTimeContainer \
TargetPropertiesCreator \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* 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 .
*/
#ifndef __com_sun_star_animations_Audio_idl__
#define __com_sun_star_animations_Audio_idl__
#include <com/sun/star/animations/XAudio.idl>
module com { module sun { module star { module animations {
/**
@since LibreOffice 4.1
*/
service Audio : com::sun::star::animations::XAudio;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* 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 .
*/
#ifndef __com_sun_star_animations_IterateContainer_idl__
#define __com_sun_star_animations_IterateContainer_idl__
#include <com/sun/star/animations/XTimeContainer.idl>
module com { module sun { module star { module animations {
/**
@since LibreOffice 4.1
*/
service IterateContainer : com::sun::star::animations::XTimeContainer;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -22,6 +22,8 @@
#include <com/sun/star/animations/AnimateColor.hpp>
#include <com/sun/star/animations/AnimateSet.hpp>
#include <com/sun/star/animations/AnimationFill.hpp>
#include <com/sun/star/animations/Audio.hpp>
#include <com/sun/star/animations/IterateContainer.hpp>
#include <com/sun/star/animations/ParallelTimeContainer.hpp>
#include <com/sun/star/animations/SequenceTimeContainer.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
......@@ -1032,14 +1034,14 @@ void CustomAnimationEffect::setIterateType( sal_Int16 nIterateType )
{
sal_Int16 nTargetSubItem = mnTargetSubItem;
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< XTimeContainer > xNewContainer;
if(nIterateType)
{
Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() );
xNewContainer.set( xMsf->createInstance( OUString::createFromAscii("com.sun.star.animations.IterateContainer") ), UNO_QUERY_THROW );
xNewContainer.set( IterateContainer::create( xContext ) );
}
else
xNewContainer.set( ParallelTimeContainer::create( ::comphelper::getProcessComponentContext() ), UNO_QUERY_THROW );
xNewContainer.set( ParallelTimeContainer::create( xContext ), UNO_QUERY_THROW );
Reference< XTimeContainer > xOldContainer( mxNode, UNO_QUERY_THROW );
Reference< XEnumerationAccess > xEnumerationAccess( mxNode, UNO_QUERY_THROW );
......@@ -1553,8 +1555,8 @@ void CustomAnimationEffect::createAudio( const ::com::sun::star::uno::Any& rSour
if( !mxAudio.is() ) try
{
Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() );
Reference< XAudio > xAudio( xMsf->createInstance( "com.sun.star.animations.Audio" ), UNO_QUERY_THROW );
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< XAudio > xAudio( Audio::create( xContext ) );
xAudio->setSource( rSource );
xAudio->setVolume( fVolume );
setAudio( xAudio );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment