1f39251c4SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3f39251c4SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4f39251c4SAndrew Rist * or more contributor license agreements. See the NOTICE file 5f39251c4SAndrew Rist * distributed with this work for additional information 6f39251c4SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7f39251c4SAndrew Rist * to you under the Apache License, Version 2.0 (the 8f39251c4SAndrew Rist * "License"); you may not use this file except in compliance 9f39251c4SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11f39251c4SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13f39251c4SAndrew Rist * Unless required by applicable law or agreed to in writing, 14f39251c4SAndrew Rist * software distributed under the License is distributed on an 15f39251c4SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16f39251c4SAndrew Rist * KIND, either express or implied. See the License for the 17f39251c4SAndrew Rist * specific language governing permissions and limitations 18f39251c4SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20f39251c4SAndrew Rist *************************************************************/ 21f39251c4SAndrew Rist 22f39251c4SAndrew 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<uno::XComponentContext> & rxContext)34*652e100fSDamjan JovanovicManager::Manager( const uno::Reference< uno::XComponentContext >& rxContext ) : 35*652e100fSDamjan Jovanovic mxContext( rxContext ) 36cdf0e10cSrcweir { 37cdf0e10cSrcweir } 38cdf0e10cSrcweir 39cdf0e10cSrcweir // ------------------------------------------------------------------------------ 40cdf0e10cSrcweir ~Manager()41cdf0e10cSrcweirManager::~Manager() 42cdf0e10cSrcweir { 43cdf0e10cSrcweir } 44cdf0e10cSrcweir 45cdf0e10cSrcweir // ------------------------------------------------------------------------------ 46cdf0e10cSrcweir createPlayer(const::rtl::OUString & aURL)47cdf0e10cSrcweiruno::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 { 64*652e100fSDamjan Jovanovic return getImplementationName_Static(); 65cdf0e10cSrcweir } 66cdf0e10cSrcweir 67cdf0e10cSrcweir // ------------------------------------------------------------------------------ 68cdf0e10cSrcweir supportsService(const::rtl::OUString & ServiceName)69cdf0e10cSrcweirsal_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()77cdf0e10cSrcweiruno::Sequence< ::rtl::OUString > SAL_CALL Manager::getSupportedServiceNames( ) 78cdf0e10cSrcweir throw (uno::RuntimeException) 79cdf0e10cSrcweir { 80*652e100fSDamjan Jovanovic return getSupportedServiceNames_Static(); 81*652e100fSDamjan Jovanovic } 82*652e100fSDamjan Jovanovic 83*652e100fSDamjan Jovanovic // ------------------------------------------------------------------------------ 84*652e100fSDamjan Jovanovic getImplementationName_Static()85*652e100fSDamjan Jovanovic::rtl::OUString SAL_CALL Manager::getImplementationName_Static( ) 86*652e100fSDamjan Jovanovic { 87*652e100fSDamjan Jovanovic return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_XINE_MANAGER_IMPLEMENTATIONNAME ) ); 88*652e100fSDamjan Jovanovic } 89*652e100fSDamjan Jovanovic 90*652e100fSDamjan Jovanovic // ------------------------------------------------------------------------------ 91*652e100fSDamjan Jovanovic getSupportedServiceNames_Static()92*652e100fSDamjan Jovanovicuno::Sequence< ::rtl::OUString > SAL_CALL Manager::getSupportedServiceNames_Static( ) 93*652e100fSDamjan Jovanovic { 94cdf0e10cSrcweir uno::Sequence< ::rtl::OUString > aRet(1); 95cdf0e10cSrcweir aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_XINE_MANAGER_SERVICENAME ) ); 96cdf0e10cSrcweir return aRet; 97cdf0e10cSrcweir } 98cdf0e10cSrcweir 99cdf0e10cSrcweir } // namespace xine 100cdf0e10cSrcweir } // namespace avmedia 101