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: Yoda-JM <yo...@us...> - 2009-09-05 11:19:42
|
Module: performous
Branch: master
Commit: d6ee3d6e96fa04bce9b78f9717232556a1e96b1d
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Sep 5 13:19:04 2009 +0200
Fixed instrument loading
---
game/guitargraph.cc | 11 ++++++-----
game/guitargraph.hh | 2 +-
game/screen_sing.cc | 14 +++++++++-----
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 9f50c34..f45ee92 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -36,14 +36,14 @@ namespace {
}
-GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, unsigned track):
+GuitarGraph::GuitarGraph(Audio& audio, Song const& song, std::string track):
m_audio(audio),
- m_input(drums ? input::DRUMS : input::GUITAR),
+ m_input(track=="drums" ? input::DRUMS : input::GUITAR),
m_song(song),
m_button("button.svg"),
m_button_l("button_l.svg"),
m_tap("tap.svg"),
- m_drums(drums),
+ m_drums(track=="drums"),
m_cx(0.0, 0.2),
m_width(0.5, 0.4),
m_stream(),
@@ -71,9 +71,10 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, unsigned tr
unsigned int i = 0;
for (TrackMap::const_iterator it = m_song.track_map.begin(); it != m_song.track_map.end(); ++it,++i) {
std::string index = it->first;
- if (drums != (index == "drums")) continue;
m_track_map.insert(make_pair(index, &it->second));
- if( i == track ) m_track_index = index;
+ if( index == track ) m_track_index = index;
+
+ // load required textures (even the unused)
if (index == "drums") m_necks.insert(index, new Texture("drumneck.svg"));
else if (index == "bass") m_necks.insert(index, new Texture("bassneck.svg"));
else m_necks.insert(index, new Texture("guitarneck.svg"));
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index b965104..889b1ca 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -43,7 +43,7 @@ static inline bool operator==(Chord const& a, Chord const& b) {
class GuitarGraph {
public:
/// constructor
- GuitarGraph(Audio& audio, Song const& song, bool drums, unsigned num);
+ GuitarGraph(Audio& audio, Song const& song, std::string track);
/** draws GuitarGraph
* @param time at which time to draw
*/
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 0ca3028..eed1cd9 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -34,13 +34,17 @@ void ScreenSing::enter() {
m_layout_singer.reset(new LayoutSinger(*m_song, m_players, theme));
// I know some purists would hang me for this loop
if( !m_song->track_map.empty() ) {
- bool drums = false;
- for (int num = 0; true; ++num) {
+ // Here we load alternatively guitar/bass tracks until no guitar controler is available
+ // then we load all the drums tracks until no drum controler is available (and place them in second position)
+ std::string track = "guitar";
+ while (1) {
try {
Instruments::iterator it = m_instruments.end();
- if (drums && m_instruments.size() > 1) it = m_instruments.begin() + 1; // Drums go after the first guitar
- m_instruments.insert(it, new GuitarGraph(m_audio, *m_song, drums, num));
- } catch (std::runtime_error&) { if (drums) break; drums = true; }
+ if (track == "drums" && m_instruments.size() > 1) it = m_instruments.begin() + 1; // Drums go after the first guitar
+ m_instruments.insert(it, new GuitarGraph(m_audio, *m_song, track));
+ } catch (std::runtime_error&) { if (track=="drums") break; track = "drums";}
+ if( track == "guitar" ) track = "bass";
+ if( track == "bass" ) track = "guitar";
}
}
m_audio.playMusic(m_song->music, false, 0.0, m_instruments.empty() ? -1.0 : -8.0); // Startup delay for instruments is longer than for singing only
|
|
From: Markus R. <god...@us...> - 2009-09-03 09:47:29
|
Module: performous Branch: master Commit: 4b3d01fd697621f47bd26ee0fed950fdb60c01f3 Author: Markus Raab <un...@ma...> Date: Thu Sep 3 11:42:59 2009 +0200 hiscore is now readonly --- game/highscore.cc | 56 ++++++++++++++-------------------------------- game/highscore.hh | 28 +++++++++++++++------- game/screen_highscore.cc | 24 +++++++++---------- game/screen_highscore.hh | 3 ++ game/screen_players.cc | 15 +++++------ game/screen_sing.cc | 25 -------------------- 6 files changed, 57 insertions(+), 94 deletions(-) |
|
From: Markus R. <god...@us...> - 2009-09-03 09:47:28
|
Module: performous Branch: master Commit: 2d3dd5b4c46c86edb579d3155f00b6cc0c55845c Author: Markus Raab <un...@ma...> Date: Wed Jul 29 17:46:37 2009 +0200 use cmake . later on --- docs/Compiling.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/docs/Compiling.txt b/docs/Compiling.txt index 8f1128d..cab8fea 100644 --- a/docs/Compiling.txt +++ b/docs/Compiling.txt @@ -14,7 +14,7 @@ To install from git: performous # Should you need to change building settings (e.g. installation prefix) - ccmake .. + ccmake . Dependencies: |
|
From: Markus R. <god...@us...> - 2009-09-03 09:47:27
|
Module: performous Branch: master Commit: 617d3c607700397e15f4a470dc9a42892aa00999 Author: Markus Raab <un...@ma...> Date: Thu Sep 3 11:36:37 2009 +0200 Some spelling errors. Always end sentences with full stop. --- data/performous.xml | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/data/performous.xml b/data/performous.xml index aa1d309..e0577a8 100644 --- a/data/performous.xml +++ b/data/performous.xml @@ -35,7 +35,7 @@ <entry name="game/karaoke_mode" type="bool" value="false"> <locale name="C"> <short>Karaoke mode</short> - <long>Hide pitch wave, notes and scoring</long> + <long>Hide pitch wave, notes and scoring.</long> </locale> </entry> <entry name="game/song_hiscore" type="bool" value="false"> @@ -47,20 +47,20 @@ <entry name="game/pitch" type="bool" value="true"> <locale name="C"> <short>Pitch waves</short> - <long>Enable singing pitch display (when not in karaoke mode)</long> + <long>Enable singing pitch display (when not in karaoke mode).</long> </locale> </entry> <entry name="game/theme" type="string"> <stringvalue>default</stringvalue> <locale name="C"> <short>Theme</short> - <long>Name of the theme to use or absolute path to theme folder</long> + <long>Name of the theme to use or absolute path to theme folder.</long> </locale> </entry> <entry name="game/keyboard_guitar" type="bool" value="true"> <locale name="C"> <short>Keyboard as guitar</short> - <long>Enable keyboard as guitar (Frets on Frire mode)</long> + <long>Enable keyboard as guitar (Frets on Fire mode).</long> </locale> </entry> <entry name="game/instruments" type="string_list"> @@ -80,7 +80,7 @@ <limits min="320" max="4096" step="16" /> <locale name="C"> <short>Windowed width</short> - <long></long> + <long>The width of the window.</long> </locale> </entry> <entry name="graphic/window_height" type="int" value="600" hidden="true"> @@ -88,13 +88,13 @@ <limits min="240" max="2048" step="16" /> <locale name="C"> <short>Windowed height</short> - <long></long> + <long>The height of the window.</long> </locale> </entry> <entry name="graphic/fullscreen" type="bool" value="false"> <locale name="C"> <short>Fullscreen mode</short> - <long></long> + <long>Enable fullscreen mode on startup.</long> </locale> </entry> <entry name="graphic/video" type="bool" value="true"> |
|
From: Markus R. <god...@us...> - 2009-09-03 09:47:26
|
Module: performous
Branch: master
Commit: bb7ecc589258121d7badca1dd152282fbd3f0525
Author: Markus Raab <un...@ma...>
Date: Thu Sep 3 11:20:05 2009 +0200
Require one argument
space before ; in while (eliminate warning)
---
editor/main.cc | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/editor/main.cc b/editor/main.cc
index a60b742..2d5cc84 100644
--- a/editor/main.cc
+++ b/editor/main.cc
@@ -4,6 +4,15 @@
#include <boost/math/special_functions/fpclassify.hpp>
int main(int argc, char **argv) {
+
+ if (argc < 2)
+ {
+ std::cerr << "Not enough arguments" << std::endl;
+ std::cerr << "Use " << argv[0] << " audiofile" << std::endl;
+
+ return 1;
+ }
+
// Load audio
FFmpeg mpeg(false, true, argv[1], 48000);
Analyzer analyzer(48000, 1500);
@@ -11,7 +20,7 @@ int main(int argc, char **argv) {
// wait for ffmpeg to be ready
// TODO: fix this it is probably not enough
- while( boost::math::isinf(mpeg.duration()) );
+ while( boost::math::isinf(mpeg.duration()) ) ;
// this should majorate the song duration
int64_t duration = (mpeg.duration() + 0.5) * 48000 * 2;
|
|
From: Markus R. <god...@us...> - 2009-09-03 09:47:25
|
Module: performous Branch: master Commit: 2ab245f89e4e16a7056e8baa84c641959a0e1a13 Author: Markus Raab <un...@ma...> Date: Thu Sep 3 08:52:28 2009 +0200 Merge branch 'hiscore' --- |
|
From: Yoda-JM <yo...@us...> - 2009-09-01 19:30:22
|
Module: performous
Branch: master
Commit: ef4dae4b74d8f7029c72a9b58ecbe7c5e6452faf
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Sep 1 21:30:05 2009 +0200
Enabled back instrument audio mute
---
game/guitargraph.cc | 38 ++++++++++++++++++++++++--------------
game/guitargraph.hh | 7 ++++---
game/screen_sing.cc | 22 +++++++++-------------
3 files changed, 37 insertions(+), 30 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index eeb74b2..9f50c34 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -46,7 +46,6 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, unsigned tr
m_drums(drums),
m_cx(0.0, 0.2),
m_width(0.5, 0.4),
- m_track(track),
m_stream(),
m_level(),
m_dead(1000),
@@ -69,16 +68,19 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, unsigned tr
g_samplesG.push_back(Sample(getDataPath("sounds/guitar_fail5.ogg"), sr));
g_samplesG.push_back(Sample(getDataPath("sounds/guitar_fail6.ogg"), sr));
}
- for (TrackMap::const_iterator it = m_song.track_map.begin(); it != m_song.track_map.end(); ++it) {
- if (drums != (it->first == "drums")) continue;
- m_tracks.push_back(&it->second);
- if (it->first == "drums") m_necks.push_back(new Texture("drumneck.svg"));
- else if (it->first == "bass") m_necks.push_back(new Texture("bassneck.svg"));
- else m_necks.push_back(new Texture("guitarneck.svg"));
+ unsigned int i = 0;
+ for (TrackMap::const_iterator it = m_song.track_map.begin(); it != m_song.track_map.end(); ++it,++i) {
+ std::string index = it->first;
+ if (drums != (index == "drums")) continue;
+ m_track_map.insert(make_pair(index, &it->second));
+ if( i == track ) m_track_index = index;
+ if (index == "drums") m_necks.insert(index, new Texture("drumneck.svg"));
+ else if (index == "bass") m_necks.insert(index, new Texture("bassneck.svg"));
+ else m_necks.insert(index, new Texture("guitarneck.svg"));
}
for (int i = 0; i < 6; ++i) m_hit[i].setRate(5.0);
for (int i = 0; i < 5; ++i) m_holds[i] = 0;
- if (m_tracks.empty()) throw std::runtime_error("No track");
+ if (m_track_map.empty()) throw std::runtime_error("No track");
difficultyAuto();
}
@@ -102,7 +104,16 @@ void GuitarGraph::engine() {
if (time < -0.5) {
if (ev.type == input::Event::PICK || (m_drums && ev.type == input::Event::PRESS)) {
if (m_drums ? ev.pressed[0] : ev.pressed[4]) {
- ++m_track;
+ // lets find the next track
+ TrackMapConstPtr::iterator track_it = m_track_map.find(m_track_index);
+ if( track_it != m_track_map.end() ) {
+ ++track_it;
+ if(track_it != m_track_map.end()) {
+ m_track_index = track_it->first;
+ } else {
+ m_track_index = m_track_map.begin()->first;
+ }
+ }
if (!difficulty(m_level)) difficultyAuto();
}
if (ev.pressed[0 + m_drums]) difficulty(DIFFICULTY_SUPAEASY);
@@ -259,8 +270,7 @@ void GuitarGraph::difficultyAuto() {
}
bool GuitarGraph::difficulty(Difficulty level) {
- m_track %= m_tracks.size();
- Track const& track = *m_tracks[m_track];
+ Track const& track = *m_track_map.find(m_track_index)->second;
// Find the stream number
for (TrackMap::const_iterator it = m_song.track_map.begin(); it != m_song.track_map.end(); ++it) {
if (&track == &it->second) break;
@@ -299,7 +309,7 @@ void GuitarGraph::draw(double time) {
double frac = 0.75; // Adjustable: 1.0 means fully separated, 0.0 means fully attached
if (time < -0.5) {
std::string txt;
- txt += m_tracks[m_track]->name + "\n" + diffv[m_level].name;
+ txt += m_track_map.find(m_track_index)->first + "\n" + diffv[m_level].name;
m_text.dimensions.screenBottom(-0.05).middle(-0.1 + offsetX);
m_text.draw(txt);
} else {
@@ -314,7 +324,7 @@ void GuitarGraph::draw(double time) {
{ float s = dimensions.w() / 5.0f; glScalef(s, s, s); }
// Draw the neck
{
- UseTexture tex(m_necks[m_track]);
+ UseTexture tex(*m_necks.find(m_track_index)->second);
glutil::Begin block(GL_TRIANGLE_STRIP);
float w = (m_drums ? 2.0f : 2.5f);
float texCoord = 0.0f;
@@ -441,7 +451,7 @@ void GuitarGraph::updateChords() {
Durations::size_type pos[5] = {}, size[5] = {};
Durations const* durations[5] = {};
for (int fret = 0; fret < 5; ++fret) {
- NoteMap const& nm = m_tracks[m_track]->nm;
+ NoteMap const& nm = m_track_map.find(m_track_index)->second->nm;
int basepitch = diffv[m_level].basepitch;
NoteMap::const_iterator it = nm.find(basepitch + fret);
if (it == nm.end()) continue;
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index bc321e7..b965104 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -53,6 +53,7 @@ class GuitarGraph {
double dead(double time) const { return time > -0.5 && m_dead > 50; }
unsigned stream() const { return m_stream; }
double correctness() const { return m_correctness.get(); }
+ std::string getTrackIndex() const { return m_track_index;}
private:
void fail(double time, int fret);
void endHold(int fret);
@@ -63,12 +64,12 @@ class GuitarGraph {
Texture m_button_l;
Surface m_tap;
AnimValue m_hit[6];
- boost::ptr_vector<Texture> m_necks;
+ boost::ptr_map<std::string,Texture> m_necks;
bool m_drums;
AnimValue m_cx, m_width;
- unsigned m_track;
+ std::string m_track_index;
std::size_t m_stream;
- TrackVectorConstPtr m_tracks;
+ TrackMapConstPtr m_track_map;
void drumHit(double time, int pad);
void guitarPlay(double time, input::Event const& ev);
enum Difficulty {
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index f64115d..4567cc3 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -55,10 +55,10 @@ void ScreenSing::instrumentLayout(double time) {
m_instruments[i].position((0.5 + i - 0.5 * s) * iw, iw);
}
typedef std::pair<unsigned, double> CountSum;
- std::map<unsigned, CountSum> volume; // stream id to (count, sum)
+ std::map<std::string, CountSum> volume; // stream id to (count, sum)
for (Instruments::iterator it = m_instruments.begin(); it != m_instruments.end(); ++it) {
it->engine();
- CountSum& cs = volume[it->stream() + 1];
+ CountSum& cs = volume[it->getTrackIndex()];
cs.first++;
cs.second += it->correctness();
it->draw(time);
@@ -69,20 +69,16 @@ void ScreenSing::instrumentLayout(double time) {
glColor3f(1.0f, 1.0f, 1.0f);
}
// Set volume levels (averages of all instruments playing that track)
- for (std::size_t i = 0, s = m_song->music.size(); i < s; ++i) {
- double level = 1.0;
- CountSum cs = volume[i];
- if (cs.first > 0) level = cs.second / cs.first;
- //m_audio.streamFade(i, level); // +1 because 0 is bg
- }
- /*
for( std::map<std::string,std::string>::iterator it = m_song->music.begin() ; it != m_song->music.end() ; ++it ) {
double level = 1.0;
- CountSum cs = volume[it->first];
- if (cs.first > 0) level = cs.second / cs.first;
- m_audio.streamFade(it->first, level);
+ if( volume.find(it->first) == volume.end() ) {
+ m_audio.streamFade(it->first, level);
+ } else {
+ CountSum cs = volume[it->first];
+ if (cs.first > 0) level = cs.second / cs.first;
+ m_audio.streamFade(it->first, level);
+ }
}
- */
}
void ScreenSing::exit() {
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-09-01 07:28:16
|
Module: performous
Branch: master
Commit: 941d233862307657ba6463f2c9a21f7bbfc4250a
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Sep 1 10:13:01 2009 +0300
Use desktop resolution for full screen mode. Disable modesetting commandline options.
---
data/performous.xml | 18 +-----------------
game/main.cc | 9 +--------
game/video_driver.cc | 7 +++++--
game/video_driver.hh | 5 ++---
4 files changed, 9 insertions(+), 30 deletions(-)
diff --git a/data/performous.xml b/data/performous.xml
index 651b0a8..aa1d309 100644
--- a/data/performous.xml
+++ b/data/performous.xml
@@ -91,26 +91,10 @@
<long></long>
</locale>
</entry>
- <entry name="graphic/fs_width" type="int" value="1024">
- <ui unit=" px" />
- <limits min="320" max="4096" step="16" />
- <locale name="C">
- <short>Fullscreen width</short>
- <long></long>
- </locale>
- </entry>
- <entry name="graphic/fs_height" type="int" value="768">
- <ui unit=" px" />
- <limits min="240" max="2048" step="16" />
- <locale name="C">
- <short>Fullscreen height</short>
- <long></long>
- </locale>
- </entry>
<entry name="graphic/fullscreen" type="bool" value="false">
<locale name="C">
<short>Fullscreen mode</short>
- <long>Set width and height to suitable values first!</long>
+ <long></long>
</locale>
</entry>
<entry name="graphic/video" type="bool" value="true">
diff --git a/game/main.cc b/game/main.cc
index 064b4e8..965173d 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -138,7 +138,7 @@ void mainLoop() {
Songs songs(songlist);
Players players(getSharePath("performous.xml"));
ScreenManager sm;
- Window window(config["graphic/window_width"].i(), config["graphic/window_height"].i(), config["graphic/fullscreen"].b(), config["graphic/fs_width"].i(), config["graphic/fs_height"].i());
+ Window window(config["graphic/window_width"].i(), config["graphic/window_height"].i(), config["graphic/fullscreen"].b());
sm.addScreen(new ScreenIntro("Intro", audio, capture));
sm.addScreen(new ScreenSongs("Songs", audio, songs));
sm.addScreen(new ScreenSing("Sing", audio, capture, players));
@@ -199,9 +199,6 @@ int main(int argc, char** argv) {
("songlist", po::value<std::string>(&songlist), "save a list of songs in the specified folder");
po::options_description opt2("Configuration options");
opt2.add_options()
- ("fs", po::value<bool>()->implicit_value(true), "start in full screen mode\n --fs=0 for windowed mode")
- ("width,W", po::value<int>(), "set horizontal resolution")
- ("height,H", po::value<int>(), "set vertical resolution")
("mics", po::value<std::vector<std::string> >(&mics)->composing(), "specify the microphones to use")
("pdev", po::value<std::vector<std::string> >(&pdevs)->composing(), "specify the playback device")
("michelp", "detailed help and device list for --mics")
@@ -277,10 +274,6 @@ int main(int argc, char** argv) {
return EXIT_FAILURE;
}
// Override XML config for options that were specified from commandline or performous.conf
- if (vm.count("fs")) config["graphic/fullscreen"].b() = vm["fs"].as<bool>();
- std::string graphic = config["graphic/fullscreen"].b() ? "graphic/fs_" : "graphic/window_";
- if (vm.count("width")) config[graphic + "width"].i() = vm["width"].as<int>();
- if (vm.count("height")) config[graphic + "height"].i() = vm["height"].as<int>();
confOverride(songdirs, "system/path_songs");
confOverride(mics, "audio/capture");
confOverride(pdevs, "audio/playback");
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 9f6f4c9..d5ed163 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -15,7 +15,7 @@ namespace {
unsigned int screenW() { return s_width; }
unsigned int screenH() { return s_height; }
-Window::Window(unsigned int width, unsigned int height, int fs, unsigned int fs_width, unsigned int fs_height): m_windowW(width), m_windowH(height), m_fsW(fs_width), m_fsH(fs_height) {
+Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(width), m_windowH(height), m_fullscreen(fs) {
std::atexit(SDL_Quit);
if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) == -1 ) throw std::runtime_error("SDL_Init failed");
SDL_WM_SetCaption(PACKAGE " " VERSION, PACKAGE);
@@ -24,7 +24,10 @@ Window::Window(unsigned int width, unsigned int height, int fs, unsigned int fs_
SDL_WM_SetIcon(icon, NULL);
SDL_FreeSurface(icon);
}
- m_fullscreen = (fs != 0);
+ // SDL_SetVideoMode not called yet => get the desktop resolution for fs mode
+ SDL_VideoInfo const* vi = SDL_GetVideoInfo();
+ m_fsW = vi->current_w;
+ m_fsH = vi->current_h;
resize();
SDL_ShowCursor(SDL_DISABLE);
SDL_EnableUNICODE(SDL_ENABLE);
diff --git a/game/video_driver.hh b/game/video_driver.hh
index b8c90dc..48364cf 100644
--- a/game/video_driver.hh
+++ b/game/video_driver.hh
@@ -14,7 +14,7 @@ class SDL_Surface;
class Window {
public:
/// constructor
- Window(unsigned int width, unsigned int height, int fullscreen, unsigned int fs_width, unsigned int fs_height);
+ Window(unsigned int windowW, unsigned int windowH, bool fullscreen);
/// destructor
~Window();
/// clears window
@@ -26,8 +26,7 @@ class Window {
* @param height the new height
*/
void resize(unsigned width, unsigned height) {
- if (m_fullscreen) { m_fsW = width; m_fsH = height; }
- else { m_windowW = width; m_windowH = height; }
+ if (!m_fullscreen) { m_windowW = width; m_windowH = height; }
resize();
}
/// does the resizing
|
|
From: Yoda-JM <yo...@us...> - 2009-08-29 17:58:13
|
Module: performous
Branch: master
Commit: 7d39b328bf2ef9c0f62485282082dc5c40e9e48c
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Aug 29 19:57:45 2009 +0200
Added yet another non-working editor stuff
---
editor/main.cc | 39 ++++++++++++++++++---
editor/notes.cc | 82 ++++++++++++++++++++++++++++++++++++++++++++
editor/notes.hh | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 216 insertions(+), 6 deletions(-)
diff --git a/editor/main.cc b/editor/main.cc
index 2855334..a60b742 100644
--- a/editor/main.cc
+++ b/editor/main.cc
@@ -1,23 +1,50 @@
#include "pitch.hh"
#include "ffmpeg.hh"
+#include "notes.hh"
#include <boost/math/special_functions/fpclassify.hpp>
int main(int argc, char **argv) {
// Load audio
FFmpeg mpeg(false, true, argv[1], 48000);
- int64_t position = 0;
-
- da::sample_t *sample = new da::sample_t(1500);
- da::pcm_data data(sample, 1500, 2, 48000);
+ Analyzer analyzer(48000, 1500);
+ MusicalScale scale;
// wait for ffmpeg to be ready
// TODO: fix this it is probably not enough
while( boost::math::isinf(mpeg.duration()) );
+ // this should majorate the song duration
+ int64_t duration = (mpeg.duration() + 0.5) * 48000 * 2;
+
+ unsigned int i = 0;
+ int64_t position = 0;
+ da::sample_t *sample = new da::sample_t(2);
+ da::pcm_data data(sample, 1500, 2, 48000);
while( mpeg.audioQueue(data, position) ) {
- std::cout << "Position: " << position << " " << double(position) / double(48000*2)<< std::endl;
+ std::cout << i << ": " << position << " " << double(position) / double(48000*2)<< std::endl;
+
+ analyzer.input(data.begin(0), data.end(0));
+ analyzer.process();
+
+ Tone const* tone = analyzer.findTone();
+ double freq = (tone ? tone->freq : 0.0);
+
+ if( freq != 0.0 ) {
+ std::cout << " Found: " << freq << std::endl;
+ Analyzer::tones_t tones = analyzer.getTones();
+ for (Analyzer::tones_t::const_iterator t = tones.begin(); t != tones.end(); ++t) {
+ if (t->age < Tone::MINAGE) continue;
+ std::cout << " " << t->freq << std::endl;
+ int note = scale.getNoteId(t->freq);
+ if (note < 0) continue;
+ // Here I could spot X=position, Y=note, Z=t->db
+ }
+ } else {
+ std::cout << " No tone here" << std::endl;
+ }
+ i++;
}
- std::cout << "Duration: " << mpeg.duration() << std::endl;
+ std::cout << i << ": " << duration << " " << mpeg.duration() << std::endl;
return EXIT_SUCCESS;
}
diff --git a/editor/notes.cc b/editor/notes.cc
new file mode 100644
index 0000000..49664e0
--- /dev/null
+++ b/editor/notes.cc
@@ -0,0 +1,82 @@
+#include "notes.hh"
+
+#include "util.hh"
+#include <cmath>
+#include <algorithm>
+#include <limits>
+#include <sstream>
+#include <stdexcept>
+
+std::string MusicalScale::getNoteStr(double freq) const {
+ int id = getNoteId(freq);
+ if (id == -1) return std::string();
+ static const char * note[12] = {"C ","C#","D ","D#","E ","F ","F#","G ","G#","A ","A#","B "};
+ std::ostringstream oss;
+ // Acoustical Society of America Octave Designation System
+ //int octave = 2 + id / 12;
+ oss << note[id%12] << " " << int(round(freq)) << " Hz";
+ return oss.str();
+}
+
+unsigned int MusicalScale::getNoteNum(int id) const {
+ // C major scale
+ int n = id % 12;
+ return (n + (n > 4)) / 2;
+}
+
+bool MusicalScale::isSharp(int id) const {
+ if (id < 0) throw std::logic_error("MusicalScale::isSharp: Invalid note ID");
+ // C major scale
+ switch (id % 12) {
+ case 1: case 3: case 6: case 8: case 10: return true;
+ }
+ return false;
+}
+
+double MusicalScale::getNoteFreq(int id) const {
+ if (id == -1) return 0.0;
+ return m_baseFreq * pow(2.0, (id - m_baseId) / 12.0);
+}
+
+int MusicalScale::getNoteId(double freq) const {
+ double note = getNote(freq);
+ if (note >= 0.0 && note < 100.0) return int(note + 0.5);
+ return -1;
+}
+
+double MusicalScale::getNote(double freq) const {
+ if (freq < 1.0) return getNaN();
+ return m_baseId + 12.0 * std::log(freq / m_baseFreq) / std::log(2.0);
+}
+
+double MusicalScale::getNoteOffset(double freq) const {
+ double frac = freq / getNoteFreq(getNoteId(freq));
+ return 12.0 * std::log(frac) / std::log(2.0);
+}
+
+Note::Note(): begin(getNaN()), end(getNaN()), power(getNaN()), type(NORMAL), note(), notePrev() {}
+
+double Note::diff(double note, double n) { return remainder(n - note, 12.0); }
+double Note::maxScore() const { return scoreMultiplier(0.0) * (end - begin); }
+
+double Note::score(double n, double b, double e) const {
+ double len = std::min(e, end) - std::max(b, begin);
+ if (len <= 0.0 || !(n > 0.0)) return 0.0;
+ return scoreMultiplier(std::abs(diff(n))) * len;
+}
+
+double Note::scoreMultiplier(double error) const {
+ double max = 0.0;
+ switch (type) {
+ case FREESTYLE: power += 1.0; return 1.0;
+ case NORMAL: case SLIDE: max = 1.0; break;
+ case GOLDEN: max = 2.0; break;
+ case SLEEP: break;
+ }
+ double accuracy = clamp(1.5 - error, 0.0, 1.0);
+ power += accuracy;
+ return accuracy * max;
+}
+
+Duration::Duration(): begin(getNaN()), end(getNaN()) {}
+
diff --git a/editor/notes.hh b/editor/notes.hh
new file mode 100644
index 0000000..59c3fc6
--- /dev/null
+++ b/editor/notes.hh
@@ -0,0 +1,101 @@
+#pragma once
+
+#include <map>
+#include <string>
+#include <vector>
+
+/// musical scale, defaults to C major
+class MusicalScale {
+ private:
+ double m_baseFreq;
+ static const int m_baseId = 33;
+
+ public:
+ /// constructor
+ MusicalScale(double baseFreq = 440.0): m_baseFreq(baseFreq) {}
+ /// get name of note
+ std::string getNoteStr(double freq) const;
+ /// get note number for id
+ unsigned int getNoteNum(int id) const;
+ /// true if sharp note
+ bool isSharp(int id) const;
+ /// get frequence for note id
+ double getNoteFreq(int id) const;
+ /// get note id for frequence
+ int getNoteId(double freq) const;
+ /// get note for frequence
+ double getNote(double freq) const;
+ /// get note offset for frequence
+ double getNoteOffset(double freq) const;
+};
+
+/// stores duration of a note
+struct Duration {
+ double begin, ///< beginning timestamp in seconds
+ end; ///< ending timestamp in seconds
+ Duration();
+ /// create a new Duration object and initialize begin and end
+ Duration(double b, double e): begin(b), end(e) {}
+ /// compares begin timestamps of two Duration structs
+ static bool ltBegin(Duration const& a, Duration const& b) { return a.begin < b.begin; }
+ /// compares end timestamps of two Duration structs
+ static bool ltEnd(Duration const& a, Duration const& b) { return a.end < b.end; }
+};
+
+typedef std::vector<Duration> Durations;
+typedef std::map<int, Durations> NoteMap;
+
+struct Track {
+ // TODO: name should not be needed here (contained into the map)
+ Track(std::string n): name(n) {}
+ std::string name;
+ NoteMap nm;
+};
+
+// TODO: remove the following two types
+typedef std::vector<Track> TrackVector;
+typedef std::vector<Track const*> TrackVectorConstPtr;
+// keep these ones
+typedef std::map<std::string,Track> TrackMap;
+typedef std::map<std::string,Track const*> TrackMapConstPtr; // this one really needed ? can't we save only the map key for comparison ?
+
+namespace {
+ bool isTrackInside(TrackMap &track_map, std::string name) {
+ if( track_map.find(name) != track_map.end() ) return true;
+ return false;
+ }
+}
+
+// TODO: Make Note use Duration
+
+/// note read from songfile
+struct Note {
+ Note();
+ double begin, ///< begin time
+ end; ///< end time
+ /// power of note
+ mutable double power;
+ /// note type
+ enum Type { FREESTYLE = 'F', NORMAL = ':', GOLDEN = '*', SLIDE = '+', SLEEP = '-'} type;
+ int note; ///< MIDI pitch of the note (at the end for slide notes)
+ int notePrev; ///< MIDI pitch of the previous note (should be same as note for everything but SLIDE)
+ /// lyrics syllable for that note
+ std::string syllable;
+ /// Difference of n from note
+ double diff(double n) const { return diff(note, n); }
+ /// Difference of n from note, so that note + diff(note, n) is n (mod 12)
+ static double diff(double note, double n);
+ /// maximum score
+ double maxScore() const;
+ /// score when singing
+ double score(double freq, double b, double e) const;
+ /// compares begin of two notes
+ static bool ltBegin(Note const& a, Note const& b) { return a.begin < b.begin; }
+ /// compares end of two notes
+ static bool ltEnd(Note const& a, Note const& b) { return a.end < b.end; }
+ private:
+ double scoreMultiplier(double error) const;
+};
+
+typedef std::vector<Note> Notes;
+
|
|
From: Yoda-JM <yo...@us...> - 2009-08-29 17:14:08
|
Module: performous
Branch: master
Commit: 90c28fca312900041186f650cd8ee0925059b043
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Aug 29 19:13:38 2009 +0200
Fixed ffmpeg stuff (probably just a workaround)
---
editor/main.cc | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/editor/main.cc b/editor/main.cc
index 5c931e9..2855334 100644
--- a/editor/main.cc
+++ b/editor/main.cc
@@ -1,5 +1,6 @@
#include "pitch.hh"
#include "ffmpeg.hh"
+#include <boost/math/special_functions/fpclassify.hpp>
int main(int argc, char **argv) {
// Load audio
@@ -9,10 +10,14 @@ int main(int argc, char **argv) {
da::sample_t *sample = new da::sample_t(1500);
da::pcm_data data(sample, 1500, 2, 48000);
+ // wait for ffmpeg to be ready
+ // TODO: fix this it is probably not enough
+ while( boost::math::isinf(mpeg.duration()) );
+
while( mpeg.audioQueue(data, position) ) {
std::cout << "Position: " << position << " " << double(position) / double(48000*2)<< std::endl;
}
- std::cout << "Duration: " << mpeg.audioQueue.duration() << std::endl;
+ std::cout << "Duration: " << mpeg.duration() << std::endl;
return EXIT_SUCCESS;
}
|
|
From: Yoda-JM <yo...@us...> - 2009-08-29 09:02:50
|
Module: performous
Branch: master
Commit: c3216e9310fb5ac3d6cf56d1addd869e88a0a986
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Aug 29 11:02:22 2009 +0200
Played a little bit more with ffmpeg
---
editor/main.cc | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/editor/main.cc b/editor/main.cc
index 75a7ead..5c931e9 100644
--- a/editor/main.cc
+++ b/editor/main.cc
@@ -6,14 +6,13 @@ int main(int argc, char **argv) {
FFmpeg mpeg(false, true, argv[1], 48000);
int64_t position = 0;
- da::sample_t *sample = new da::sample_t(2*4800);
+ da::sample_t *sample = new da::sample_t(1500);
da::pcm_data data(sample, 1500, 2, 48000);
while( mpeg.audioQueue(data, position) ) {
- std::cout << "Position: " << position << std::endl;
- position += (data.frames * data.channels);
+ std::cout << "Position: " << position << " " << double(position) / double(48000*2)<< std::endl;
}
- std::cout << "Total: " << mpeg.audioQueue.duration() << std::endl;
+ std::cout << "Duration: " << mpeg.audioQueue.duration() << std::endl;
return EXIT_SUCCESS;
}
|
|
From: Yoda-JM <yo...@us...> - 2009-08-28 18:58:58
|
Module: performous
Branch: master
Commit: eda1e0dcf3fc4855d963b5c4f41beda11bec1adf
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Aug 28 20:58:28 2009 +0200
Added some editor code
---
editor/ffmpeg.hh | 1 -
editor/main.cc | 9 +++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/editor/ffmpeg.hh b/editor/ffmpeg.hh
index 5b85297..b7eefbc 100644
--- a/editor/ffmpeg.hh
+++ b/editor/ffmpeg.hh
@@ -157,7 +157,6 @@ class AudioBuffer {
bool eof(int64_t pos) const { return double(pos) / m_sps >= m_duration; }
double duration() const { return m_duration; }
void setDuration(double seconds) { m_duration = seconds; }
- double position() { return double(m_pos) / m_sps; }
bool wantSeek() {
size_t oldest = m_pos - m_data.size();
return oldest > 0 && m_posReq < int64_t(oldest);
diff --git a/editor/main.cc b/editor/main.cc
index 6ab7ae4..75a7ead 100644
--- a/editor/main.cc
+++ b/editor/main.cc
@@ -4,15 +4,16 @@
int main(int argc, char **argv) {
// Load audio
FFmpeg mpeg(false, true, argv[1], 48000);
- int64_t position;
- /*
+ int64_t position = 0;
+
da::sample_t *sample = new da::sample_t(2*4800);
da::pcm_data data(sample, 1500, 2, 48000);
while( mpeg.audioQueue(data, position) ) {
- std::cout << "Position: " << mpeg.audioQueue.position() << std::endl;
+ std::cout << "Position: " << position << std::endl;
+ position += (data.frames * data.channels);
}
+
std::cout << "Total: " << mpeg.audioQueue.duration() << std::endl;
- */
return EXIT_SUCCESS;
}
|
|
From: Yoda-JM <yo...@us...> - 2009-08-28 18:13:06
|
Module: performous Branch: master Commit: 8c81069b3fcad29a3c8c09886e3abd9e0c5f137f Author: Vincent Le Ligeour <yo...@us...> Date: Fri Aug 28 20:12:24 2009 +0200 Added some preliminary code for song editor sandbox --- CMakeLists.txt | 1 + editor/CMakeLists.txt | 40 +++++++ editor/config.cmake.hh | 16 +++ editor/ffmpeg.cc | 286 ++++++++++++++++++++++++++++++++++++++++++++++++ editor/ffmpeg.hh | 241 ++++++++++++++++++++++++++++++++++++++++ editor/main.cc | 18 +++ editor/pitch.cc | 197 +++++++++++++++++++++++++++++++++ editor/pitch.hh | 111 +++++++++++++++++++ editor/util.hh | 25 ++++ editor/xtime.hh | 34 ++++++ 10 files changed, 969 insertions(+), 0 deletions(-) |
|
From: Yoda-JM <yo...@us...> - 2009-08-27 09:15:28
|
Module: performous Branch: refs/tags/0.4.0-pre4 Tag: 04ae16292a65a6e0ad163af529dd9aede6ccf648 Tagger: Vincent Le Ligeour <yo...@us...> Date: Thu Aug 27 11:13:11 2009 +0200 Performous 0.4.0-pre4 released. |
|
From: Yoda-JM <yo...@us...> - 2009-08-27 09:15:15
|
Module: performous Branch: master Commit: 28d92a863f27c2627ab0e0f59913c2bbd6d81120 Author: Vincent Le Ligeour <yo...@us...> Date: Thu Aug 27 11:12:15 2009 +0200 Changed revision --- CMakeLists.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a03b45..2a843d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ project(Performous CXX) cmake_minimum_required(VERSION 2.6) -set(PROJECT_VERSION "0.4-pre3") +set(PROJECT_VERSION "0.4-pre4") # Avoid source tree pollution if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-08-24 12:32:40
|
Module: performous Branch: master Commit: cb91e5e07a2a191d14e0e093be8b1c4672b2807b Author: Lasse Karkkainen <tro...@tr...> Date: Mon Aug 24 15:32:17 2009 +0300 Update git docs. --- docs/git.txt | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) diff --git a/docs/git.txt b/docs/git.txt index 0d5190d..f57cc17 100644 --- a/docs/git.txt +++ b/docs/git.txt @@ -11,14 +11,7 @@ Getting started Most probably you figured the clone part out by yourself: - $ git clone git://performous.git.sourceforge.net/gitroot/performous/performous <new-working-dir> - -respectively - - $ git clone ssh://<username>@performous.git.sourceforge.net/gitroot/performous/performous <new-working-dir> - -if you are a developer and want to have write access on our global -repository. + $ git clone git://git.performous.org/gitroot/performous/performous <new-working-dir> This will create a clone of the repository on your local harddisk with branch "master" checked out by default. @@ -97,7 +90,8 @@ Getting involved ---------------- When you become a developer of performous, you'll probably already have -a clone of the performous repository. To be able to commit, you need to +a clone of the performous repository. To be able to push, you need to change the project url with this command: - $ git config remote.origin.url ssh://USER@performous.git.sourceforge.net/gitroot/performous/performous + $ git config remote.origin.url <SF.net username>@git.performous.org:/gitroot/performous/performous + |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-08-22 15:36:47
|
Module: performous Branch: master Commit: 739063d12198d38af5360ee3da75bce0c01f3ecb Author: Lasse Karkkainen <tro...@tr...> Date: Sat Aug 22 18:35:29 2009 +0300 Autodetect Rock Band mic. --- data/performous.xml | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/data/performous.xml b/data/performous.xml index 0a0d84e..651b0a8 100644 --- a/data/performous.xml +++ b/data/performous.xml @@ -168,7 +168,8 @@ </locale> </entry> <entry name="audio/capture" type="string_list"> - <stringvalue>channels=2@alsa:hw:default</stringvalue> + <stringvalue>channels=2@alsa:hw:default</stringvalue><!-- SingStar mics --> + <stringvalue>channels=1@alsa:hw:Microphone</stringvalue><!-- Rock Band branded Logitech mic --> <stringvalue>channels=2</stringvalue> <locale name="C"> <short>Microphones</short> |
|
From: Yoda-JM <yo...@us...> - 2009-08-21 12:45:45
|
Module: performous
Branch: master
Commit: 5c34641afd53fae9acca8fd2e4d25f94387609d0
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Aug 21 14:44:52 2009 +0200
Removed some vector of tracks to replace it by map of tracks
---
game/guitargraph.cc | 16 ++++++++--------
game/guitargraph.hh | 2 +-
game/notes.hh | 14 +++++++++-----
game/screen_sing.cc | 8 ++++----
game/screen_songs.cc | 8 ++++----
game/song.cc | 2 +-
game/song.hh | 2 +-
game/songparser-ini.cc | 6 +++---
8 files changed, 31 insertions(+), 27 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 379f8e7..eeb74b2 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -69,16 +69,16 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, unsigned tr
g_samplesG.push_back(Sample(getDataPath("sounds/guitar_fail5.ogg"), sr));
g_samplesG.push_back(Sample(getDataPath("sounds/guitar_fail6.ogg"), sr));
}
- for (Tracks::const_iterator it = m_song.tracks.begin(); it != m_song.tracks.end(); ++it) {
- if (drums != (it->name == "drums")) continue;
- m_tracks.push_back(&*it);
- if (it->name == "drums") m_necks.push_back(new Texture("drumneck.svg"));
- else if (it->name == "bass") m_necks.push_back(new Texture("bassneck.svg"));
+ for (TrackMap::const_iterator it = m_song.track_map.begin(); it != m_song.track_map.end(); ++it) {
+ if (drums != (it->first == "drums")) continue;
+ m_tracks.push_back(&it->second);
+ if (it->first == "drums") m_necks.push_back(new Texture("drumneck.svg"));
+ else if (it->first == "bass") m_necks.push_back(new Texture("bassneck.svg"));
else m_necks.push_back(new Texture("guitarneck.svg"));
}
for (int i = 0; i < 6; ++i) m_hit[i].setRate(5.0);
for (int i = 0; i < 5; ++i) m_holds[i] = 0;
- if (m_tracks.empty()) throw std::runtime_error("No tracks");
+ if (m_tracks.empty()) throw std::runtime_error("No track");
difficultyAuto();
}
@@ -262,8 +262,8 @@ bool GuitarGraph::difficulty(Difficulty level) {
m_track %= m_tracks.size();
Track const& track = *m_tracks[m_track];
// Find the stream number
- for (m_stream = 0; m_stream < m_song.tracks.size(); ++m_stream) {
- if (&track == &m_song.tracks[m_stream]) break;
+ for (TrackMap::const_iterator it = m_song.track_map.begin(); it != m_song.track_map.end(); ++it) {
+ if (&track == &it->second) break;
}
// Check if the difficulty level is available
uint8_t basepitch = diffv[level].basepitch;
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 9345dbb..bc321e7 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -68,7 +68,7 @@ class GuitarGraph {
AnimValue m_cx, m_width;
unsigned m_track;
std::size_t m_stream;
- std::vector<Track const*> m_tracks;
+ TrackVectorConstPtr m_tracks;
void drumHit(double time, int pad);
void guitarPlay(double time, input::Event const& ev);
enum Difficulty {
diff --git a/game/notes.hh b/game/notes.hh
index 29f22f5..59c3fc6 100644
--- a/game/notes.hh
+++ b/game/notes.hh
@@ -46,18 +46,22 @@ typedef std::vector<Duration> Durations;
typedef std::map<int, Durations> NoteMap;
struct Track {
+ // TODO: name should not be needed here (contained into the map)
Track(std::string n): name(n) {}
std::string name;
NoteMap nm;
};
-typedef std::vector<Track> Tracks;
+// TODO: remove the following two types
+typedef std::vector<Track> TrackVector;
+typedef std::vector<Track const*> TrackVectorConstPtr;
+// keep these ones
+typedef std::map<std::string,Track> TrackMap;
+typedef std::map<std::string,Track const*> TrackMapConstPtr; // this one really needed ? can't we save only the map key for comparison ?
namespace {
- bool isTrackInside(Tracks &_tracks, std::string _name) {
- for( Tracks::iterator it = _tracks.begin() ; it != _tracks.end() ; ++it ) {
- if(it->name == _name) return true;
- }
+ bool isTrackInside(TrackMap &track_map, std::string name) {
+ if( track_map.find(name) != track_map.end() ) return true;
return false;
}
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 9640093..f64115d 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -33,7 +33,7 @@ void ScreenSing::enter() {
m_engine.reset(new Engine(m_audio, *m_song, analyzers.begin(), analyzers.end(), m_players));
m_layout_singer.reset(new LayoutSinger(*m_song, m_players, theme));
// I know some purists would hang me for this loop
- if( !m_song->tracks.empty() ) {
+ if( !m_song->track_map.empty() ) {
bool drums = false;
for (int num = 0; true; ++num) {
try {
@@ -153,7 +153,7 @@ void ScreenSing::manageEvent(SDL_Event event) {
else if (key == SDLK_SPACE || key == SDLK_PAUSE) m_audio.togglePause();
if (m_score_window.get()) return;
// The rest are only available when score window is not displayed and when there are no instruments
- if (key == SDLK_RETURN && status == Song::INSTRUMENTAL_BREAK && m_song->tracks.empty()) {
+ if (key == SDLK_RETURN && status == Song::INSTRUMENTAL_BREAK && m_song->track_map.empty()) {
double diff = m_layout_singer->lyrics_begin() - 3.0 - time;
if (diff > 0.0) m_audio.seek(diff);
}
@@ -240,14 +240,14 @@ void ScreenSing::draw() {
unsigned t = clamp(time, 0.0, length);
m_progress->draw(songPercent);
std::string statustxt = (boost::format("%02u:%02u") % (t / 60) % (t % 60)).str();
- if (!m_score_window.get() && m_song->tracks.empty()) {
+ if (!m_score_window.get() && m_song->track_map.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!";
}
theme->timer.draw(statustxt);
}
- if (config["game/karaoke_mode"].b() || !m_song->tracks.empty()) {
+ if (config["game/karaoke_mode"].b() || !m_song->track_map.empty()) {
if (!m_audio.isPlaying()) {
ScreenManager* sm = ScreenManager::getSingletonPtr();
sm->activateScreen("Songs");
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index e0bd153..a4cb4cb 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -205,7 +205,7 @@ void ScreenSongs::draw() {
// Fetch cover image from cache or try loading it
if (!song_display.cover.empty()) try { cover = &m_covers[song_display.path + song_display.cover]; } catch (std::exception const&) {}
if (!cover) {
- size_t tracks = song_display.tracks.size();
+ size_t tracks = song_display.track_map.size();
if (tracks == 0) cover = m_emptyCover.get();
else if (tracks == 1) cover = m_instrumentCover.get();
else cover = m_bandCover.get();
@@ -243,7 +243,7 @@ void ScreenSongs::draw() {
}
{
// guitar
- alpha = (isTrackInside(song_display.tracks,"guitar")) ? 1.00 : 0.25;
+ alpha = (isTrackInside(song_display.track_map,"guitar")) ? 1.00 : 0.25;
glutil::Begin block(GL_TRIANGLE_STRIP);
glColor4f(1.0, 1.0, 1.0, alpha);
x = dim.x1()+0.25*(dim.x2()-dim.x1());
@@ -255,7 +255,7 @@ void ScreenSongs::draw() {
}
{
// bass
- alpha = (isTrackInside(song_display.tracks,"bass")) ? 1.00 : 0.25;
+ alpha = (isTrackInside(song_display.track_map,"bass")) ? 1.00 : 0.25;
glutil::Begin block(GL_TRIANGLE_STRIP);
glColor4f(1.0, 1.0, 1.0, alpha);
x = dim.x1()+0.50*(dim.x2()-dim.x1());
@@ -267,7 +267,7 @@ void ScreenSongs::draw() {
}
{
// drums
- alpha = (isTrackInside(song_display.tracks,"drums")) ? 1.00 : 0.25;
+ alpha = (isTrackInside(song_display.track_map,"drums")) ? 1.00 : 0.25;
glutil::Begin block(GL_TRIANGLE_STRIP);
glColor4f(1.0, 1.0, 1.0, alpha);
x = dim.x1()+0.75*(dim.x2()-dim.x1());
diff --git a/game/song.cc b/game/song.cc
index 31de0c2..31831a6 100644
--- a/game/song.cc
+++ b/game/song.cc
@@ -5,7 +5,7 @@
void Song::reload(bool errorIgnore) {
notes.clear();
- tracks.clear();
+ track_map.clear();
beats.clear();
category.clear();
genre.clear();
diff --git a/game/song.hh b/game/song.hh
index 968c889..41b0b2e 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -37,7 +37,7 @@ class Song: boost::noncopyable {
Status status(double time) const;
int randomIdx; ///< sorting index used for random order
Notes notes; ///< notes for song (only used for singing)
- Tracks tracks; ///< guitar etc. notes for this song
+ TrackMap track_map; ///< guitar etc. notes for this song
typedef std::vector<double> Beats;
Beats beats;
int noteMin, ///< lowest note
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 74a99b1..5899b1f 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -85,10 +85,10 @@ void SongParser::iniParse() {
// Process non-vocal tracks
if (name != "VOCALS") {
bool drums = (name == "drums");
- s.tracks.push_back(Track(name));
- NoteMap& nm = s.tracks.back().nm;
+ s.track_map.insert(make_pair(name,Track(name)));
+ NoteMap& nm2 = s.track_map.find(name)->second.nm;
for (MidiFileParser::NoteMap::const_iterator it2 = it->notes.begin(); it2 != it->notes.end(); ++it2) {
- Durations& dur = nm[it2->first];
+ Durations& dur = nm2[it2->first];
MidiFileParser::Notes const& notes = it2->second;
for (MidiFileParser::Notes::const_iterator it3 = notes.begin(); it3 != notes.end(); ++it3) {
double beg = midi.get_seconds(it3->begin);
|
|
From: Yoda-JM <yo...@us...> - 2009-08-20 11:15:26
|
Module: performous Branch: refs/tags/0.3.2 Tag: c8cb19238ce143f8d525e44fc38c29e9968d3c2a Tagger: Vincent Le Ligeour <yo...@us...> Date: Thu Aug 20 13:11:02 2009 +0200 Performous 0.3.2 released. |
|
From: Yoda-JM <yo...@us...> - 2009-08-20 11:01:02
|
Module: performous Branch: master Commit: 5d4bb03ac7b98561b43d0d3eb9fbf46aaf3830fd Author: Vincent Le Ligeour <yo...@us...> Date: Thu Aug 20 13:00:22 2009 +0200 Changed git repository URL according to the new sf.net scheme --- docs/Compiling.txt | 2 +- docs/git.txt | 6 +++--- .../games-arcade/performous/performous-9999.ebuild | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/Compiling.txt b/docs/Compiling.txt index 8f1128d..629d4c1 100644 --- a/docs/Compiling.txt +++ b/docs/Compiling.txt @@ -1,7 +1,7 @@ To install from git: # Checkout the git - git clone git://performous.git.sourceforge.net/gitroot/performous + git clone git://performous.git.sourceforge.net/gitroot/performous/performous # Create separate build folder under trunk to avoid polluting the source three mkdir performous/build cd performous/build diff --git a/docs/git.txt b/docs/git.txt index 0cfe8ef..0d5190d 100644 --- a/docs/git.txt +++ b/docs/git.txt @@ -11,11 +11,11 @@ Getting started Most probably you figured the clone part out by yourself: - $ git clone git://performous.git.sourceforge.net/gitroot/performous <new-working-dir> + $ git clone git://performous.git.sourceforge.net/gitroot/performous/performous <new-working-dir> respectively - $ git clone ssh://<username>@performous.git.sourceforge.net/gitroot/performous <new-working-dir> + $ git clone ssh://<username>@performous.git.sourceforge.net/gitroot/performous/performous <new-working-dir> if you are a developer and want to have write access on our global repository. @@ -100,4 +100,4 @@ When you become a developer of performous, you'll probably already have a clone of the performous repository. To be able to commit, you need to change the project url with this command: - $ git config remote.origin.url ssh://USER@performous.git.sourceforge.net/gitroot/performous + $ git config remote.origin.url ssh://USER@performous.git.sourceforge.net/gitroot/performous/performous diff --git a/portage-overlay/games-arcade/performous/performous-9999.ebuild b/portage-overlay/games-arcade/performous/performous-9999.ebuild index 16ded03..110650c 100644 --- a/portage-overlay/games-arcade/performous/performous-9999.ebuild +++ b/portage-overlay/games-arcade/performous/performous-9999.ebuild @@ -17,7 +17,7 @@ SRC_URI="songs? ( mirror://sourceforge/${PN}/${SONGS_PN}-shearer-1.zip )" -EGIT_REPO_URI="git://performous.git.sourceforge.net/gitroot/performous" +EGIT_REPO_URI="git://performous.git.sourceforge.net/gitroot/performous/performous" LICENSE="GPL-2 songs? ( |
|
From: Yoda-JM <yo...@us...> - 2009-08-19 12:09:14
|
Module: performous
Branch: master
Commit: 1d2af98e740eaa983d8c109fdb3b79e531f5edb9
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Aug 19 14:08:37 2009 +0200
Used glColor4f instead of glColor3f
---
game/screen_songs.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 07cdb27..e0bd153 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -217,7 +217,7 @@ void ScreenSongs::draw() {
s.dimensions.middle(-0.2 + 0.17 * (i - shift)).bottom(y - 0.2 * diff).fitInside(0.14 + diff, 0.14 + diff); s.draw();
// Draw the reflection
s.dimensions.top(y + 0.2 * diff); s.tex = TexCoords(0, 1, 1, 0); glColor4f(1.0, 1.0, 1.0, 0.4); s.draw();
- s.tex = TexCoords(); glColor3f(1.0, 1.0, 1.0); // Restore default attributes
+ s.tex = TexCoords(); glColor4f(1.0, 1.0, 1.0, 1.0); // Restore default attributes
// Draw the intruments
{
UseTexture tex(*m_instrumentList);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-08-18 22:33:26
|
Module: performous
Branch: master
Commit: 819e5f1e4e2a089ce070cc43e1120dcf5c749a35
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Aug 19 01:32:13 2009 +0300
Make global shortcuts such as Alt+Enter higher priority than keyboard guitar.
---
game/main.cc | 56 +++++++++++++++++++++++++++-----------------------------
1 files changed, 27 insertions(+), 29 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 424054c..064b4e8 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -40,38 +40,36 @@ static void checkEvents_SDL(ScreenManager& sm, Window& window) {
static bool esc = false;
SDL_Event event;
while(SDL_PollEvent(&event) == 1) {
- // catch input event first
- if(!input::SDL::pushEvent(event)) {
- switch(event.type) {
- case SDL_QUIT:
+ switch(event.type) {
+ case SDL_QUIT:
+ sm.finished();
+ break;
+ case SDL_VIDEORESIZE:
+ window.resize(event.resize.w, event.resize.h);
+ break;
+ case SDL_KEYUP:
+ if (event.key.keysym.sym == SDLK_ESCAPE) esc = false;
+ break;
+ case SDL_KEYDOWN:
+ int keypressed = event.key.keysym.sym;
+ SDLMod modifier = event.key.keysym.mod;
+ // Workaround for key repeat on escape
+ if (keypressed == SDLK_ESCAPE) {
+ if (esc) return;
+ esc = true;
+ }
+ if (keypressed == SDLK_RETURN && modifier & KMOD_ALT ) {
+ config["graphic/fullscreen"].b() = !config["graphic/fullscreen"].b();
+ continue; // Already handled here...
+ }
+ if (keypressed == SDLK_F4 && modifier & KMOD_ALT) {
sm.finished();
- break;
- case SDL_VIDEORESIZE:
- window.resize(event.resize.w, event.resize.h);
- break;
- case SDL_KEYUP:
- if (event.key.keysym.sym == SDLK_ESCAPE) esc = false;
- break;
- case SDL_KEYDOWN:
- int keypressed = event.key.keysym.sym;
- SDLMod modifier = event.key.keysym.mod;
- // Workaround for key repeat on escape
- if (keypressed == SDLK_ESCAPE) {
- if (esc) return;
- esc = true;
- }
- if (keypressed == SDLK_RETURN && modifier & KMOD_ALT ) {
- config["graphic/fullscreen"].b() = !config["graphic/fullscreen"].b();
- continue; // Already handled here...
- }
- if (keypressed == SDLK_F4 && modifier & KMOD_ALT) {
- sm.finished();
- continue; // Already handled here...
- }
- break;
+ continue; // Already handled here...
}
- sm.getCurrentScreen()->manageEvent(event);
+ break;
}
+ // Forward to screen if the input system doesn't eat the event first
+ if(!input::SDL::pushEvent(event)) sm.getCurrentScreen()->manageEvent(event);
switch(glGetError()) {
case GL_INVALID_ENUM: std::cerr << "OpenGL error: invalid enum" << std::endl; break;
case GL_INVALID_VALUE: std::cerr << "OpenGL error: invalid value" << std::endl; break;
|
|
From: Yoda-JM <yo...@us...> - 2009-08-18 15:44:42
|
Module: performous
Branch: master
Commit: 0e3a40261fac65ff6d38ed98ffafda861c34fc5d
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Aug 18 17:44:06 2009 +0200
Added some documentation for american SingStar DVD
---
tools/ss_extract.cpp | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/tools/ss_extract.cpp b/tools/ss_extract.cpp
index b9ac5f9..908f637 100644
--- a/tools/ss_extract.cpp
+++ b/tools/ss_extract.cpp
@@ -131,6 +131,7 @@ void parseSentence(xmlpp::Node* node) {
#include "adpcm.h"
unsigned getLE16(char* buf) { unsigned char* b = reinterpret_cast<unsigned char*>(buf); return b[0] | (b[1] << 8); }
+unsigned getLE32(char* buf) { unsigned char* b = reinterpret_cast<unsigned char*>(buf); return b[0] | (b[1] << 8) | (b[2] << 16) | (b[3] << 24); }
struct Song {
std::string dataPakName, title, artist, genre, edition, year;
@@ -299,7 +300,29 @@ struct Process {
dom.get_document()->write_to_file((path / "notes.xml").string(), "UTF-8");
Pak dataPak(song.dataPakName);
std::cerr << ">>> Extracting and decoding music" << std::endl;
- music(song, dataPak[id + "/music.mib"], pak["export/" + id + "/music.mih"], path);
+ try {
+ music(song, dataPak[id + "/music.mib"], pak["export/" + id + "/music.mih"], path);
+ } catch (...) {
+ std::cerr << " >>> European DVD failed, trying American (WIP)" << std::endl;
+ // Tracks on my example
+ // 0 => video (ipu)
+ // 1 and 2 => adpcm song (left/right)
+ // 3 and 4 => adpcm vocals (left/right)
+ std::vector<char> offsets_header;
+ std::vector<char> offsets_data;
+ dataPak[id + "/mus+vid.ind"].get(offsets_header, 0, 0x68);
+ unsigned int track_count = getLE32(&offsets_header[4]);
+ dataPak[id + "/mus+vid.ind"].get(offsets_data, 0x68);
+ unsigned int offset = 0;
+ /*
+ for( unsigned int i = 0 ; i < offsets_data.size() ; i+=2) {
+ std::vector<char> chunk_data;
+ unsigned int size = getLE16(&offsets_data[i]) << 4;
+ dataPak[id + "/mus+vid.iav"].get(chunk_data, offset, size);
+ offset+=size;
+ }
+ */
+ }
std::cerr << ">>> Extracting lyrics" << std::endl;
xmlpp::NodeSet sentences = dom.get_document()->get_root_node()->find("/" + ns + "MELODY/" + ns + "SENTENCE", nsmap);
if(!sentences.empty()) {
|
|
From: Yoda-JM <yo...@us...> - 2009-08-18 12:59:56
|
Module: performous
Branch: master
Commit: 37a5200e23cc40efdccf39c9d782e169695b9404
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Aug 18 14:59:20 2009 +0200
Added tools use flag to git ebuild
---
.../games-arcade/performous/performous-9999.ebuild | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/portage-overlay/games-arcade/performous/performous-9999.ebuild b/portage-overlay/games-arcade/performous/performous-9999.ebuild
index f068622..16ded03 100644
--- a/portage-overlay/games-arcade/performous/performous-9999.ebuild
+++ b/portage-overlay/games-arcade/performous/performous-9999.ebuild
@@ -27,7 +27,7 @@ LICENSE="GPL-2
SLOT="0"
KEYWORDS="~x86 ~amd64 ~ppc ~ppc64"
-IUSE="debug alsa portaudio pulseaudio jack songs gstreamer"
+IUSE="debug alsa portaudio pulseaudio jack songs gstreamer tools"
RDEPEND="gnome-base/librsvg
dev-libs/boost
@@ -70,6 +70,11 @@ src_compile() {
mkdir build
cd build
plugins="-DLIBDA_AUTODETECT_PLUGINS=false -DLIBDA_PLUGIN_TESTING=false"
+ if use tools ; then
+ plugins="$plugins -DENABLE_TOOLS=true"
+ else
+ plugins="$plugins -DENABLE_TOOLS=false"
+ fi
if use alsa ; then
plugins="$plugins -DLIBDA_PLUGIN_ALSA=true"
else
|
|
From: Yoda-JM <yo...@us...> - 2009-08-18 12:28:38
|
Module: performous
Branch: master
Commit: 8d0e66481b7f199d9f0f10f3ad10c4740b422c83
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Aug 18 14:27:42 2009 +0200
Fixed alpha not resetted
Added special color for karaoke versions (with vocals audio track)
---
game/screen_songs.cc | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 1689062..07cdb27 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -227,8 +227,13 @@ void ScreenSongs::draw() {
{
// vocals
alpha = (song_display.notes.size()) ? 1.00 : 0.25;
+ bool karaoke = (song_display.music.find("vocals") != song_display.music.end());
glutil::Begin block(GL_TRIANGLE_STRIP);
- glColor4f(1.0, 1.0, 1.0, alpha);
+ if(karaoke) {
+ glColor4f(1.0, 1.0, 0.25, alpha);
+ } else {
+ glColor4f(1.0, 1.0, 1.0, alpha);
+ }
x = dim.x1()+0.00*(dim.x2()-dim.x1());
glTexCoord2f(0.00f, 0.0f); glVertex2f(x, dim.y1());
glTexCoord2f(0.00f, 1.0f); glVertex2f(x, dim.y2());
@@ -272,6 +277,7 @@ void ScreenSongs::draw() {
glTexCoord2f(1.00f, 0.0f); glVertex2f(x, dim.y1());
glTexCoord2f(1.00f, 1.0f); glVertex2f(x, dim.y2());
}
+ glColor4f(1.0, 1.0, 1.0, 1.0);
}
}
}
|