Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

player Class Reference

the SMUSH player class More...

#include <player.h>

Collaboration diagram for player:

Collaboration graph
[legend]
List of all members.

Public Methods

 player (renderer *, bool wait=true, bool output_sound=true) throw ()
virtual ~player () throw ()
bool play (const std::string &) throw (std::exception)
void update_palette (void)
void show (const std::string &p)
void hide (const std::string &p)

Protected Methods

bool read_string (const std::string &file) throw (std::exception)
void clean () throw ()
void checkBlock (const chunck &, chunck::type, unsigned int=0)
void handleAnimHeader (chunck &) throw (std::exception)
void handleFrame (chunck &) throw (std::exception)
void handleNewPalette (chunck &) throw (std::exception)
void handleFrameObject (chunck &) throw (std::exception)
void handleSoundBuffer (int, int, int, int, int, int, chunck &, int) throw (std::exception)
void handleImuseBuffer (int, int, int, int, int, int, chunck &, int) throw (std::exception)
void handleSoundFrame (chunck &) throw (std::exception)
void handleSkip (chunck &) throw (std::exception)
void handleStore (chunck &) throw (std::exception)
void handleFetch (chunck &) throw (std::exception)
void handleImuseAction8 (chunck &, int flags, int unknown, int track_id) throw (std::exception)
void handleImuseAction (chunck &) throw (std::exception)
void handleTextResource (chunck &) throw (std::exception)
void handleDeltaPalette (chunck &) throw (std::exception)
void decodeCodec (chunck &, const rect &, decoder &) throw (std::exception)
void readPalette (palette &, chunck &) throw (std::exception)
void init_size (const rect &, bool, bool) throw (std::exception)

Private Attributes

std::string _fname
 the name of the animation file being played

int _version
 the version of the animation file being played

int _secondary_version
 the secondary version number of the animation file being played

int _sound_frequency
 the sound frequency of the animation file being played

int _nbframes
 the number of frames in the animation file

mixer _mixer
 the sound mixer

palette _pal
 the current palette

short _delta_pal [768]
 the delta palette information set by an xpal

renderer_renderer
 pointer to the renderer

string_resource_strings
 pointer to the string resources associated with the animation

font_renderer_fr [4]
 pointers to the fonts for the animation

codec1_decoder _codec1
 the decoder for codec 1 and 3

codec37_decoder _codec37
 the decoder for codec 37

codec44_decoder _codec44
 the decoder for codec 21 and 44

point _frame_size
 the current frame size of the animation

int _frame
 the current frame number of the animation

bool _output_sound
 should we handle sound ?

bool _wait
 should we synchronise the player ?

bool _already_init
 has the player already been initialized for the current frame

bool _codec37_called
 has the codec 37 already been called once for this animation

bool _skipnext
 should the player skip the next frame object ?

bool _subtitles
 should the player handle subtitles ?

bool _bgmusic
 should the player output the background music ?

bool _voices
 should the player output the voice ?

std::map< int, bool > _skips
 mapping of frame object identifier to show or hide

char * _cur_buffer
 pointer to the current frame


Detailed Description

the SMUSH player class

This class is the player itself.

Definition at line 48 of file player.h.


Constructor & Destructor Documentation

player::player renderer  ,
bool    wait = true,
bool    output_sound = true
throw ()
 

Definition at line 136 of file player.cpp.

player::~player   throw () [virtual]
 

Definition at line 158 of file player.cpp.


Member Function Documentation

void player::checkBlock const chunck  ,
chunck::type   ,
unsigned    int = 0
[protected]
 

Definition at line 174 of file player.cpp.

References chunck::get_size(), chunck::get_type(), and chunck::type.

void player::clean   throw () [protected]
 

Definition at line 166 of file player.cpp.

void player::decodeCodec chunck  ,
const rect  ,
decoder  
throw (std::exception) [protected]
 

Definition at line 438 of file player.cpp.

void player::handleAnimHeader chunck   throw (std::exception) [protected]
 

Definition at line 584 of file player.cpp.

References WAIT.

void player::handleDeltaPalette chunck   throw (std::exception) [protected]
 

Definition at line 388 of file player.cpp.

void player::handleFetch chunck   throw (std::exception) [protected]
 

Definition at line 254 of file player.cpp.

void player::handleFrame chunck   throw (std::exception) [protected]
 

Definition at line 527 of file player.cpp.

References chunck::chunck_string(), chunck::get_size(), chunck::get_type(), and WAIT.

void player::handleFrameObject chunck   throw (std::exception) [protected]
 

Definition at line 473 of file player.cpp.

void player::handleImuseAction chunck   throw (std::exception) [protected]
 

Definition at line 294 of file player.cpp.

void player::handleImuseAction8 chunck  ,
int    flags,
int    unknown,
int    track_id
throw (std::exception) [protected]
 

Definition at line 280 of file player.cpp.

void player::handleImuseBuffer int   ,
int   ,
int   ,
int   ,
int   ,
int   ,
chunck  ,
int   
throw (std::exception) [protected]
 

Definition at line 267 of file player.cpp.

References channel::append_data(), channel::check_parameters(), and channel::set_parameters().

void player::handleNewPalette chunck   throw (std::exception) [protected]
 

Definition at line 429 of file player.cpp.

void player::handleSkip chunck   throw (std::exception) [protected]
 

Definition at line 227 of file player.cpp.

void player::handleSoundBuffer int   ,
int   ,
int   ,
int   ,
int   ,
int   ,
chunck  ,
int   
throw (std::exception) [protected]
 

Definition at line 190 of file player.cpp.

References channel::append_data(), channel::check_parameters(), and channel::set_parameters().

void player::handleSoundFrame chunck   throw (std::exception) [protected]
 

Definition at line 205 of file player.cpp.

void player::handleStore chunck   throw (std::exception) [protected]
 

Definition at line 240 of file player.cpp.

void player::handleTextResource chunck   throw (std::exception) [protected]
 

Definition at line 328 of file player.cpp.

References font_renderer::draw_string_absolute(), font_renderer::draw_string_centered(), and font_renderer::set_color().

void player::hide const std::string &    p
 

Definition at line 119 of file player.cpp.

References _bgmusic, _skips, _subtitles, and _voices.

Referenced by main().

void player::init_size const rect  ,
bool   ,
bool   
throw (std::exception) [protected]
 

Definition at line 450 of file player.cpp.

bool player::play const std::string &    throw (std::exception)
 

Definition at line 704 of file player.cpp.

References file_chunck::eof(), chunck::get_size(), chunck::get_type(), load_font(), and file_chunck::sub_block().

Referenced by load_font(), and main().

bool player::read_string const std::string &    file throw (std::exception) [protected]
 

Definition at line 671 of file player.cpp.

References get_strings().

void player::readPalette palette  ,
chunck  
throw (std::exception) [protected]
 

Definition at line 382 of file player.cpp.

void player::show const std::string &    p
 

Definition at line 103 of file player.cpp.

References _bgmusic, _skips, _subtitles, and _voices.

Referenced by main().

void player::update_palette void   
 

Definition at line 162 of file player.cpp.

References _pal, _renderer, and renderer::set_palette().


Member Data Documentation

bool player::_already_init [private]
 

has the player already been initialized for the current frame

Definition at line 68 of file player.h.

bool player::_bgmusic [private]
 

should the player output the background music ?

Definition at line 72 of file player.h.

Referenced by hide(), and show().

codec1_decoder player::_codec1 [private]
 

the decoder for codec 1 and 3

Definition at line 61 of file player.h.

codec37_decoder player::_codec37 [private]
 

the decoder for codec 37

Definition at line 62 of file player.h.

bool player::_codec37_called [private]
 

has the codec 37 already been called once for this animation

Definition at line 69 of file player.h.

codec44_decoder player::_codec44 [private]
 

the decoder for codec 21 and 44

Definition at line 63 of file player.h.

char* player::_cur_buffer [private]
 

pointer to the current frame

Definition at line 75 of file player.h.

short player::_delta_pal[768] [private]
 

the delta palette information set by an xpal

Definition at line 57 of file player.h.

std::string player::_fname [private]
 

the name of the animation file being played

Definition at line 50 of file player.h.

font_renderer* player::_fr[4] [private]
 

pointers to the fonts for the animation

Definition at line 60 of file player.h.

int player::_frame [private]
 

the current frame number of the animation

Definition at line 65 of file player.h.

point player::_frame_size [private]
 

the current frame size of the animation

Definition at line 64 of file player.h.

mixer player::_mixer [private]
 

the sound mixer

Definition at line 55 of file player.h.

int player::_nbframes [private]
 

the number of frames in the animation file

Definition at line 54 of file player.h.

bool player::_output_sound [private]
 

should we handle sound ?

Definition at line 66 of file player.h.

palette player::_pal [private]
 

the current palette

Definition at line 56 of file player.h.

Referenced by update_palette().

renderer* player::_renderer [private]
 

pointer to the renderer

Definition at line 58 of file player.h.

Referenced by update_palette().

int player::_secondary_version [private]
 

the secondary version number of the animation file being played

Definition at line 52 of file player.h.

bool player::_skipnext [private]
 

should the player skip the next frame object ?

Definition at line 70 of file player.h.

std::map<int, bool> player::_skips [private]
 

mapping of frame object identifier to show or hide

Definition at line 74 of file player.h.

Referenced by hide(), and show().

int player::_sound_frequency [private]
 

the sound frequency of the animation file being played

Definition at line 53 of file player.h.

string_resource* player::_strings [private]
 

pointer to the string resources associated with the animation

Definition at line 59 of file player.h.

bool player::_subtitles [private]
 

should the player handle subtitles ?

Definition at line 71 of file player.h.

Referenced by hide(), and show().

int player::_version [private]
 

the version of the animation file being played

Definition at line 51 of file player.h.

bool player::_voices [private]
 

should the player output the voice ?

Definition at line 73 of file player.h.

Referenced by hide(), and show().

bool player::_wait [private]
 

should we synchronise the player ?

Definition at line 67 of file player.h.


The documentation for this class was generated from the following files:
Generated on Fri Aug 9 22:54:32 2002 for san_player by doxygen1.2.16