1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #include "player.hxx" 25 #include "window.hxx" 26 27 using namespace ::com::sun::star; 28 29 namespace avmedia { namespace xine { 30 31 // ---------------- 32 // - Player - 33 // ---------------- 34 35 Player::Player() 36 { 37 } 38 39 // ------------------------------------------------------------------------------ 40 41 Player::~Player() 42 { 43 } 44 45 // ------------------------------------------------------------------------------ 46 47 bool Player::create( const ::rtl::OUString& /* rURL */ ) 48 { 49 bool bRet = false; 50 51 52 return bRet; 53 } 54 55 // ------------------------------------------------------------------------------ 56 57 void SAL_CALL Player::start( ) 58 { 59 } 60 61 // ------------------------------------------------------------------------------ 62 63 void SAL_CALL Player::stop( ) 64 { 65 } 66 67 // ------------------------------------------------------------------------------ 68 69 sal_Bool SAL_CALL Player::isPlaying() 70 { 71 bool bRet = false; 72 73 return bRet; 74 } 75 76 // ------------------------------------------------------------------------------ 77 78 double SAL_CALL Player::getDuration( ) 79 { 80 double fRet = 0.0; 81 82 return fRet; 83 } 84 85 // ------------------------------------------------------------------------------ 86 87 void SAL_CALL Player::setMediaTime( double /* fTime */ ) 88 { 89 } 90 91 // ------------------------------------------------------------------------------ 92 93 double SAL_CALL Player::getMediaTime( ) 94 { 95 double fRet = 0.0; 96 97 return fRet; 98 } 99 100 // ------------------------------------------------------------------------------ 101 102 void SAL_CALL Player::setStopTime( double /* fTime */ ) 103 { 104 } 105 106 // ------------------------------------------------------------------------------ 107 108 double SAL_CALL Player::getStopTime( ) 109 { 110 double fRet = 0.0; 111 112 return fRet; 113 } 114 115 // ------------------------------------------------------------------------------ 116 117 void SAL_CALL Player::setRate( double /* fRate */ ) 118 { 119 } 120 121 // ------------------------------------------------------------------------------ 122 123 double SAL_CALL Player::getRate( ) 124 { 125 double fRet = 0.0; 126 127 return fRet; 128 } 129 130 // ------------------------------------------------------------------------------ 131 132 void SAL_CALL Player::setPlaybackLoop( sal_Bool /* bSet */ ) 133 { 134 } 135 136 // ------------------------------------------------------------------------------ 137 138 sal_Bool SAL_CALL Player::isPlaybackLoop( ) 139 { 140 bool bRet = false; 141 142 return bRet; 143 } 144 145 // ------------------------------------------------------------------------------ 146 147 void SAL_CALL Player::setMute( sal_Bool /* bSet */ ) 148 { 149 } 150 151 // ------------------------------------------------------------------------------ 152 153 sal_Bool SAL_CALL Player::isMute( ) 154 { 155 bool bRet = false; 156 157 return bRet; 158 } 159 160 // ------------------------------------------------------------------------------ 161 162 void SAL_CALL Player::setVolumeDB( sal_Int16 /* nVolumeDB */ ) 163 { 164 } 165 166 // ------------------------------------------------------------------------------ 167 168 sal_Int16 SAL_CALL Player::getVolumeDB( ) 169 { 170 sal_Int16 nRet = 0; 171 172 return nRet; 173 } 174 175 // ------------------------------------------------------------------------------ 176 177 awt::Size SAL_CALL Player::getPreferredPlayerWindowSize( ) 178 { 179 awt::Size aSize( 0, 0 ); 180 181 return aSize; 182 } 183 184 // ------------------------------------------------------------------------------ 185 186 uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& aArguments ) 187 { 188 uno::Reference< ::media::XPlayerWindow > xRet; 189 awt::Size aSize( getPreferredPlayerWindowSize() ); 190 191 if( aSize.Width > 0 && aSize.Height > 0 ) 192 { 193 ::avmedia::xine::Window* pWindow = new ::avmedia::xine::Window( *this ); 194 195 xRet = pWindow; 196 197 if( !pWindow->create( aArguments ) ) 198 xRet = uno::Reference< ::media::XPlayerWindow >(); 199 } 200 201 return xRet; 202 } 203 204 // ------------------------------------------------------------------------------ 205 206 uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber( ) 207 { 208 return NULL; 209 } 210 211 // ------------------------------------------------------------------------------ 212 213 ::rtl::OUString SAL_CALL Player::getImplementationName( ) 214 { 215 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_XINE_PLAYER_IMPLEMENTATIONNAME ) ); 216 } 217 218 // ------------------------------------------------------------------------------ 219 220 sal_Bool SAL_CALL Player::supportsService( const ::rtl::OUString& ServiceName ) 221 { 222 return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_XINE_PLAYER_SERVICENAME ) ); 223 } 224 225 // ------------------------------------------------------------------------------ 226 227 uno::Sequence< ::rtl::OUString > SAL_CALL Player::getSupportedServiceNames( ) 228 { 229 uno::Sequence< ::rtl::OUString > aRet(1); 230 aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_XINE_PLAYER_SERVICENAME ) ); 231 232 return aRet; 233 } 234 235 } // namespace xine 236 } // namespace avmedia 237