xref: /trunk/main/avmedia/source/xine/player.cxx (revision f39251c4)
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 
Player()35 Player::Player()
36 {
37 }
38 
39 // ------------------------------------------------------------------------------
40 
~Player()41 Player::~Player()
42 {
43 }
44 
45 // ------------------------------------------------------------------------------
46 
create(const::rtl::OUString &)47 bool Player::create( const ::rtl::OUString& /* rURL */ )
48 {
49     bool bRet = false;
50 
51 
52     return bRet;
53 }
54 
55 // ------------------------------------------------------------------------------
56 
start()57 void SAL_CALL Player::start(  )
58     throw (uno::RuntimeException)
59 {
60 }
61 
62 // ------------------------------------------------------------------------------
63 
stop()64 void SAL_CALL Player::stop(  )
65     throw (uno::RuntimeException)
66 {
67 }
68 
69 // ------------------------------------------------------------------------------
70 
isPlaying()71 sal_Bool SAL_CALL Player::isPlaying()
72     throw (uno::RuntimeException)
73 {
74     bool bRet = false;
75 
76     return bRet;
77 }
78 
79 // ------------------------------------------------------------------------------
80 
getDuration()81 double SAL_CALL Player::getDuration(  )
82     throw (uno::RuntimeException)
83 {
84 	double fRet = 0.0;
85 
86     return fRet;
87 }
88 
89 // ------------------------------------------------------------------------------
90 
setMediaTime(double)91 void SAL_CALL Player::setMediaTime( double /* fTime */ )
92     throw (uno::RuntimeException)
93 {
94 }
95 
96 // ------------------------------------------------------------------------------
97 
getMediaTime()98 double SAL_CALL Player::getMediaTime(  )
99     throw (uno::RuntimeException)
100 {
101 	double fRet = 0.0;
102 
103     return fRet;
104 }
105 
106 // ------------------------------------------------------------------------------
107 
setStopTime(double)108 void SAL_CALL Player::setStopTime( double /* fTime */ )
109     throw (uno::RuntimeException)
110 {
111 }
112 
113 // ------------------------------------------------------------------------------
114 
getStopTime()115 double SAL_CALL Player::getStopTime(  )
116     throw (uno::RuntimeException)
117 {
118 	double fRet = 0.0;
119 
120     return fRet;
121 }
122 
123 // ------------------------------------------------------------------------------
124 
setRate(double)125 void SAL_CALL Player::setRate( double /* fRate */ )
126     throw (uno::RuntimeException)
127 {
128 }
129 
130 // ------------------------------------------------------------------------------
131 
getRate()132 double SAL_CALL Player::getRate(  )
133     throw (uno::RuntimeException)
134 {
135 	double fRet = 0.0;
136 
137     return fRet;
138 }
139 
140 // ------------------------------------------------------------------------------
141 
setPlaybackLoop(sal_Bool)142 void SAL_CALL Player::setPlaybackLoop( sal_Bool /* bSet */ )
143     throw (uno::RuntimeException)
144 {
145 }
146 
147 // ------------------------------------------------------------------------------
148 
isPlaybackLoop()149 sal_Bool SAL_CALL Player::isPlaybackLoop(  )
150     throw (uno::RuntimeException)
151 {
152 	bool bRet = false;
153 
154     return bRet;
155 }
156 
157 // ------------------------------------------------------------------------------
158 
setMute(sal_Bool)159 void SAL_CALL Player::setMute( sal_Bool /* bSet */ )
160     throw (uno::RuntimeException)
161 {
162 }
163 
164 // ------------------------------------------------------------------------------
165 
isMute()166 sal_Bool SAL_CALL Player::isMute(  )
167     throw (uno::RuntimeException)
168 {
169 	bool bRet = false;
170 
171     return bRet;
172 }
173 
174 // ------------------------------------------------------------------------------
175 
setVolumeDB(sal_Int16)176 void SAL_CALL Player::setVolumeDB( sal_Int16 /* nVolumeDB */ )
177 	throw (uno::RuntimeException)
178 {
179 }
180 
181 // ------------------------------------------------------------------------------
182 
getVolumeDB()183 sal_Int16 SAL_CALL Player::getVolumeDB(  )
184 	throw (uno::RuntimeException)
185 {
186 	sal_Int16 nRet = 0;
187 
188     return nRet;
189 }
190 
191 // ------------------------------------------------------------------------------
192 
getPreferredPlayerWindowSize()193 awt::Size SAL_CALL Player::getPreferredPlayerWindowSize(  )
194     throw (uno::RuntimeException)
195 {
196     awt::Size aSize( 0, 0 );
197 
198     return aSize;
199 }
200 
201 // ------------------------------------------------------------------------------
202 
createPlayerWindow(const uno::Sequence<uno::Any> & aArguments)203 uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& aArguments )
204     throw (uno::RuntimeException)
205 {
206     uno::Reference< ::media::XPlayerWindow >    xRet;
207     awt::Size                                   aSize( getPreferredPlayerWindowSize() );
208 
209     if( aSize.Width > 0 && aSize.Height > 0 )
210     {
211         ::avmedia::xine::Window* pWindow = new ::avmedia::xine::Window( *this );
212 
213         xRet = pWindow;
214 
215         if( !pWindow->create( aArguments ) )
216             xRet = uno::Reference< ::media::XPlayerWindow >();
217     }
218 
219     return xRet;
220 }
221 
222 // ------------------------------------------------------------------------------
223 
createFrameGrabber()224 uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber(  )
225     throw (::com::sun::star::uno::RuntimeException)
226 {
227     return NULL;
228 }
229 
230 // ------------------------------------------------------------------------------
231 
getImplementationName()232 ::rtl::OUString SAL_CALL Player::getImplementationName(  )
233     throw (uno::RuntimeException)
234 {
235     return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_XINE_PLAYER_IMPLEMENTATIONNAME ) );
236 }
237 
238 // ------------------------------------------------------------------------------
239 
supportsService(const::rtl::OUString & ServiceName)240 sal_Bool SAL_CALL Player::supportsService( const ::rtl::OUString& ServiceName )
241     throw (uno::RuntimeException)
242 {
243     return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_XINE_PLAYER_SERVICENAME ) );
244 }
245 
246 // ------------------------------------------------------------------------------
247 
getSupportedServiceNames()248 uno::Sequence< ::rtl::OUString > SAL_CALL Player::getSupportedServiceNames(  )
249     throw (uno::RuntimeException)
250 {
251     uno::Sequence< ::rtl::OUString > aRet(1);
252     aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_XINE_PLAYER_SERVICENAME ) );
253 
254     return aRet;
255 }
256 
257 } // namespace xine
258 } // namespace avmedia
259