Class Hierarchy   Compound List   Compound Members   Related Pages  

SPlayer Class Reference

#include <splayer.h>

Class diagram for SPlayer:

NativePlayerWnd

List of all members.

Public Members

void FreeBuffer ()
void MouseMove ( int x, int y, BOOL mouseIsDown)
void MouseDown ( int x, int y )
void MouseUp ( int x, int y )
void CancelCapture (BOOL outsideWindow = true)
void OnDraw ()
void Repaint ( SRECT* rect )
void GetURL ( char* url, char* target = "", char* postData = "", int loadMethod = 0)
virtual void StreamPostURLNotify ( const char* url, const char* window, U32 len, const char* buf, void* notifyData ) = 0
virtual void StreamGetURLNotify ( const char* url, const char* window, void* notifyData ) = 0
void StreamInNew ( StreamData* streamData, char* url, void* notifyData )
int StreamInWrite ( StreamData* streamData, void* buffer, int length )
void StreamInDestroy ( StreamData* streamData )
virtual void CloseStream ( StreamData* streamData ) = 0
virtual void ProcessFSCommand ( char* command, char* args ) = 0
void SetMenuState ()
void GetMenuState ( MenuStatus* menuStatus )
void GetEditMenuState ( EditMenuStatus* editMenuStatus )
int GetPopupMenuState ()
void ControlOpen ( char* url )
void ControlClose ()
void ControlPlay ()
void ControlRewind ()
void ControlForward ()
void ControlBack ()
void ControlLoop ()
void ControlViewAll ()
void Control100 ()
void ControlZoomIn ()
void ControlZoomContext ( int x, int y )
void ControlZoomOut ()
void ControlHighQuality ()
void CreateIdealPalette ( SColorTable* ctab )
int GetCursorType ()

Detailed Description

The parent class of NativePlayerWnd, SPlayer deals with events (mouse, keyboard), drawing, cursors, etc. at a "higher" OS-independant level. It aggregates the ScriptPlayer, DisplayList, and CBitBuffer, acting as a sort of "main" object.

Member Function Documentation

void SPlayer::FreeBuffer ()

Deletes the bitmap backing the window, invalidates the display. Flash will rebuild the bitmap with the current screen depth and palette.

void SPlayer::MouseMove (int x, int y, BOOL mouseIsDown)

MouseMove is a method provided for use by the native code.
MouseMove should be called whenever the mouse position needs to be updated. (The actual frequency should be often enough to update the mouse, but not so often as to clog the system.) It should be called irrespective of whether the mouse button is down.

void SPlayer::MouseDown (int x, int y)

MouseDown is a method provided for use by the native code.
MouseDown should be called when the mouse button is pressed.

void SPlayer::MouseUp (int x, int y)

MouseUp is a method provided for use by the native code.
MouseUp should be called when the mouse button is released.

void SPlayer::CancelCapture (BOOL outsideWindow = true)

CancelCapture is a method provided for use by the native code.
CancelCapture should be called if the mouse capture needs to be aborted for some reason. outsideWindow is true if the mouse has left the window. (Elvis has left the building.)

void SPlayer::OnDraw ()

OnDraw is a method provided for use by the native code.
OnDraw should be called when the play timer fires, or when the screen should be rendered.

void SPlayer::Repaint (SRECT * rect)

OnDraw is a method provided for use by the native code.
It is used to request a repaint of a screen rectangle. Usefull for responding to re-paint requests from the OS.

void SPlayer::GetURL (char * url, char * target = "", char * postData = "", int loadMethod = 0)

GetURL provides support for all URL retrieval. It is not generally used by Native code.

virtual void SPlayer::StreamPostURLNotify (const char * url, const char * window, U32 len, const char * buf, void * notifyData) [pure virtual]

StreamPostURLNotify is a call made to the Native code to start a Post. It mimics the netscape call NPN_PostURLNotify. (See the plug-in guide at http://developer.netscape.com/docs/manuals/ )

Parameters:
url - URL of the POST request, specified by the plug-in.
window - Target window. For values, see NPN_GetURL.
len - Length of the buffer buf.
buf - Path to local temporary file or data buffer that contains the data to post.
notifydata - Plug-in-private value

Reimplemented in NativePlayerWnd.

virtual void SPlayer::StreamGetURLNotify (const char * url, const char * window, void * notifyData) [pure virtual]

StreamGetURLNotify is a call made to the Native code to start a Get. It mimics the netscape call NPN_GetURLNotify (See the plug-in guide at http://developer.netscape.com/docs/manuals/ )

Parameters:
url - URL of the GET request, specified by the plug-in.
window - Target window. For values, see NPN_GetURL.
notifydata - Plug-in-private value

Reimplemented in NativePlayerWnd.

void SPlayer::StreamInNew (StreamData * streamData, char * url, void * notifyData)

A data stream is delivered to Flash in 3 steps:
1) StreamInNew
2) StreamInWrite
3) StreamInDestroy
Note that Flash has only one thread and these calls need to be on that thread; it may be necessary to perform synchronization in native code.
StreamInNew is either a response to a POST or GET, or can be used to initiate streaming (and loading a movie) without a request from Flash. If used to initiate streaming, it is possible the incoming stream will confilct with the existing movie. There are 2 solutions to this problem:
1) only use StreamGetURLNotify to load the first movie - useful for plugins
2) use ControlOpen to start streaming, which will clear existing movies and strings.
StreamInNew is modeled after the netscape NPP_NewStream.

Parameters:
streamData - Storage space for data -- used by Flash core.
url - URL of the request, which was (usually) passed to the native code by StreamGetURLNotify.
notifyData - The data passed in by StreamGetURLNotify -- null if the stream is initiated by the native code.

int SPlayer::StreamInWrite (StreamData * streamData, void * buffer, int length)

StreamInWrite delivers a block of SWF data to the Flash core. Based on netscape NPP_Write. Returns >= 0 to continue, return -1 if error

Parameters:
streamData - Storage space for data -- used by Flash core.
buffer - Pointer to a block o' SWF data.
length - length of that block.

void SPlayer::StreamInDestroy (StreamData * streamData)

StreamInDestroy ends the delivery of SWF data to the Flash core. Based on netscape NPP_DestroyStream. Deallocates memory stored by streamData.

Parameters:
streamData - Storage space for data -- used by Flash core.

virtual void SPlayer::CloseStream (StreamData * streamData) [pure virtual]

If a stream needs to be axed mid-way (after the Stream in new, but before completion) this call kills it. The most basic functionality of this call should be to set streamData->scriptPlayer to NULL. That way, future calls to StreamInWrite and StreamInDestroy will not write SWF data. It is a good idea to call StreamInDestroy on the closed stream to clean up memory.

Reimplemented in NativePlayerWnd.

virtual void SPlayer::ProcessFSCommand (char * command, char * args) [pure virtual]

FSCommand sends a command from the movie to the player. The ProcessFSCommand method call is made to the NativePlayerWnd when it needs to process an FSCommand. It has two parameters: Command and Argument. Since the FSCommand does something different on every host platform, there are a wide range of actions that FSCommand can cause. Please see the Flash 4 help file on FSCommand for a complete description.

Reimplemented in NativePlayerWnd.

void SPlayer::SetMenuState ()

SetMenuState will determine the state of the menu options and call EnableMenus.

void SPlayer::GetMenuState (MenuStatus * menuStatus)

GetMenuState puts the status (enabled, disabled, checked) of the various menu items into the MenuStatus structure. It has no side effects and can be called at any time.

void SPlayer::GetEditMenuState (EditMenuStatus * editMenuStatus)

GetEditMenuState puts the status (enabled, disabled) of the edit text popup menu items into the EditMenuStatus structure. It has no side effects and can be called at any time. If no field has the focus, all of the fields in the structure will be false.

int SPlayer::GetPopupMenuState ()

Based on the current mouse cursor, GetPopupMenuState assumes a popup menu has been requested and returns an enumerated for what type of menu it should be: MENU_EDIT, MENU_NONE, MENU_NO_MOVIE, MENU_NORMAL, or MENU_STATIC. Please see the design doc for a description of the various menu types.

void SPlayer::ControlOpen (char * filenameToOpen)

The Control* methods are provided for use by the native code. Their functionality (and names) reflects menu item choices.
ControlOpen opens and plays a movie given a URL to a local or remote object.

void SPlayer::ControlClose ()

Closes a playing movie.

void SPlayer::ControlPlay ()

Play or stop (toggle).

void SPlayer::ControlRewind ()

Rewind the current movie to the beginning.

void SPlayer::ControlForward ()

Move the movie forward one frame.

void SPlayer::ControlBack ()

Move the movie backward one frame.

void SPlayer::ControlLoop ()

Sets the movie looping or non-looping.

void SPlayer::ControlViewAll ()

Sets the movie to fill the client window.

void SPlayer::Control100 ()

Sets the movie to its actual size (100% zoom).

void SPlayer::ControlZoomIn ()

Zoom in.

void SPlayer::ControlZoomContext (int x, int y)

Zoom in, from context menu. An x and y coordinate to zoom to must be specified.

void SPlayer::ControlZoomOut ()

Zoom out.

void SPlayer::ControlHighQuality ()

Toggles high quality on and off.

void SPlayer::CreateIdealPalette (SColorTable * ctab)

Currently not used. Writes an "ideal" palette into ctab. Just a suggestion.

int SPlayer::GetCursorType ()

Query the current cursor type. Returns either CURSOR_TYPE_ARROW, CURSOR_TYPE_HAND, CURSOR_TYPE_BUTTON, CURSOR_TYPE_BEAM


The documentation for this classwas generated from the following file:

Version 1.0 of the Flash 4 Porting SDK                        Middlesoft, Inc.