Public Member Functions

gnash::DummyMovieDefinition Class Reference

A dummy movie definition, for use by unit tests. More...

#include <DummyMovieDefinition.h>

Inheritance diagram for gnash::DummyMovieDefinition:
Inheritance graph
[legend]
Collaboration diagram for gnash::DummyMovieDefinition:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DummyMovieDefinition (const RunResources &ri)
 Default constructor.
 DummyMovieDefinition (const RunResources &ri, int version)
 Overloaded constructor for specifying target version.
virtual bool ensure_frame_loaded (size_t) const
 Ensure that frame number 'framenum' (1-based offset) has been loaded (load on demand).
virtual int get_version () const
 Return the advertised version for the SWFMovie.
virtual size_t get_width_pixels () const
 Frame width in pixels.
virtual size_t get_height_pixels () const
 Frame height in pixels.
virtual size_t get_frame_count () const
 Return total number of frames advertised for the SWFMovie.
virtual float get_frame_rate () const
 Return frame rate advertised for the SWFMovie.
virtual const SWFRectget_frame_size () const
 Return dimensions of the SWFMovie.
virtual size_t get_bytes_loaded () const
 Get number of bytes loaded from input stream.
virtual size_t get_bytes_total () const
 Get total number of bytes as parsed from the SWF header.
virtual MoviecreateMovie (Global_as &gl, DisplayObject *parent=NULL)
 Create a playable movie instance from a def.
virtual const PlayListget_playlist (size_t frame_number) const
virtual size_t get_loading_frame () const
 Returns 1 based index. Ex: if 1 then 1st frame as been fully loaded.
virtual const std::string & get_url () const
 Return the URL of the SWF stream this definition has been read from.

Detailed Description

A dummy movie definition, for use by unit tests.

This class provides implementation of all virtual methods of movie_definition by returning user-defined values for version/size/frame rate etc..

The createMovie function will return the same object created by createEmptyMovieClip() calls (an empty movieclip... still to be designed)


Constructor & Destructor Documentation

gnash::DummyMovieDefinition::DummyMovieDefinition ( const RunResources ri  )  [inline]

Default constructor.

Will be initialized with the following values

  • SWF version 6
  • 640x480 size
  • Single frame (unlabeled)
  • 12 FPS
  • 0 bytes (for get_bytes_loaded()/get_bytes_total())
  • empty url
gnash::DummyMovieDefinition::DummyMovieDefinition ( const RunResources ri,
int  version 
) [inline]

Overloaded constructor for specifying target version.

This is particularly useful for unit tests. All but the target version will be initialized exactly as with the default constructor.


Member Function Documentation

virtual Movie* gnash::DummyMovieDefinition::createMovie ( Global_as gl,
DisplayObject parent = NULL 
) [inline, virtual]

Create a playable movie instance from a def.

Reimplemented from gnash::SWFMovieDefinition.

References gnash::NSV::CLASS_MOVIE_CLIP, gnash::getObjectWithPrototype(), and gnash::key::o.

virtual bool gnash::DummyMovieDefinition::ensure_frame_loaded ( size_t  framenum  )  const [inline, virtual]

Ensure that frame number 'framenum' (1-based offset) has been loaded (load on demand).

Reimplemented from gnash::SWFMovieDefinition.

virtual size_t gnash::DummyMovieDefinition::get_bytes_loaded (  )  const [inline, virtual]

Get number of bytes loaded from input stream.

NOTE: this method locks _bytes_loaded_mutex

Reimplemented from gnash::SWFMovieDefinition.

virtual size_t gnash::DummyMovieDefinition::get_bytes_total (  )  const [inline, virtual]

Get total number of bytes as parsed from the SWF header.

Reimplemented from gnash::SWFMovieDefinition.

virtual size_t gnash::DummyMovieDefinition::get_frame_count (  )  const [inline, virtual]

Return total number of frames advertised for the SWFMovie.

Reimplemented from gnash::SWFMovieDefinition.

virtual float gnash::DummyMovieDefinition::get_frame_rate (  )  const [inline, virtual]

Return frame rate advertised for the SWFMovie.

Reimplemented from gnash::SWFMovieDefinition.

virtual const SWFRect& gnash::DummyMovieDefinition::get_frame_size (  )  const [inline, virtual]

Return dimensions of the SWFMovie.

Reimplemented from gnash::SWFMovieDefinition.

virtual size_t gnash::DummyMovieDefinition::get_height_pixels (  )  const [inline, virtual]

Frame height in pixels.

The frame size is in twips and may be rounded up.

Reimplemented from gnash::SWFMovieDefinition.

References gnash::SWFRect::height().

virtual size_t gnash::DummyMovieDefinition::get_loading_frame (  )  const [inline, virtual]

Returns 1 based index. Ex: if 1 then 1st frame as been fully loaded.

Reimplemented from gnash::SWFMovieDefinition.

virtual const PlayList& gnash::DummyMovieDefinition::get_playlist ( size_t  frame_number  )  const [inline, virtual]
virtual const std::string& gnash::DummyMovieDefinition::get_url (  )  const [inline, virtual]

Return the URL of the SWF stream this definition has been read from.

Reimplemented from gnash::SWFMovieDefinition.

virtual int gnash::DummyMovieDefinition::get_version (  )  const [inline, virtual]

Return the advertised version for the SWFMovie.

This is stored and used in AS interpretation for some version-based behaviour.

Reimplemented from gnash::SWFMovieDefinition.

virtual size_t gnash::DummyMovieDefinition::get_width_pixels (  )  const [inline, virtual]

Frame width in pixels.

The frame size is in twips and may be rounded up.

Reimplemented from gnash::SWFMovieDefinition.

References gnash::SWFRect::width().


The documentation for this class was generated from the following file: