1*9ea84ac5SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9ea84ac5SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9ea84ac5SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9ea84ac5SAndrew Rist * distributed with this work for additional information 6*9ea84ac5SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9ea84ac5SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9ea84ac5SAndrew Rist * "License"); you may not use this file except in compliance 9*9ea84ac5SAndrew Rist * with the License. You may obtain a copy of the License at 10*9ea84ac5SAndrew Rist * 11*9ea84ac5SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9ea84ac5SAndrew Rist * 13*9ea84ac5SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9ea84ac5SAndrew Rist * software distributed under the License is distributed on an 15*9ea84ac5SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9ea84ac5SAndrew Rist * KIND, either express or implied. See the License for the 17*9ea84ac5SAndrew Rist * specific language governing permissions and limitations 18*9ea84ac5SAndrew Rist * under the License. 19*9ea84ac5SAndrew Rist * 20*9ea84ac5SAndrew Rist *************************************************************/ 21*9ea84ac5SAndrew Rist 22*9ea84ac5SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _PLAYER_HXX 25cdf0e10cSrcweir #define _PLAYER_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "wincommon.hxx" 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include "com/sun/star/media/XPlayer.hdl" 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include <cppuhelper/compbase2.hxx> 32cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir struct IGraphBuilder; 35cdf0e10cSrcweir struct IBaseFilter; 36cdf0e10cSrcweir struct IMediaControl; 37cdf0e10cSrcweir struct IMediaEventEx; 38cdf0e10cSrcweir struct IMediaSeeking; 39cdf0e10cSrcweir struct IMediaPosition; 40cdf0e10cSrcweir struct IBasicAudio; 41cdf0e10cSrcweir struct IBasicVideo; 42cdf0e10cSrcweir struct IVideoWindow; 43cdf0e10cSrcweir struct IDDrawExclModeVideo; 44cdf0e10cSrcweir struct IDirectDraw; 45cdf0e10cSrcweir struct IDirectDrawSurface; 46cdf0e10cSrcweir 47cdf0e10cSrcweir namespace avmedia { namespace win { 48cdf0e10cSrcweir 49cdf0e10cSrcweir // ---------- 50cdf0e10cSrcweir // - Player - 51cdf0e10cSrcweir // ---------- 52cdf0e10cSrcweir typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer, 53cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo > Player_BASE; 54cdf0e10cSrcweir 55cdf0e10cSrcweir class Player : public cppu::BaseMutex, 56cdf0e10cSrcweir public Player_BASE 57cdf0e10cSrcweir { 58cdf0e10cSrcweir public: 59cdf0e10cSrcweir 60cdf0e10cSrcweir Player( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMgr ); 61cdf0e10cSrcweir ~Player(); 62cdf0e10cSrcweir 63cdf0e10cSrcweir bool create( const ::rtl::OUString& rURL ); 64cdf0e10cSrcweir 65cdf0e10cSrcweir void setNotifyWnd( int nNotifyWnd ); 66cdf0e10cSrcweir void setDDrawParams( IDirectDraw* pDDraw, IDirectDrawSurface* pDDrawSurface ); 67cdf0e10cSrcweir long processEvent(); 68cdf0e10cSrcweir 69cdf0e10cSrcweir const IVideoWindow* getVideoWindow() const; 70cdf0e10cSrcweir 71cdf0e10cSrcweir // XPlayer 72cdf0e10cSrcweir virtual void SAL_CALL start( ) throw (::com::sun::star::uno::RuntimeException); 73cdf0e10cSrcweir virtual void SAL_CALL stop( ) throw (::com::sun::star::uno::RuntimeException); 74cdf0e10cSrcweir virtual sal_Bool SAL_CALL isPlaying( ) throw (::com::sun::star::uno::RuntimeException); 75cdf0e10cSrcweir virtual double SAL_CALL getDuration( ) throw (::com::sun::star::uno::RuntimeException); 76cdf0e10cSrcweir virtual void SAL_CALL setMediaTime( double fTime ) throw (::com::sun::star::uno::RuntimeException); 77cdf0e10cSrcweir virtual double SAL_CALL getMediaTime( ) throw (::com::sun::star::uno::RuntimeException); 78cdf0e10cSrcweir virtual void SAL_CALL setStopTime( double fTime ) throw (::com::sun::star::uno::RuntimeException); 79cdf0e10cSrcweir virtual double SAL_CALL getStopTime( ) throw (::com::sun::star::uno::RuntimeException); 80cdf0e10cSrcweir virtual void SAL_CALL setRate( double fRate ) throw (::com::sun::star::uno::RuntimeException); 81cdf0e10cSrcweir virtual double SAL_CALL getRate( ) throw (::com::sun::star::uno::RuntimeException); 82cdf0e10cSrcweir virtual void SAL_CALL setPlaybackLoop( sal_Bool bSet ) throw (::com::sun::star::uno::RuntimeException); 83cdf0e10cSrcweir virtual sal_Bool SAL_CALL isPlaybackLoop( ) throw (::com::sun::star::uno::RuntimeException); 84cdf0e10cSrcweir virtual void SAL_CALL setMute( sal_Bool bSet ) throw (::com::sun::star::uno::RuntimeException); 85cdf0e10cSrcweir virtual sal_Bool SAL_CALL isMute( ) throw (::com::sun::star::uno::RuntimeException); 86cdf0e10cSrcweir virtual void SAL_CALL setVolumeDB( sal_Int16 nVolumeDB ) throw (::com::sun::star::uno::RuntimeException); 87cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getVolumeDB( ) throw (::com::sun::star::uno::RuntimeException); 88cdf0e10cSrcweir virtual ::com::sun::star::awt::Size SAL_CALL getPreferredPlayerWindowSize( ) throw (::com::sun::star::uno::RuntimeException); 89cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayerWindow > SAL_CALL createPlayerWindow( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::RuntimeException); 90cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XFrameGrabber > SAL_CALL createFrameGrabber( ) throw (::com::sun::star::uno::RuntimeException); 91cdf0e10cSrcweir 92cdf0e10cSrcweir // XServiceInfo 93cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); 94cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); 95cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); 96cdf0e10cSrcweir 97cdf0e10cSrcweir // ::cppu::OComponentHelper 98cdf0e10cSrcweir virtual void SAL_CALL disposing(void); 99cdf0e10cSrcweir 100cdf0e10cSrcweir private: 101cdf0e10cSrcweir 102cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr; 103cdf0e10cSrcweir 104cdf0e10cSrcweir ::rtl::OUString maURL; 105cdf0e10cSrcweir IGraphBuilder* mpGB; 106cdf0e10cSrcweir IBaseFilter* mpOMF; 107cdf0e10cSrcweir IMediaControl* mpMC; 108cdf0e10cSrcweir IMediaEventEx* mpME; 109cdf0e10cSrcweir IMediaSeeking* mpMS; 110cdf0e10cSrcweir IMediaPosition* mpMP; 111cdf0e10cSrcweir IBasicAudio* mpBA; 112cdf0e10cSrcweir IBasicVideo* mpBV; 113cdf0e10cSrcweir IVideoWindow* mpVW; 114cdf0e10cSrcweir IDDrawExclModeVideo* mpEV; 115cdf0e10cSrcweir long mnUnmutedVolume; 116cdf0e10cSrcweir int mnFrameWnd; 117cdf0e10cSrcweir 118cdf0e10cSrcweir sal_Bool mbMuted; 119cdf0e10cSrcweir sal_Bool mbLooping; 120cdf0e10cSrcweir sal_Bool mbAddWindow; 121cdf0e10cSrcweir 122cdf0e10cSrcweir void ImplLayoutVideoWindow(); 123cdf0e10cSrcweir }; 124cdf0e10cSrcweir 125cdf0e10cSrcweir } // namespace win 126cdf0e10cSrcweir } // namespace avmedia 127cdf0e10cSrcweir 128cdf0e10cSrcweir #endif // _PLAYER_HXX 129