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

Dialog.h

Go to the documentation of this file.
00001 #ifndef HEADER_DIALOG_H
00002 #define HEADER_DIALOG_H
00003 
00004 #include "NoCopy.h"
00005 #include "StringTool.h"
00006 
00007 #include "SDL_mixer.h"
00008 #include <string>
00009 
00010 /**
00011  * Dialog with sound and subtitle.
00012  * Dialog is const class only sound is lazy loaded.
00013  */
00014 class Dialog: public NoCopy {
00015     public:
00016         static const std::string DEFAULT_LANG;
00017     private:
00018         mutable Mix_Chunk *m_sound;
00019         std::string m_soundfile;
00020         std::string m_lang;
00021         std::string m_subtitle;
00022     public:
00023         Dialog(const std::string &lang,
00024                 const std::string &soundfile, const std::string &subtitle);
00025         virtual ~Dialog();
00026 
00027         bool isSpeechless() const { return m_soundfile.empty(); }
00028         int talk(int volume, int loops=0) const;
00029         virtual void runSubtitle(const StringTool::t_args &args) const;
00030         std::string getLang() const { return m_lang; }
00031         std::string getSubtitle() const { return m_subtitle; }
00032         std::string getFormatedSubtitle(const StringTool::t_args &args) const;
00033         int getMinTime() const;
00034 
00035         bool equalSound(const Mix_Chunk *other) const
00036         { return m_sound == other; }
00037 };
00038 
00039 #endif
00040 

Generated on Wed Jun 1 09:54:30 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2