/usr/include/wx-2.6/wx/mediactrl.h is in wx2.6-headers 2.6.3.2.2-5ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/mediactrl.h
// Purpose: wxMediaCtrl class
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
// Created: 11/07/04
// RCS-ID: $Id: mediactrl.h,v 1.25 2005/09/11 11:03:38 VZ Exp $
// Copyright: (c) Ryan Norton
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// Definitions
// ============================================================================
// ----------------------------------------------------------------------------
// Header guard
// ----------------------------------------------------------------------------
#ifndef _WX_MEDIACTRL_H_
#define _WX_MEDIACTRL_H_
// ----------------------------------------------------------------------------
// Pre-compiled header stuff
// ----------------------------------------------------------------------------
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "mediactrl.h"
#endif
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// Compilation guard
// ----------------------------------------------------------------------------
#if wxUSE_MEDIACTRL
// ----------------------------------------------------------------------------
// Includes
// ----------------------------------------------------------------------------
#include "wx/control.h"
#include "wx/uri.h"
// ============================================================================
// Declarations
// ============================================================================
// ----------------------------------------------------------------------------
//
// Enumerations
//
// ----------------------------------------------------------------------------
enum wxMediaState
{
wxMEDIASTATE_STOPPED,
wxMEDIASTATE_PAUSED,
wxMEDIASTATE_PLAYING
};
enum wxMediaCtrlPlayerControls
{
wxMEDIACTRLPLAYERCONTROLS_NONE = 0,
//Step controls like fastfoward, step one frame etc.
wxMEDIACTRLPLAYERCONTROLS_STEP = 1 << 0,
//Volume controls like the speaker icon, volume slider, etc.
wxMEDIACTRLPLAYERCONTROLS_VOLUME = 1 << 1,
wxMEDIACTRLPLAYERCONTROLS_DEFAULT =
wxMEDIACTRLPLAYERCONTROLS_STEP |
wxMEDIACTRLPLAYERCONTROLS_VOLUME
};
#define wxMEDIABACKEND_DIRECTSHOW wxT("wxAMMediaBackend")
#define wxMEDIABACKEND_MCI wxT("wxMCIMediaBackend")
#define wxMEDIABACKEND_QUICKTIME wxT("wxQTMediaBackend")
#define wxMEDIABACKEND_GSTREAMER wxT("wxGStreamerMediaBackend")
// ----------------------------------------------------------------------------
//
// wxMediaEvent
//
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaEvent : public wxNotifyEvent
{
public:
// ------------------------------------------------------------------------
// wxMediaEvent Constructor
//
// Normal constructor, much the same as wxNotifyEvent
// ------------------------------------------------------------------------
wxMediaEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
: wxNotifyEvent(commandType, winid)
{ }
// ------------------------------------------------------------------------
// wxMediaEvent Copy Constructor
//
// Normal copy constructor, much the same as wxNotifyEvent
// ------------------------------------------------------------------------
wxMediaEvent(const wxMediaEvent &clone)
: wxNotifyEvent(clone)
{ }
// ------------------------------------------------------------------------
// wxMediaEvent::Clone
//
// Allocates a copy of this object.
// Required for wxEvtHandler::AddPendingEvent
// ------------------------------------------------------------------------
virtual wxEvent *Clone() const
{ return new wxMediaEvent(*this); }
// Put this class on wxWidget's RTTI table
DECLARE_DYNAMIC_CLASS(wxMediaEvent)
};
// ----------------------------------------------------------------------------
//
// wxMediaCtrl
//
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaCtrl : public wxControl
{
public:
wxMediaCtrl() : m_imp(NULL), m_bLoaded(false)
{ }
wxMediaCtrl(wxWindow* parent, wxWindowID winid,
const wxString& fileName = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"))
: m_imp(NULL), m_bLoaded(false)
{ Create(parent, winid, fileName, pos, size, style,
szBackend, validator, name); }
wxMediaCtrl(wxWindow* parent, wxWindowID winid,
const wxURI& location,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"))
: m_imp(NULL), m_bLoaded(false)
{ Create(parent, winid, location, pos, size, style,
szBackend, validator, name); }
~wxMediaCtrl();
bool Create(wxWindow* parent, wxWindowID winid,
const wxString& fileName = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"));
bool Create(wxWindow* parent, wxWindowID winid,
const wxURI& location,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"));
bool DoCreate(wxClassInfo* instance,
wxWindow* parent, wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"));
bool Play();
bool Pause();
bool Stop();
bool Load(const wxString& fileName);
wxMediaState GetState();
wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart);
wxFileOffset Tell(); //FIXME: This should be const
wxFileOffset Length(); //FIXME: This should be const
#if wxABI_VERSION >= 20601 /* 2.6.1+ only */
double GetPlaybackRate(); //All but MCI & GStreamer
bool SetPlaybackRate(double dRate); //All but MCI & GStreamer
#endif
#if wxABI_VERSION >= 20602 /* 2.6.2+ only */
bool Load(const wxURI& location);
bool Load(const wxURI& location, const wxURI& proxy);
wxFileOffset GetDownloadProgress();
wxFileOffset GetDownloadTotal();
double GetVolume();
bool SetVolume(double dVolume);
bool ShowPlayerControls(
wxMediaCtrlPlayerControls flags = wxMEDIACTRLPLAYERCONTROLS_DEFAULT);
//helpers for the wxPython people
bool LoadURI(const wxString& fileName)
{ return Load(wxURI(fileName)); }
bool LoadURIWithProxy(const wxString& fileName, const wxString& proxy)
{ return Load(wxURI(fileName), wxURI(proxy)); }
#endif
protected:
static wxClassInfo* NextBackend();
void OnMediaFinished(wxMediaEvent& evt);
virtual void DoMoveWindow(int x, int y, int w, int h);
wxSize DoGetBestSize() const;
//FIXME: This is nasty... find a better way to work around
//inheritance issues
#if defined(__WXMAC__) || defined(__WXCOCOA__)
friend class wxQTMediaBackend;
#endif
class wxMediaBackend* m_imp;
bool m_bLoaded;
DECLARE_DYNAMIC_CLASS(wxMediaCtrl)
};
// ----------------------------------------------------------------------------
//
// wxMediaBackend
//
// Derive from this and use standard wxWidgets RTTI
// (DECLARE_DYNAMIC_CLASS and IMPLEMENT_CLASS) to make a backend
// for wxMediaCtrl. Backends are searched alphabetically -
// the one with the earliest letter is tried first.
//
// Note that this is currently not API or ABI compatable -
// so statically link or make the client compile on-site.
//
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaBackend : public wxObject
{
public:
wxMediaBackend()
{ }
virtual ~wxMediaBackend();
virtual bool CreateControl(wxControl* WXUNUSED(ctrl),
wxWindow* WXUNUSED(parent),
wxWindowID WXUNUSED(winid),
const wxPoint& WXUNUSED(pos),
const wxSize& WXUNUSED(size),
long WXUNUSED(style),
const wxValidator& WXUNUSED(validator),
const wxString& WXUNUSED(name))
{ return false; }
virtual bool Play()
{ return false; }
virtual bool Pause()
{ return false; }
virtual bool Stop()
{ return false; }
virtual bool Load(const wxString& WXUNUSED(fileName))
{ return false; }
virtual bool Load(const wxURI& WXUNUSED(location))
{ return false; }
virtual bool SetPosition(wxLongLong WXUNUSED(where))
{ return 0; }
virtual wxLongLong GetPosition()
{ return 0; }
virtual wxLongLong GetDuration()
{ return 0; }
virtual void Move(int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(w), int WXUNUSED(h))
{ }
virtual wxSize GetVideoSize() const
{ return wxSize(0,0); }
virtual double GetPlaybackRate()
{ return 0.0; }
virtual bool SetPlaybackRate(double WXUNUSED(dRate))
{ return false; }
virtual wxMediaState GetState()
{ return wxMEDIASTATE_STOPPED; }
virtual double GetVolume()
{ return 0.0; }
virtual bool SetVolume(double WXUNUSED(dVolume))
{ return false; }
virtual bool Load(const wxURI& WXUNUSED(location),
const wxURI& WXUNUSED(proxy))
{ return false; }
virtual bool ShowPlayerControls(
wxMediaCtrlPlayerControls WXUNUSED(flags))
{ return false; }
virtual bool IsInterfaceShown()
{ return false; }
virtual wxLongLong GetDownloadProgress()
{ return 0; }
virtual wxLongLong GetDownloadTotal()
{ return 0; }
virtual void RESERVED8() {}
virtual void RESERVED9() {}
DECLARE_DYNAMIC_CLASS(wxMediaBackend)
};
//Event ID to give to our events
#define wxMEDIA_FINISHED_ID 13000
#define wxMEDIA_STOP_ID 13001
//Define our event types - we need to call DEFINE_EVENT_TYPE(EVT) later
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_FINISHED, wxMEDIA_FINISHED_ID)
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STOP, wxMEDIA_STOP_ID)
//Function type(s) our events need
typedef void (wxEvtHandler::*wxMediaEventFunction)(wxMediaEvent&);
#define wxMediaEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMediaEventFunction, &func)
//Macro for usage with message maps
#define EVT_MEDIA_FINISHED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_FINISHED, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ),
#define EVT_MEDIA_STOP(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STOP, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ),
#if wxABI_VERSION >= 20602 /* 2.6.2+ only */
# define wxMEDIA_LOADED_ID 13002
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_LOADED, wxMEDIA_LOADED_ID)
# define EVT_MEDIA_LOADED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_LOADED, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ),
#endif
// ----------------------------------------------------------------------------
// common backend base class used by many other backends
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaBackendCommonBase : public wxMediaBackend
{
public:
// add a pending wxMediaEvent of the given type
void QueueEvent(wxEventType evtType);
// notify that the movie playback is finished
void QueueFinishEvent() { QueueEvent(wxEVT_MEDIA_FINISHED); }
// send the stop event and return true if it hasn't been vetoed
bool SendStopEvent();
protected:
// call this when the movie size has changed but not because it has just
// been loaded (in this case, call NotifyMovieLoaded() below)
void NotifyMovieSizeChanged();
// call this when the movie is fully loaded
void NotifyMovieLoaded();
wxMediaCtrl *m_ctrl; // parent control
};
// ----------------------------------------------------------------------------
// End compilation gaurd
// ----------------------------------------------------------------------------
#endif // wxUSE_MEDIACTRL
// ----------------------------------------------------------------------------
// End header guard and header itself
// ----------------------------------------------------------------------------
#endif // _WX_MEDIACTRL_H_
|