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-07-18 13:46:19
|
Module: performous
Branch: portaudio
Commit: e94fa6f85f83b4490ec5a6873e5a4d8d38277677
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jul 18 16:45:32 2010 +0300
Allow spaces before key start in key=value parser.
---
game/audio.cc | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 3d34946..b92264f 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -29,11 +29,11 @@ namespace {
continue;
}
// Space in key (bad)
- if (st[i] == ' ' && parsing_key)
- throw std::logic_error("Error: Space in key in string: " + st);
+ if (st[i] == ' ' && parsing_key && !key.empty())
+ throw std::logic_error("Space in key in string: " + st);
// Value start
if (st[i] == '=' && !inside_quotes) {
- if (key.empty()) throw std::logic_error("Error: Empty key in string: " + st);
+ if (key.empty()) throw std::logic_error("Empty key in string: " + st);
parsing_key = false;
continue;
}
|
|
From: Tapio V. <aa...@us...> - 2010-07-18 13:42:33
|
Module: performous
Branch: portaudio
Commit: 10510c64c4bed76a1b7c4a3c3cdb5087625c0164
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jul 18 16:42:05 2010 +0300
Parse quoted strings.
---
game/audio.cc | 64 +++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 51 insertions(+), 13 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 3d85777..3d34946 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -9,6 +9,45 @@
#include <libda/portaudio.hpp>
#include <cmath>
#include <iostream>
+#include <map>
+
+namespace {
+ std::map<std::string, std::string> parseKeyValuePairs(const std::string& st) {
+ std::map<std::string, std::string> ret;
+ bool inside_quotes = false;
+ int parsing_key = true;
+ std::string key = "", value = "";
+ for (size_t i = 0; i < st.size(); ++i) {
+ // Quotes
+ if (st[i] == '"') { inside_quotes = !inside_quotes; continue; }
+ // Value end
+ if (st[i] == ' ' && !inside_quotes && !parsing_key) {
+ if (value.empty()) continue; // Skip whitespace after equals sign
+ ret[key] = value;
+ key = ""; value = "";
+ parsing_key = true;
+ continue;
+ }
+ // Space in key (bad)
+ if (st[i] == ' ' && parsing_key)
+ throw std::logic_error("Error: Space in key in string: " + st);
+ // Value start
+ if (st[i] == '=' && !inside_quotes) {
+ if (key.empty()) throw std::logic_error("Error: Empty key in string: " + st);
+ parsing_key = false;
+ continue;
+ }
+ // Key start
+ if (st[i] != ' ' && parsing_key) { key += st[i]; continue; }
+ // If we got here, it is value
+ value += st[i];
+ }
+ // Handle last key
+ if (!key.empty()) ret[key] = value;
+ return ret;
+ }
+}
+
class Music {
struct Track {
@@ -267,25 +306,24 @@ struct Audio::Impl {
} params = Params();
params.rate = 48000;
// Break into tokens:
- std::istringstream iss(*it);
- for (std::string token; std::getline(iss, token, ' '); ) {
- // Parse key=value
- std::istringstream iss2(token);
- std::string key;
- std::getline(iss2, key, '=');
- if (key == "out") iss2 >> params.out;
- else if (key == "in") iss2 >> params.in;
- else if (key == "rate") iss2 >> params.rate;
- else if (key == "dev") std::getline(iss2, params.dev);
+ std::map<std::string, std::string> keyvalues = parseKeyValuePairs(*it);
+ for (std::map<std::string, std::string>::const_iterator it2 = keyvalues.begin();
+ it2 != keyvalues.end(); ++it2) {
+ // Handle keys
+ std::string key = it2->first;
+ std::istringstream iss(it2->second);
+ if (key == "out") iss >> params.out;
+ else if (key == "in") iss >> params.in;
+ else if (key == "rate") iss >> params.rate;
+ else if (key == "dev") std::getline(iss, params.dev);
else if (key == "mics") {
// Parse a comma-separated list of mics
- for (std::string mic; std::getline(iss2, mic, ','); ) {
+ for (std::string mic; std::getline(iss, mic, ','); ) {
params.mics.push_back(0); // TODO/FIXME: implement
}
-
}
else throw std::runtime_error("Unknown device parameter " + key);
- if (!iss2.eof()) throw std::runtime_error("Syntax error parsing device parameter " + key);
+ if (!iss.eof()) throw std::runtime_error("Syntax error parsing device parameter " + key);
}
devices.push_back(new Device(params.in, params.out, params.rate, params.dev));
Device& d = devices.back();
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 07:18:54
|
Module: performous
Branch: portaudio
Commit: cb9219b0dfb92e14d7a6798a5d887e5dac149413
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Jul 18 10:18:40 2010 +0300
Fix init order bug that caused segfault on Alt+F4 from singing screen
---
game/audio.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 81eec71..3d85777 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -249,10 +249,10 @@ struct Device {
};
struct Audio::Impl {
+ Output output;
portaudio::Init init;
boost::ptr_vector<Device> devices;
boost::ptr_vector<Analyzer> analyzers;
- Output output;
bool playback;
Impl(): playback() {
// Parse audio devices from config
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 07:18:51
|
Module: performous
Branch: portaudio
Commit: c0db3b7c1d3a2bfd0245e335844e325cede35ab3
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Jul 18 10:12:40 2010 +0300
Another way of struct initialization avoids GCC compile warnings.
---
tools/itg_pck.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/itg_pck.cc b/tools/itg_pck.cc
index 0593e37..0dbe4cf 100644
--- a/tools/itg_pck.cc
+++ b/tools/itg_pck.cc
@@ -46,7 +46,7 @@ struct Extract {
std::string ext;
if (file.mode == 1) {
std::vector<char> buf2(file.size);
- z_stream strm = {};
+ z_stream strm = z_stream();
strm.avail_in = buffer.size();
strm.next_in = reinterpret_cast<Bytef*>(&buffer[0]);
strm.avail_out = buf2.size();
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:28
|
Module: performous Branch: portaudio Commit: a5e395fde064c89588a393d577ace04a50ea4f11 Author: Lasse Karkkainen <tro...@tr...> Date: Sun Jul 18 09:37:44 2010 +0300 Merge branch 'master' into portaudio Conflicts: game/main.cc game/screen_intro.hh game/screen_practice.cc game/screen_practice.hh --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:26
|
Module: performous Branch: portaudio Commit: e3ba3fa22419dacc1ed3ca4a8ac2931e07c870be Author: Tapio Vierros <tap...@gm...> Date: Sat Jul 17 11:19:55 2010 +0300 Revert "Midi I/O does not compile under Fedora 13" This reverts commit 107a4c07d8a03dffa603a6d38eed6476c83bd70c. Reason: Apparantly this causes Launchpad builds to fail, so it is reverted pending better solution. --- cmake/Modules/FindPortMidi.cmake | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cmake/Modules/FindPortMidi.cmake b/cmake/Modules/FindPortMidi.cmake index 38224a0..f5126d8 100644 --- a/cmake/Modules/FindPortMidi.cmake +++ b/cmake/Modules/FindPortMidi.cmake @@ -13,7 +13,7 @@ include(LibFindMacros) find_path(PortMidi_INCLUDE_DIR NAMES portmidi.h) find_library(PortMidi_LIBRARY NAMES portmidi) -find_library(PortTime_LIBRARY NAMES portmidi) +find_library(PortTime_LIBRARY NAMES porttime) set(PortMidi_PROCESS_INCLUDES PortMidi_INCLUDE_DIR) set(PortMidi_PROCESS_LIBS PortMidi_LIBRARY PortTime_LIBRARY) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:24
|
Module: performous
Branch: portaudio
Commit: b1b1d8d9c4720c5941a2bacc7cb2aaa0c699051f
Author: Tapio Vierros <tap...@gm...>
Date: Sat Jul 17 00:57:29 2010 +0300
Remove excess includes and move to .cc when possible.
---
game/3dobject.cc | 6 ------
game/3dobject.hh | 4 ----
game/backgrounds.cc | 1 -
game/backgrounds.hh | 1 -
game/dancegraph.cc | 7 +++----
game/dancegraph.hh | 8 --------
game/guitargraph.cc | 5 ++---
game/guitargraph.hh | 8 --------
game/instrumentgraph.hh | 3 ---
game/joystick.cc | 1 -
game/screen_configuration.cc | 3 +++
game/screen_configuration.hh | 7 ++++---
game/screen_intro.cc | 2 ++
game/screen_intro.hh | 8 ++++----
game/screen_practice.cc | 4 +++-
game/screen_practice.hh | 10 +++++-----
game/songparser-ini.cc | 1 -
game/songparser-sm.cc | 1 -
game/songparser.cc | 3 +--
game/songparser.hh | 2 --
20 files changed, 27 insertions(+), 58 deletions(-)
diff --git a/game/3dobject.cc b/game/3dobject.cc
index edafe3d..053896c 100644
--- a/game/3dobject.cc
+++ b/game/3dobject.cc
@@ -1,14 +1,8 @@
#include "3dobject.hh"
-#include "surface.hh"
-#include "glutil.hh"
-#include <vector>
-#include <map>
-#include <iostream>
#include <sstream>
#include <fstream>
#include <stdexcept>
-#include <string>
#include <cmath>
diff --git a/game/3dobject.hh b/game/3dobject.hh
index 8bf6ceb..9858de8 100644
--- a/game/3dobject.hh
+++ b/game/3dobject.hh
@@ -1,11 +1,7 @@
#pragma once
#include <vector>
-#include <map>
-#include <iostream>
-#include <stdexcept>
#include <string>
-
#include <boost/scoped_ptr.hpp>
#include <boost/noncopyable.hpp>
#include "surface.hh"
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index fcc7fe2..5fe42bd 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -1,7 +1,6 @@
#include "backgrounds.hh"
#include "configuration.hh"
-#include "fs.hh"
#include <boost/bind.hpp>
#include <boost/format.hpp>
diff --git a/game/backgrounds.hh b/game/backgrounds.hh
index aa99bab..d56eab7 100644
--- a/game/backgrounds.hh
+++ b/game/backgrounds.hh
@@ -7,7 +7,6 @@
#include <boost/scoped_ptr.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
-#include <set>
#include <vector>
/// songs class for songs screen
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 468106c..8d2d7a9 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -1,8 +1,7 @@
#include "dancegraph.hh"
-#include "instrumentgraph.hh"
-#include "fs.hh"
-#include "notes.hh"
-#include "surface.hh"
+#include "song.hh"
+#include "i18n.hh"
+
#include <boost/lexical_cast.hpp>
#include <stdexcept>
#include <algorithm>
diff --git a/game/dancegraph.hh b/game/dancegraph.hh
index 0eff7b7..67c58fd 100644
--- a/game/dancegraph.hh
+++ b/game/dancegraph.hh
@@ -1,16 +1,8 @@
#pragma once
-#include <vector>
#include <boost/ptr_container/ptr_map.hpp>
#include "instrumentgraph.hh"
-#include "animvalue.hh"
-#include "song.hh"
-#include "notes.hh"
-#include "audio.hh"
-#include "joystick.hh"
-#include "surface.hh"
-#include "opengl_text.hh"
class Song;
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 01d9ffb..c0152b1 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -1,12 +1,11 @@
#include "guitargraph.hh"
-#include "instrumentgraph.hh"
#include "fs.hh"
#include "song.hh"
-#include "3dobject.hh"
+#include "i18n.hh"
+
#include <cmath>
#include <cstdlib>
#include <stdexcept>
-
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index ed8b931..e8e5e1f 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -1,17 +1,9 @@
#pragma once
-#include <vector>
#include <boost/ptr_container/ptr_map.hpp>
#include "instrumentgraph.hh"
-#include "animvalue.hh"
-#include "notes.hh"
-#include "audio.hh"
-#include "joystick.hh"
-#include "surface.hh"
-#include "opengl_text.hh"
#include "3dobject.hh"
-#include "glutil.hh"
class Song;
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index 8ca5cac..7bc6ab8 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -8,11 +8,8 @@
#include "joystick.hh"
#include "surface.hh"
#include "opengl_text.hh"
-#include "3dobject.hh"
#include "glutil.hh"
#include "fs.hh"
-#include "i18n.hh"
-
/// Represents popup messages
class Popup {
diff --git a/game/joystick.cc b/game/joystick.cc
index 02d016d..98640c1 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -1,5 +1,4 @@
#include "joystick.hh"
-#include <iostream>
#include <boost/lexical_cast.hpp>
diff --git a/game/screen_configuration.cc b/game/screen_configuration.cc
index 87b7a4a..e61ecf3 100644
--- a/game/screen_configuration.cc
+++ b/game/screen_configuration.cc
@@ -2,6 +2,9 @@
#include "configuration.hh"
#include "joystick.hh"
+#include "theme.hh"
+#include "audio.hh"
+
ScreenConfiguration::ScreenConfiguration(std::string const& name, Audio& audio): Screen(name), m_audio(audio), selected() {
for (ConfigMenu::const_iterator it = configMenu.begin(); it != configMenu.end(); ++it) {
diff --git a/game/screen_configuration.hh b/game/screen_configuration.hh
index 72d54b8..3524d3c 100644
--- a/game/screen_configuration.hh
+++ b/game/screen_configuration.hh
@@ -1,9 +1,10 @@
#pragma once
-#include "screen.hh"
-#include "audio.hh"
-#include "theme.hh"
#include <boost/scoped_ptr.hpp>
+#include "screen.hh"
+
+class Audio;
+class ThemeConfiguration;
/// options dialogue
class ScreenConfiguration: public Screen {
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index 2b488a5..818bfeb 100644
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -5,6 +5,8 @@
#include "record.hh"
#include "i18n.hh"
#include "joystick.hh"
+#include "theme.hh"
+#include "menu.hh"
ScreenIntro::ScreenIntro(std::string const& name, Audio& audio, Capture& capture): Screen(name), m_audio(audio), m_capture(capture), selected(), m_first(true) {
}
diff --git a/game/screen_intro.hh b/game/screen_intro.hh
index 76d7909..a7912d8 100644
--- a/game/screen_intro.hh
+++ b/game/screen_intro.hh
@@ -1,13 +1,13 @@
#pragma once
+#include <boost/scoped_ptr.hpp>
#include "dialog.hh"
#include "screen.hh"
-#include "theme.hh"
-#include "menu.hh"
-#include <boost/scoped_ptr.hpp>
class Audio;
class Capture;
+class ThemeIntro;
+class MenuOption;
/// intro screen
class ScreenIntro : public Screen {
@@ -18,7 +18,7 @@ class ScreenIntro : public Screen {
void exit();
void manageEvent(SDL_Event event);
void draw();
-
+
/// draw menu
void draw_menu_options();
diff --git a/game/screen_practice.cc b/game/screen_practice.cc
index 1ca3135..4b37583 100644
--- a/game/screen_practice.cc
+++ b/game/screen_practice.cc
@@ -3,7 +3,9 @@
#include "util.hh"
#include "fs.hh"
#include "record.hh"
-#include "joystick.hh"
+#include "audio.hh"
+#include "theme.hh"
+#include "progressbar.hh"
ScreenPractice::ScreenPractice(std::string const& name, Audio& audio, Capture& capture):
Screen(name), m_audio(audio), m_capture(capture)
diff --git a/game/screen_practice.hh b/game/screen_practice.hh
index a2c372c..fd77a75 100644
--- a/game/screen_practice.hh
+++ b/game/screen_practice.hh
@@ -1,14 +1,14 @@
#pragma once
#include <boost/scoped_ptr.hpp>
-#include "audio.hh"
#include "screen.hh"
-#include "theme.hh"
-//#include "opengl_text.hh"
-#include "progressbar.hh"
#include "joystick.hh"
+class Audio;
class Capture;
+class Sample;
+class ProgressBar;
+class ThemePractice;
/// screen for practice mode
class ScreenPractice : public Screen {
@@ -19,7 +19,7 @@ class ScreenPractice : public Screen {
void exit();
void manageEvent( SDL_Event event );
void draw();
-
+
/// draw analyzers
void draw_analyzers();
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 1b5a686..67e2ce0 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -2,7 +2,6 @@
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
-#include <boost/filesystem.hpp>
#include <boost/regex.hpp>
#include <stdexcept>
#include "midifile.hh"
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index df5fe91..cb84732 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -1,6 +1,5 @@
#include "songparser.hh"
-#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <algorithm>
diff --git a/game/songparser.cc b/game/songparser.cc
index 47c6ca8..af47a6d 100644
--- a/game/songparser.cc
+++ b/game/songparser.cc
@@ -1,9 +1,8 @@
#include "songparser.hh"
+
#include <fstream>
-#include <sstream>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
-#include <boost/filesystem.hpp>
#include <boost/regex.hpp>
diff --git a/game/songparser.hh b/game/songparser.hh
index 20a6901..a0bb6e5 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -2,10 +2,8 @@
#include "song.hh"
#include "unicode.hh"
-#include <fstream>
#include <sstream>
#include <boost/filesystem.hpp>
-#include <boost/regex.hpp>
namespace SongParserUtil {
/// Parse an int from string and assign it to a variable
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:20
|
Module: performous
Branch: portaudio
Commit: 57e1b19e6bc1f9d06f3856996371520e706f3530
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Jul 16 17:10:17 2010 +0200
Fixed (workaround) midi golden and freestyle vocal notes
---
game/songparser-ini.cc | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 9437e77..1b5a686 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -176,13 +176,9 @@ void SongParser::iniParse() {
n.end = midi.get_seconds(it2->end)+s.start;
n.notePrev = n.note = it2->note;
n.type = n.note > 100 ? Note::SLEEP : Note::NORMAL;
- if(n.note == 116 || n.note == 103)
- // n.type = Note::GOLDEN;
- continue; // not yet managed by midi parser
- else if(n.note == 124)
- // n.type = Note::GOLDEN;
- continue; // not yet managed by midi parser
- else if(n.note > 100)
+ if(n.note == 116 || n.note == 103 || n.note == 124)
+ continue; // managed in the next loop (GOLDEN/FREESTYLE notes)
+ else if(n.note > 100) // is it always 105 ?
n.type = Note::SLEEP;
else
n.type = Note::NORMAL;
@@ -245,6 +241,20 @@ void SongParser::iniParse() {
vocal.notes.push_back(n);
}
}
+ for (MidiFileParser::Lyrics::const_iterator it2 = it->lyrics.begin(); it2 != it->lyrics.end(); ++it2) {
+ if(it2->note == 116 || it2->note == 103 || it2->note == 124) {
+ for(Notes::iterator it3 = vocal.notes.begin() ; it3 != vocal.notes.end(); ++it3) {
+ if(it3->begin == midi.get_seconds(it2->begin)+s.start && it3->type == Note::NORMAL) {
+ if(it2->note == 124) {
+ it3->type = Note::FREESTYLE;
+ } else {
+ it3->type = Note::GOLDEN;
+ }
+ break;
+ }
+ }
+ }
+ }
if (!vocal.notes.empty()) break;
}
// Figure out if we have BRE in the song
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:18
|
Module: performous Branch: portaudio Commit: 22d20084de7f009a363d89af10d2227818e3e20a Author: Tapio Vierros <tap...@gm...> Date: Fri Jul 16 16:39:23 2010 +0300 Some fixes to PPA script. --- tools/ppa/ppa.sh | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/ppa/ppa.sh b/tools/ppa/ppa.sh index 569081f..3f1fa54 100755 --- a/tools/ppa/ppa.sh +++ b/tools/ppa/ppa.sh @@ -42,7 +42,7 @@ PPAPATCHDIR="`pwd`" $COPYCMD "$1/tools" "$2" } -cd $TEMPDIR +cd "$TEMPDIR" # Download the "old" source package version=`apt-cache showsrc $PKG | sed -n 's/^Version: \(.*\)/\1/p' | head -n 1` @@ -52,17 +52,17 @@ if [ -z "$pkgversion" ] ; then echo "Assuming native package" pkgversion="$version" fi -echo "Working on $pkg $version ($pkgversion)" +echo "Working on $PKG $version ($pkgversion)" mkdir -p $PKG-$version cd $PKG-$version apt-get --download-only source $PKG # Download fresh version from git echo "Fetch from git..." -git clone $GITURL $SOURCEDIR +git clone "$GITURL" "$SOURCEDIR" # Get some info from git for changelog pushd . -cd $SOURCEDIR +cd "$SOURCEDIR" headcommit=`git log | head -n 1 | cut --delimiter=" " -f 2 | cut -c 1-10` popd |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:16
|
Module: performous Branch: portaudio Commit: efa8470abab625022332f76a5497515de7a12ea4 Author: Tapio Vierros <tap...@gm...> Date: Thu Jul 15 23:41:45 2010 +0300 Make cppcheck static analyzer happier. --- game/3dobject.cc | 2 +- game/dancegraph.cc | 8 ++++---- game/database.cc | 4 ++-- game/guitargraph.cc | 2 +- game/instrumentgraph.hh | 1 + game/menu.cc | 2 +- game/menu.hh | 2 +- game/midifile.cc | 2 +- game/screen_configuration.cc | 2 +- game/screen_practice.cc | 7 +++---- game/song.cc | 2 +- game/songparser-ini.cc | 2 +- game/theme.cc | 2 +- game/theme.hh | 4 ++-- 14 files changed, 21 insertions(+), 21 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:14
|
Module: performous Branch: portaudio Commit: bf397bf072ad14257e2d04dc5dc5b187aa465aed Author: Tapio Vierros <tap...@gm...> Date: Thu Jul 15 20:33:39 2010 +0300 Merge branch 'svg_caching' --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:11
|
Module: performous
Branch: portaudio
Commit: 9a1623b1739d85502e36a99c925830b09d79f2bf
Author: Vincent Le Ligeour <yo...@us...>
Date: Thu Jul 15 13:01:44 2010 +0200
Removed debug message about caching SVG
---
game/image.hh | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/game/image.hh b/game/image.hh
index 1b59873..c5a1c36 100644
--- a/game/image.hh
+++ b/game/image.hh
@@ -53,10 +53,8 @@ namespace {
png_set_IHDR(pngPtr, infoPtr, w, h, 8, PNG_COLOR_TYPE_RGBA, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
bpp = 4;
break;
- case pix::INT_ARGB:
- throw std::runtime_error("Writing PNG failed (pix::INT_ARGB not supported)");
- case pix::BGR:
- throw std::runtime_error("Writing PNG failed (pix::BGR not supported)");
+ default:
+ throw std::logic_error("Unsupported pixel format in writePNG_internal");
}
png_write_info(pngPtr, infoPtr);
unsigned stride = (w * bpp + 3) & ~3; // Number of bytes per row (word-aligned)
@@ -131,7 +129,6 @@ template <typename T> void loadSVG(T& target, std::string const& filename, fs::p
g_error_free(pError);
throw std::runtime_error("Unable to load " + filename);
}
- std::cout << "Caching \"" << filename << "\" into \"" << cache_filename << "\"" << std::endl;
fs::create_directories(cache_filename.parent_path());
writePNG(cache_filename.string(), w, h, pix::CHAR_RGBA, false, gdk_pixbuf_get_pixels(pb));
gdk_pixbuf_unref(pb);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:09
|
Module: performous
Branch: portaudio
Commit: 916c7353fa84d983b557bdfc52182a566b54ae21
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Jul 14 20:15:48 2010 +0200
Removed compilation warning and throw error on wrong image format
---
game/image.hh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/game/image.hh b/game/image.hh
index 5ff8a37..1b59873 100644
--- a/game/image.hh
+++ b/game/image.hh
@@ -53,6 +53,10 @@ namespace {
png_set_IHDR(pngPtr, infoPtr, w, h, 8, PNG_COLOR_TYPE_RGBA, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
bpp = 4;
break;
+ case pix::INT_ARGB:
+ throw std::runtime_error("Writing PNG failed (pix::INT_ARGB not supported)");
+ case pix::BGR:
+ throw std::runtime_error("Writing PNG failed (pix::BGR not supported)");
}
png_write_info(pngPtr, infoPtr);
unsigned stride = (w * bpp + 3) & ~3; // Number of bytes per row (word-aligned)
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:06
|
Module: performous
Branch: portaudio
Commit: 05b38b758eaea4623c2d201b627d6b9076b1d6eb
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Jul 14 20:04:58 2010 +0200
Appended theme name to cache directory
---
game/fs.cc | 3 +--
game/surface.cc | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/game/fs.cc b/game/fs.cc
index d356d8b..b52539b 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -86,10 +86,9 @@ fs::path getCacheDir() {
return getConfigDir() / "cache"; // APPDATA/performous
#else
fs::path shortDir = "performous";
- fs::path shareDir = SHARED_DATA_DIR;
char const* xdg_cache_home = getenv("XDG_CACHE_HOME");
// FIXME: Should this use "games" or not?
- return (xdg_cache_home ? xdg_cache_home / shortDir : getHomeDir() / ".cache" / shareDir);
+ return (xdg_cache_home ? xdg_cache_home / shortDir : getHomeDir() / ".cache" / shortDir);
#endif
}
diff --git a/game/surface.cc b/game/surface.cc
index 47468ec..319e0e7 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -46,7 +46,7 @@ template <typename T> void loader(T& target, fs::path name) {
loadSVG(target, filename);
} else {
std::string cache_basename = name.filename() + ".cache_" + (boost::format("%.2f") % config["graphic/svg_lod"].f()).str() + ".png";
- fs::path cache_filename = getCacheDir() / cache_basename;
+ fs::path cache_filename = getCacheDir() / "themes" / (config["game/theme"].s().empty() ? "default" : config["game/theme"].s()) / cache_basename;
if(fs::exists(cache_filename)) {
if(fs::last_write_time(filename) > fs::last_write_time(cache_filename)) {
// SVG file is newer we should update cache
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:39:01
|
Module: performous
Branch: portaudio
Commit: 3edb9cec23efbedc484730b24c7f2dc800388035
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Jul 14 19:59:08 2010 +0200
Used XDG cache directory for svg caching to keep themes directory clean
---
game/fs.cc | 13 ++++++++++++-
game/fs.hh | 3 +++
game/surface.cc | 2 +-
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/game/fs.cc b/game/fs.cc
index 8349f1c..d356d8b 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -36,7 +36,6 @@ fs::path getLocaleDir() {
}
fs::path getConfigDir() {
-
static fs::path dir;
static bool initialized = false;
if (!initialized) {
@@ -82,6 +81,18 @@ fs::path getDataDir() {
#endif
}
+fs::path getCacheDir() {
+#ifdef _WIN32
+ return getConfigDir() / "cache"; // APPDATA/performous
+#else
+ fs::path shortDir = "performous";
+ fs::path shareDir = SHARED_DATA_DIR;
+ char const* xdg_cache_home = getenv("XDG_CACHE_HOME");
+ // FIXME: Should this use "games" or not?
+ return (xdg_cache_home ? xdg_cache_home / shortDir : getHomeDir() / ".cache" / shareDir);
+#endif
+}
+
fs::path getThemeDir() {
std::string theme = config["game/theme"].s();
static const std::string defaultTheme = "default";
diff --git a/game/fs.hh b/game/fs.hh
index 3d38eed..6d8baa2 100644
--- a/game/fs.hh
+++ b/game/fs.hh
@@ -15,6 +15,9 @@ fs::path getConfigDir();
/** Get the users data folder **/
fs::path getDataDir();
+/** Get the users cache folder **/
+fs::path getCacheDir();
+
/** Get the users theme folder **/
fs::path getThemeDir();
diff --git a/game/surface.cc b/game/surface.cc
index ee01d4c..47468ec 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -46,7 +46,7 @@ template <typename T> void loader(T& target, fs::path name) {
loadSVG(target, filename);
} else {
std::string cache_basename = name.filename() + ".cache_" + (boost::format("%.2f") % config["graphic/svg_lod"].f()).str() + ".png";
- fs::path cache_filename = getThemeDir() / cache_basename;
+ fs::path cache_filename = getCacheDir() / cache_basename;
if(fs::exists(cache_filename)) {
if(fs::last_write_time(filename) > fs::last_write_time(cache_filename)) {
// SVG file is newer we should update cache
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:38:59
|
Module: performous
Branch: portaudio
Commit: 7b6b24cc896d1d9ec5fb311e66b0527aeab78df4
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Jul 14 03:34:21 2010 +0300
Revert "Removed godmode and solo color from fret (reported as disturbing)"
This reverts commit 000f681de62ce7a75528f192d8c79b65ec772d07.
---
game/guitargraph.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 29ef04a..0be7a41 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -725,7 +725,7 @@ void GuitarGraph::draw(double time) {
float x = getFretX(fret);
float l = m_pressed_anim[fret + !m_drums].get();
// Get a color for the fret and adjust it if GodMode is on
- glColor4fv(color(fret));
+ glColor4fv(colorize(color(fret), time));
m_button.dimensions.center(time2y(0.0)).middle(x);
m_button.draw();
glColor3f(l, l, l);
@@ -782,7 +782,7 @@ void GuitarGraph::draw(double time) {
glutil::Color c(0.5f, 0.5f, 0.5f);
if (!joining(time)) {
// Get a color for the fret and adjust it if GodMode is on
- c = color(fret);
+ c = colorize(color(fret), it->begin);
if (glow > 0.1f) { ng_r+=c.r; ng_g+=c.g; ng_b+=c.b; ng_ccnt++; } // neck glow
// Further adjust the color if the note is hit
c.r += glow * 0.2f;
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:38:56
|
Module: performous
Branch: portaudio
Commit: 4b9472ae964e0410c3550bb50d4a6cccff589460
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Jul 14 03:31:34 2010 +0300
Fix word alignment.
---
game/image.hh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/image.hh b/game/image.hh
index 194b064..5ff8a37 100644
--- a/game/image.hh
+++ b/game/image.hh
@@ -55,7 +55,7 @@ namespace {
break;
}
png_write_info(pngPtr, infoPtr);
- unsigned stride = (w * bpp + bpp) & ~bpp; // Number of bytes per row (word-aligned)
+ unsigned stride = (w * bpp + 3) & ~3; // Number of bytes per row (word-aligned)
unsigned pos = reverse ? h * stride : -stride;
for (unsigned y = 0; y < h; ++y) {
if(reverse)
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:38:53
|
Module: performous Branch: portaudio Commit: dbfe45b507815e42299afbf721be613d19a3e9f2 Author: Vincent Le Ligeour <yo...@us...> Date: Tue Jul 13 22:52:20 2010 +0200 Added SVG caching feature --- game/fs.cc | 34 +++++++++++----- game/fs.hh | 6 +++ game/image.hh | 104 +++++++++++++++++++++++++++++++++----------------- game/main.cc | 2 +- game/surface.cc | 27 ++++++++++++- game/video_driver.cc | 2 + 6 files changed, 127 insertions(+), 48 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:38:51
|
Module: performous
Branch: portaudio
Commit: 0682ec2fb913ef05927f7595e9fc9650f5680e3c
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Jul 13 20:15:47 2010 +0200
Worked around a bug in midi lyrics parsing
---
game/songparser-ini.cc | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 016ef4f..8bd6e7c 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -176,6 +176,16 @@ void SongParser::iniParse() {
n.end = midi.get_seconds(it2->end)+s.start;
n.notePrev = n.note = it2->note;
n.type = n.note > 100 ? Note::SLEEP : Note::NORMAL;
+ if(n.note == 116 || n.note == 103)
+ // n.type = Note::GOLDEN;
+ continue; // not yet managed by midi parser
+ else if(n.note == 124)
+ // n.type = Note::GOLDEN;
+ continue; // not yet managed by midi parser
+ else if(n.note > 100)
+ n.type = Note::SLEEP;
+ else
+ n.type = Note::NORMAL;
{
std::stringstream ss(it2->lyric);
convertToUTF8(ss);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:38:49
|
Module: performous
Branch: portaudio
Commit: 000f681de62ce7a75528f192d8c79b65ec772d07
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Jul 11 11:44:44 2010 +0200
Removed godmode and solo color from fret (reported as disturbing)
---
game/guitargraph.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 0be7a41..29ef04a 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -725,7 +725,7 @@ void GuitarGraph::draw(double time) {
float x = getFretX(fret);
float l = m_pressed_anim[fret + !m_drums].get();
// Get a color for the fret and adjust it if GodMode is on
- glColor4fv(colorize(color(fret), time));
+ glColor4fv(color(fret));
m_button.dimensions.center(time2y(0.0)).middle(x);
m_button.draw();
glColor3f(l, l, l);
@@ -782,7 +782,7 @@ void GuitarGraph::draw(double time) {
glutil::Color c(0.5f, 0.5f, 0.5f);
if (!joining(time)) {
// Get a color for the fret and adjust it if GodMode is on
- c = colorize(color(fret), it->begin);
+ c = color(fret);
if (glow > 0.1f) { ng_r+=c.r; ng_g+=c.g; ng_b+=c.b; ng_ccnt++; } // neck glow
// Further adjust the color if the note is hit
c.r += glow * 0.2f;
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:38:46
|
Module: performous
Branch: portaudio
Commit: cf96cf8b35d132aeb81f1a6fb4cc7205cdd09076
Author: Tapio Vierros <tap...@gm...>
Date: Mon Jul 5 22:43:36 2010 +0300
Add enabled() to MidiDrums (in style of Webcam and Gettext) + fix some whitespace.
---
game/joystick.cc | 32 ++++++++++++++++----------------
game/joystick.hh | 2 ++
game/main.cc | 6 +-----
3 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 8c1cf66..02d016d 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -22,30 +22,30 @@ input::MidiDrums::MidiDrums(): stream(pm::findDevice(true, config["system/midi_i
static const int DRUM3_BLUE = 3; // low tom/ ride cymbal
static const int DRUM4_GREEN = 4; // low floor tom/ crash cymbal
- map[35] = DRUM0_ORANGE; // 35 - Acoustic Bass Drum
+ map[35] = DRUM0_ORANGE; // 35 - Acoustic Bass Drum
map[36] = DRUM0_ORANGE; // 36 - Bass Drum 1 *)
- map[37] = DRUM1_RED; // 37 - Side Stick
- map[38] = DRUM1_RED; // 38 - Acoustic Snare *)
- // 39 - Hand Clap
- map[40] = DRUM1_RED; // 40 - Electric Snare
+ map[37] = DRUM1_RED; // 37 - Side Stick
+ map[38] = DRUM1_RED; // 38 - Acoustic Snare *)
+ // 39 - Hand Clap
+ map[40] = DRUM1_RED; // 40 - Electric Snare
map[41] = DRUM4_GREEN; // 41 - Low Floor Tom *)
- map[42] = DRUM2_YELLOW; // 42 - Closed Hi-Hat
- // 43 - High Floor Tom
+ map[42] = DRUM2_YELLOW; // 42 - Closed Hi-Hat
+ // 43 - High Floor Tom
// map[44] = DRUM2_YELLOW; // 44 - Pedal Hi-Hat *) - ignore this for playability!
map[45] = DRUM3_BLUE; // 45 - Low Tom *)
map[46] = DRUM2_YELLOW; // 46 - Open Hi-Hat *)
- // 47 - Low-Mid Tom
+ // 47 - Low-Mid Tom
map[48] = DRUM2_YELLOW; // 48 - Hi-Mid Tom *)
map[49] = DRUM4_GREEN; // 49 - Crash Cymbal 1 *)
// 50 - High Tom
map[51] = DRUM3_BLUE; // 51 - Ride Cymbal 1 *)
// 52 - Chinese Cymbal
- // 53 - Ride Bell
- // 54 - Tambourine
- // 55 - Splash Cymbal
- // 56 - Cowbell
- map[57] = DRUM4_GREEN; // 57 - Crash Cymbal 2
- // 58 - Vibraslap
+ // 53 - Ride Bell
+ // 54 - Tambourine
+ // 55 - Splash Cymbal
+ // 56 - Cowbell
+ map[57] = DRUM4_GREEN; // 57 - Crash Cymbal 2
+ // 58 - Vibraslap
map[59] = DRUM3_BLUE; // 59 - Ride Cymbal 2
// 60 - Hi Bongo
// 61 - Low Bongo
@@ -56,7 +56,7 @@ input::MidiDrums::MidiDrums(): stream(pm::findDevice(true, config["system/midi_i
// 66 - Low Timbale
// 67 - High Agogo
// 68 - Low Agogo
- // 69 - Cabasa
+ // 69 - Cabasa
// 70 - Maracas
// 71 - Short Whistle
// 72 - Long Whistle
@@ -91,7 +91,7 @@ void input::MidiDrums::process() {
unsigned char note = ev.message >> 8;
unsigned char vel = ev.message >> 16;
#if 0
- // it is IMHO not a good idea to filter on the channel.
+ // it is IMHO not a good idea to filter on the channel.
// code snippet left here for visibility
unsigned char chan = ev.message & 0x0F;
if (chan != 0x09) continue; // only accept channel 10 (percussion)
diff --git a/game/joystick.hh b/game/joystick.hh
index ab12136..d8086ae 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -160,6 +160,7 @@ namespace input {
#ifdef USE_PORTMIDI
class MidiDrums {
public:
+ static bool enabled() { return true; }
MidiDrums();
void process();
private:
@@ -172,6 +173,7 @@ namespace input {
#else
class MidiDrums {
public:
+ static bool enabled() { return false; }
MidiDrums() {};
void process() {};
private:
diff --git a/game/main.cc b/game/main.cc
index e577384..0d1f585 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -406,11 +406,7 @@ void outputOptionalFeatureStatus() {
std::cout << " Internationalization: " <<
(Gettext::enabled() ? "Enabled" : "Disabled")
<< std::endl << " MIDI I/O: " <<
- #ifdef USE_PORTMIDI
- "Enabled"
- #else
- "Disabled"
- #endif
+ (input::MidiDrums::enabled() ? "Enabled" : "Disabled")
<< std::endl << " Webcam support: " <<
(Webcam::enabled() ? "Enabled" : "Disabled")
<< std::endl;
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:38:44
|
Module: performous
Branch: portaudio
Commit: 2c2aeaa2abee6a18e173599371db5b15778df3c7
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Jul 6 10:44:13 2010 +0200
Added new theme file to windows NSI
---
win32/setup.nsi | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/win32/setup.nsi b/win32/setup.nsi
index 9c4c359..220d217 100644
--- a/win32/setup.nsi
+++ b/win32/setup.nsi
@@ -226,6 +226,7 @@ Section "SezionePrincipale" SEC01
File "${FILES_PATH}\themes\default\songs_order.svg"
File "${FILES_PATH}\themes\default\songs_song.svg"
File "${FILES_PATH}\themes\default\star.svg"
+ File "${FILES_PATH}\themes\default\star_glow.svg"
File "${FILES_PATH}\themes\default\tail.svg"
File "${FILES_PATH}\themes\default\tail_drumfill.svg"
File "${FILES_PATH}\themes\default\tail_glow.svg"
@@ -285,6 +286,7 @@ Section Uninstall
Delete "$INSTDIR\themes\default\tail_glow.svg"
Delete "$INSTDIR\themes\default\tail_drumfill.svg"
Delete "$INSTDIR\themes\default\tail.svg"
+ Delete "$INSTDIR\themes\default\star_glow.svg"
Delete "$INSTDIR\themes\default\star.svg"
Delete "$INSTDIR\themes\default\songs_song.svg"
Delete "$INSTDIR\themes\default\songs_order.svg"
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:38:41
|
Module: performous
Branch: portaudio
Commit: d6d3a4991e7d1735c8242aca92893afe626cf99a
Author: Felix Bertram <fl...@be...>
Date: Mon Jul 5 16:08:32 2010 -0700
bugfix for multiple audio devices in config
when multiple audio devices where specified in the config file, the code did not stop to use a device that was successfully opened. This patch fixes the behavior and stops at the first devices that can be opened.
---
game/main.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 91aed77..e577384 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -145,6 +145,9 @@ void audioSetup(Capture& capture, Audio& audio) {
if (channels != 2) throw std::runtime_error("Only stereo playback is supported, error in pdev=" + *it);
try {
audio.open(devstr, rate, frames);
+ // when we get here, we have successfully opened a device.
+ // let's use it then!
+ break;
} catch (std::exception const& e) {
std::cerr << "Playback device pdev=" << *it << " failed and will be ignored:\n " << e.what() << std::endl;
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:38:39
|
Module: performous
Branch: portaudio
Commit: 6bb7de2655d6ab9039b7ae7a538548f31a3e5595
Author: Felix Bertram <fl...@be...>
Date: Mon Jul 5 12:50:47 2010 -0700
Revert "Slowdown play"
create new features in separate branch
This reverts commit c783bf544100b9501830fd34c256ac9e30324b8a.
---
game/audio.cc | 44 +++++++++-----------------------------------
game/audio.hh | 7 ++-----
game/guitargraph.cc | 4 +---
game/main.cc | 2 --
game/screen_sing.cc | 8 ++------
game/screen_sing.hh | 1 -
6 files changed, 14 insertions(+), 52 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 18824d8..ae4acfb 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -5,7 +5,6 @@
#include <libda/fft.hpp> // For M_PI
#include <cmath>
#include <iostream>
-#include <boost/filesystem.hpp>
struct SampleStream {
SampleStream(boost::shared_ptr<FFmpeg> const& mpeg): m_mpeg(mpeg) {}
@@ -76,39 +75,19 @@ void Audio::play(Sample const& s, std::string const& volumeSetting) {
m_mixer.add(da::shared_ref(acc));
}
-void Audio::playMusic(std::map<std::string,std::string> const& filenames, bool preview, double fadeTime, double startPos, int speed) {
+void Audio::playMusic(std::map<std::string,std::string> const& filenames, bool preview, double fadeTime, double startPos) {
if (!isOpen()) return;
da::lock_holder l = m_mixer.lock();
fadeout(fadeTime);
boost::shared_ptr<da::chain> ch(new da::chain());
for(std::map<std::string,std::string>::const_iterator it = filenames.begin() ; it != filenames.end() ; ++it ) {
- std::string f;
try {
- f = it->second;
- if (speed != 100) {
- // instead of real-time time-stretching we use previously created files
- // best effects have been achieved with SBSMS library
- // as used by Audacity's Sliding Time Scale/ Pitch Shift plugin
- std::string f2 = "-" + boost::lexical_cast<std::string>(speed) + ".ogg";
- f.replace(f.find(".ogg"), 4, f2);
- // std::cout << "loading time-stretched audio (" << f << ")" << std::endl;
-
- if (!boost::filesystem::exists(f)) throw std::runtime_error("time-stretched file \"" + f +"\" not found");
- }
-
- boost::shared_ptr<Stream> s(new Stream(f, m_rs.rate()));
+ boost::shared_ptr<Stream> s(new Stream(it->second, m_rs.rate()));
m_streams[it->first] = s;
ch->add(da::shared_ref(s));
s->seek(startPos);
} catch (std::runtime_error& e) {
- if (speed != 100) {
- // in case time-stretching failed let's retry at normal speed
- // TODO: we could also auto-create time-stretched files here
- playMusic(filenames, preview, fadeTime, startPos, 100);
- return;
- }
- // in case we are at normal speed we skip this file and try to continue
- std::cerr << "Error loading " << f << " (" << e.what() << ")" << std::endl;
+ std::cerr << "Error loading " << it->second << " (" << e.what() << ")" << std::endl;
continue;
}
}
@@ -117,14 +96,12 @@ void Audio::playMusic(std::map<std::string,std::string> const& filenames, bool p
ch->add(boost::ref(m_volume));
m_mixer.fadein(da::shared_ref(ch), fadeTime, startPos);
if (!preview) pause(false);
-
- m_speed = speed;
}
-void Audio::playMusic(std::string const& filename, bool preview, double fadeTime, double startPos, int speed) {
+void Audio::playMusic(std::string const& filename, bool preview, double fadeTime, double startPos) {
std::map<std::string,std::string> tmp;
tmp["unidentified"] = filename;
- playMusic(tmp, preview, fadeTime, startPos, speed);
+ playMusic(tmp, preview, fadeTime, startPos);
}
void Audio::stopMusic() {
@@ -143,13 +120,12 @@ void Audio::fadeout(double fadeTime) {
double Audio::getPosition() const {
da::lock_holder l = m_mixer.lock();
- // only the audio slows down; the game still uses original time base
- return m_streams.empty() ? getNaN() : m_streams.begin()->second->pos() * m_speed/100.0;
+ return m_streams.empty() ? getNaN() : m_streams.begin()->second->pos();
}
double Audio::getLength() const {
da::lock_holder l = m_mixer.lock();
- return m_streams.empty() ? getNaN() : m_streams.begin()->second->duration() * m_speed/100.0;
+ return m_streams.empty() ? getNaN() : m_streams.begin()->second->duration();
}
bool Audio::isPlaying() const {
@@ -157,16 +133,14 @@ bool Audio::isPlaying() const {
return m_streams.empty() ? false : !m_streams.begin()->second->eof();
}
-void Audio::seek(double offset2) {
- double offset = offset2 * 100.0/m_speed;
+void Audio::seek(double offset) {
da::lock_holder l = m_mixer.lock();
for(std::map<std::string,boost::shared_ptr<Stream> >::iterator it = m_streams.begin() ; it != m_streams.end() ; ++it)
it->second->seek(clamp(it->second->pos() + offset, 0.0, it->second->duration()));
pause(false);
}
-void Audio::seekPos(double pos2) {
- double pos = pos2 * 100.0/m_speed;
+void Audio::seekPos(double pos) {
da::lock_holder l = m_mixer.lock();
for(std::map<std::string,boost::shared_ptr<Stream> >::iterator it = m_streams.begin() ; it != m_streams.end() ; ++it)
it->second->seek(pos);
diff --git a/game/audio.hh b/game/audio.hh
index d441cb1..e4f701f 100644
--- a/game/audio.hh
+++ b/game/audio.hh
@@ -94,9 +94,9 @@ class Audio {
* @param fadeTime time to fade
* @param startPos starting position
*/
- void playMusic(std::string const& filename, bool preview = false, double fadeTime = 0.5, double startPos = -0.2, int speed = 100);
+ void playMusic(std::string const& filename, bool preview = false, double fadeTime = 0.5, double startPos = -0.2);
/// plays a list of songs
- void playMusic(std::map<std::string,std::string> const& filenames, bool preview = false, double fadeTime = 0.5, double startPos = -0.2, int speed = 100);
+ void playMusic(std::map<std::string,std::string> const& filenames, bool preview = false, double fadeTime = 0.5, double startPos = -0.2);
/// plays a sample
void play(Sample const& s, std::string const& volumeSetting);
/// get pause status
@@ -107,8 +107,6 @@ class Audio {
void fadeout(double time = 1.0);
/** Get the length of the currently playing song, in seconds. **/
double getLength() const;
- /// return current speed
- int getSpeed() {return m_speed;}
/**
* This methods seek forward in the stream (backwards if
* argument is negative), and continues playing.
@@ -139,6 +137,5 @@ class Audio {
std::string m_volumeSetting;
da::mixer m_mixer;
std::map<std::string,boost::shared_ptr<Stream> > m_streams;
- int m_speed;
};
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 0fdf6aa..0be7a41 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -185,9 +185,7 @@ bool GuitarGraph::difficulty(Difficulty level) {
/// Core engine
void GuitarGraph::engine() {
double time = m_audio.getPosition();
- // need to compensate for speed as well. When playing at half speed,
- // 1 second from getPosition is actually two seconds in real time
- time -= config["audio/controller_delay"].f() * m_audio.getSpeed()/100.0;
+ time -= config["audio/controller_delay"].f();
// Handle key markers
if (!m_drums) {
for (int i = 0; i < m_pads; ++i) {
diff --git a/game/main.cc b/game/main.cc
index 03da057..91aed77 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -145,8 +145,6 @@ void audioSetup(Capture& capture, Audio& audio) {
if (channels != 2) throw std::runtime_error("Only stereo playback is supported, error in pdev=" + *it);
try {
audio.open(devstr, rate, frames);
- // when we get here, we have successfully opened a device. let's use it!
- break;
} catch (std::exception const& e) {
std::cerr << "Playback device pdev=" << *it << " failed and will be ignored:\n " << e.what() << std::endl;
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 0b52e85..dd822f3 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -31,7 +31,6 @@ namespace {
void ScreenSing::enter() {
//m_practmode = true; // un-comment this line to play with practice mode. temporary, of course!
- m_speed = 75; // 75% slow-down; falls back to 100% if time-stretch files are not found. temporary, of course!
ScreenManager* sm = ScreenManager::getSingletonPtr();
sm->flashMessage(_("Loading song..."), 0.0, 1.0, 0.5);
sm->drawFlashMessage(); sm->window().swap(); // Make loading message show
@@ -86,7 +85,6 @@ void ScreenSing::enter() {
theme->timer.dimensions.screenTop(0.5 * m_progress->dimensions.h());
boost::ptr_vector<Analyzer>& analyzers = m_capture.analyzers();
m_layout_singer.reset(new LayoutSinger(m_song->vocals, m_database, theme));
-
// Load instrument and dance tracks
{
int type = 0; // 0 for dance, 1 for guitars, 2 for drums
@@ -110,7 +108,7 @@ void ScreenSing::enter() {
}
// Startup delay for instruments is longer than for singing only
double setup_delay = (m_instruments.empty() && m_dancers.empty() ? -1.0 : -8.0);
- m_audio.playMusic(m_song->music, false, 0.0, setup_delay, m_speed);
+ 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));
}
@@ -319,9 +317,7 @@ void ScreenSing::draw() {
// Get the time in the song
double length = m_audio.getLength();
double time = m_audio.getPosition();
- // need to compensate for speed as well. When playing at half speed,
- // 1 second from getPosition is actually two seconds in real time
- time -= config["audio/video_delay"].f() * m_audio.getSpeed()/100.0;
+ time -= config["audio/video_delay"].f();
double songPercent = clamp(time / length);
// Rendering starts
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 16cff8e..c743877 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -93,6 +93,5 @@ class ScreenSing: public Screen {
AnimValue m_quitTimer;
bool m_only_singers_alive;
bool m_practmode;
- int m_speed; // speed in percent, 100 for normal, 50 for half
};
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-07-18 06:38:36
|
Module: performous Branch: portaudio Commit: d51a1ea094c57ed0357791e70e253e498606f9f8 Author: Tapio Vierros <tap...@gm...> Date: Mon Jul 5 21:46:14 2010 +0300 Refactor song parsers. * Move long constructor to a new .cc file. * Move duplicate helper functions to one place. * Use Boost for case conversions. --- game/songparser-ini.cc | 16 +----- game/songparser-sm.cc | 31 +---------- game/songparser-txt.cc | 23 +-------- game/songparser.cc | 137 ++++++++++++++++++++++++++++++++++++++++++++++++ game/songparser.hh | 111 +++++---------------------------------- 5 files changed, 157 insertions(+), 161 deletions(-) |