sbBaseMediacorePlaybackControl.h
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25  */
26 
32 #ifndef __SB_BASEMEDIACOREPLAYBACKCONTROL_H__
33 #define __SB_BASEMEDIACOREPLAYBACKCONTROL_H__
34 
35 #include <sbIMediacorePlaybackControl.h>
36 #include <sbIMediacoreEventTarget.h>
37 
38 #include <nsIURI.h>
39 
40 #include <nsAutoLock.h>
41 #include <nsCOMPtr.h>
42 
45 {
46 public:
48  NS_DECL_SBIMEDIACOREPLAYBACKCONTROL
49 
51 
53 
54  // Override me, see cpp file for implementation notes.
55  virtual nsresult OnInitBaseMediacorePlaybackControl();
56 
57  // Override me, see cpp file for implementation notes.
58  virtual nsresult OnSetUri(nsIURI *aURI);
59  // Override me, see cpp file for implementation notes.
60  virtual nsresult OnGetDuration(PRUint64 *aPosition);
61  // Override me, see cpp file for implementation notes.
62  virtual nsresult OnGetPosition(PRUint64 *aPosition);
63  // Override me, see cpp file for implementation notes.
64  virtual nsresult OnSetPosition(PRUint64 aPosition);
65  // Override me, see cpp file for implementation notes.
66  virtual nsresult OnGetIsPlayingAudio(PRBool *aIsPlayingAudio);
67  // Override me, see cpp file for implementation notes.
68  virtual nsresult OnGetIsPlayingVideo(PRBool *aIsPlayingVideo);
69  // Override me, see cpp file for implementation notes.
70  virtual nsresult OnPlay();
71  // Override me, see cpp file for implementation notes.
72  virtual nsresult OnPause();
73  // Override me, see cpp file for implementation notes.
74  virtual nsresult OnStop();
75  // Override me, see cpp file for implementation notes.
76  virtual nsresult OnSeek(PRUint64 aPosition, PRUint32 aFlags);
77 
78 protected:
80 
81  nsresult DispatchPlaybackControlEvent(PRUint32 aType);
82 
83  PRMonitor* mMonitor;
84 
85  nsCOMPtr<nsIURI> mUri;
86 
87  // Use for caching if you wish, lock mLock before using.
88  PRUint64 mPosition;
89  // Use for caching if you wish, lock mLock before using.
90  PRUint64 mDuration;
91 };
92 
93 #endif /* __SB_BASEMEDIACOREPLAYBACKCONTROL_H__ */
virtual nsresult OnGetPosition(PRUint64 *aPosition)
virtual nsresult OnSetPosition(PRUint64 aPosition)
virtual nsresult OnSeek(PRUint64 aPosition, PRUint32 aFlags)
virtual nsresult OnGetDuration(PRUint64 *aPosition)
NS_DECL_ISUPPORTS NS_DECL_SBIMEDIACOREPLAYBACKCONTROL sbBaseMediacorePlaybackControl()
virtual nsresult OnGetIsPlayingAudio(PRBool *aIsPlayingAudio)
virtual nsresult OnGetIsPlayingVideo(PRBool *aIsPlayingVideo)