1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: player.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 using namespace ::com::sun::star
;
36 namespace avmedia
{ namespace xine
{
46 // ------------------------------------------------------------------------------
52 // ------------------------------------------------------------------------------
54 bool Player::create( const ::rtl::OUString
& /* rURL */ )
62 // ------------------------------------------------------------------------------
64 void SAL_CALL
Player::start( )
65 throw (uno::RuntimeException
)
69 // ------------------------------------------------------------------------------
71 void SAL_CALL
Player::stop( )
72 throw (uno::RuntimeException
)
76 // ------------------------------------------------------------------------------
78 sal_Bool SAL_CALL
Player::isPlaying()
79 throw (uno::RuntimeException
)
86 // ------------------------------------------------------------------------------
88 double SAL_CALL
Player::getDuration( )
89 throw (uno::RuntimeException
)
96 // ------------------------------------------------------------------------------
98 void SAL_CALL
Player::setMediaTime( double /* fTime */ )
99 throw (uno::RuntimeException
)
103 // ------------------------------------------------------------------------------
105 double SAL_CALL
Player::getMediaTime( )
106 throw (uno::RuntimeException
)
113 // ------------------------------------------------------------------------------
115 void SAL_CALL
Player::setStopTime( double /* fTime */ )
116 throw (uno::RuntimeException
)
120 // ------------------------------------------------------------------------------
122 double SAL_CALL
Player::getStopTime( )
123 throw (uno::RuntimeException
)
130 // ------------------------------------------------------------------------------
132 void SAL_CALL
Player::setRate( double /* fRate */ )
133 throw (uno::RuntimeException
)
137 // ------------------------------------------------------------------------------
139 double SAL_CALL
Player::getRate( )
140 throw (uno::RuntimeException
)
147 // ------------------------------------------------------------------------------
149 void SAL_CALL
Player::setPlaybackLoop( sal_Bool
/* bSet */ )
150 throw (uno::RuntimeException
)
154 // ------------------------------------------------------------------------------
156 sal_Bool SAL_CALL
Player::isPlaybackLoop( )
157 throw (uno::RuntimeException
)
164 // ------------------------------------------------------------------------------
166 void SAL_CALL
Player::setMute( sal_Bool
/* bSet */ )
167 throw (uno::RuntimeException
)
171 // ------------------------------------------------------------------------------
173 sal_Bool SAL_CALL
Player::isMute( )
174 throw (uno::RuntimeException
)
181 // ------------------------------------------------------------------------------
183 void SAL_CALL
Player::setVolumeDB( sal_Int16
/* nVolumeDB */ )
184 throw (uno::RuntimeException
)
188 // ------------------------------------------------------------------------------
190 sal_Int16 SAL_CALL
Player::getVolumeDB( )
191 throw (uno::RuntimeException
)
198 // ------------------------------------------------------------------------------
200 awt::Size SAL_CALL
Player::getPreferredPlayerWindowSize( )
201 throw (uno::RuntimeException
)
203 awt::Size
aSize( 0, 0 );
208 // ------------------------------------------------------------------------------
210 uno::Reference
< ::media::XPlayerWindow
> SAL_CALL
Player::createPlayerWindow( const uno::Sequence
< uno::Any
>& aArguments
)
211 throw (uno::RuntimeException
)
213 uno::Reference
< ::media::XPlayerWindow
> xRet
;
214 awt::Size
aSize( getPreferredPlayerWindowSize() );
216 if( aSize
.Width
> 0 && aSize
.Height
> 0 )
218 ::avmedia::xine::Window
* pWindow
= new ::avmedia::xine::Window( *this );
222 if( !pWindow
->create( aArguments
) )
223 xRet
= uno::Reference
< ::media::XPlayerWindow
>();
229 // ------------------------------------------------------------------------------
231 uno::Reference
< media::XFrameGrabber
> SAL_CALL
Player::createFrameGrabber( )
232 throw (::com::sun::star::uno::RuntimeException
)
237 // ------------------------------------------------------------------------------
239 ::rtl::OUString SAL_CALL
Player::getImplementationName( )
240 throw (uno::RuntimeException
)
242 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_XINE_PLAYER_IMPLEMENTATIONNAME
) );
245 // ------------------------------------------------------------------------------
247 sal_Bool SAL_CALL
Player::supportsService( const ::rtl::OUString
& ServiceName
)
248 throw (uno::RuntimeException
)
250 return ServiceName
.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_XINE_PLAYER_SERVICENAME
) );
253 // ------------------------------------------------------------------------------
255 uno::Sequence
< ::rtl::OUString
> SAL_CALL
Player::getSupportedServiceNames( )
256 throw (uno::RuntimeException
)
258 uno::Sequence
< ::rtl::OUString
> aRet(1);
259 aRet
[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_XINE_PLAYER_SERVICENAME
) );
265 } // namespace avmedia