Contents Up Previous Next

wxMediaCtrl

wxMediaCtrl is a class that allows a way to convieniently display types of media, such as videos, audio files, natively through native codecs.

On Windows wxMediaCtrl uses DirectShow, and on Macintosh wxMediaCtrl uses QuickTime.

wxMediaCtrl is not currently available on unix systems.

Derived from

wxControl

Include files

<wx/mediactrl.h>

Members

wxMediaCtrl::wxMediaCtrl
wxMediaCtrl::Create
wxMediaCtrl::GetDuration
wxMediaCtrl::GetPosition
wxMediaCtrl::GetState
wxMediaCtrl::Load
wxMediaCtrl::Pause
wxMediaCtrl::Play
wxMediaCtrl::SetPosition
wxMediaCtrl::Stop


wxMediaCtrl::wxMediaCtrl

wxMediaCtrl()

Default constructor - you must call Create before calling any other methods of wxMediaCtrl.

wxMediaCtrl(wxWindow* parent, wxWindowID id, const wxString& fileName, const wxString& label = wxT(""), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, long driver = 0, const wxString& name = wxPanelNameStr)

Constructor that calls Create. You may prefer to call Create directly to check to see if wxMediaCtrl is available on the system.

parent

id fileName pos size style driver name


wxMediaCtrl::Create

bool Create(wxWindow* parent, wxWindowID id, const wxString& fileName, const wxString& label = wxT(""), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, long driver = 0, const wxString& name = wxPanelNameStr)

Creates this control. Returns false if it can't load the movie located at fileName or it cannot load one of its native backends.

parent

id fileName pos size style driver name


wxMediaCtrl::GetDuration

long GetDuration()

Obtains the length - the total amount of time the movie has in milliseconds.


wxMediaCtrl::GetPosition

long GetPosition()

Obtains the current position in time within the movie in milliseconds.


wxMediaCtrl::GetState

wxMediaCtrlState GetState()

Obtains the state the playback of the movie is in -

wxMEDIASTATE_STOPPED The movie has stopped.
wxMEDIASTATE_PAUSED The movie is paused.
wxMEDIASTATE_PLAYING The movie is currently playing.


wxMediaCtrl::Load

bool Load(const wxString& fileName)

Loads the file that fileName refers to. Returns false if loading fails.


wxMediaCtrl::Pause

bool Pause()

Pauses playback of the movie.


wxMediaCtrl::Play

bool Play()

Resumes playback of the movie.


wxMediaCtrl::SetPosition

bool SetPosition(long where)

Seeks to a position within the movie.


wxMediaCtrl::Stop

bool Stop()

Stops the media.