xref: /aoo41x/main/avmedia/source/xine/player.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #include "player.hxx"
29 #include "window.hxx"
30 
31 using namespace ::com::sun::star;
32 
33 namespace avmedia { namespace xine {
34 
35 // ----------------
36 // - Player -
37 // ----------------
38 
39 Player::Player()
40 {
41 }
42 
43 // ------------------------------------------------------------------------------
44 
45 Player::~Player()
46 {
47 }
48 
49 // ------------------------------------------------------------------------------
50 
51 bool Player::create( const ::rtl::OUString& /* rURL */ )
52 {
53     bool bRet = false;
54 
55 
56     return bRet;
57 }
58 
59 // ------------------------------------------------------------------------------
60 
61 void SAL_CALL Player::start(  )
62     throw (uno::RuntimeException)
63 {
64 }
65 
66 // ------------------------------------------------------------------------------
67 
68 void SAL_CALL Player::stop(  )
69     throw (uno::RuntimeException)
70 {
71 }
72 
73 // ------------------------------------------------------------------------------
74 
75 sal_Bool SAL_CALL Player::isPlaying()
76     throw (uno::RuntimeException)
77 {
78     bool bRet = false;
79 
80     return bRet;
81 }
82 
83 // ------------------------------------------------------------------------------
84 
85 double SAL_CALL Player::getDuration(  )
86     throw (uno::RuntimeException)
87 {
88 	double fRet = 0.0;
89 
90     return fRet;
91 }
92 
93 // ------------------------------------------------------------------------------
94 
95 void SAL_CALL Player::setMediaTime( double /* fTime */ )
96     throw (uno::RuntimeException)
97 {
98 }
99 
100 // ------------------------------------------------------------------------------
101 
102 double SAL_CALL Player::getMediaTime(  )
103     throw (uno::RuntimeException)
104 {
105 	double fRet = 0.0;
106 
107     return fRet;
108 }
109 
110 // ------------------------------------------------------------------------------
111 
112 void SAL_CALL Player::setStopTime( double /* fTime */ )
113     throw (uno::RuntimeException)
114 {
115 }
116 
117 // ------------------------------------------------------------------------------
118 
119 double SAL_CALL Player::getStopTime(  )
120     throw (uno::RuntimeException)
121 {
122 	double fRet = 0.0;
123 
124     return fRet;
125 }
126 
127 // ------------------------------------------------------------------------------
128 
129 void SAL_CALL Player::setRate( double /* fRate */ )
130     throw (uno::RuntimeException)
131 {
132 }
133 
134 // ------------------------------------------------------------------------------
135 
136 double SAL_CALL Player::getRate(  )
137     throw (uno::RuntimeException)
138 {
139 	double fRet = 0.0;
140 
141     return fRet;
142 }
143 
144 // ------------------------------------------------------------------------------
145 
146 void SAL_CALL Player::setPlaybackLoop( sal_Bool /* bSet */ )
147     throw (uno::RuntimeException)
148 {
149 }
150 
151 // ------------------------------------------------------------------------------
152 
153 sal_Bool SAL_CALL Player::isPlaybackLoop(  )
154     throw (uno::RuntimeException)
155 {
156 	bool bRet = false;
157 
158     return bRet;
159 }
160 
161 // ------------------------------------------------------------------------------
162 
163 void SAL_CALL Player::setMute( sal_Bool /* bSet */ )
164     throw (uno::RuntimeException)
165 {
166 }
167 
168 // ------------------------------------------------------------------------------
169 
170 sal_Bool SAL_CALL Player::isMute(  )
171     throw (uno::RuntimeException)
172 {
173 	bool bRet = false;
174 
175     return bRet;
176 }
177 
178 // ------------------------------------------------------------------------------
179 
180 void SAL_CALL Player::setVolumeDB( sal_Int16 /* nVolumeDB */ )
181 	throw (uno::RuntimeException)
182 {
183 }
184 
185 // ------------------------------------------------------------------------------
186 
187 sal_Int16 SAL_CALL Player::getVolumeDB(  )
188 	throw (uno::RuntimeException)
189 {
190 	sal_Int16 nRet = 0;
191 
192     return nRet;
193 }
194 
195 // ------------------------------------------------------------------------------
196 
197 awt::Size SAL_CALL Player::getPreferredPlayerWindowSize(  )
198     throw (uno::RuntimeException)
199 {
200     awt::Size aSize( 0, 0 );
201 
202     return aSize;
203 }
204 
205 // ------------------------------------------------------------------------------
206 
207 uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& aArguments )
208     throw (uno::RuntimeException)
209 {
210     uno::Reference< ::media::XPlayerWindow >    xRet;
211     awt::Size                                   aSize( getPreferredPlayerWindowSize() );
212 
213     if( aSize.Width > 0 && aSize.Height > 0 )
214     {
215         ::avmedia::xine::Window* pWindow = new ::avmedia::xine::Window( *this );
216 
217         xRet = pWindow;
218 
219         if( !pWindow->create( aArguments ) )
220             xRet = uno::Reference< ::media::XPlayerWindow >();
221     }
222 
223     return xRet;
224 }
225 
226 // ------------------------------------------------------------------------------
227 
228 uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber(  )
229     throw (::com::sun::star::uno::RuntimeException)
230 {
231     return NULL;
232 }
233 
234 // ------------------------------------------------------------------------------
235 
236 ::rtl::OUString SAL_CALL Player::getImplementationName(  )
237     throw (uno::RuntimeException)
238 {
239     return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_XINE_PLAYER_IMPLEMENTATIONNAME ) );
240 }
241 
242 // ------------------------------------------------------------------------------
243 
244 sal_Bool SAL_CALL Player::supportsService( const ::rtl::OUString& ServiceName )
245     throw (uno::RuntimeException)
246 {
247     return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_XINE_PLAYER_SERVICENAME ) );
248 }
249 
250 // ------------------------------------------------------------------------------
251 
252 uno::Sequence< ::rtl::OUString > SAL_CALL Player::getSupportedServiceNames(  )
253     throw (uno::RuntimeException)
254 {
255     uno::Sequence< ::rtl::OUString > aRet(1);
256     aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_XINE_PLAYER_SERVICENAME ) );
257 
258     return aRet;
259 }
260 
261 } // namespace xine
262 } // namespace avmedia
263