-//---------------------------------------------------------------------------
-// wxQTMediaBackend::DoCreateMovieControl
-//
-// Calls CreateMovieControl and performs setup related to it
-//
-// Note that we always hide the controller initially becuase when loading
-// from a url it displays about a 40x40 box with the word loading... in it,
-// but the box is outside the range of the control, which is bad (0,0
-// i believe), so we need to wait until finishload to actually display
-// the movie controller in this instance
-//---------------------------------------------------------------------------
-#if wxUSE_CREATEMOVIECONTROL
-void wxQTMediaBackend::DoCreateMovieControl()
-{
- // Native CreateMovieControl QT control (Thanks to Kevin Olliver's
- // wxQTMovie for some of this).
- Rect bounds = wxMacGetBoundsForControl(
- m_ctrl,
- m_ctrl->GetPosition(),
- m_ctrl->GetSize());
-
- // Dispose of old control for new one
- if (m_ctrl->m_peer && m_ctrl->m_peer->Ok() )
- m_ctrl->m_peer->Dispose();
-
- // Options:
- // kMovieControlOptionXXX
- // HideController - hide the movie controller
- // LocateTopLeft - movie is pinned to top left rather than centered in the control
- // EnableEditing - Allows programmatic editing and dragn'drop
- // HandleEditingHI- Installs event stuff for edit menu - forces EnableEditing also
- // SetKeysEnabled - Allows keyboard input
- // ManuallyIdled - app handles movie idling rather than internal timer event loop
- ::CreateMovieControl(
- (WindowRef) m_ctrl->MacGetTopLevelWindowRef(), //parent
- &bounds, // control bounds
- m_movie, // movie handle
- kMovieControlOptionHideController// flags
- // | kMovieControlOptionManuallyIdled
- | kMovieControlOptionLocateTopLeft
- | kMovieControlOptionSetKeysEnabled,
- m_ctrl->m_peer->GetControlRefAddr() );
-
- ::EmbedControl(
- m_ctrl->m_peer->GetControlRef(),
- (ControlRef)m_ctrl->GetParent()->GetHandle());
-
- // set up MovieController for the new movie
- long dataSize;
-
- // Get movie controller from our control
- ::GetControlData(
- m_ctrl->m_peer->GetControlRef(), 0,
- kMovieControlDataMovieController,
- sizeof(MovieController), (Ptr)&m_mc, &dataSize );
-
- // Setup a callback so we can tell when the user presses
- // play on the player controls
- ::MCSetActionFilterWithRefCon(m_mc,
- (MCActionFilterWithRefConUPP)wxQTMediaBackend::MCFilterProc,
- (long)this);