Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

PlannedDialog Class Reference

Inheritance diagram for PlannedDialog:

Inheritance graph
[legend]
Collaboration diagram for PlannedDialog:

Collaboration graph
[legend]

Detailed Description

Active dialog.

Definition at line 13 of file PlannedDialog.h.

Public Member Functions

 PlannedDialog (int actor, const Dialog *dialog, int minTime)
 Structure to store planned dialog.
void talk (int volume, int loops=0)
 Run talk.
void killTalk ()
 Stop talking.
bool isTalking () const
 Return true when is playing or return true for minimal time according subtitle length.
bool equalsActor (int other) const


Constructor & Destructor Documentation

PlannedDialog::PlannedDialog int  actor,
const Dialog dialog,
int  minTime
 

Structure to store planned dialog.

Parameters:
actor who will talk
dialog what will talk, shared resource
minTime minimal time to talk when sound resource is not available

Definition at line 21 of file PlannedDialog.cpp.

00022 {
00023     m_actor = actor;
00024     m_dialog = dialog;
00025     m_channel = -1;
00026     m_endtime = 0;
00027     m_minTime = minTime;
00028 }


Member Function Documentation

bool PlannedDialog::equalsActor int  other  )  const
 

Definition at line 49 of file PlannedDialog.cpp.

00050 {
00051     return m_actor == other;
00052 }

bool PlannedDialog::isTalking  )  const
 

Return true when is playing or return true for minimal time according subtitle length.

Definition at line 86 of file PlannedDialog.cpp.

00087 {
00088     bool result = false;
00089     if (m_channel > -1) {
00090         result = isPlaying();
00091     }
00092     else {
00093         result = m_endtime > TimerAgent::agent()->getCycles();
00094     }
00095 
00096     return result;
00097 }

void PlannedDialog::killTalk  ) 
 

Stop talking.

Definition at line 58 of file PlannedDialog.cpp.

00059 {
00060     if (isPlaying()) {
00061         Mix_HaltChannel(m_channel);
00062     }
00063 }

void PlannedDialog::talk int  volume,
int  loops = 0
 

Run talk.

Parameters:
volume sound volume
loops numer of loops. 0=play once, 1=play twice, -1=play infinite

Definition at line 36 of file PlannedDialog.cpp.

00037 {
00038     m_channel = m_dialog->talk(volume, loops);
00039     if (loops == -1) {
00040         m_endtime = 1 << 30;
00041     }
00042     else {
00043         m_endtime = m_minTime * (loops + 1) + TimerAgent::agent()->getCycles();
00044     }
00045 }


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:56:16 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2