Debian Codegraph @

src/plan/FishDialog.cpp

raw
1 /*
2 * Copyright (C) 2004 Ivo Danihelka ([email protected])
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9 #include "FishDialog.h"
10
11 #include "SubTitleAgent.h"
12
13 //-----------------------------------------------------------------
14 /**
15 * Prepare new wavy dialoge.
16 * @param lang lang
17 * @param soundfile a wav file
18 * @param subtitle subtitle
19 * @param fontname name of selected font
20 */
21 FishDialog::FishDialog(const std::string &lang,
22 const std::string &soundfile, const std::string &subtitle,
23 const std::string &fontname)
24 : Dialog(lang, soundfile, subtitle), m_fontname(fontname)
25 {
26 /* empty */
27 }
28 //-----------------------------------------------------------------
29 /**
30 * Subtitles are optional, dialog can have only sound.
31 */
32 void
33 FishDialog::runSubtitle(const StringTool::t_args &args) const
34 {
35 if (!m_fontname.empty()) {
36 std::string subtitle = getFormatedSubtitle(args);
37 if (!subtitle.empty()) {
38 SubTitleAgent::agent()->newSubtitle(subtitle, m_fontname);
39 }
40 }
41 }
42