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

window_renderer Class Reference

renderer implementation that convert shows frames in a window. More...

#include <win32.h>

Inheritance diagram for window_renderer:

Inheritance graph
[legend]
Collaboration diagram for window_renderer:

Collaboration graph
[legend]
List of all members.

Public Methods

 window_renderer () throw (std::exception)
virtual ~window_renderer () throw ()
bool init_frame (const point &size) throw (std::exception)
 start of animation output

void dump (char *data, int size) throw (std::exception)
bool wait (int ms) throw ()
 wait for some time

void clean () throw ()
 memory cleanup (deletes frame buffer)

virtual sound_rendererget_sound_renderer () throw (std::exception)
 request for a sound_renderer

bool set_palette (const palette &pal) throw ()
 set a new palette

void save (int f=-1) throw (std::exception)
int get_frame () const throw ()
virtual char * lock_frame (int frame) throw (std::exception)
 lock a frame buffer

virtual bool unlock_frame () throw ()
 unlock a frame buffer

virtual bool flip_frame () throw ()
 flip a frame buffer

virtual bool start_decode (const std::string &fname, int version, int nbframes) throw ()
 start of animation output

virtual bool save_current () throw ()
 debugging function : do not use


Static Public Attributes

const int HEADER_SIZE

Protected Methods

const BITMAPINFO * get_bmi () const throw ()
const std::string & get_filename () const throw ()
int get_nbframes () const throw ()
int get_width () const throw ()
int get_height () const throw ()
const palettepal () const throw ()
const char * data () const throw ()
void set_frame (int f) throw ()

Static Private Methods

LRESULT WINAPI windowProc (HWND, UINT, WPARAM, LPARAM)
DWORD CALLBACK threadProc (void *)

Private Attributes

HWND _hwnd
 the window handle

char * _bitmap
 bitmap data of the current frame

int _size
 size of the bitmap data

int _clock
 date of the last frame update (in ms)

HANDLE _hThread
 handle of the thread that handle window messages

HANDLE _hEvent
 handle to an event use for thread synchronisation

HANDLE _hMutex
 handle to a mutex to protect write access to _bitmap

ds_wave_out_out
 the sound_renderer


Detailed Description

renderer implementation that convert shows frames in a window.

Definition at line 88 of file win32.h.


Constructor & Destructor Documentation

window_renderer::window_renderer   throw (std::exception)
 

Definition at line 346 of file win32.cpp.

window_renderer::~window_renderer   throw () [virtual]
 

Definition at line 354 of file win32.cpp.


Member Function Documentation

void window_renderer::clean   throw ()
 

memory cleanup (deletes frame buffer)

Reimplemented from base_renderer.

Definition at line 390 of file win32.cpp.

const char* base_renderer::data   const throw () [inline, protected, inherited]
 

Definition at line 54 of file brenderer.h.

References base_renderer::_data.

Referenced by font_renderer::save().

void window_renderer::dump char *    data,
int    size
throw (std::exception) [virtual]
 

Implements bitmap_renderer.

Definition at line 372 of file win32.cpp.

bool base_renderer::flip_frame   throw () [virtual, inherited]
 

flip a frame buffer

This is called by the animation player when the current frame should be shown.

Returns:
true if everything went fine, false otherwise

Implements renderer.

Definition at line 65 of file brenderer.cpp.

const BITMAPINFO* bitmap_renderer::get_bmi   const throw () [inline, protected, inherited]
 

Definition at line 55 of file win32.h.

References bitmap_renderer::_bmi.

Referenced by windowProc().

const std::string& base_renderer::get_filename   const throw () [inline, protected, inherited]
 

Definition at line 49 of file brenderer.h.

References base_renderer::_fname.

int base_renderer::get_frame   const throw () [inline, inherited]
 

Definition at line 58 of file brenderer.h.

References base_renderer::_frame.

int base_renderer::get_height   const throw () [inline, protected, inherited]
 

Definition at line 52 of file brenderer.h.

References base_renderer::_height.

Referenced by font_renderer::save().

int base_renderer::get_nbframes   const throw () [inline, protected, inherited]
 

Definition at line 50 of file brenderer.h.

References base_renderer::_nbframes.

sound_renderer * window_renderer::get_sound_renderer   throw (std::exception) [virtual]
 

request for a sound_renderer

This is called by the animation player when sound output is required by the animation.

Returns:
a valid pointer to an uninitialized sound_renderer instance, or null if none is available.

Reimplemented from base_renderer.

Definition at line 412 of file win32.cpp.

int base_renderer::get_width   const throw () [inline, protected, inherited]
 

Definition at line 51 of file brenderer.h.

References base_renderer::_width.

Referenced by font_renderer::save().

bool window_renderer::init_frame const point   size throw (std::exception) [virtual]
 

start of animation output

This is called by the animation player when the frame size is changing.

Parameters:
size  new size of the frames.
Returns:
true if everything went fine, false otherwise

Reimplemented from bitmap_renderer.

Definition at line 365 of file win32.cpp.

References bitmap_renderer::init_frame().

char * base_renderer::lock_frame int    frame throw (std::exception) [virtual, inherited]
 

lock a frame buffer

This is called by the animation player when a frame is going to be decoded.

Parameters:
frame  the frame number.
Returns:
a pointer to the frame buffer to output data to.

Implements renderer.

Definition at line 55 of file brenderer.cpp.

const palette& base_renderer::pal   const throw () [inline, protected, inherited]
 

Definition at line 53 of file brenderer.h.

void bitmap_renderer::save int    f = -1 throw (std::exception) [virtual, inherited]
 

Implements base_renderer.

Definition at line 228 of file win32.cpp.

virtual bool renderer::save_current   throw () [inline, virtual, inherited]
 

debugging function : do not use

Returns:
true if everything went fine, false otherwise

Reimplemented in bitmap_file_renderer.

Definition at line 151 of file renderer.h.

void base_renderer::set_frame int    f throw () [inline, protected, inherited]
 

Definition at line 56 of file brenderer.h.

References base_renderer::_frame.

bool bitmap_renderer::set_palette const palette   pal throw () [virtual, inherited]
 

set a new palette

This is called by the animation player when the palette is changing.

Parameters:
pal  new palette.
Returns:
true if everything went fine, false otherwise

Reimplemented from base_renderer.

Definition at line 217 of file win32.cpp.

References base_renderer::set_palette().

virtual bool base_renderer::start_decode const std::string &    fname,
int    version,
int    nbframes
throw () [inline, virtual, inherited]
 

start of animation output

This is called by the animation player when output is going to start.

Parameters:
fname  name of the animation being played.
version  version number of the animation
nbframes  total number of frames of the animation.
Returns:
true if initialisation was ok, false otherwise

Implements renderer.

Definition at line 67 of file brenderer.h.

References base_renderer::_fname, and base_renderer::_nbframes.

DWORD CALLBACK window_renderer::threadProc void *    [static, private]
 

Definition at line 317 of file win32.cpp.

References windowProc().

bool base_renderer::unlock_frame   throw () [virtual, inherited]
 

unlock a frame buffer

This is called by the animation player when a frame has been decoded.

Returns:
true if everything went fine, false otherwise

Implements renderer.

Definition at line 61 of file brenderer.cpp.

bool window_renderer::wait int    ms throw () [virtual]
 

wait for some time

This is called by the animation player when the animation should stay idle.

Parameters:
ms  number of millisecond to wait.
Returns:
true if everything went fine, false otherwise

Implements renderer.

Definition at line 397 of file win32.cpp.

LRESULT WINAPI window_renderer::windowProc HWND   ,
UINT   ,
WPARAM   ,
LPARAM   
[static, private]
 

Definition at line 278 of file win32.cpp.

References _bitmap, _hEvent, _hMutex, and bitmap_renderer::get_bmi().

Referenced by threadProc().


Member Data Documentation

char* window_renderer::_bitmap [private]
 

bitmap data of the current frame

Definition at line 91 of file win32.h.

Referenced by windowProc().

int window_renderer::_clock [private]
 

date of the last frame update (in ms)

Definition at line 93 of file win32.h.

HANDLE window_renderer::_hEvent [private]
 

handle to an event use for thread synchronisation

Definition at line 95 of file win32.h.

Referenced by windowProc().

HANDLE window_renderer::_hMutex [private]
 

handle to a mutex to protect write access to _bitmap

Definition at line 96 of file win32.h.

Referenced by windowProc().

HANDLE window_renderer::_hThread [private]
 

handle of the thread that handle window messages

Definition at line 94 of file win32.h.

HWND window_renderer::_hwnd [private]
 

the window handle

Definition at line 90 of file win32.h.

ds_wave_out* window_renderer::_out [private]
 

the sound_renderer

Definition at line 97 of file win32.h.

int window_renderer::_size [private]
 

size of the bitmap data

Definition at line 92 of file win32.h.

const int bitmap_renderer::HEADER_SIZE [static, inherited]
 

Definition at line 53 of file win32.h.


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