1eb7664d6SHerbert Dürr /**************************************************************
2eb7664d6SHerbert Dürr  *
3eb7664d6SHerbert Dürr  * Licensed to the Apache Software Foundation (ASF) under one
4eb7664d6SHerbert Dürr  * or more contributor license agreements.  See the NOTICE file
5eb7664d6SHerbert Dürr  * distributed with this work for additional information
6eb7664d6SHerbert Dürr  * regarding copyright ownership.  The ASF licenses this file
7eb7664d6SHerbert Dürr  * to you under the Apache License, Version 2.0 (the
8eb7664d6SHerbert Dürr  * "License"); you may not use this file except in compliance
9eb7664d6SHerbert Dürr  * with the License.  You may obtain a copy of the License at
10eb7664d6SHerbert Dürr  *
11eb7664d6SHerbert Dürr  *   http://www.apache.org/licenses/LICENSE-2.0
12eb7664d6SHerbert Dürr  *
13eb7664d6SHerbert Dürr  * Unless required by applicable law or agreed to in writing,
14eb7664d6SHerbert Dürr  * software distributed under the License is distributed on an
15eb7664d6SHerbert Dürr  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16eb7664d6SHerbert Dürr  * KIND, either express or implied.  See the License for the
17eb7664d6SHerbert Dürr  * specific language governing permissions and limitations
18eb7664d6SHerbert Dürr  * under the License.
19eb7664d6SHerbert Dürr  *
20eb7664d6SHerbert Dürr  *************************************************************/
21eb7664d6SHerbert Dürr 
22eb7664d6SHerbert Dürr 
23e8649ecdSHerbert Dürr #ifndef MACAVF_PLAYER_HXX
24e8649ecdSHerbert Dürr #define MACAVF_PLAYER_HXX
25eb7664d6SHerbert Dürr 
26eb7664d6SHerbert Dürr #include <osl/conditn.h>
27e8649ecdSHerbert Dürr #include "macavf_common.hxx"
28eb7664d6SHerbert Dürr 
29eb7664d6SHerbert Dürr #include "com/sun/star/media/XPlayer.hdl"
30eb7664d6SHerbert Dürr 
31eb7664d6SHerbert Dürr namespace avmedia { namespace macavf {
32eb7664d6SHerbert Dürr 
33eb7664d6SHerbert Dürr /*
34eb7664d6SHerbert Dürr // ----------
35eb7664d6SHerbert Dürr // - Player -
36eb7664d6SHerbert Dürr // ----------
37eb7664d6SHerbert Dürr */
38eb7664d6SHerbert Dürr 
39eb7664d6SHerbert Dürr class Player
40eb7664d6SHerbert Dürr :   public MacAVObserverHandler
41eb7664d6SHerbert Dürr ,   public ::cppu::WeakImplHelper2< ::com::sun::star::media::XPlayer,
42eb7664d6SHerbert Dürr                                     ::com::sun::star::lang::XServiceInfo >
43eb7664d6SHerbert Dürr {
44eb7664d6SHerbert Dürr public:
45eb7664d6SHerbert Dürr     explicit Player( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
46eb7664d6SHerbert Dürr     virtual  ~Player();
47eb7664d6SHerbert Dürr 
48eb7664d6SHerbert Dürr     bool create( const ::rtl::OUString& rURL );
49*32322404SHerbert Dürr     bool create( AVAsset* );
50eb7664d6SHerbert Dürr 
51eb7664d6SHerbert Dürr     // XPlayer
52eb7664d6SHerbert Dürr     virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
53eb7664d6SHerbert Dürr     virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
54eb7664d6SHerbert Dürr     virtual sal_Bool SAL_CALL isPlaying() throw (::com::sun::star::uno::RuntimeException);
55eb7664d6SHerbert Dürr     virtual double SAL_CALL getDuration() throw (::com::sun::star::uno::RuntimeException);
56eb7664d6SHerbert Dürr     virtual void SAL_CALL setMediaTime( double fTime ) throw (::com::sun::star::uno::RuntimeException);
57eb7664d6SHerbert Dürr     virtual double SAL_CALL getMediaTime() throw (::com::sun::star::uno::RuntimeException);
58eb7664d6SHerbert Dürr     virtual void SAL_CALL setStopTime( double fTime ) throw (::com::sun::star::uno::RuntimeException);
59eb7664d6SHerbert Dürr     virtual double SAL_CALL getStopTime() throw (::com::sun::star::uno::RuntimeException);
60eb7664d6SHerbert Dürr     virtual void SAL_CALL setRate( double fRate ) throw (::com::sun::star::uno::RuntimeException);
61eb7664d6SHerbert Dürr     virtual double SAL_CALL getRate() throw (::com::sun::star::uno::RuntimeException);
62eb7664d6SHerbert Dürr     virtual void SAL_CALL setPlaybackLoop( sal_Bool bSet ) throw (::com::sun::star::uno::RuntimeException);
63eb7664d6SHerbert Dürr     virtual sal_Bool SAL_CALL isPlaybackLoop() throw (::com::sun::star::uno::RuntimeException);
64eb7664d6SHerbert Dürr     virtual void SAL_CALL setMute( sal_Bool bSet ) throw (::com::sun::star::uno::RuntimeException);
65eb7664d6SHerbert Dürr     virtual sal_Bool SAL_CALL isMute() throw (::com::sun::star::uno::RuntimeException);
66eb7664d6SHerbert Dürr     virtual void SAL_CALL setVolumeDB( sal_Int16 nVolumeDB ) throw (::com::sun::star::uno::RuntimeException);
67eb7664d6SHerbert Dürr     virtual sal_Int16 SAL_CALL getVolumeDB() throw (::com::sun::star::uno::RuntimeException);
68eb7664d6SHerbert Dürr     virtual ::com::sun::star::awt::Size SAL_CALL getPreferredPlayerWindowSize(  ) throw (::com::sun::star::uno::RuntimeException);
69eb7664d6SHerbert 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);
70eb7664d6SHerbert Dürr     virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XFrameGrabber > SAL_CALL createFrameGrabber(  ) throw (::com::sun::star::uno::RuntimeException);
71eb7664d6SHerbert Dürr     // XServiceInfo
72eb7664d6SHerbert Dürr     virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
73eb7664d6SHerbert Dürr     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
74eb7664d6SHerbert Dürr     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
75eb7664d6SHerbert Dürr 
getAVPlayer() const76eb7664d6SHerbert Dürr     AVPlayer* getAVPlayer() const { return mpPlayer; }
77eb7664d6SHerbert Dürr     virtual bool handleObservation( NSString* pKeyPath );
78eb7664d6SHerbert Dürr 
79eb7664d6SHerbert Dürr private:
80eb7664d6SHerbert Dürr     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr;
81eb7664d6SHerbert Dürr 
82eb7664d6SHerbert Dürr     AVPlayer*           mpPlayer;
83eb7664d6SHerbert Dürr 
84eb7664d6SHerbert Dürr     float               mfUnmutedVolume;
85eb7664d6SHerbert Dürr     double              mfStopTime;
86eb7664d6SHerbert Dürr 
87eb7664d6SHerbert Dürr     bool                mbMuted;
88eb7664d6SHerbert Dürr     bool                mbLooping;
89eb7664d6SHerbert Dürr };
90eb7664d6SHerbert Dürr 
91eb7664d6SHerbert Dürr } // namespace macavf
92eb7664d6SHerbert Dürr } // namespace avmedia
93eb7664d6SHerbert Dürr 
94e8649ecdSHerbert Dürr #endif // MACAVF_PLAYER_HXX
95e8649ecdSHerbert Dürr 
96