14ba16609SHerbert Dürr /************************************************************** 24ba16609SHerbert Dürr * 34ba16609SHerbert Dürr * Licensed to the Apache Software Foundation (ASF) under one 44ba16609SHerbert Dürr * or more contributor license agreements. See the NOTICE file 54ba16609SHerbert Dürr * distributed with this work for additional information 64ba16609SHerbert Dürr * regarding copyright ownership. The ASF licenses this file 74ba16609SHerbert Dürr * to you under the Apache License, Version 2.0 (the 84ba16609SHerbert Dürr * "License"); you may not use this file except in compliance 94ba16609SHerbert Dürr * with the License. You may obtain a copy of the License at 104ba16609SHerbert Dürr * 114ba16609SHerbert Dürr * http://www.apache.org/licenses/LICENSE-2.0 124ba16609SHerbert Dürr * 134ba16609SHerbert Dürr * Unless required by applicable law or agreed to in writing, 144ba16609SHerbert Dürr * software distributed under the License is distributed on an 154ba16609SHerbert Dürr * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 164ba16609SHerbert Dürr * KIND, either express or implied. See the License for the 174ba16609SHerbert Dürr * specific language governing permissions and limitations 184ba16609SHerbert Dürr * under the License. 194ba16609SHerbert Dürr * 204ba16609SHerbert Dürr *************************************************************/ 214ba16609SHerbert Dürr 224ba16609SHerbert Dürr 234ba16609SHerbert Dürr #ifndef MACAVF_PLAYER_HXX 244ba16609SHerbert Dürr #define MACAVF_PLAYER_HXX 254ba16609SHerbert Dürr 264ba16609SHerbert Dürr #include <osl/conditn.h> 274ba16609SHerbert Dürr #include "macavf_common.hxx" 284ba16609SHerbert Dürr 294ba16609SHerbert Dürr #include "com/sun/star/media/XPlayer.hdl" 304ba16609SHerbert Dürr 314ba16609SHerbert Dürr namespace avmedia { namespace macavf { 324ba16609SHerbert Dürr 334ba16609SHerbert Dürr /* 344ba16609SHerbert Dürr // ---------- 354ba16609SHerbert Dürr // - Player - 364ba16609SHerbert Dürr // ---------- 374ba16609SHerbert Dürr */ 384ba16609SHerbert Dürr 394ba16609SHerbert Dürr class Player 404ba16609SHerbert Dürr : public MacAVObserverHandler 414ba16609SHerbert Dürr , public ::cppu::WeakImplHelper2< ::com::sun::star::media::XPlayer, 424ba16609SHerbert Dürr ::com::sun::star::lang::XServiceInfo > 434ba16609SHerbert Dürr { 444ba16609SHerbert Dürr public: 454ba16609SHerbert Dürr explicit Player( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); 464ba16609SHerbert Dürr virtual ~Player(); 474ba16609SHerbert Dürr 484ba16609SHerbert Dürr bool create( const ::rtl::OUString& rURL ); 49*6a7d45efSHerbert Dürr bool create( AVAsset* ); 504ba16609SHerbert Dürr 514ba16609SHerbert Dürr // XPlayer 524ba16609SHerbert Dürr virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException); 534ba16609SHerbert Dürr virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException); 544ba16609SHerbert Dürr virtual sal_Bool SAL_CALL isPlaying() throw (::com::sun::star::uno::RuntimeException); 554ba16609SHerbert Dürr virtual double SAL_CALL getDuration() throw (::com::sun::star::uno::RuntimeException); 564ba16609SHerbert Dürr virtual void SAL_CALL setMediaTime( double fTime ) throw (::com::sun::star::uno::RuntimeException); 574ba16609SHerbert Dürr virtual double SAL_CALL getMediaTime() throw (::com::sun::star::uno::RuntimeException); 584ba16609SHerbert Dürr virtual void SAL_CALL setStopTime( double fTime ) throw (::com::sun::star::uno::RuntimeException); 594ba16609SHerbert Dürr virtual double SAL_CALL getStopTime() throw (::com::sun::star::uno::RuntimeException); 604ba16609SHerbert Dürr virtual void SAL_CALL setRate( double fRate ) throw (::com::sun::star::uno::RuntimeException); 614ba16609SHerbert Dürr virtual double SAL_CALL getRate() throw (::com::sun::star::uno::RuntimeException); 624ba16609SHerbert Dürr virtual void SAL_CALL setPlaybackLoop( sal_Bool bSet ) throw (::com::sun::star::uno::RuntimeException); 634ba16609SHerbert Dürr virtual sal_Bool SAL_CALL isPlaybackLoop() throw (::com::sun::star::uno::RuntimeException); 644ba16609SHerbert Dürr virtual void SAL_CALL setMute( sal_Bool bSet ) throw (::com::sun::star::uno::RuntimeException); 654ba16609SHerbert Dürr virtual sal_Bool SAL_CALL isMute() throw (::com::sun::star::uno::RuntimeException); 664ba16609SHerbert Dürr virtual void SAL_CALL setVolumeDB( sal_Int16 nVolumeDB ) throw (::com::sun::star::uno::RuntimeException); 674ba16609SHerbert Dürr virtual sal_Int16 SAL_CALL getVolumeDB() throw (::com::sun::star::uno::RuntimeException); 684ba16609SHerbert Dürr virtual ::com::sun::star::awt::Size SAL_CALL getPreferredPlayerWindowSize( ) throw (::com::sun::star::uno::RuntimeException); 694ba16609SHerbert Dürr 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); 704ba16609SHerbert Dürr virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XFrameGrabber > SAL_CALL createFrameGrabber( ) throw (::com::sun::star::uno::RuntimeException); 714ba16609SHerbert Dürr // XServiceInfo 724ba16609SHerbert Dürr virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); 734ba16609SHerbert Dürr virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); 744ba16609SHerbert Dürr virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); 754ba16609SHerbert Dürr getAVPlayer() const764ba16609SHerbert Dürr AVPlayer* getAVPlayer() const { return mpPlayer; } 774ba16609SHerbert Dürr virtual bool handleObservation( NSString* pKeyPath ); 784ba16609SHerbert Dürr 794ba16609SHerbert Dürr private: 804ba16609SHerbert Dürr ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr; 814ba16609SHerbert Dürr 824ba16609SHerbert Dürr AVPlayer* mpPlayer; 834ba16609SHerbert Dürr 844ba16609SHerbert Dürr float mfUnmutedVolume; 854ba16609SHerbert Dürr double mfStopTime; 864ba16609SHerbert Dürr 874ba16609SHerbert Dürr bool mbMuted; 884ba16609SHerbert Dürr bool mbLooping; 894ba16609SHerbert Dürr }; 904ba16609SHerbert Dürr 914ba16609SHerbert Dürr } // namespace macavf 924ba16609SHerbert Dürr } // namespace avmedia 934ba16609SHerbert Dürr 944ba16609SHerbert Dürr #endif // MACAVF_PLAYER_HXX 954ba16609SHerbert Dürr 96