git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39188
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#ifndef WX_PRECOMP
#include "wx/string.h"
#include "wx/utils.h"
#ifndef WX_PRECOMP
#include "wx/string.h"
#include "wx/utils.h"
#endif
#include "wx/fontutil.h"
#include "wx/gdicmn.h"
#include "wx/fontutil.h"
#endif
#include "wx/fontutil.h"
#include "wx/gdicmn.h"
#include "wx/fontutil.h"
#include "wx/mac/private.h"
#include "wx/mac/private.h"
#ifndef WX_PRECOMP
#include "wx/dynarray.h"
#include "wx/log.h"
#ifndef WX_PRECOMP
#include "wx/dynarray.h"
#include "wx/log.h"
#include "wx/app.h"
#include "wx/utils.h"
#include "wx/button.h"
#include "wx/app.h"
#include "wx/utils.h"
#include "wx/button.h"
#include "wx/settings.h"
#include "wx/toplevel.h"
#include "wx/settings.h"
#include "wx/toplevel.h"
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-// Name: mac/carbon/mediactrl.cpp
+// Name: src/mac/carbon/mediactrl.cpp
// Purpose: Built-in Media Backends for Mac
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
// Purpose: Built-in Media Backends for Mac
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/mediactrl.h"
#include "wx/mediactrl.h"
+#ifndef WX_PRECOMP
+ #include "wx/log.h"
+#endif
+
// uma is for wxMacFSSpec
#include "wx/mac/uma.h"
#include "wx/timer.h"
// uma is for wxMacFSSpec
#include "wx/mac/uma.h"
#include "wx/timer.h"
// standard QT stuff
#ifndef __DARWIN__
// standard QT stuff
#ifndef __DARWIN__
#include <QuickTime/QuickTimeComponents.h>
#endif
#include <QuickTime/QuickTimeComponents.h>
#endif
//---------------------------------------------------------------------------
// Height and Width of movie controller in the movie control (apple samples)
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Height and Width of movie controller in the movie control (apple samples)
//---------------------------------------------------------------------------
wxMediaCtrlPlayerControls m_interfaceflags; // Saved interface flags
// Event handlers and UPPs/Callbacks
wxMediaCtrlPlayerControls m_interfaceflags; // Saved interface flags
// Event handlers and UPPs/Callbacks
- EventHandlerRef m_windowEventHandler;
+ EventHandlerRef m_windowEventHandler;
EventHandlerUPP m_windowUPP;
MoviePrePrerollCompleteUPP m_preprerollupp;
MCActionFilterWithRefConUPP m_mcactionupp;
EventHandlerUPP m_windowUPP;
MoviePrePrerollCompleteUPP m_preprerollupp;
MCActionFilterWithRefConUPP m_mcactionupp;
- GWorldPtr m_movieWorld; //Offscreen movie GWorld
+ GWorldPtr m_movieWorld; //Offscreen movie GWorld
friend class wxQTMediaEvtHandler;
friend class wxQTMediaEvtHandler;
::DisposeMovieController(m_mc);
m_mc = NULL;
DisposeMCActionFilterWithRefConUPP(m_mcactionupp);
::DisposeMovieController(m_mc);
m_mc = NULL;
DisposeMCActionFilterWithRefConUPP(m_mcactionupp);
// Dispose of offscreen GWorld
::DisposeGWorld(m_movieWorld);
}
// Dispose of offscreen GWorld
::DisposeGWorld(m_movieWorld);
}
- ::ClearMoviesStickyError(); // clear previous errors so
+ ::ClearMoviesStickyError(); // clear previous errors so
// GetMoviesStickyError is useful
// GetMoviesStickyError is useful
OSErr err = noErr;
short movieResFile;
FSSpec sfFile;
OSErr err = noErr;
short movieResFile;
FSSpec sfFile;
- ::ClearMoviesStickyError(); // clear previous errors so
+ ::ClearMoviesStickyError(); // clear previous errors so
// GetMoviesStickyError is useful
wxString theURI = location.BuildURI();
// GetMoviesStickyError is useful
wxString theURI = location.BuildURI();
// require it if you don't use a Movie Controller,
// which we don't by default.
//
// require it if you don't use a Movie Controller,
// which we don't by default.
//
NewMoviePrePrerollCompleteUPP( wxQTMediaBackend::PPRMProc );
NewMoviePrePrerollCompleteUPP( wxQTMediaBackend::PPRMProc );
- ::PrePrerollMovie( m_movie, timeNow, playRate,
+ ::PrePrerollMovie( m_movie, timeNow, playRate,
m_preprerollupp, (void*)this);
return true;
m_preprerollupp, (void*)this);
return true;
// Setup a callback so we can tell when the user presses
// play on the player controls
// Setup a callback so we can tell when the user presses
// play on the player controls
NewMCActionFilterWithRefConUPP( wxQTMediaBackend::MCFilterProc );
::MCSetActionFilterWithRefCon( m_mc, m_mcactionupp, (long)this );
wxASSERT(::GetMoviesError() == noErr);
NewMCActionFilterWithRefConUPP( wxQTMediaBackend::MCFilterProc );
::MCSetActionFilterWithRefCon( m_mc, m_mcactionupp, (long)this );
wxASSERT(::GetMoviesError() == noErr);
{ kEventClassWindow, kEventWindowActivated },
{ kEventClassWindow, kEventWindowDeactivated }
};
{ kEventClassWindow, kEventWindowActivated },
{ kEventClassWindow, kEventWindowDeactivated }
};
NewEventHandlerUPP( wxQTMediaBackend::WindowEventHandler );
InstallWindowEventHandler(
wrTLW,
m_windowUPP,
GetEventTypeCount( theWindowEventTypes ), theWindowEventTypes,
NewEventHandlerUPP( wxQTMediaBackend::WindowEventHandler );
InstallWindowEventHandler(
wrTLW,
m_windowUPP,
GetEventTypeCount( theWindowEventTypes ), theWindowEventTypes,
&m_windowEventHandler );
}
else
&m_windowEventHandler );
}
else
| ((flags & wxMEDIACTRLPLAYERCONTROLS_VOLUME)
? 0 : (1 << 2)/*mcFlagSuppressSpeakerButton*/)
//if we take care of repainting ourselves
| ((flags & wxMEDIACTRLPLAYERCONTROLS_VOLUME)
? 0 : (1 << 2)/*mcFlagSuppressSpeakerButton*/)
//if we take care of repainting ourselves
- // | (1 << 4) /*mcFlagDontInvalidate*/
+ // | (1 << 4) /*mcFlagDontInvalidate*/
);
::MCDoAction(m_mc, 38/*mcActionSetFlags*/, (void*)mcFlags);
);
::MCDoAction(m_mc, 38/*mcActionSetFlags*/, (void*)mcFlags);
//---------------------------------------------------------------------------
wxLongLong wxQTMediaBackend::GetDownloadTotal()
{
//---------------------------------------------------------------------------
wxLongLong wxQTMediaBackend::GetDownloadTotal()
{
- return wxQTMediaBackend::GetDataSizeFromStart(
- ::GetMovieDuration(m_movie)
+ return wxQTMediaBackend::GetDataSizeFromStart(
+ ::GetMovieDuration(m_movie)
{
if(!m_mc || !m_ctrl->m_bLoaded)
return; //not initialized yet
{
if(!m_mc || !m_ctrl->m_bLoaded)
return; //not initialized yet
if(m_ctrl->MacIsReallyShown())
{
//The window is being shown again, so set the GWorld of the
//controller back to the port of the parent WindowRef
if(m_ctrl->MacIsReallyShown())
{
//The window is being shown again, so set the GWorld of the
//controller back to the port of the parent WindowRef
(WindowRef) m_ctrl->MacGetTopLevelWindowRef();
::MCSetControllerPort(m_mc, (CGrafPtr) GetWindowPort(wrTLW));
(WindowRef) m_ctrl->MacGetTopLevelWindowRef();
::MCSetControllerPort(m_mc, (CGrafPtr) GetWindowPort(wrTLW));
//We are being hidden - set the GWorld of the controller
//to the offscreen GWorld
::MCSetControllerPort(m_mc, m_movieWorld);
//We are being hidden - set the GWorld of the controller
//to the offscreen GWorld
::MCSetControllerPort(m_mc, m_movieWorld);
- wxASSERT(::GetMoviesError() == noErr);
+ wxASSERT(::GetMoviesError() == noErr);
void *inUserData)
{
wxQTMediaBackend* be = (wxQTMediaBackend*) inUserData;
void *inUserData)
{
wxQTMediaBackend* be = (wxQTMediaBackend*) inUserData;
// Only process keyboard messages on this window if it actually
// has focus, otherwise it will steal keystrokes from other windows!
// As well as when it is not loaded properly as it
// will crash in MCIsPlayerEvent
if((GetEventClass(inEvent) == kEventClassKeyboard &&
// Only process keyboard messages on this window if it actually
// has focus, otherwise it will steal keystrokes from other windows!
// As well as when it is not loaded properly as it
// will crash in MCIsPlayerEvent
if((GetEventClass(inEvent) == kEventClassKeyboard &&
- wxWindow::FindFocus() != be->m_ctrl)
+ wxWindow::FindFocus() != be->m_ctrl)
|| !be->m_ctrl->m_bLoaded)
return eventNotHandledErr;
|| !be->m_ctrl->m_bLoaded)
return eventNotHandledErr;
ConvertEventRefToEventRecord( inEvent, &theEvent );
OSStatus err;
ConvertEventRefToEventRecord( inEvent, &theEvent );
OSStatus err;
- // TODO: Apple says MCIsPlayerEvent is depreciated and
+ // TODO: Apple says MCIsPlayerEvent is depreciated and
// MCClick, MCKey, MCIdle etc. should be used
// (RN: Of course that's what they say about
// CreateMovieControl and HIMovieView as well, LOL!)
// MCClick, MCKey, MCIdle etc. should be used
// (RN: Of course that's what they say about
// CreateMovieControl and HIMovieView as well, LOL!)