|
From: Tapio V. <aa...@us...> - 2009-12-11 12:45:49
|
Module: performous
Branch: dance
Commit: 28b801578ef10d5283db9f20edc3f23d1af3029e
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Dec 9 19:37:57 2009 +0100
Displayed playback/microphone not working only at start
---
game/screen_intro.cc | 15 ++++++++++-----
game/screen_intro.hh | 1 +
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index 2e5aec9..68de5b1 100755
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -5,7 +5,7 @@
#include "record.hh"
#include "i18n.hh"
-ScreenIntro::ScreenIntro(std::string const& name, Audio& audio, Capture& capture): Screen(name), m_audio(audio), m_capture(capture), selected() {
+ScreenIntro::ScreenIntro(std::string const& name, Audio& audio, Capture& capture): Screen(name), m_audio(audio), m_capture(capture), selected(), m_first(true) {
m_menuOptions.push_back(new MenuOption(_("Perform"), "Songs", "intro_sing.svg", _("Start performing!")));
m_menuOptions.push_back(new MenuOption(_("Practice"), "Practice", "intro_practice.svg", _("Check your skills or test the microphones")));
m_menuOptions.push_back(new MenuOption(_("Configure"), "Configuration", "intro_configure.svg", _("Configure game options")));
@@ -15,10 +15,15 @@ ScreenIntro::ScreenIntro(std::string const& name, Audio& audio, Capture& capture
void ScreenIntro::enter() {
m_audio.playMusic(getThemePath("menu.ogg"), true);
theme.reset(new ThemeIntro());
- std::string msg;
- if (!m_audio.isOpen()) msg = _("No playback devices could be used.\n");
- if (m_capture.analyzers().empty()) msg += _("No microphones found.\n");
- if (!msg.empty()) m_dialog.reset(new Dialog(msg + _("\nPlease configure some before playing.")));
+ if( m_first ) {
+ std::string msg;
+ if (!m_audio.isOpen()) msg = _("No playback devices could be used.\n");
+ if (m_capture.analyzers().empty()) msg += _("No microphones found.\n");
+ if (!msg.empty()) m_dialog.reset(new Dialog(msg + _("\nPlease configure some before playing.")));
+ m_first = false;
+ } else {
+ m_dialog.reset();
+ }
}
void ScreenIntro::exit() {
diff --git a/game/screen_intro.hh b/game/screen_intro.hh
index 79ae510..76d7909 100755
--- a/game/screen_intro.hh
+++ b/game/screen_intro.hh
@@ -29,4 +29,5 @@ class ScreenIntro : public Screen {
boost::ptr_vector<MenuOption> m_menuOptions;
boost::scoped_ptr<Dialog> m_dialog;
unsigned int selected;
+ bool m_first;
};
|