You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(25) |
Jul
(288) |
Aug
(119) |
Sep
(31) |
Oct
(59) |
Nov
(458) |
Dec
(359) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(268) |
Feb
(26) |
Mar
(36) |
Apr
(48) |
May
(119) |
Jun
(37) |
Jul
(173) |
Aug
(429) |
Sep
(137) |
Oct
(156) |
Nov
(59) |
Dec
(45) |
| 2011 |
Jan
(398) |
Feb
(257) |
Mar
(49) |
Apr
(5) |
May
(34) |
Jun
(11) |
Jul
(38) |
Aug
(12) |
Sep
(1) |
Oct
(49) |
Nov
(5) |
Dec
(10) |
| 2012 |
Jan
(21) |
Feb
(32) |
Mar
(20) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(173) |
Aug
|
Sep
(25) |
Oct
(6) |
Nov
(44) |
Dec
|
|
From: Tapio V. <aa...@us...> - 2010-10-23 13:19:58
|
Module: performous
Branch: master
Commit: b6650d3ca8388b8fec2a1149b576d3ccc34a8f6d
Author: Tapio Vierros <tap...@gm...>
Date: Sat Oct 23 16:19:24 2010 +0300
Vocals selector i18n.
---
game/screen_sing.cc | 8 ++++++--
game/screen_sing.hh | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index c0c2c00..59f800c 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -130,7 +130,8 @@ void ScreenSing::enter() {
if (opts.size() > 1) { // Vocal track changer only if there is options
m_vocalTrackOpts.select(cur); // Set the selection to current track
m_menu.add(MenuOption("", _("Change vocal track\n(restart required)"), &m_vocalTrackOpts));
- m_menu.back().setDynamicName(m_selectedTrack); // Set the title to be dynamic
+ m_selectedTrackLocalized = _(m_selectedTrack.c_str());
+ m_menu.back().setDynamicName(m_selectedTrackLocalized); // Set the title to be dynamic
}
}
m_menu.add(MenuOption(_("Quit"), _("Exit to song browser"), "Songs"));
@@ -303,7 +304,10 @@ void ScreenSing::manageEvent(SDL_Event event) {
m_menu.action();
if (!m_menu.isOpen() && m_audio.isPaused()) m_audio.togglePause();
// Handle updates
- if (m_selectedTrack != m_vocalTrackOpts.so()) m_selectedTrack = m_vocalTrackOpts.so();
+ if (m_selectedTrack != m_vocalTrackOpts.so()) {
+ m_selectedTrack = m_vocalTrackOpts.so();
+ m_selectedTrackLocalized = _(m_selectedTrack.c_str());
+ }
return;
}
else if (nav == input::DOWN) { m_menu.move(1); return; }
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 447802d..5df5af6 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -96,6 +96,7 @@ class ScreenSing: public Screen {
bool m_only_singers_alive;
bool m_practmode;
std::string m_selectedTrack;
+ std::string m_selectedTrackLocalized;
ConfigItem m_vocalTrackOpts;
};
|
|
From: Fredrik K. <sci...@us...> - 2010-10-23 13:11:37
|
Module: performous Branch: master Commit: 877276ab31e389aae6a5daa3e9fe0166ceaadc3e Author: Fredrik Klasson <sci...@gm...> Date: Sat Oct 23 15:10:56 2010 +0200 Merge branch 'master' of git.performous.org:/gitroot/performous/performous --- |
|
From: Fredrik K. <sci...@us...> - 2010-10-23 13:11:35
|
Module: performous
Branch: master
Commit: 4ae18750bd0677857af24e05b8f2d68a13ded258
Author: Fredrik Klasson <sci...@gm...>
Date: Sat Oct 23 15:10:07 2010 +0200
[ ] These two strings should be gettext'd too.
---
game/database.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index 3d4ee32..36ce48b 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -124,8 +124,8 @@ void Database::queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::sha
if (songid == -1 || hi.empty())
{
- os << "No Items up to now.\n";
- os << "Be the first to be listed here!\n";
+ os << _("No Items up to now.") << '\n';
+ os << _("Be the first to be listed here!") << '\n';
return;
}
|
|
From: Tapio V. <aa...@us...> - 2010-10-23 12:56:07
|
Module: performous Branch: master Commit: cd9862a98aa62cbd6aadfc1e4968253d65ab1b10 Author: Tapio Vierros <tap...@gm...> Date: Sat Oct 23 15:55:22 2010 +0300 Update fi translation. --- lang/fi.po | 291 ++++++++++++++++++++++++++++++++++-------------------------- 1 files changed, 167 insertions(+), 124 deletions(-) |
|
From: Yoda-JM <yo...@us...> - 2010-10-23 12:35:54
|
Module: performous
Branch: master
Commit: 543ecb238f02846da008295304358b739e7b10bc
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Oct 23 14:35:32 2010 +0200
Removed editor from gentoo's ebuild
---
.../games-arcade/performous/performous-9999.ebuild | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/portage-overlay/games-arcade/performous/performous-9999.ebuild b/portage-overlay/games-arcade/performous/performous-9999.ebuild
index 0c4c6b5..bb9baa1 100644
--- a/portage-overlay/games-arcade/performous/performous-9999.ebuild
+++ b/portage-overlay/games-arcade/performous/performous-9999.ebuild
@@ -34,7 +34,7 @@ LICENSE="GPL-2
SLOT="0"
KEYWORDS="~amd64 ~x86"
-IUSE="debug editor midi songs tools webcam"
+IUSE="debug midi songs tools webcam"
RDEPEND="gnome-base/librsvg
>=dev-libs/boost-1.39.0
@@ -45,7 +45,6 @@ RDEPEND="gnome-base/librsvg
media-libs/libpng
media-libs/jpeg
tools? ( media-gfx/imagemagick[png] )
- editor? ( media-gfx/imagemagick[png] )
webcam? ( media-libs/opencv[v4l] )
>=media-video/ffmpeg-0.4.9_p20070616-r20
media-libs/portaudio
@@ -78,7 +77,6 @@ src_prepare() {
src_configure() {
local mycmakeargs="
$(cmake-utils_use_enable tools TOOLS)
- $(cmake-utils_use_enable editor EDITOR)
$(cmake-utils_use_no webcam WEBCAM)
-DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}
-DGENTOO_DATA_DIR=${GAMES_DATADIR}/${PN}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-10-23 12:28:47
|
Module: performous Branch: master Commit: a53fecb2c95e308d150a03835a23284303652809 Author: Lasse Karkkainen <tro...@tr...> Date: Sat Oct 23 14:28:24 2010 +0200 Remove editor (didn't work and used old audio code) --- CMakeLists.txt | 6 - editor/CMakeLists.txt | 38 ------ editor/config.cmake.hh | 16 --- editor/ffmpeg.cc | 294 ------------------------------------------------ editor/ffmpeg.hh | 240 --------------------------------------- editor/main.cc | 63 ---------- editor/notes.cc | 82 ------------- editor/notes.hh | 101 ----------------- editor/pitch.cc | 197 -------------------------------- editor/pitch.hh | 111 ------------------ editor/util.hh | 25 ---- editor/xtime.hh | 34 ------ 12 files changed, 0 insertions(+), 1207 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-10-19 18:16:50
|
Module: performous
Branch: master
Commit: 5a9c3644a36bc76b7cdb82402ecbc3dc8bcf10d8
Author: Tapio Vierros <tap...@gm...>
Date: Tue Oct 19 21:16:18 2010 +0300
Fix a warning.
---
game/cache.hh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/cache.hh b/game/cache.hh
index 564cd8b..9121a54 100644
--- a/game/cache.hh
+++ b/game/cache.hh
@@ -22,7 +22,7 @@ namespace cache {
fs::path constructSVGCacheFileName(fs::path const& svgfilename, double factor);
/** Given a path to an SVG the caching policy is returned **/
- inline bool cachableSVGResource(fs::path const& svgfilename) {
+ inline bool cachableSVGResource(fs::path const& /*svgfilename*/ ) {
// FIXME: Currently all is cached, so should this be removed?
return true;
}
|
|
From: Tapio V. <aa...@us...> - 2010-10-19 18:16:48
|
Module: performous
Branch: master
Commit: 9a4963b4addf3fbb91b6114daa168182da8e52a4
Author: Tapio Vierros <tap...@gm...>
Date: Tue Oct 19 21:15:06 2010 +0300
Added a dummy screen_paths.
---
game/main.cc | 2 +
game/screen_intro.cc | 4 +--
game/screen_paths.cc | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++
game/screen_paths.hh | 26 +++++++++++++++++
4 files changed, 104 insertions(+), 3 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index f542705..a694de5 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -17,6 +17,7 @@
#include "screen_sing.hh"
#include "screen_practice.hh"
#include "screen_audiodevices.hh"
+#include "screen_paths.hh"
#include "screen_players.hh"
#include <boost/format.hpp>
@@ -151,6 +152,7 @@ void mainLoop(std::string const& songlist) {
sm.addScreen(new ScreenSing("Sing", audio, database, backgrounds));
sm.addScreen(new ScreenPractice("Practice", audio));
sm.addScreen(new ScreenAudioDevices("AudioDevices", audio));
+ sm.addScreen(new ScreenPaths("Paths", audio));
sm.addScreen(new ScreenPlayers("Players", audio, database));
sm.activateScreen("Intro");
sm.loading(_("Entering main menu"), 0.8);
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index bbf919c..1da49db 100644
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -135,7 +135,6 @@ void ScreenIntro::populateMenu() {
MenuOptions audiomenu;
MenuOptions gfxmenu;
MenuOptions gamemenu;
- MenuOptions pathsmenu; // FIXME: Dummy (just to get a gray option to the menu)
// Populate the submenus
for (Config::iterator it = config.begin(); it != config.end(); ++it) {
// Skip items that are configured elsewhere
@@ -153,8 +152,7 @@ void ScreenIntro::populateMenu() {
configmain.push_back(MenuOption(_("Audio"), _("Configure general audio settings"), audiomenu, "intro_configure.svg"));
configmain.push_back(MenuOption(_("Graphics"), _("Configure rendering and video settings"), gfxmenu, "intro_configure.svg"));
configmain.push_back(MenuOption(_("Game"), _("Gameplay related options"), gamemenu, "intro_configure.svg"));
- // FIXME: 'Paths' should open a screen
- configmain.push_back(MenuOption(_("Paths"), _("Setup song and data paths"), pathsmenu, "intro_configure.svg"));
+ configmain.push_back(MenuOption(_("Paths"), _("Setup song and data paths"), "Paths", "intro_configure.svg"));
configmain.back().image.reset(new Surface(getThemePath("intro_quit.svg")));
// Add to root menu
m_menu.add(MenuOption(_("Configure"), _("Configure audio and game options"), configmain, "intro_configure.svg"));
diff --git a/game/screen_paths.cc b/game/screen_paths.cc
new file mode 100644
index 0000000..9169e44
--- /dev/null
+++ b/game/screen_paths.cc
@@ -0,0 +1,75 @@
+#include "screen_paths.hh"
+
+#include "configuration.hh"
+#include "joystick.hh"
+#include "theme.hh"
+#include "audio.hh"
+#include "i18n.hh"
+#include <boost/thread.hpp>
+#include <boost/bind.hpp>
+
+namespace {
+ const float yoff = 0.18; // Offset from center where to place top row
+ const float xoff = 0.45; // Offset from middle where to place first column
+}
+
+ScreenPaths::ScreenPaths(std::string const& name, Audio& audio): Screen(name), m_audio(audio) {}
+
+void ScreenPaths::enter() {
+ m_theme.reset(new ThemeAudioDevices());
+ m_txtinp.text.clear();
+
+ // FIXME: Temp error message
+ ScreenManager::getSingletonPtr()->dialog(
+ _("This tool is not yet available.\n"
+ "Configure paths by adding them\n"
+ "as command line parameters and\n"
+ "then save them in configuration menu."));
+}
+
+void ScreenPaths::exit() { m_theme.reset(); }
+
+void ScreenPaths::manageEvent(SDL_Event event) {
+ ScreenManager* sm = ScreenManager::getSingletonPtr();
+ input::NavButton nav(input::getNav(event));
+ if (nav != input::NONE) {
+ if (nav == input::CANCEL || nav == input::SELECT) {
+ if (m_txtinp.text.empty()) sm->activateScreen("Intro");
+ else m_txtinp.text.clear();
+ }
+ else if (nav == input::PAUSE) m_audio.togglePause();
+ else if (nav == input::START) {
+ // TODO: Save config
+ sm->activateScreen("Intro");
+ }
+ } else if (event.type == SDL_KEYDOWN) {
+ return; // FIXME: Remove
+ SDLKey key = event.key.keysym.sym;
+ SDLMod modifier = event.key.keysym.mod;
+ if (m_txtinp.process(event.key.keysym)) /* Nop */ ;
+ // Reset to defaults
+ else if (key == SDLK_r && modifier & KMOD_CTRL) {
+ config["paths/songs"].reset(modifier & KMOD_ALT);
+ config["paths/system"].reset(modifier & KMOD_ALT);
+ // TODO: Save
+ }
+ }
+}
+
+void ScreenPaths::draw() {
+ if (!ScreenManager::getSingletonPtr()->isDialogOpen())
+ ScreenManager::getSingletonPtr()->activateScreen("Intro"); // FIXME: Remove
+
+ m_theme->bg.draw();
+
+ // Key help
+ m_theme->comment_bg.dimensions.stretch(1.0, 0.025).middle().screenBottom(-0.054);
+ m_theme->comment_bg.draw();
+ m_theme->comment.dimensions.left(-0.48).screenBottom(-0.067);
+ m_theme->comment.draw(_("Press any key to exit."));
+ // Additional info
+ m_theme->comment_bg.dimensions.middle().screenBottom(-0.01);
+ m_theme->comment_bg.draw();
+ m_theme->comment.dimensions.left(-0.48).screenBottom(-0.023);
+ m_theme->comment.draw(_("Windows users can also use ConfigureSongDirectory.bat in the bin-directory."));
+}
diff --git a/game/screen_paths.hh b/game/screen_paths.hh
new file mode 100644
index 0000000..3b739b6
--- /dev/null
+++ b/game/screen_paths.hh
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <map>
+#include <boost/scoped_ptr.hpp>
+#include "screen.hh"
+#include "textinput.hh"
+
+class Audio;
+class ThemeAudioDevices;
+
+/// options dialogue
+class ScreenPaths: public Screen {
+ public:
+ /// constructor
+ ScreenPaths(std::string const& name, Audio& m_audio);
+ void enter();
+ void exit();
+ void manageEvent(SDL_Event event);
+ void draw();
+
+ private:
+ Audio& m_audio;
+ boost::scoped_ptr<ThemeAudioDevices> m_theme;
+ TextInput m_txtinp;
+};
+
|
|
From: Tapio V. <aa...@us...> - 2010-10-19 17:53:34
|
Module: performous Branch: master Commit: 5d08902686b98595ac4dfebdb7c1b5ea0fceb146 Author: Tapio Vierros <tap...@gm...> Date: Tue Oct 19 20:52:04 2010 +0300 Remove unused stuff from background SVGs. --- data/backgrounds/blue_band.svg | 2305 +++---------------------------------- data/backgrounds/classic_bg.svg | 179 +--- data/backgrounds/default_bg.svg | 711 +------------ data/backgrounds/flying_notes.svg | 33 +- 4 files changed, 174 insertions(+), 3054 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-10-19 17:41:51
|
Module: performous Branch: master Commit: 5cdba099862b53b151fbe14d4c332f172c96b18e Author: Tapio Vierros <tap...@gm...> Date: Tue Oct 19 20:41:00 2010 +0300 Add two random backgrounds. --- data/backgrounds/blue_band.svg | 2320 +++++++++++++++++++++++++++++++++++++ data/backgrounds/flying_notes.svg | 361 ++++++ 2 files changed, 2681 insertions(+), 0 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-10-19 16:27:41
|
Module: performous
Branch: master
Commit: 3201b2c79c81fd27fd596b9371160f3a2640c574
Author: Tapio Vierros <tap...@gm...>
Date: Tue Oct 19 19:26:57 2010 +0300
Uses SVG caching also for non-theme files.
---
game/cache.cc | 10 +++++-----
game/cache.hh | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/game/cache.cc b/game/cache.cc
index babd3b2..e549763 100644
--- a/game/cache.cc
+++ b/game/cache.cc
@@ -10,13 +10,13 @@ namespace cache {
std::string const lod = (boost::format("%.2f") % factor).str();
std::string const cache_basename = svgfilename.filename() + ".cache_" + lod + ".png";
- // presently only theme resources are cachable, "true ||" makes sure the compiler optimize out the conditional code
- if(true || isThemeResource(svgfilename)){
+ if (isThemeResource(svgfilename)) {
std::string const theme_name = (config["game/theme"].s().empty() ? "default" : config["game/theme"].s());
cache_filename = getCacheDir() / "themes" / theme_name / cache_basename;
- }else {
- // RFC: is this a sensible "fallback"?
- cache_filename = getCacheDir() / "misc" / cache_basename;
+ } else {
+ // We use the full path under cache to avoid name collisions
+ // with images other than theme files (mostly backgrounds).
+ cache_filename = getCacheDir() / "misc" / svgfilename.parent_path() / cache_basename;
}
return cache_filename;
diff --git a/game/cache.hh b/game/cache.hh
index e45fd5d..564cd8b 100644
--- a/game/cache.hh
+++ b/game/cache.hh
@@ -23,8 +23,8 @@ namespace cache {
/** Given a path to an SVG the caching policy is returned **/
inline bool cachableSVGResource(fs::path const& svgfilename) {
- // currently only theme files are cachable
- return isThemeResource(svgfilename);
+ // FIXME: Currently all is cached, so should this be removed?
+ return true;
}
/** Load an SVG from the cache, if loading fails invalid_cache_error is thrown **/
|
|
From: Tapio V. <aa...@us...> - 2010-10-19 15:57:25
|
Module: performous Branch: master Commit: e31002373fb2ed366c88bddbfb7c30c025c044e7 Author: Tapio Vierros <tap...@gm...> Date: Tue Oct 19 18:52:10 2010 +0300 Drop karmic from ppa script. --- tools/ppa/ppa.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/ppa/ppa.sh b/tools/ppa/ppa.sh index e392fca..0f322e2 100755 --- a/tools/ppa/ppa.sh +++ b/tools/ppa/ppa.sh @@ -17,7 +17,7 @@ export DEBEMAIL="`gpg --list-keys | grep uid | sed 's/ *(.*)//; s/>.*//; s/.*[:< # Config PKG="performous" VERSIONCOMMON="0.5.1-9+git"`date '+%Y%m%d'`"~ppa1" -SUITES="karmic lucid maverick" +SUITES="lucid maverick" GITURL="git://git.performous.org/gitroot/performous/performous" DESTINATIONPPA="ppa:performous-team/ppa" |
|
From: Tapio V. <aa...@us...> - 2010-10-19 14:33:03
|
Module: performous Branch: master Commit: b9b699fa39d0a9ab0f999a58c4b4d2850ab42b5a Author: Tapio Vierros <tap...@gm...> Date: Tue Oct 19 17:31:33 2010 +0300 Add back dummy screen_configuration.* as a work-around for ppa troubles. --- game/screen_configuration.cc | 4 ++++ game/screen_configuration.hh | 4 ++++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/game/screen_configuration.cc b/game/screen_configuration.cc new file mode 100644 index 0000000..9b09ff0 --- /dev/null +++ b/game/screen_configuration.cc @@ -0,0 +1,4 @@ +// Dummy file +// The PPA deb packaging diff doesn't seem to know how to delete files, +// so this is here as a work-around to avoid compilation errors. +// If someone knows how to fix this, the ppa script is tools/ppa/ppa.sh diff --git a/game/screen_configuration.hh b/game/screen_configuration.hh new file mode 100644 index 0000000..9b09ff0 --- /dev/null +++ b/game/screen_configuration.hh @@ -0,0 +1,4 @@ +// Dummy file +// The PPA deb packaging diff doesn't seem to know how to delete files, +// so this is here as a work-around to avoid compilation errors. +// If someone knows how to fix this, the ppa script is tools/ppa/ppa.sh |
|
From: Yoda-JM <yo...@us...> - 2010-10-19 09:41:26
|
Module: performous
Branch: master
Commit: 052aa59e436fd5e457540432d3c384941a9e2ae3
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Oct 19 11:43:43 2010 +0200
Fixed error in previous commit (thank you gcc warning message)
---
game/song.hh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/song.hh b/game/song.hh
index c592271..3250442 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -74,7 +74,7 @@ class Song: boost::noncopyable {
return vocalTracks.find(TrackName::LEAD_VOCAL)->second;
} else {
if(!vocalTracks.empty()) {
- vocalTracks.begin()->second;
+ return vocalTracks.begin()->second;
} else {
return dummyVocal;
}
|
|
From: Yoda-JM <yo...@us...> - 2010-10-19 06:56:05
|
Module: performous
Branch: master
Commit: 809fbbc4b1c2d415e66e0a907b8caf6f9feb7655
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Oct 19 08:55:46 2010 +0200
Fixed problem when going from a multiple vocal track to a single one
---
game/song.hh | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/game/song.hh b/game/song.hh
index 2f62346..c592271 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -65,12 +65,20 @@ class Song: boost::noncopyable {
vocalTracks.erase(vocalTrack);
vocalTracks.insert(std::make_pair<std::string, VocalTrack>(vocalTrack, track));
};
- // Change default value to HARMONIC_{1,2,3} to sing harmonics
+ // Get a selected track, or LEAD_VOCAL if not found or the first one if not found
VocalTrack& getVocalTrack(std::string vocalTrack = TrackName::LEAD_VOCAL) {
if(vocalTracks.find(vocalTrack) != vocalTracks.end()) {
return vocalTracks.find(vocalTrack)->second;
} else {
- return dummyVocal;
+ if(vocalTracks.find(TrackName::LEAD_VOCAL) != vocalTracks.end()) {
+ return vocalTracks.find(TrackName::LEAD_VOCAL)->second;
+ } else {
+ if(!vocalTracks.empty()) {
+ vocalTracks.begin()->second;
+ } else {
+ return dummyVocal;
+ }
+ }
}
};
std::vector<std::string> getVocalTrackNames() {
|
|
From: Tapio V. <aa...@us...> - 2010-10-17 21:38:53
|
Module: performous
Branch: master
Commit: 396041e0c4cbd02b9c15178a57a14f19f92e2577
Author: Tapio Vierros <tap...@gm...>
Date: Mon Oct 18 00:37:13 2010 +0300
Reload current screen when doing fullscreen switch to counter graphics glitches.
---
game/main.cc | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index c5879a4..f542705 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -106,8 +106,11 @@ static void checkEvents_SDL(ScreenManager& sm) {
// Check for OpenGL errors
glutil::GLErrorChecker glerror;
}
- if( config["graphic/fullscreen"].b() != sm.window().getFullscreen() )
+ if (config["graphic/fullscreen"].b() != sm.window().getFullscreen()) {
sm.window().setFullscreen(config["graphic/fullscreen"].b());
+ // Reloading the screen seems to counter window going white on Windows and possibly OSX
+ sm.activateScreen(sm.getCurrentScreen()->getName());
+ }
}
void mainLoop(std::string const& songlist) {
|
|
From: Tapio V. <aa...@us...> - 2010-10-17 16:36:33
|
Module: performous
Branch: master
Commit: 909f06a59c14cb7b2f0e8dbc3b059cab0a8e25c2
Author: Tapio Vierros <tap...@gm...>
Date: Sun Oct 17 19:35:38 2010 +0300
Vocal track changer to pause menu.
---
game/configuration.cc | 2 +-
game/screen_sing.cc | 19 ++++++++++++++++++-
game/screen_sing.hh | 2 ++
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/game/configuration.cc b/game/configuration.cc
index e68516b..fdc1bcd 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -66,7 +66,7 @@ void ConfigItem::verifyType(std::string const& type) const {
for (Config::const_iterator it = config.begin(); it != config.end(); ++it) {
if (&it->second == this) { name = it->first; break; }
}
- if (m_type.empty()) throw std::logic_error("Config item " + name + " used in C++ but missing from config schema");
+ if (m_type.empty()) throw std::logic_error("Config item " + name + ", requested_type=" + type + " used in C++ but missing from config schema");
throw std::logic_error("Config item type mismatch: item=" + name + ", type=" + m_type + ", requested=" + type);
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 8f9d27a..c0c2c00 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -2,7 +2,6 @@
#include "songparser.hh"
#include "util.hh"
-#include "configuration.hh"
#include "screen_players.hh"
#include "fs.hh"
#include "database.hh"
@@ -118,6 +117,22 @@ void ScreenSing::enter() {
m_menu.clear();
m_menu.add(MenuOption(_("Resume"), _("Back to performing!")));
m_menu.add(MenuOption(_("Restart"), _("Start the song\nfrom the beginning"), "Sing"));
+ { // Vocal tracks
+ ConfigItem::OptionList opts;
+ std::vector<std::string> voctracks = m_song->getVocalTrackNames();
+ int cur = 0;
+ // Add vocal tracks to option list
+ for (std::vector<std::string>::const_iterator it = voctracks.begin(); it != voctracks.end(); ++it) {
+ if (m_selectedTrack == *it) cur = opts.size(); // Find the index of current track
+ opts.push_back(*it);
+ }
+ m_vocalTrackOpts = ConfigItem(opts); // Create a ConfigItem from the option list
+ if (opts.size() > 1) { // Vocal track changer only if there is options
+ m_vocalTrackOpts.select(cur); // Set the selection to current track
+ m_menu.add(MenuOption("", _("Change vocal track\n(restart required)"), &m_vocalTrackOpts));
+ m_menu.back().setDynamicName(m_selectedTrack); // Set the title to be dynamic
+ }
+ }
m_menu.add(MenuOption(_("Quit"), _("Exit to song browser"), "Songs"));
m_menu.close();
// Startup delay for instruments is longer than for singing only
@@ -287,6 +302,8 @@ void ScreenSing::manageEvent(SDL_Event event) {
if (nav == input::START) {
m_menu.action();
if (!m_menu.isOpen() && m_audio.isPaused()) m_audio.togglePause();
+ // Handle updates
+ if (m_selectedTrack != m_vocalTrackOpts.so()) m_selectedTrack = m_vocalTrackOpts.so();
return;
}
else if (nav == input::DOWN) { m_menu.move(1); return; }
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 6ea1fa0..447802d 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -15,6 +15,7 @@
#include "progressbar.hh"
#include "webcam.hh"
#include "screen_players.hh"
+#include "configuration.hh"
class Players;
class Audio;
@@ -95,5 +96,6 @@ class ScreenSing: public Screen {
bool m_only_singers_alive;
bool m_practmode;
std::string m_selectedTrack;
+ ConfigItem m_vocalTrackOpts;
};
|
|
From: Yoda-JM <yo...@us...> - 2010-10-17 10:20:54
|
Module: performous
Branch: master
Commit: cb93f69bd1510831595c457e656930bb8142e2a0
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Oct 17 12:20:29 2010 +0200
Simplified joystick axis management
---
game/joystick.cc | 51 +++++++++++++++++++++++++++------------------------
1 files changed, 27 insertions(+), 24 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 59791a4..c132f99 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -736,20 +736,24 @@ bool input::SDL::pushEvent(SDL_Event _e) {
if(!devices.find(joy_id)->second.assigned()) return false;
if (_e.jaxis.axis == 5 || _e.jaxis.axis == 6 || _e.jaxis.axis == 1) {
event.type = input::Event::PICK;
+ // Direction
+ if(_e.jaxis.value > 0 ) {
+ // down
+ event.button = 0;
+ devices.find(joy_id)->second.addEvent(event);
+ } else if(_e.jaxis.value < 0 ) {
+ // up
+ event.button = 1;
+ devices.find(joy_id)->second.addEvent(event);
+ }
+ break;
} else if (_e.jaxis.axis == 2 || (devices.find(joy_id)->second.name() == "GUITAR_ROCKBAND_XBOX360" && _e.jaxis.axis == 4)) {
- // nothing to do here
- } else if (devices.find(joy_id)->second.name() == "GUITAR_ROCKBAND_XBOX360" && _e.jaxis.axis == 3) { // <= WTF HERE !!!
- // nothing to do here
- } else {
- return false;
- }
- for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
- event.pressed[i] = devices.find(joy_id)->second.pressed(i);
- }
- // XBox RB guitar's Tilt sensor
- if (devices.find(joy_id)->second.name() == "GUITAR_ROCKBAND_XBOX360" && _e.jaxis.axis == 3) {
- event.button = input::GODMODE_BUTTON;
- if (_e.jaxis.value < -2) {
+ // Whammy bar (special case for XBox RB guitar
+ for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
+ event.pressed[i] = devices.find(joy_id)->second.pressed(i);
+ }
+ event.button = input::WHAMMY_BUTTON;
+ if (_e.jaxis.value > 0) {
event.type = input::Event::PRESS;
event.pressed[event.button] = true;
} else {
@@ -758,9 +762,13 @@ bool input::SDL::pushEvent(SDL_Event _e) {
}
devices.find(joy_id)->second.addEvent(event);
break;
- } else if (_e.jaxis.axis == 2 || (devices.find(joy_id)->second.name() == "GUITAR_ROCKBAND_XBOX360" && _e.jaxis.axis == 4)) {
- event.button = input::WHAMMY_BUTTON;
- if (_e.jaxis.value > 0) {
+ } else if (devices.find(joy_id)->second.name() == "GUITAR_ROCKBAND_XBOX360" && _e.jaxis.axis == 3) {
+ // XBox RB guitar's Tilt sensor
+ for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
+ event.pressed[i] = devices.find(joy_id)->second.pressed(i);
+ }
+ event.button = input::GODMODE_BUTTON;
+ if (_e.jaxis.value < -2) {
event.type = input::Event::PRESS;
event.pressed[event.button] = true;
} else {
@@ -769,15 +777,10 @@ bool input::SDL::pushEvent(SDL_Event _e) {
}
devices.find(joy_id)->second.addEvent(event);
break;
+ } else {
+ return false;
}
- // Direction
- if(_e.jaxis.value > 0 ) { // down
- event.button = 0;
- devices.find(joy_id)->second.addEvent(event);
- } else if(_e.jaxis.value < 0 ) { // up
- event.button = 1;
- devices.find(joy_id)->second.addEvent(event);
- }
+ // we should never be there
break;
case SDL_JOYHATMOTION:
joy_id = _e.jhat.which;
|
|
From: Yoda-JM <yo...@us...> - 2010-10-15 23:44:35
|
Module: performous
Branch: master
Commit: 690959a0adff79c29d65c62abf94ab888450f709
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Oct 16 01:44:11 2010 +0200
Prepared for vocal track configuration
---
game/screen_sing.cc | 10 +++++-----
game/screen_sing.hh | 4 +++-
game/song.hh | 8 ++++++++
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index c1d4cd1..8f9d27a 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -90,7 +90,7 @@ void ScreenSing::enter() {
m_progress->dimensions.fixedWidth(0.4).left(-0.5).screenTop();
theme->timer.dimensions.screenTop(0.5 * m_progress->dimensions.h());
boost::ptr_vector<Analyzer>& analyzers = m_audio.analyzers();
- m_layout_singer.reset(new LayoutSinger(m_song->getVocalTrack(), m_database, theme));
+ m_layout_singer.reset(new LayoutSinger(m_song->getVocalTrack(m_selectedTrack), m_database, theme));
// Load instrument and dance tracks
sm->loading(_("Loading instruments..."), 0.8);
{
@@ -124,7 +124,7 @@ void ScreenSing::enter() {
double setup_delay = (m_instruments.empty() && m_dancers.empty() ? -1.0 : -3.0);
sm->loading(_("Finalizing..."), 0.95);
m_audio.playMusic(m_song->music, false, 0.0, setup_delay);
- m_engine.reset(new Engine(m_audio, m_song->getVocalTrack(), analyzers.begin(), analyzers.end(), m_database));
+ m_engine.reset(new Engine(m_audio, m_song->getVocalTrack(m_selectedTrack), analyzers.begin(), analyzers.end(), m_database));
sm->loading(_("Loading complete"), 1.0);
// Notify about broken tracks
if (m_song->b0rkedTracks) ScreenManager::getSingletonPtr()->dialog(_("Song contains broken tracks!"));
@@ -293,7 +293,7 @@ void ScreenSing::manageEvent(SDL_Event event) {
else if (nav == input::UP) { m_menu.move(-1); return; }
}
// Start button has special functions for skipping things (only in singing for now)
- if (nav == input::START && m_only_singers_alive && !m_song->getVocalTrack().notes.empty() && !m_audio.isPaused()) {
+ if (nav == input::START && m_only_singers_alive && !m_song->getVocalTrack(m_selectedTrack).notes.empty() && !m_audio.isPaused()) {
// Open score dialog early
if (status == Song::FINISHED) {
m_engine->kill(); // Kill the engine thread
@@ -311,7 +311,7 @@ void ScreenSing::manageEvent(SDL_Event event) {
}
// Ctrl combinations that can be used while performing (not when score dialog is displayed)
if (event.type == SDL_KEYDOWN && (event.key.keysym.mod & KMOD_CTRL) && !m_score_window.get()) {
- if (key == SDLK_s) m_audio.toggleSynth(m_song->getVocalTrack().notes);
+ if (key == SDLK_s) m_audio.toggleSynth(m_song->getVocalTrack(m_selectedTrack).notes);
if (key == SDLK_v) m_audio.streamFade("vocals", event.key.keysym.mod & KMOD_SHIFT ? 1.0 : 0.0);
if (key == SDLK_k) dispInFlash(++config["game/karaoke_mode"]); // Toggle karaoke mode
if (key == SDLK_w) dispInFlash(++config["game/pitch"]); // Toggle pitch wave
@@ -453,7 +453,7 @@ void ScreenSing::draw() {
statustxt = (boost::format("%02u:%02u - %s") % (t / 60) % (t % 60) % section.name).str();
} else statustxt = (boost::format("%02u:%02u") % (t / 60) % (t % 60)).str();
- if (!m_score_window.get() && m_only_singers_alive && !m_song->getVocalTrack().notes.empty()) {
+ if (!m_score_window.get() && m_only_singers_alive && !m_song->getVocalTrack(m_selectedTrack).notes.empty()) {
if (status == Song::INSTRUMENTAL_BREAK) statustxt += _(" ENTER to skip instrumental break");
if (status == Song::FINISHED && !config["game/karaoke_mode"].b()) statustxt += _(" Remember to wait for grading!");
}
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index d753185..6ea1fa0 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -48,7 +48,8 @@ class ScreenSing: public Screen {
public:
/// constructor
ScreenSing(std::string const& name, Audio& audio, Database& database, Backgrounds& bgs):
- Screen(name), m_audio(audio), m_database(database), m_backgrounds(bgs), m_latencyAV(), m_only_singers_alive(true), m_practmode(false)
+ Screen(name), m_audio(audio), m_database(database), m_backgrounds(bgs), m_latencyAV(), m_only_singers_alive(true), m_practmode(false),
+ m_selectedTrack(TrackName::LEAD_VOCAL)
{}
void enter();
void exit();
@@ -93,5 +94,6 @@ class ScreenSing: public Screen {
AnimValue m_quitTimer;
bool m_only_singers_alive;
bool m_practmode;
+ std::string m_selectedTrack;
};
diff --git a/game/song.hh b/game/song.hh
index 58f2546..2f62346 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -3,6 +3,7 @@
#include "notes.hh"
#include "i18n.hh"
#include <boost/noncopyable.hpp>
+#include <boost/foreach.hpp>
#include <stdexcept>
#include <string>
@@ -72,6 +73,13 @@ class Song: boost::noncopyable {
return dummyVocal;
}
};
+ std::vector<std::string> getVocalTrackNames() {
+ std::vector<std::string> result;
+ BOOST_FOREACH(VocalTracks::value_type &it, vocalTracks) {
+ result.push_back(it.first);
+ }
+ return result;
+ }
InstrumentTracks instrumentTracks; ///< guitar etc. notes for this song
DanceTracks danceTracks; ///< dance tracks
bool hasDance() const { return !danceTracks.empty(); }
|
|
From: Yoda-JM <yo...@us...> - 2010-10-15 23:21:57
|
Module: performous
Branch: master
Commit: 79b00f49b92cf507ec2b4c4482d40d3f1e61042b
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Oct 16 01:21:32 2010 +0200
Created path to songlist dumping
---
game/songs.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/songs.cc b/game/songs.cc
index e8e76d4..038c24d 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -273,7 +273,7 @@ void Songs::dumpSongs_internal() const {
SongVector svec = m_songs;
std::sort(svec.begin(), svec.end(), comparator(&Song::collateByArtist));
fs::path coverpath = fs::path(m_songlist) / "covers";
- fs::create_directory(coverpath);
+ fs::create_directories(coverpath);
dumpXML(svec, m_songlist + "/songlist.xml");
}
|
|
From: Yoda-JM <yo...@us...> - 2010-10-08 14:00:40
|
Module: performous
Branch: master
Commit: d756b8e1514b656f11b657441551bebb49146da6
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Oct 8 16:01:21 2010 +0200
Enabled multiple midi vocal tracks management
---
game/song.cc | 14 +++++++-------
game/song.hh | 22 +++++++++++++++++-----
game/songparser-ini.cc | 9 ++-------
game/songparser-txt.cc | 6 +++---
4 files changed, 29 insertions(+), 22 deletions(-)
diff --git a/game/song.cc b/game/song.cc
index 901e3cb..2795a43 100644
--- a/game/song.cc
+++ b/game/song.cc
@@ -7,7 +7,7 @@
void Song::reload(bool errorIgnore) {
loadStatus = NONE;
- vocals.reload();
+ vocalTracks.clear();
instrumentTracks.clear();
beats.clear();
midifilename.clear();
@@ -37,9 +37,9 @@ void Song::reload(bool errorIgnore) {
void Song::dropNotes() {
// Singing
- if (!vocals.notes.empty()) {
- vocals.notes.clear();
- vocals.notes.push_back(Note()); // Dummy note to indicate there is a track
+ if (!vocalTracks.empty()) {
+ for (VocalTracks::iterator it = vocalTracks.begin(); it != vocalTracks.end(); ++it)
+ it->second.notes.clear();
}
// Instruments
if (!instrumentTracks.empty()) {
@@ -71,10 +71,10 @@ namespace {
bool noteEndLessThan(Note const& a, Note const& b) { return a.end < b.end; }
}
-Song::Status Song::status(double time) const {
+Song::Status Song::status(double time) {
Note target; target.end = time;
- Notes::const_iterator it = std::lower_bound(vocals.notes.begin(), vocals.notes.end(), target, noteEndLessThan);
- if (it == vocals.notes.end()) return FINISHED;
+ Notes::const_iterator it = std::lower_bound(getVocalTrack().notes.begin(), getVocalTrack().notes.end(), target, noteEndLessThan);
+ if (it == getVocalTrack().notes.end()) return FINISHED;
if (it->begin > time + 4.0) return INSTRUMENTAL_BREAK;
return NORMAL;
}
diff --git a/game/song.hh b/game/song.hh
index 75c96f7..58f2546 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -38,10 +38,11 @@ namespace TrackName {
/// class to load and parse songfiles
class Song: boost::noncopyable {
friend class SongParser;
- VocalTrack vocals; ///< notes for the sing part
+ VocalTracks vocalTracks; ///< notes for the sing part
+ VocalTrack dummyVocal; ///< notes for the sing part
public:
/// constructor
- Song(std::string const& path_, std::string const& filename_): vocals(TrackName::LEAD_VOCAL), path(path_), filename(filename_) { reload(false); }
+ Song(std::string const& path_, std::string const& filename_): dummyVocal(TrackName::LEAD_VOCAL), path(path_), filename(filename_) { reload(false); }
/// reload song
void reload(bool errorIgnore = true);
/// parse field
@@ -57,15 +58,26 @@ class Song: boost::noncopyable {
/// status of song
enum Status { NORMAL, INSTRUMENTAL_BREAK, FINISHED };
/** Get the song status at a given timestamp **/
- Status status(double time) const;
+ Status status(double time);
int randomIdx; ///< sorting index used for random order
- VocalTrack& getVocalTrack(std::string vocalTrack = TrackName::LEAD_VOCAL) { (void) vocalTrack; return vocals; };
+ void insertVocalTrack(std::string vocalTrack, VocalTrack track) {
+ vocalTracks.erase(vocalTrack);
+ vocalTracks.insert(std::make_pair<std::string, VocalTrack>(vocalTrack, track));
+ };
+ // Change default value to HARMONIC_{1,2,3} to sing harmonics
+ VocalTrack& getVocalTrack(std::string vocalTrack = TrackName::LEAD_VOCAL) {
+ if(vocalTracks.find(vocalTrack) != vocalTracks.end()) {
+ return vocalTracks.find(vocalTrack)->second;
+ } else {
+ return dummyVocal;
+ }
+ };
InstrumentTracks instrumentTracks; ///< guitar etc. notes for this song
DanceTracks danceTracks; ///< dance tracks
bool hasDance() const { return !danceTracks.empty(); }
bool hasDrums() const { return instrumentTracks.find(TrackName::DRUMS) != instrumentTracks.end(); }
bool hasGuitars() const { return instrumentTracks.size() - hasDrums(); }
- bool hasVocals() const { return !vocals.notes.empty(); }
+ bool hasVocals() const { return !vocalTracks.empty(); }
std::string path; ///< path of songfile
std::string filename; ///< name of songfile
std::string midifilename; ///< name of midi file in FoF format
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 5839255..398b092 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -24,11 +24,9 @@ namespace {
}
bool isVocalTrack(std::string name) {
if(name == TrackName::LEAD_VOCAL) return true;
- /*
else if(name == TrackName::HARMONIC_1) return true;
else if(name == TrackName::HARMONIC_2) return true;
else if(name == TrackName::HARMONIC_3) return true;
- */
return false;
}
/// Change the MIDI track name to Performous track name
@@ -46,11 +44,9 @@ namespace {
else if (name == "BASS") name = TrackName::BASS;
else if (name == "GUITAR") name = TrackName::GUITAR;
else if (name == "VOCALS") name = TrackName::LEAD_VOCAL;
- /*
else if (name == "HARM1") name = TrackName::HARMONIC_1;
else if (name == "HARM2") name = TrackName::HARMONIC_2;
else if (name == "HARM3") name = TrackName::HARMONIC_3;
- */
else return false;
return true;
}
@@ -126,7 +122,7 @@ void SongParser::iniParseHeader() {
else if (midi.tracks.size() == 1) name = TrackName::GUITAR; // Original (old) FoF songs only have one track
else continue; // not a valid track
// Add dummy notes to tracks so that they can be seen in song browser
- if (isVocalTrack(name)) s.getVocalTrack().notes.push_back(Note());
+ if (isVocalTrack(name)) s.insertVocalTrack(name, VocalTrack(name));
else {
for (MidiFileParser::NoteMap::const_iterator it2 = it->notes.begin(); it2 != it->notes.end(); ++it2) {
// If a track has not enough notes on any level, ignore it
@@ -270,8 +266,7 @@ void SongParser::iniParse() {
}
}
}
- s.getVocalTrack().notes.clear();
- s.getVocalTrack() = vocal;
+ s.insertVocalTrack(name, vocal);
}
}
// Figure out if we have BRE in the song
diff --git a/game/songparser-txt.cc b/game/songparser-txt.cc
index f658e07..fd9d451 100644
--- a/game/songparser-txt.cc
+++ b/game/songparser-txt.cc
@@ -22,20 +22,20 @@ void SongParser::txtParseHeader() {
while (getline(line) && txtParseField(line)) {}
if (s.title.empty() || s.artist.empty()) throw std::runtime_error("Required header fields missing");
if (m_bpm != 0.0) addBPM(0, m_bpm);
- s.getVocalTrack().notes.push_back(Note()); // Dummy note to indicate there is a track
+ s.insertVocalTrack(TrackName::LEAD_VOCAL, VocalTrack(TrackName::LEAD_VOCAL)); // Dummy note to indicate there is a track
}
/// Parse notes
void SongParser::txtParse() {
std::string line;
- VocalTrack &vocal = m_song.getVocalTrack();
- vocal.notes.clear();
+ VocalTrack vocal(TrackName::LEAD_VOCAL);
while (getline(line) && txtParseField(line)) {} // Parse the header again
if (m_bpm != 0.0) addBPM(0, m_bpm);
while (txtParseNote(line, vocal) && getline(line)) {} // Parse notes
// Workaround for the terminating : 1 0 0 line, written by some converters
if (!vocal.notes.empty() && vocal.notes.back().type != Note::SLEEP
&& vocal.notes.back().begin == vocal.notes.back().end) vocal.notes.pop_back();
+ m_song.insertVocalTrack(TrackName::LEAD_VOCAL, vocal);
}
bool SongParser::txtParseField(std::string const& line) {
|
|
From: Yoda-JM <yo...@us...> - 2010-10-08 13:11:28
|
Module: performous
Branch: master
Commit: 0db9cd04f01640248cfdc70d38debe000da28601
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Oct 8 15:12:26 2010 +0200
Changed vocal tracks visibility, fixed bug crashing when midi song has multiple vocal tracks
---
game/guitargraph.cc | 2 +-
game/screen_players.cc | 2 +-
game/screen_sing.cc | 10 +++++-----
game/song.hh | 3 ++-
game/songparser-ini.cc | 8 +++++---
game/songparser-txt.cc | 4 ++--
game/songparser.cc | 15 ++++++++-------
7 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index fdbbcc2..16d89d0 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -239,7 +239,7 @@ void GuitarGraph::changeDifficulty(int dir) {
void GuitarGraph::difficultyAuto(bool tryKeep) {
if (tryKeep && difficulty(Difficulty(m_level))) return;
for (int level = 0; level < DIFFICULTYCOUNT; ++level) if (difficulty(Difficulty(level))) return;
- throw std::runtime_error("No difficulty levels found");
+ throw std::runtime_error("No difficulty levels found for track " + m_track_index->first);
}
/// Attempt to use a given difficulty level
diff --git a/game/screen_players.cc b/game/screen_players.cc
index 680a075..5f0c867 100644
--- a/game/screen_players.cc
+++ b/game/screen_players.cc
@@ -23,7 +23,7 @@ ScreenPlayers::ScreenPlayers(std::string const& name, Audio& audio, Database& da
}
void ScreenPlayers::enter() {
- m_layout_singer.reset(new LayoutSinger(m_song->vocals, m_database));
+ m_layout_singer.reset(new LayoutSinger(m_song->getVocalTrack(), m_database));
theme.reset(new ThemeSongs());
m_emptyCover.reset(new Surface(getThemePath("no_player_image.svg")));
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 4509b47..c1d4cd1 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -90,7 +90,7 @@ void ScreenSing::enter() {
m_progress->dimensions.fixedWidth(0.4).left(-0.5).screenTop();
theme->timer.dimensions.screenTop(0.5 * m_progress->dimensions.h());
boost::ptr_vector<Analyzer>& analyzers = m_audio.analyzers();
- m_layout_singer.reset(new LayoutSinger(m_song->vocals, m_database, theme));
+ m_layout_singer.reset(new LayoutSinger(m_song->getVocalTrack(), m_database, theme));
// Load instrument and dance tracks
sm->loading(_("Loading instruments..."), 0.8);
{
@@ -124,7 +124,7 @@ void ScreenSing::enter() {
double setup_delay = (m_instruments.empty() && m_dancers.empty() ? -1.0 : -3.0);
sm->loading(_("Finalizing..."), 0.95);
m_audio.playMusic(m_song->music, false, 0.0, setup_delay);
- m_engine.reset(new Engine(m_audio, m_song->vocals, analyzers.begin(), analyzers.end(), m_database));
+ m_engine.reset(new Engine(m_audio, m_song->getVocalTrack(), analyzers.begin(), analyzers.end(), m_database));
sm->loading(_("Loading complete"), 1.0);
// Notify about broken tracks
if (m_song->b0rkedTracks) ScreenManager::getSingletonPtr()->dialog(_("Song contains broken tracks!"));
@@ -293,7 +293,7 @@ void ScreenSing::manageEvent(SDL_Event event) {
else if (nav == input::UP) { m_menu.move(-1); return; }
}
// Start button has special functions for skipping things (only in singing for now)
- if (nav == input::START && m_only_singers_alive && !m_song->vocals.notes.empty() && !m_audio.isPaused()) {
+ if (nav == input::START && m_only_singers_alive && !m_song->getVocalTrack().notes.empty() && !m_audio.isPaused()) {
// Open score dialog early
if (status == Song::FINISHED) {
m_engine->kill(); // Kill the engine thread
@@ -311,7 +311,7 @@ void ScreenSing::manageEvent(SDL_Event event) {
}
// Ctrl combinations that can be used while performing (not when score dialog is displayed)
if (event.type == SDL_KEYDOWN && (event.key.keysym.mod & KMOD_CTRL) && !m_score_window.get()) {
- if (key == SDLK_s) m_audio.toggleSynth(m_song->vocals.notes);
+ if (key == SDLK_s) m_audio.toggleSynth(m_song->getVocalTrack().notes);
if (key == SDLK_v) m_audio.streamFade("vocals", event.key.keysym.mod & KMOD_SHIFT ? 1.0 : 0.0);
if (key == SDLK_k) dispInFlash(++config["game/karaoke_mode"]); // Toggle karaoke mode
if (key == SDLK_w) dispInFlash(++config["game/pitch"]); // Toggle pitch wave
@@ -453,7 +453,7 @@ void ScreenSing::draw() {
statustxt = (boost::format("%02u:%02u - %s") % (t / 60) % (t % 60) % section.name).str();
} else statustxt = (boost::format("%02u:%02u") % (t / 60) % (t % 60)).str();
- if (!m_score_window.get() && m_only_singers_alive && !m_song->vocals.notes.empty()) {
+ if (!m_score_window.get() && m_only_singers_alive && !m_song->getVocalTrack().notes.empty()) {
if (status == Song::INSTRUMENTAL_BREAK) statustxt += _(" ENTER to skip instrumental break");
if (status == Song::FINISHED && !config["game/karaoke_mode"].b()) statustxt += _(" Remember to wait for grading!");
}
diff --git a/game/song.hh b/game/song.hh
index 0c08df9..75c96f7 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -38,6 +38,7 @@ namespace TrackName {
/// class to load and parse songfiles
class Song: boost::noncopyable {
friend class SongParser;
+ VocalTrack vocals; ///< notes for the sing part
public:
/// constructor
Song(std::string const& path_, std::string const& filename_): vocals(TrackName::LEAD_VOCAL), path(path_), filename(filename_) { reload(false); }
@@ -58,7 +59,7 @@ class Song: boost::noncopyable {
/** Get the song status at a given timestamp **/
Status status(double time) const;
int randomIdx; ///< sorting index used for random order
- VocalTrack vocals; ///< notes for the sing part
+ VocalTrack& getVocalTrack(std::string vocalTrack = TrackName::LEAD_VOCAL) { (void) vocalTrack; return vocals; };
InstrumentTracks instrumentTracks; ///< guitar etc. notes for this song
DanceTracks danceTracks; ///< dance tracks
bool hasDance() const { return !danceTracks.empty(); }
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index c63f4e7..5839255 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -46,9 +46,11 @@ namespace {
else if (name == "BASS") name = TrackName::BASS;
else if (name == "GUITAR") name = TrackName::GUITAR;
else if (name == "VOCALS") name = TrackName::LEAD_VOCAL;
+ /*
else if (name == "HARM1") name = TrackName::HARMONIC_1;
else if (name == "HARM2") name = TrackName::HARMONIC_2;
else if (name == "HARM3") name = TrackName::HARMONIC_3;
+ */
else return false;
return true;
}
@@ -124,7 +126,7 @@ void SongParser::iniParseHeader() {
else if (midi.tracks.size() == 1) name = TrackName::GUITAR; // Original (old) FoF songs only have one track
else continue; // not a valid track
// Add dummy notes to tracks so that they can be seen in song browser
- if (isVocalTrack(name)) s.vocals.notes.push_back(Note());
+ if (isVocalTrack(name)) s.getVocalTrack().notes.push_back(Note());
else {
for (MidiFileParser::NoteMap::const_iterator it2 = it->notes.begin(); it2 != it->notes.end(); ++it2) {
// If a track has not enough notes on any level, ignore it
@@ -268,8 +270,8 @@ void SongParser::iniParse() {
}
}
}
- s.vocals.notes.clear();
- s.vocals = vocal;
+ s.getVocalTrack().notes.clear();
+ s.getVocalTrack() = vocal;
}
}
// Figure out if we have BRE in the song
diff --git a/game/songparser-txt.cc b/game/songparser-txt.cc
index bbd014c..f658e07 100644
--- a/game/songparser-txt.cc
+++ b/game/songparser-txt.cc
@@ -22,13 +22,13 @@ void SongParser::txtParseHeader() {
while (getline(line) && txtParseField(line)) {}
if (s.title.empty() || s.artist.empty()) throw std::runtime_error("Required header fields missing");
if (m_bpm != 0.0) addBPM(0, m_bpm);
- s.vocals.notes.push_back(Note()); // Dummy note to indicate there is a track
+ s.getVocalTrack().notes.push_back(Note()); // Dummy note to indicate there is a track
}
/// Parse notes
void SongParser::txtParse() {
std::string line;
- VocalTrack &vocal = m_song.vocals;
+ VocalTrack &vocal = m_song.getVocalTrack();
vocal.notes.clear();
while (getline(line) && txtParseField(line)) {} // Parse the header again
if (m_bpm != 0.0) addBPM(0, m_bpm);
diff --git a/game/songparser.cc b/game/songparser.cc
index af47a6d..3728d8e 100644
--- a/game/songparser.cc
+++ b/game/songparser.cc
@@ -117,18 +117,19 @@ SongParser::SongParser(Song& s):
void SongParser::finalize() {
// Adjust negative notes
- if (m_song.vocals.noteMin <= 0) {
- unsigned int shift = (1 - m_song.vocals.noteMin / 12) * 12;
- m_song.vocals.noteMin += shift;
- m_song.vocals.noteMax += shift;
- for (Notes::iterator it = m_song.vocals.notes.begin(); it != m_song.vocals.notes.end(); ++it) {
+ VocalTrack& vocal = m_song.getVocalTrack();
+ if (vocal.noteMin <= 0) {
+ unsigned int shift = (1 - vocal.noteMin / 12) * 12;
+ vocal.noteMin += shift;
+ vocal.noteMax += shift;
+ for (Notes::iterator it = vocal.notes.begin(); it != vocal.notes.end(); ++it) {
it->note += shift;
it->notePrev += shift;
}
}
// Set begin/end times
- if (!m_song.vocals.notes.empty()) m_song.vocals.beginTime = m_song.vocals.notes.front().begin, m_song.vocals.endTime = m_song.vocals.notes.back().end;
- m_song.vocals.m_scoreFactor = 1.0 / m_maxScore;
+ if (!vocal.notes.empty()) vocal.beginTime = vocal.notes.front().begin, vocal.endTime = vocal.notes.back().end;
+ vocal.m_scoreFactor = 1.0 / m_maxScore;
if (m_tsPerBeat) {
// Add song beat markers
for (unsigned ts = 0; ts < m_tsEnd; ts += m_tsPerBeat) m_song.beats.push_back(tsTime(ts));
|
|
From: Yoda-JM <yo...@us...> - 2010-10-07 23:13:41
|
Module: performous
Branch: master
Commit: 19d943858ea45fbb994cdab33a170bee552df1f9
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Oct 8 01:13:12 2010 +0200
Added debug message on broken tracks
---
game/songparser-ini.cc | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 8711c40..c63f4e7 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -174,6 +174,10 @@ void SongParser::iniParse() {
if (durCount <= 20) {
s.b0rkedTracks = true;
nm2.clear();
+ std::ostringstream oss;
+ oss << "Track " << name << " is broken in ";
+ oss << s.path << s.midifilename << std::endl;
+ std::clog << "songparser/warning: " << oss.str(); // More likely to be atomic when written as one string
s.instrumentTracks.erase(name);
}
} else {
|
|
From: Yoda-JM <yo...@us...> - 2010-10-07 23:13:38
|
Module: performous Branch: master Commit: 9afa8a95af41ac092e0a5add1b1c673a97a6d408 Author: Vincent Le Ligeour <yo...@us...> Date: Thu Oct 7 15:14:59 2010 +0200 Renamed vocals to vocal when only one track is expected in the near future --- game/engine.hh | 16 ++-- game/layout_singer.cc | 10 ++-- game/layout_singer.hh | 4 +- game/notegraph.cc | 42 ++++++------ game/notegraph.hh | 4 +- game/player.cc | 20 +++--- game/player.hh | 6 +- game/songparser-ini.cc | 176 +++++++++++++++++++++++------------------------- 8 files changed, 135 insertions(+), 143 deletions(-) |
|
From: Yoda-JM <yo...@us...> - 2010-10-07 23:13:36
|
Module: performous
Branch: master
Commit: 826c167fc46761d14cecf606c998692ff2b9d0e5
Author: Vincent Le Ligeour <yo...@us...>
Date: Thu Oct 7 13:57:24 2010 +0200
Enhanced multiple singer midi parsing, Fixed midi parsing bug
---
game/midifile.cc | 2 +-
game/notes.hh | 2 +-
game/song.hh | 8 ++++++--
game/songparser-ini.cc | 19 +++++++++++++++----
4 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/game/midifile.cc b/game/midifile.cc
index 0317473..5272165 100644
--- a/game/midifile.cc
+++ b/game/midifile.cc
@@ -317,7 +317,7 @@ void MidiFileParser::process_midi_event(Track& track, uint8_t t, uint8_t arg1, u
pitch.push_back(Note(miditime));
}
// special management for lyrics
- if (track.name == "PART VOCALS") {
+ if (track.name == "PART VOCALS" || track.name == "PART HARM1" || track.name == "PART HARM2" || track.name == "PART HARM3") {
// Discard note effects
if( arg1 < 20 ) return;
if (t == 8 || (t == 9 && arg2 == 0)) {
diff --git a/game/notes.hh b/game/notes.hh
index ac8838c..4c67bae 100644
--- a/game/notes.hh
+++ b/game/notes.hh
@@ -122,7 +122,7 @@ struct VocalTrack {
MusicalScale scale; ///< scale in which song is sung
};
-typedef std::map<std::string, VocalTrack> VocalsTracks;
+typedef std::map<std::string, VocalTrack> VocalTracks;
struct DanceTrack {
DanceTrack(std::string& description, Notes& notes);
diff --git a/game/song.hh b/game/song.hh
index d753084..0c08df9 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -26,8 +26,12 @@ namespace TrackName {
const std::string GUITAR_RHYTHM = "Rhythm guitar";
const std::string BASS = "Bass";
const std::string DRUMS = "Drums";
+ const std::string LEAD_VOCAL = "Vocals";
+ const std::string HARMONIC_1 = "Harmonic 1";
+ const std::string HARMONIC_2 = "Harmonic 2";
+ const std::string HARMONIC_3 = "Harmonic 3";
#if 0 // Here is some dummy gettext calls to populate the dictionary
- _("Guitar") _("Coop guitar") _("Rhythm guitar") _("Bass") _("Drums")
+ _("Guitar") _("Coop guitar") _("Rhythm guitar") _("Bass") _("Drums") _("Vocals") _("Harmonic 1") _("Harmonic 2") _("Harmonic 3")
#endif
}
@@ -36,7 +40,7 @@ class Song: boost::noncopyable {
friend class SongParser;
public:
/// constructor
- Song(std::string const& path_, std::string const& filename_): vocals(std::string("VOCALS")), path(path_), filename(filename_) { reload(false); }
+ Song(std::string const& path_, std::string const& filename_): vocals(TrackName::LEAD_VOCAL), path(path_), filename(filename_) { reload(false); }
/// reload song
void reload(bool errorIgnore = true);
/// parse field
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index cdba2ad..a331f54 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -22,6 +22,15 @@ namespace {
std::string f = s.path + filename;
if (boost::filesystem::exists(f)) s.music[trackid] = f;
}
+ bool isVocalTrack(std::string name) {
+ if(name == TrackName::LEAD_VOCAL) return true;
+ /*
+ else if(name == TrackName::HARMONIC_1) return true;
+ else if(name == TrackName::HARMONIC_2) return true;
+ else if(name == TrackName::HARMONIC_3) return true;
+ */
+ return false;
+ }
/// Change the MIDI track name to Performous track name
/// Return false if not valid
bool mangleTrackName(std::string& name) {
@@ -36,7 +45,10 @@ namespace {
else if (name == "DRUMS") name = TrackName::DRUMS;
else if (name == "BASS") name = TrackName::BASS;
else if (name == "GUITAR") name = TrackName::GUITAR;
- else if (name == "VOCALS") return true;
+ else if (name == "VOCALS") name = TrackName::LEAD_VOCAL;
+ else if (name == "HARM1") name = TrackName::HARMONIC_1;
+ else if (name == "HARM2") name = TrackName::HARMONIC_2;
+ else if (name == "HARM3") name = TrackName::HARMONIC_3;
else return false;
return true;
}
@@ -112,7 +124,7 @@ void SongParser::iniParseHeader() {
else if (midi.tracks.size() == 1) name = TrackName::GUITAR; // Original (old) FoF songs only have one track
else continue;
// Add dummy notes to tracks so that they can be seen in song browser
- if (name == "VOCALS") s.vocals.notes.push_back(Note());
+ if (isVocalTrack(name)) s.vocals.notes.push_back(Note());
else {
for (MidiFileParser::NoteMap::const_iterator it2 = it->notes.begin(); it2 != it->notes.end(); ++it2) {
// If a track has not enough notes on any level, ignore it
@@ -137,7 +149,7 @@ void SongParser::iniParse() {
else if (midi.tracks.size() == 1) name = TrackName::GUITAR; // Original (old) FoF songs only have one track
else continue;
// Process non-vocal tracks
- if (name != "VOCALS") {
+ if (!isVocalTrack(name)) {
int durCount = 0;
s.instrumentTracks.insert(make_pair(name,InstrumentTrack(name)));
NoteMap& nm2 = s.instrumentTracks.find(name)->second.nm;
@@ -254,7 +266,6 @@ void SongParser::iniParse() {
}
}
}
- if (!vocal.notes.empty()) break;
}
// Figure out if we have BRE in the song
for (MidiFileParser::CommandEvents::const_iterator it = midi.cmdevents.begin(); it != midi.cmdevents.end(); ++it) {
|