xref: /aoo41x/main/avmedia/source/xine/manager.cxx (revision f39251c4)
1*f39251c4SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f39251c4SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f39251c4SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f39251c4SAndrew Rist  * distributed with this work for additional information
6*f39251c4SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f39251c4SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f39251c4SAndrew Rist  * "License"); you may not use this file except in compliance
9*f39251c4SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f39251c4SAndrew Rist  *
11*f39251c4SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f39251c4SAndrew Rist  *
13*f39251c4SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f39251c4SAndrew Rist  * software distributed under the License is distributed on an
15*f39251c4SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f39251c4SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f39251c4SAndrew Rist  * specific language governing permissions and limitations
18*f39251c4SAndrew Rist  * under the License.
19*f39251c4SAndrew Rist  *
20*f39251c4SAndrew Rist  *************************************************************/
21*f39251c4SAndrew Rist 
22*f39251c4SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "manager.hxx"
25cdf0e10cSrcweir #include "player.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir using namespace ::com::sun::star;
28cdf0e10cSrcweir 
29cdf0e10cSrcweir namespace avmedia { namespace xine {
30cdf0e10cSrcweir // ----------------
31cdf0e10cSrcweir // - Manager -
32cdf0e10cSrcweir // ----------------
33cdf0e10cSrcweir 
Manager(const uno::Reference<lang::XMultiServiceFactory> & rxMgr)34cdf0e10cSrcweir Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
35cdf0e10cSrcweir     mxMgr( rxMgr )
36cdf0e10cSrcweir {
37cdf0e10cSrcweir }
38cdf0e10cSrcweir 
39cdf0e10cSrcweir // ------------------------------------------------------------------------------
40cdf0e10cSrcweir 
~Manager()41cdf0e10cSrcweir Manager::~Manager()
42cdf0e10cSrcweir {
43cdf0e10cSrcweir }
44cdf0e10cSrcweir 
45cdf0e10cSrcweir // ------------------------------------------------------------------------------
46cdf0e10cSrcweir 
createPlayer(const::rtl::OUString & aURL)47cdf0e10cSrcweir uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const ::rtl::OUString& aURL )
48cdf0e10cSrcweir     throw (uno::RuntimeException)
49cdf0e10cSrcweir {
50cdf0e10cSrcweir     Player*                         	pPlayer( new Player );
51cdf0e10cSrcweir     uno::Reference< media::XPlayer >    xRet( pPlayer );
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     if( !pPlayer->create( aURL )  )
54cdf0e10cSrcweir         xRet = uno::Reference< media::XPlayer >();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     return xRet;
57cdf0e10cSrcweir }
58cdf0e10cSrcweir 
59cdf0e10cSrcweir // ------------------------------------------------------------------------------
60cdf0e10cSrcweir 
getImplementationName()61cdf0e10cSrcweir ::rtl::OUString SAL_CALL Manager::getImplementationName(  )
62cdf0e10cSrcweir     throw (uno::RuntimeException)
63cdf0e10cSrcweir {
64cdf0e10cSrcweir     return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_XINE_MANAGER_IMPLEMENTATIONNAME ) );
65cdf0e10cSrcweir }
66cdf0e10cSrcweir 
67cdf0e10cSrcweir // ------------------------------------------------------------------------------
68cdf0e10cSrcweir 
supportsService(const::rtl::OUString & ServiceName)69cdf0e10cSrcweir sal_Bool SAL_CALL Manager::supportsService( const ::rtl::OUString& ServiceName )
70cdf0e10cSrcweir     throw (uno::RuntimeException)
71cdf0e10cSrcweir {
72cdf0e10cSrcweir     return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_XINE_MANAGER_SERVICENAME ) );
73cdf0e10cSrcweir }
74cdf0e10cSrcweir 
75cdf0e10cSrcweir // ------------------------------------------------------------------------------
76cdf0e10cSrcweir 
getSupportedServiceNames()77cdf0e10cSrcweir uno::Sequence< ::rtl::OUString > SAL_CALL Manager::getSupportedServiceNames(  )
78cdf0e10cSrcweir     throw (uno::RuntimeException)
79cdf0e10cSrcweir {
80cdf0e10cSrcweir     uno::Sequence< ::rtl::OUString > aRet(1);
81cdf0e10cSrcweir     aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_XINE_MANAGER_SERVICENAME ) );
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     return aRet;
84cdf0e10cSrcweir }
85cdf0e10cSrcweir 
86cdf0e10cSrcweir } // namespace xine
87cdf0e10cSrcweir } // namespace avmedia
88