Annexe C
Signature des classes du système Talking Reader

 

C.1 La classe WaveFile

C.1.1 Signature de la classe :

//----------------------------------//
// class WaveFile - Wave File
//
// manages a waveform-audio file.
//
//----------------------------------
 
class WaveFile
{
private:

DWORD WAVEFileSize; // Size of the open WAVEFile
UINT BPS;
DWORD SPS;
HWND hWnd;
protected:
UINT wDeviceID;
public:
DWORD To, From;

DWORD last; // memorize the last position for undo feature

bool jump; // semaphore indicating that a jump is processing
// The MCINOTIFY event must not be treat in this case.
// When a jump is processed, the play
// command send an MCINOTIFY event even if the play
// is not fully complete.

MarkMan amm; // A Mark Manager

UINT BitsPerSample( void );

// Close a waveform-audio file
void close( void );

// secondes nb -> bytes size
DWORD duration( UINT nbsec );

bool EOWF( void );

// Return the current position inside the waveform-audio file
DWORD getPos( void );

// Return the current speed of the waveform-audio file
DWORD getSpeed( void );

// Go to the beginning of the waveform-audio file
DWORD goBegin( void );

DWORD Info( void );

void Init( HWND OhWnd );

// Info about the mode of the playing of a waveform-audio file
DWORD mode( void );

// Open a given waveform-audio file.
// Returns when the open is done. Returns 0L on success, otherwise
// returns an MCI error code.
DWORD open(LPSTR lpszWAVEFileName, UINT *pwDeviceID);

// Pause the playing of a waveform-audio file
DWORD pause( void );

// Play a given waveform-audio file
DWORD play( void );

// Play a small sound file to signal a mark
DWORD playmark( char *sound );

// Resume the playing of a waveform-audio file
DWORD resume( void );

// Set the position inside the waveform-audio file
// The position to set is stored into the dwTo parameter
// of the structure MCI-SEEK-PARMS
DWORD setPos(DWORD target);

// Return the current speed of the waveform-audio file
DWORD setSpeed( void );

// Uses mciGetErrorString to get a textual description of an MCI error.
// Displays the error description using MessageBox.
void showError(DWORD dwError);

// skip to near unit (according to the current level)
void skip ( UINT direction );

DWORD SamplesPerSec( void );

// Stop the readind of a waveform-audio
fileDWORD stop( void );

// avoid to access to the size of the WaveFile
DWORD WaveFileSize( void );

// Write the current position inside the waveform-audio file
// in the file WAVEFILE (#define)
DWORD writePos( void );
}; // End of WaveFile class définition
 

C.2 La classe MarkManager

C.2.1 Signature de la classe :

class MarkMan
{
private:

DWORD FileSize; // Size of the file
HWND hWnd;
bool FindMark( DWORD pos, UINT *mark, MarkList marks );
bool FindMark( DWORD pos, UINT *mark, IndexList index, UINT flag );
bool FindAnchorMark( UINT ind, UINT *mark );

void ReadAnchors( void);
void ReadIndex( void );
public:
MarkList marks; // memorises all anchors of the wavefile
UINT current; // indice of the current anchor in the anchors table
bool where; // to know if we are Inside or Outside an anchor
UINT level; // indicate the reading level

LevelsData leveld;

void Init( HWND hWnd, DWORD WaveFileSize );

~MarkMan( void );

DWORD succ ( void );
DWORD prev ( void );
DWORD next ( DWORD pos );
DWORD targ ( void );
bool FindIndex( DWORD pos, UINT *mark, IndexList index, UINT flag );
};