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...> - 2011-12-18 17:40:40
|
Author: Tapio Vierros <tap...@gm...>
Date: Sun Dec 18 19:30:43 2011 +0200
Display bottom lyrics further down in duet mode.
---
game/layout_singer.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/layout_singer.cc b/game/layout_singer.cc
index 14e1100..4f0645c 100644
--- a/game/layout_singer.cc
+++ b/game/layout_singer.cc
@@ -129,7 +129,7 @@ void LayoutSinger::draw(double time, PositionMode position) {
linespacing = 0.04;
break;
case LayoutSinger::BOTTOM:
- pos.screenBottom(-0.1);
+ pos.screenBottom(-0.05);
linespacing = 0.04;
break;
case LayoutSinger::LEFT:
|
|
From: Tapio V. <aa...@us...> - 2011-12-18 17:40:32
|
Author: Tapio Vierros <tap...@gm...>
Date: Sun Dec 18 19:28:44 2011 +0200
Create and display two LayoutSingers if more than one VocalTrack is found.
---
game/screen_sing.cc | 38 +++++++++++++++++++++++++-------------
game/screen_sing.hh | 2 +-
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index c6e249d..31ab59c 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -55,7 +55,14 @@ void ScreenSing::enter() {
}
boost::ptr_vector<Analyzer>& analyzers = m_audio.analyzers();
reloadGL();
- m_layout_singer.reset(new LayoutSinger(m_song->getVocalTrack(m_selectedTrack), m_database, theme));
+ // Add a singer layout
+ m_layout_singer.clear();
+ m_layout_singer.push_back(new LayoutSinger(m_song->getVocalTrack(m_selectedTrack), m_database, theme));
+ // Find out if we have multiple vocal tracks and create layouts for them, up to a total of 2
+ std::vector<std::string> tracks = m_song->getVocalTrackNames();
+ for (size_t i = 1; i < std::min((int)tracks.size(), 2); ++i) {
+ m_layout_singer.push_back(new LayoutSinger(m_song->getVocalTrack(tracks[i]), m_database, theme));
+ }
// Load instrument and dance tracks
sm->loading(_("Loading instruments..."), 0.8);
{
@@ -153,7 +160,7 @@ void ScreenSing::exit() {
m_menu.clear();
m_instruments.clear();
m_dancers.clear();
- m_layout_singer.reset();
+ m_layout_singer.clear();
m_help.reset();
m_pause_icon.reset();
m_cam.reset();
@@ -328,7 +335,8 @@ void ScreenSing::manageEvent(SDL_Event event) {
else if (status == Song::INSTRUMENTAL_BREAK) {
if (time < 0) m_audio.seek(0.0);
else {
- double diff = m_layout_singer->lyrics_begin() - 3.0 - time;
+ // FIXME: Should check for all layout singers
+ double diff = m_layout_singer[0].lyrics_begin() - 3.0 - time;
if (diff > 0.0) m_audio.seek(diff);
}
}
@@ -377,7 +385,9 @@ void ScreenSing::manageEvent(SDL_Event event) {
}
// Some things must be reset after seeking backwards
- if (seekback) m_layout_singer->reset();
+ if (seekback)
+ for (int i = 0; i < m_layout_singer.size(); ++i)
+ m_layout_singer[i].reset();
// Reload current song
if (key == SDLK_r) {
exit(); m_song->reload(); enter();
@@ -451,21 +461,23 @@ void ScreenSing::draw() {
theme->bg_top.draw();
}
- m_layout_singer->hideLyrics(m_audio.isPaused());
+ for (int i = 0; i < m_layout_singer.size(); ++i)
+ m_layout_singer[i].hideLyrics(m_audio.isPaused());
// Dancing
- if( !m_dancers.empty() ) {
+ if (!m_dancers.empty()) {
danceLayout(time);
//m_layout_singer->draw(time, LayoutSinger::LEFT);
m_only_singers_alive = false;
- // Singing only
- } else if( m_instruments.empty() ) {
- m_layout_singer->draw(time, LayoutSinger::FULL);
- m_only_singers_alive = true;
- // Band
+ // Singing & band
} else {
- m_only_singers_alive = !instrumentLayout(time);
- m_layout_singer->draw(time, m_only_singers_alive ? LayoutSinger::FULL : LayoutSinger::TOP);
+ if (m_instruments.empty()) m_only_singers_alive = true;
+ else m_only_singers_alive = !instrumentLayout(time);
+
+ bool fullSinger = m_only_singers_alive && m_layout_singer.size() <= 1;
+ m_layout_singer[0].draw(time, fullSinger ? LayoutSinger::FULL : LayoutSinger::TOP);
+ if (m_layout_singer.size() > 1)
+ m_layout_singer[1].draw(time, LayoutSinger::BOTTOM);
}
Song::Status status = m_song->status(time);
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index b3dd744..a5a5a74 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -85,7 +85,7 @@ class ScreenSing: public Screen {
boost::scoped_ptr<Surface> m_pause_icon;
boost::scoped_ptr<Surface> m_help;
boost::scoped_ptr<Engine> m_engine;
- boost::scoped_ptr<LayoutSinger> m_layout_singer;
+ boost::ptr_vector<LayoutSinger> m_layout_singer;
boost::scoped_ptr<ThemeInstrumentMenu> m_menuTheme;
Menu m_menu;
Instruments m_instruments;
|
|
From: Tapio V. <aa...@us...> - 2011-12-18 17:40:24
|
Author: Tapio Vierros <tap...@gm...>
Date: Sun Dec 18 18:36:02 2011 +0200
Change of plans: LayoutSinger will only handle one VocalTrack.
---
game/layout_singer.cc | 32 ++++++++++++++++++--------------
game/layout_singer.hh | 2 +-
game/screen_players.cc | 2 +-
game/screen_sing.cc | 2 +-
4 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/game/layout_singer.cc b/game/layout_singer.cc
index d637634..14e1100 100644
--- a/game/layout_singer.cc
+++ b/game/layout_singer.cc
@@ -38,15 +38,18 @@ void LayoutSinger::drawScore(PositionMode position) {
float b = p->m_color.b;
m_score_text[i%4]->render((boost::format("%04d") % p->getScore()).str());
switch(position) {
- case LayoutSinger::DUET:
case LayoutSinger::FULL:
m_player_icon->dimensions.left(-0.5 + 0.01 + 0.25 * i).fixedWidth(0.075).screenTop(0.055);
m_score_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.075).screenTop(0.055);
break;
- case LayoutSinger::BAND:
+ case LayoutSinger::TOP:
m_player_icon->dimensions.right(0.35).fixedHeight(0.050).screenTop(0.025 + 0.050 * i);
m_score_text[i%4]->dimensions().right(0.45).fixedHeight(0.050).screenTop(0.025 + 0.050 * i);
break;
+ case LayoutSinger::BOTTOM:
+ m_player_icon->dimensions.right(0.35).fixedHeight(0.050).center(0.025 + 0.050 * i);
+ m_score_text[i%4]->dimensions().right(0.45).fixedHeight(0.050).center(0.025 + 0.050 * i);
+ break;
case LayoutSinger::LEFT:
case LayoutSinger::RIGHT:
m_player_icon->dimensions.left(-0.5 + 0.01 + 0.25 * i).fixedWidth(0.075).screenTop(0.055);
@@ -70,13 +73,15 @@ void LayoutSinger::drawScore(PositionMode position) {
else if (p->m_prevLineScore > 0.4) prevLineRank = "OK";
m_line_rank_text[i%4]->render(prevLineRank);
switch(position) {
- case LayoutSinger::DUET:
case LayoutSinger::FULL:
m_line_rank_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.055*fzoom).screenTop(0.11);
break;
- case LayoutSinger::BAND:
+ case LayoutSinger::TOP:
m_line_rank_text[i%4]->dimensions().right(0.30).fixedHeight(0.05*fzoom).screenTop(0.025 + 0.050 * i);
break;
+ case LayoutSinger::BOTTOM:
+ m_line_rank_text[i%4]->dimensions().right(0.30).fixedHeight(0.05*fzoom).center(0.025 + 0.050 * i);
+ break;
case LayoutSinger::LEFT:
case LayoutSinger::RIGHT:
m_line_rank_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.055*fzoom).screenTop(0.11);
@@ -94,17 +99,15 @@ void LayoutSinger::draw(double time, PositionMode position) {
// Draw notes and pitch waves (only when not in karaoke mode)
if (!config["game/karaoke_mode"].b()) {
switch(position) {
- case LayoutSinger::DUET:
- // TODO: Individual NoteGraphs
- m_noteGraph.draw(time, m_database, NoteGraph::TOP);
- m_noteGraph.draw(time, m_database, NoteGraph::BOTTOM);
- break;
case LayoutSinger::FULL:
m_noteGraph.draw(time, m_database, NoteGraph::FULLSCREEN);
break;
- case LayoutSinger::BAND:
+ case LayoutSinger::TOP:
m_noteGraph.draw(time, m_database, NoteGraph::TOP);
break;
+ case LayoutSinger::BOTTOM:
+ m_noteGraph.draw(time, m_database, NoteGraph::BOTTOM);
+ break;
case LayoutSinger::LEFT:
case LayoutSinger::RIGHT:
m_noteGraph.draw(time, m_database, NoteGraph::LEFT);
@@ -121,13 +124,14 @@ void LayoutSinger::draw(double time, PositionMode position) {
pos.screenBottom(-0.1);
linespacing = 0.06;
break;
- case LayoutSinger::DUET:
- // TODO: Implement
- //break;
- case LayoutSinger::BAND:
+ case LayoutSinger::TOP:
pos.center(-0.05);
linespacing = 0.04;
break;
+ case LayoutSinger::BOTTOM:
+ pos.screenBottom(-0.1);
+ linespacing = 0.04;
+ break;
case LayoutSinger::LEFT:
case LayoutSinger::RIGHT:
pos.screenBottom(-0.1);
diff --git a/game/layout_singer.hh b/game/layout_singer.hh
index e9becc9..235889a 100644
--- a/game/layout_singer.hh
+++ b/game/layout_singer.hh
@@ -49,7 +49,7 @@ class LyricRow {
class LayoutSinger {
public:
- enum PositionMode {FULL, DUET, BAND, LEFT, RIGHT};
+ enum PositionMode {FULL, TOP, BOTTOM, LEFT, RIGHT};
/// ThemeSing is optional if you want to use drawScore only
LayoutSinger(VocalTrack& vocal, Database& database, boost::shared_ptr<ThemeSing> theme = boost::shared_ptr<ThemeSing>());
~LayoutSinger();
diff --git a/game/screen_players.cc b/game/screen_players.cc
index dd1d60e..9f49b6d 100644
--- a/game/screen_players.cc
+++ b/game/screen_players.cc
@@ -175,6 +175,6 @@ void ScreenPlayers::draw() {
if (!video.empty() && config["graphic/video"].b()) m_video.reset(new Video(video, videoGap));
m_playing = music;
}
- m_layout_singer->drawScore(LayoutSinger::BAND);
+ m_layout_singer->drawScore(LayoutSinger::TOP);
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index bab75ba..c6e249d 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -465,7 +465,7 @@ void ScreenSing::draw() {
// Band
} else {
m_only_singers_alive = !instrumentLayout(time);
- m_layout_singer->draw(time, m_only_singers_alive ? LayoutSinger::FULL : LayoutSinger::BAND);
+ m_layout_singer->draw(time, m_only_singers_alive ? LayoutSinger::FULL : LayoutSinger::TOP);
}
Song::Status status = m_song->status(time);
|
|
From: Tapio V. <aa...@us...> - 2011-12-18 17:40:16
|
Author: Tapio Vierros <tap...@gm...>
Date: Sun Dec 18 18:22:40 2011 +0200
Added mostly dummy LayoutSinger::PositionMode::DUET.
---
game/layout_singer.cc | 26 ++++++++++++++++++--------
game/layout_singer.hh | 2 +-
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/game/layout_singer.cc b/game/layout_singer.cc
index ae4a6e9..d637634 100644
--- a/game/layout_singer.cc
+++ b/game/layout_singer.cc
@@ -38,11 +38,12 @@ void LayoutSinger::drawScore(PositionMode position) {
float b = p->m_color.b;
m_score_text[i%4]->render((boost::format("%04d") % p->getScore()).str());
switch(position) {
- case LayoutSinger::FULL: // Fullscreen
+ case LayoutSinger::DUET:
+ case LayoutSinger::FULL:
m_player_icon->dimensions.left(-0.5 + 0.01 + 0.25 * i).fixedWidth(0.075).screenTop(0.055);
m_score_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.075).screenTop(0.055);
break;
- case LayoutSinger::BAND: // Band mode
+ case LayoutSinger::BAND:
m_player_icon->dimensions.right(0.35).fixedHeight(0.050).screenTop(0.025 + 0.050 * i);
m_score_text[i%4]->dimensions().right(0.45).fixedHeight(0.050).screenTop(0.025 + 0.050 * i);
break;
@@ -69,10 +70,11 @@ void LayoutSinger::drawScore(PositionMode position) {
else if (p->m_prevLineScore > 0.4) prevLineRank = "OK";
m_line_rank_text[i%4]->render(prevLineRank);
switch(position) {
- case LayoutSinger::FULL: // Fullscreen
+ case LayoutSinger::DUET:
+ case LayoutSinger::FULL:
m_line_rank_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.055*fzoom).screenTop(0.11);
break;
- case LayoutSinger::BAND: // Band mode
+ case LayoutSinger::BAND:
m_line_rank_text[i%4]->dimensions().right(0.30).fixedHeight(0.05*fzoom).screenTop(0.025 + 0.050 * i);
break;
case LayoutSinger::LEFT:
@@ -92,10 +94,15 @@ void LayoutSinger::draw(double time, PositionMode position) {
// Draw notes and pitch waves (only when not in karaoke mode)
if (!config["game/karaoke_mode"].b()) {
switch(position) {
- case LayoutSinger::FULL: // Fullscreen
+ case LayoutSinger::DUET:
+ // TODO: Individual NoteGraphs
+ m_noteGraph.draw(time, m_database, NoteGraph::TOP);
+ m_noteGraph.draw(time, m_database, NoteGraph::BOTTOM);
+ break;
+ case LayoutSinger::FULL:
m_noteGraph.draw(time, m_database, NoteGraph::FULLSCREEN);
break;
- case LayoutSinger::BAND: // Band mode
+ case LayoutSinger::BAND:
m_noteGraph.draw(time, m_database, NoteGraph::TOP);
break;
case LayoutSinger::LEFT:
@@ -110,11 +117,14 @@ void LayoutSinger::draw(double time, PositionMode position) {
double linespacing = 0.0;
Dimensions pos;
switch(position) {
- case LayoutSinger::FULL: // Fullscreen
+ case LayoutSinger::FULL:
pos.screenBottom(-0.1);
linespacing = 0.06;
break;
- case LayoutSinger::BAND: // Band mode
+ case LayoutSinger::DUET:
+ // TODO: Implement
+ //break;
+ case LayoutSinger::BAND:
pos.center(-0.05);
linespacing = 0.04;
break;
diff --git a/game/layout_singer.hh b/game/layout_singer.hh
index a948f5b..e9becc9 100644
--- a/game/layout_singer.hh
+++ b/game/layout_singer.hh
@@ -49,7 +49,7 @@ class LyricRow {
class LayoutSinger {
public:
- enum PositionMode {FULL, BAND, LEFT, RIGHT};
+ enum PositionMode {FULL, DUET, BAND, LEFT, RIGHT};
/// ThemeSing is optional if you want to use drawScore only
LayoutSinger(VocalTrack& vocal, Database& database, boost::shared_ptr<ThemeSing> theme = boost::shared_ptr<ThemeSing>());
~LayoutSinger();
|
|
From: Tapio V. <aa...@us...> - 2011-12-18 17:40:01
|
Author: Tapio Vierros <tap...@gm...>
Date: Sun Dec 18 18:02:39 2011 +0200
Made LayoutSinger enum values more informative.
---
game/layout_singer.cc | 24 ++++++++++++------------
game/layout_singer.hh | 8 ++++----
game/screen_players.cc | 2 +-
game/screen_sing.cc | 4 ++--
4 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/game/layout_singer.cc b/game/layout_singer.cc
index 09eac21..ae4a6e9 100644
--- a/game/layout_singer.cc
+++ b/game/layout_singer.cc
@@ -21,14 +21,14 @@ LayoutSinger::LayoutSinger(VocalTrack& vocal, Database& database, boost::shared_
m_player_icon.reset(new Surface(getThemePath("sing_pbox.svg")));
}
-LayoutSinger::~LayoutSinger() {};
+LayoutSinger::~LayoutSinger() {}
void LayoutSinger::reset() {
m_lyricit = m_vocal.notes.begin();
m_lyrics.clear();
}
-void LayoutSinger::drawScore(Position position) {
+void LayoutSinger::drawScore(PositionMode position) {
unsigned int i = 0;
for (std::list<Player>::const_iterator p = m_database.cur.begin(); p != m_database.cur.end(); ++p, ++i) {
float act = p->activity();
@@ -38,11 +38,11 @@ void LayoutSinger::drawScore(Position position) {
float b = p->m_color.b;
m_score_text[i%4]->render((boost::format("%04d") % p->getScore()).str());
switch(position) {
- case LayoutSinger::BOTTOM: // Fullscreen
+ case LayoutSinger::FULL: // Fullscreen
m_player_icon->dimensions.left(-0.5 + 0.01 + 0.25 * i).fixedWidth(0.075).screenTop(0.055);
m_score_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.075).screenTop(0.055);
break;
- case LayoutSinger::MIDDLE: // Band mode
+ case LayoutSinger::BAND: // Band mode
m_player_icon->dimensions.right(0.35).fixedHeight(0.050).screenTop(0.025 + 0.050 * i);
m_score_text[i%4]->dimensions().right(0.45).fixedHeight(0.050).screenTop(0.025 + 0.050 * i);
break;
@@ -69,10 +69,10 @@ void LayoutSinger::drawScore(Position position) {
else if (p->m_prevLineScore > 0.4) prevLineRank = "OK";
m_line_rank_text[i%4]->render(prevLineRank);
switch(position) {
- case LayoutSinger::BOTTOM: // Fullscreen
+ case LayoutSinger::FULL: // Fullscreen
m_line_rank_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.055*fzoom).screenTop(0.11);
break;
- case LayoutSinger::MIDDLE: // Band mode
+ case LayoutSinger::BAND: // Band mode
m_line_rank_text[i%4]->dimensions().right(0.30).fixedHeight(0.05*fzoom).screenTop(0.025 + 0.050 * i);
break;
case LayoutSinger::LEFT:
@@ -88,14 +88,14 @@ void LayoutSinger::drawScore(Position position) {
}
}
-void LayoutSinger::draw(double time, Position position) {
+void LayoutSinger::draw(double time, PositionMode position) {
// Draw notes and pitch waves (only when not in karaoke mode)
if (!config["game/karaoke_mode"].b()) {
switch(position) {
- case LayoutSinger::BOTTOM: // Fullscreen
+ case LayoutSinger::FULL: // Fullscreen
m_noteGraph.draw(time, m_database, NoteGraph::FULLSCREEN);
break;
- case LayoutSinger::MIDDLE: // Band mode
+ case LayoutSinger::BAND: // Band mode
m_noteGraph.draw(time, m_database, NoteGraph::TOP);
break;
case LayoutSinger::LEFT:
@@ -110,11 +110,11 @@ void LayoutSinger::draw(double time, Position position) {
double linespacing = 0.0;
Dimensions pos;
switch(position) {
- case LayoutSinger::BOTTOM: // Fullscreen
+ case LayoutSinger::FULL: // Fullscreen
pos.screenBottom(-0.1);
linespacing = 0.06;
break;
- case LayoutSinger::MIDDLE: // Band mode
+ case LayoutSinger::BAND: // Band mode
pos.center(-0.05);
linespacing = 0.04;
break;
@@ -143,7 +143,7 @@ void LayoutSinger::draw(double time, Position position) {
for (size_t i = 0; i < m_lyrics.size(); ++i, pos.move(0.0, linespacing)) {
pos.move(0.0, m_lyrics[i].extraspacing.get() * linespacing);
if (i == 0) m_lyrics[0].draw(m_theme->lyrics_now, time, pos);
- else if (i == 1 && position == LayoutSinger::BOTTOM) m_lyrics[1].draw(m_theme->lyrics_next, time, pos);
+ else if (i == 1 && position == LayoutSinger::FULL) m_lyrics[1].draw(m_theme->lyrics_next, time, pos);
}
}
}
diff --git a/game/layout_singer.hh b/game/layout_singer.hh
index 1529aea..a948f5b 100644
--- a/game/layout_singer.hh
+++ b/game/layout_singer.hh
@@ -49,15 +49,15 @@ class LyricRow {
class LayoutSinger {
public:
- enum Position {BOTTOM, MIDDLE, LEFT, RIGHT};
+ enum PositionMode {FULL, BAND, LEFT, RIGHT};
/// ThemeSing is optional if you want to use drawScore only
LayoutSinger(VocalTrack& vocal, Database& database, boost::shared_ptr<ThemeSing> theme = boost::shared_ptr<ThemeSing>());
~LayoutSinger();
void reset();
- void draw(double time, Position position = LayoutSinger::BOTTOM);
- void drawScore(Position position);
+ void draw(double time, PositionMode position = LayoutSinger::FULL);
+ void drawScore(PositionMode position);
double lyrics_begin() const;
- void hideLyrics(bool hide = true) { m_hideLyrics = hide; };
+ void hideLyrics(bool hide = true) { m_hideLyrics = hide; }
private:
VocalTrack& m_vocal;
NoteGraph m_noteGraph;
diff --git a/game/screen_players.cc b/game/screen_players.cc
index ae302f8..dd1d60e 100644
--- a/game/screen_players.cc
+++ b/game/screen_players.cc
@@ -175,6 +175,6 @@ void ScreenPlayers::draw() {
if (!video.empty() && config["graphic/video"].b()) m_video.reset(new Video(video, videoGap));
m_playing = music;
}
- m_layout_singer->drawScore(LayoutSinger::MIDDLE);
+ m_layout_singer->drawScore(LayoutSinger::BAND);
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index ff0f90c..bab75ba 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -460,12 +460,12 @@ void ScreenSing::draw() {
m_only_singers_alive = false;
// Singing only
} else if( m_instruments.empty() ) {
- m_layout_singer->draw(time, LayoutSinger::BOTTOM);
+ m_layout_singer->draw(time, LayoutSinger::FULL);
m_only_singers_alive = true;
// Band
} else {
m_only_singers_alive = !instrumentLayout(time);
- m_layout_singer->draw(time, m_only_singers_alive ? LayoutSinger::BOTTOM : LayoutSinger::MIDDLE);
+ m_layout_singer->draw(time, m_only_singers_alive ? LayoutSinger::FULL : LayoutSinger::BAND);
}
Song::Status status = m_song->status(time);
|
|
From: Tapio V. <aa...@us...> - 2011-12-18 12:51:01
|
Author: Tapio Vierros <tap...@gm...>
Date: Sun Dec 18 14:49:40 2011 +0200
Prepare for release: hide keyboard icon in song browser.
---
game/screen_songs.cc | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 9d5176b..fc0c86e 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -388,7 +388,7 @@ void ScreenSongs::drawInstruments(Dimensions const& dim, float alpha) const {
va.Color(c).TexCoord(getIconTex(5), 1.0f).Vertex(x, dim.y2());
va.Draw();
}
- {
+ /*{
// keyboard
float a = alpha * (have_keyboard ? 1.00f : 0.25f);
float m = !(typeFilter & 16);
@@ -401,17 +401,17 @@ void ScreenSongs::drawInstruments(Dimensions const& dim, float alpha) const {
va.Color(c).TexCoord(getIconTex(6), 0.0f).Vertex(x, dim.y1());
va.Color(c).TexCoord(getIconTex(6), 1.0f).Vertex(x, dim.y2());
va.Draw();
- }
+ }*/
{
// dancing
float a = alpha * (have_dance ? 1.00f : 0.25f);
float m = !(typeFilter & 1);
glutil::VertexArray va;
glmath::vec4 c(m * 1.0f, 1.0f, m * 1.0f, a);
- x = dim.x1()+5*xincr*(dim.x2()-dim.x1());
+ x = dim.x1()+4*xincr*(dim.x2()-dim.x1());
va.Color(c).TexCoord(getIconTex(6), 0.0f).Vertex(x, dim.y1());
va.Color(c).TexCoord(getIconTex(6), 1.0f).Vertex(x, dim.y2());
- x = dim.x1()+6*xincr*(dim.x2()-dim.x1());
+ x = dim.x1()+5*xincr*(dim.x2()-dim.x1());
va.Color(c).TexCoord(getIconTex(7), 0.0f).Vertex(x, dim.y1());
va.Color(c).TexCoord(getIconTex(7), 1.0f).Vertex(x, dim.y2());
va.Draw();
|
|
From: Tapio V. <aa...@us...> - 2011-12-15 17:25:17
|
Author: Tapio Vierros <tap...@gm...>
Date: Thu Dec 15 19:22:32 2011 +0200
Instrument forcing in UI.
* Dynamically populate the config items with available controller presets.
* Use the config values when evaluating instrument forcing.
---
game/joystick.cc | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 29432ed..21285e1 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -333,8 +333,29 @@ void input::SDL::init() {
readControllers(g_instruments, getDefaultConfig(fs::path("/config/controllers.xml")));
readControllers(g_instruments, getConfigDir() / "controllers.xml");
std::map<unsigned int, input::Instrument> forced_type;
+ ConfigItem::StringList instruments = config["game/instruments"].sl();
+
+ // Populate controller forcing config items
+ ConfigItem& ci0 = config["game/instrument0"];
+ ConfigItem& ci1 = config["game/instrument1"];
+ ConfigItem& ci2 = config["game/instrument2"];
+ ConfigItem& ci3 = config["game/instrument3"];
+ int i = 0;
+ for (input::Instruments::const_iterator it = g_instruments.begin(); it != g_instruments.end(); ++it, ++i) {
+ // Add the enum
+ std::string title = it->second.description;
+ ci0.addEnum(title);
+ ci1.addEnum(title);
+ ci2.addEnum(title);
+ ci3.addEnum(title);
+ // Check for active items
+ if (i == ci0.i()-1) instruments.push_back("0:" + it->first);
+ if (i == ci1.i()-1) instruments.push_back("1:" + it->first);
+ if (i == ci2.i()-1) instruments.push_back("2:" + it->first);
+ if (i == ci3.i()-1) instruments.push_back("3:" + it->first);
+ }
- ConfigItem::StringList const& instruments = config["game/instruments"].sl();
+ // Check all forced instruments
for (ConfigItem::StringList::const_iterator it = instruments.begin(); it != instruments.end(); ++it) {
std::istringstream iss(*it);
unsigned sdl_id;
|
|
From: Tapio V. <aa...@us...> - 2011-12-15 17:24:58
|
Author: Tapio Vierros <tap...@gm...>
Date: Thu Dec 15 18:54:48 2011 +0200
Added individual instrument forcing thingys to schema.
---
data/schema.xml | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/data/schema.xml b/data/schema.xml
index 9f9a621..29b420c 100644
--- a/data/schema.xml
+++ b/data/schema.xml
@@ -63,6 +63,38 @@ to save the current settings to XML.
<short>Keyboard as keyboard</short>
<long>Enable keyboard as keyboard.</long>
</entry>
+ <entry name="game/instrument0" type="int" value="0">
+ <limits>
+ <enum>Auto</enum>
+ <!-- Options added dynamically from controllers.xml -->
+ </limits>
+ <short>Force controller A's type</short>
+ <long>Override autodetection and force the first controller to the given type.</long>
+ </entry>
+ <entry name="game/instrument1" type="int" value="0">
+ <limits>
+ <enum>Auto</enum>
+ <!-- Options added dynamically from controllers.xml -->
+ </limits>
+ <short>Force controller B's type</short>
+ <long>Override autodetection and force the second controller to the given type.</long>
+ </entry>
+ <entry name="game/instrument2" type="int" value="0">
+ <limits>
+ <enum>Auto</enum>
+ <!-- Options added dynamically from controllers.xml -->
+ </limits>
+ <short>Force controller C's type</short>
+ <long>Override autodetection and force the third controller to the given type.</long>
+ </entry>
+ <entry name="game/instrument3" type="int" value="0">
+ <limits>
+ <enum>Auto</enum>
+ <!-- Options added dynamically from controllers.xml -->
+ </limits>
+ <short>Force controller D's type</short>
+ <long>Override autodetection and force the fourth controller to the given type.</long>
+ </entry>
<entry name="game/instruments" type="string_list">
<!-- Should be SDL_ID:{GUITAR_GUITARHERO|GUITAR_GUITARHERO_XPLORER|GUITAR_ROCKBAND_PS3|GUITAR_ROCKBAND_XB360|DRUMS_GUITARHERO|DRUMS_ROCKBAND_PS3|DRUMS_ROCKBAND_XB360|DRUMS_MIDI|DANCEPAD_GENERIC|DANCEPAD_TIGERGAME|DANCEPAD_2TECH}
example:
|
|
From: Tapio V. <aa...@us...> - 2011-12-15 17:24:46
|
Author: Tapio Vierros <tap...@gm...>
Date: Thu Dec 15 18:54:08 2011 +0200
Added a function to dynamically add enums to a ConfigItem.
---
game/configuration.cc | 8 ++++++++
game/configuration.hh | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/game/configuration.cc b/game/configuration.cc
index 3f6144d..de92d67 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -144,6 +144,14 @@ namespace {
}
}
+void ConfigItem::addEnum(std::string name) {
+ verifyType("int");
+ m_enums.push_back(name);
+ m_min = 0;
+ m_max = int(m_enums.size() - 1);
+ m_step = 1;
+}
+
template <typename T> void ConfigItem::updateNumeric(xmlpp::Element& elem, int mode) {
xmlpp::NodeSet ns = elem.find("limits");
if (!ns.empty()) setLimits<T>(dynamic_cast<xmlpp::Element&>(*ns[0]), m_min, m_max, m_step);
diff --git a/game/configuration.hh b/game/configuration.hh
index 82f2e6e..93278f8 100644
--- a/game/configuration.hh
+++ b/game/configuration.hh
@@ -37,6 +37,7 @@ class ConfigItem {
std::string getValue() const; ///< Get a human-readable representation of the current value
std::string const& getShortDesc() const { return m_shortDesc; } ///< get the short description for this ConfigItem
std::string const& getLongDesc() const { return m_longDesc; } ///< get the long description for this ConfigItem
+ void addEnum(std::string name); ///< Dynamically adds an enum to all values
private:
template <typename T> void updateNumeric(xmlpp::Element& elem, int mode); ///< Used internally for loading XML
|
|
From: Tapio V. <aa...@us...> - 2011-11-22 19:26:04
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 22 21:25:26 2011 +0200
Fixed Synth.
---
game/audio.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 3484c8c..8cd85f7 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -279,7 +279,7 @@ struct Synth {
if (it == m_notes.end() || it->type == Note::SLEEP || it->begin > position) { phase = 0.0; return; }
int note = it->note % 12;
double d = (note + 1) / 13.0;
- double freq = MusicalScale().getNoteFreq(note + 12);
+ double freq = MusicalScale().getNoteFreq(note + 4 * 12);
double value = 0.0;
// Synthesize tones
for (size_t i = 0, iend = mixbuf.size(); i != iend; ++i) {
|
|
From: Tapio V. <aa...@us...> - 2011-11-20 16:49:54
|
Author: Tapio Vierros <tap...@gm...>
Date: Sun Nov 20 18:47:57 2011 +0200
Added Ubuntu 11.04 and 11.10 CPack deps.
>From control files of the official Ubuntu binary packages.
11.10 sanity checked, 11.04 untested.
---
cmake/performous-packaging.cmake | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/cmake/performous-packaging.cmake b/cmake/performous-packaging.cmake
index 0327ebe..e0aa7fa 100644
--- a/cmake/performous-packaging.cmake
+++ b/cmake/performous-packaging.cmake
@@ -66,6 +66,14 @@ if(UNIX)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libcairo2, librsvg2-2, libboost-thread1.42.0, libboost-program-options1.42.0, libboost-regex1.42.0, libboost-filesystem1.42.0, libboost-date-time1.42.0, libavcodec52|libavcodec-extra-52, libavformat52|libavformat-extra-52, libswscale0, libmagick++2, libxml++2.6-2, libglew1.5, libpng12-0, libjpeg62, libportmidi0, libcv2.1, libhighgui2.1")
endif("${LSB_DISTRIB}" MATCHES "Ubuntu10.10")
+ if("${LSB_DISTRIB}" MATCHES "Ubuntu11.04")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libavcodec52|libavcodec-extra-52, libavformat52|libavformat-extra-52, libavutil50|libavutil-extra-50, libboost-filesystem1.42.0, libboost-program-options1.42.0, libboost-regex1.42.0, libboost-system1.42.0, libboost-thread1.42.0, libc6, libcairo2, libfreetype6, libgcc1, libgdk-pixbuf2.0-0, libgl1-mesa-glx|libgl1, libglew1.5, libglib2.0-0, libglibmm-2.4-1c2a, libglu1-mesa|libglu1, libjpeg62, libpango1.0-0, libpng12-0, libportaudio2, librsvg2-2, libsdl1.2debian, libsigc++-2.0-0c2a, libstdc++6, libswscale0|libswscale-extra-0, libxml++2.6-2, libxml2, zlib1g")
+ endif("${LSB_DISTRIB}" MATCHES "Ubuntu11.04")
+
+ if("${LSB_DISTRIB}" MATCHES "Ubuntu11.10")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libavcodec53|libavcodec-extra-53, libavformat53|libavformat-extra-53, libavutil51|libavutil-extra-51, libboost-filesystem1.46.1, libboost-program-options1.46.1, libboost-regex1.46.1, libboost-system1.46.1, libboost-thread1.46.1, libc6, libcairo2, libgcc1, libgdk-pixbuf2.0-0, libgl1-mesa-glx|libgl1, libglew1.5, libglib2.0-0, libglibmm-2.4-1c2a, libglu1-mesa|libglu1, libjpeg62, libpango1.0-0, libpng12-0, libportaudio2, librsvg2-2, libsdl1.2debian, libstdc++6, libswscale2|libswscale-extra-2, libxml++2.6-2")
+ endif("${LSB_DISTRIB}" MATCHES "Ubuntu11.10")
+
# Debian
if("${LSB_DISTRIB}" MATCHES "Debian5.*")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libcairo2, librsvg2-2, libboost-thread1.42.0, libboost-program-options1.42.0, libboost-regex1.42.0, libboost-filesystem1.42.0, libboost-date-time1.42.0, libavcodec51, libavformat52, libswscale0, libmagick++10, libxml++2.6-2, libglew1.5, libpng12-0, libjpeg62, libportmidi0, libcv2.1, libhighgui2.1")
|
|
From: Yoda-JM <yo...@us...> - 2011-11-20 12:16:41
|
Author: Vincent Le Ligeour <yo...@us...> Date: Sun Nov 20 13:15:33 2011 +0100 Merge branch 'master' of git://git.performous.org/gitroot/performous/performous --- |
|
From: Yoda-JM <yo...@us...> - 2011-11-20 12:16:33
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Nov 20 13:13:34 2011 +0100
Fixed libjpeg detection according to ubuntu jpeg-detection.patch
---
cmake/Modules/FindJpeg.cmake | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cmake/Modules/FindJpeg.cmake b/cmake/Modules/FindJpeg.cmake
index c5cc9b6..e1b1be2 100644
--- a/cmake/Modules/FindJpeg.cmake
+++ b/cmake/Modules/FindJpeg.cmake
@@ -13,7 +13,7 @@ include(LibFindMacros)
libfind_pkg_check_modules(Jpeg_PKGCONF jpeg)
find_path(Jpeg_INCLUDE_DIR
- NAMES jconfig.h
+ NAMES jconfig.h jpeglib.h
PATHS ${Jpeg_PKGCONF_INCLUDE_DIRS}
)
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-11-13 23:31:41
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Thu Nov 10 05:17:45 2011 +0200 Move MIDI parsing to a separate source module. --- game/songparser-ini.cc | 208 +------------------------------------------ game/songparser-mid.cc | 235 ++++++++++++++++++++++++++++++++++++++++++++++++ game/songparser.hh | 3 + 3 files changed, 240 insertions(+), 206 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2011-10-30 12:06:24
|
Author: Tapio Vierros <tap...@gm...> Date: Sun Oct 30 14:04:49 2011 +0200 New ppastats script that makes it work again. Previous was broken by some LP API changes. --- tools/ppa/ppastats.py | 45 +++++++++++++++++++++++++++------------------ 1 files changed, 27 insertions(+), 18 deletions(-) diff --git a/tools/ppa/ppastats.py b/tools/ppa/ppastats.py index bef3db5..32aa5e3 100755 --- a/tools/ppa/ppastats.py +++ b/tools/ppa/ppastats.py @@ -1,26 +1,35 @@ #!/usr/bin/python -# Prints download stats from Launchpad PPA. +# -*- coding: utf-8 -*- +# Licensed under the GPL v3 +# Written by arand, original: https://launchpadlibrarian.net/81374910/ppastats +# Modified for Performous by Tapio Vierros +# Inspired by Alex Mandel's script snippets at https://bugs.launchpad.net/launchpad/+bug/139855 +# This is my biggest project in python to date, it is KLUDGE beyond imagination. +# On Debian-like systems the package python-launchpadlib is required + +import os from launchpadlib.launchpad import Launchpad -PPAOWNER = "performous-team" # PPA owner -PPA = "ppa" # PPA name +archs = ["i386", "amd64"] +releases = ["lucid", "maverick", "natty", "oneiric"] -cachedir = "~/.cache/launchpadlib/" -apiurl = 'https://api.edge.launchpad.net/devel/ubuntu/' +owner_name = "performous-team" +ppas = ["ppa"] -lp_ = Launchpad.login_anonymously('ppastats', 'edge', cachedir, version='devel') -owner = lp_.people[PPAOWNER] -archive = owner.getPPAByName(name=PPA) +for individual_ppa in ppas: + print "Usage stats for PPA with owner \"" + owner_name + "\" named \"" + individual_ppa + "\"" + print "#####" + cachedir = os.path.expanduser("~/.launchpadlib/cache/") -def printDLCount(distarch): - for i in archive.getPublishedBinaries(status='Published',distro_arch_series=apiurl+distarch): - # Uncomment last part of next line to get daily stats - print i.binary_package_name + "\t" + i.binary_package_version + "\t" + str(i.getDownloadCount()) #+ "\t" + str(i.getDailyDownloadTotals()) + launchpad = Launchpad.login_anonymously('ppastats', 'production', cachedir, version='devel') + owner = launchpad.people[owner_name] + archive = owner.getPPAByName(name=individual_ppa) -print "Package\tVersion\tDownloads" #"\tDaily DLs" -print -printDLCount("maverick/i386") -printDLCount("maverick/amd64") -printDLCount("lucid/i386") -printDLCount("lucid/amd64") + for individual_arch in archs: + for individual_release in releases: + individual_distro_arch_series = "https://api.launchpad.net/devel/ubuntu/" + individual_release + "/" + individual_arch + print "\t" + individual_release + "/" + individual_arch + ":" + for individual_archive in archive.getPublishedBinaries(status='Published',distro_arch_series=individual_distro_arch_series): + print individual_archive.binary_package_name + "\t" + individual_archive.binary_package_version + "\t" + str(individual_archive.getDownloadCount()) + print "#####" |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-26 15:00:51
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Wed Oct 26 18:00:21 2011 +0300 Cleanup MusicalScale. No API changes. --- game/musicalscale.cc | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ game/musicalscale.hh | 29 ++++++++++++++++++++++++++++ game/notes.cc | 47 ---------------------------------------------- game/notes.hh | 26 +------------------------ 4 files changed, 81 insertions(+), 72 deletions(-) diff --git a/game/musicalscale.cc b/game/musicalscale.cc new file mode 100644 index 0000000..20ca870 --- /dev/null +++ b/game/musicalscale.cc @@ -0,0 +1,51 @@ +#include "musicalscale.hh" + +#include <cmath> +#include <sstream> +#include <stdexcept> + +// NOTE: This is the C major scale. +// The format needs to be preserved for isSharp, and any scale changes must be done in getNoteNum manually. +const char* const noteNames[12] = {"C ","C#","D ","D#","E ","F ","F#","G ","G#","A ","A#","B "}; + +std::string MusicalScale::getNoteStr(double freq) const try { + int id = getNoteId(freq); + std::ostringstream oss; + oss << noteNames[id % 12] << " " << int(freq + 0.5) << " Hz"; + return oss.str(); +} catch (std::logic_error&) { + return std::string(); +} + +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"); + return noteNames[id % 12][1] == '#'; +} + +double MusicalScale::getNoteFreq(int id) const { + if (id == -1) return 0.0; + return m_baseFreq * std::pow(2.0, (id - m_baseId) / 12.0); +} + +int MusicalScale::getNoteId(double freq) const { + double note = getNote(freq); + return int(note + 0.5); // Mathematical rounding +} + +double MusicalScale::getNote(double freq) const { + double note = m_baseId + 12.0 * std::log(freq / m_baseFreq) / std::log(2.0); + if (note >= 0.0 && note <= 127.0) return note; + throw std::logic_error("MusicalScale::getNote: Invalid freq"); +} + +double MusicalScale::getNoteOffset(double freq) const { + double note = getNote(freq); + return note - int(note + 0.5); +} + diff --git a/game/musicalscale.hh b/game/musicalscale.hh new file mode 100644 index 0000000..0f2aba4 --- /dev/null +++ b/game/musicalscale.hh @@ -0,0 +1,29 @@ +#pragma once + +#include <string> + +/// Conversions for the C major musical scale +class MusicalScale { + private: + double m_baseFreq; + static const int m_baseId = 69; ///< What is the baseFreq in MIDI? + + public: + /// Construct a scale object + MusicalScale(double baseFreq = 440.0): m_baseFreq(baseFreq) {} + /// Get a human-readable string representation for the frequency + std::string getNoteStr(double freq) const; + /// Get a note line number in traditional notation (0 = C, 1 = D, ...) + unsigned int getNoteNum(int id) const; + /// Check if the note is sharp (#) + bool isSharp(int id) const; + /// Get the proper frequency of the note + double getNoteFreq(int id) const; + /// Get the nearest note for the frequency + int getNoteId(double freq) const; + /// Get the precise (non-rounded) note id for a the frequency + double getNote(double freq) const; + /// Get the offset (-0.5 to 0.5) from the nearest note + double getNoteOffset(double freq) const; +}; + diff --git a/game/notes.cc b/game/notes.cc index 14af3a2..258fec2 100644 --- a/game/notes.cc +++ b/game/notes.cc @@ -5,53 +5,6 @@ #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 * std::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()), phase(getNaN()), power(getNaN()), type(NORMAL), note(), notePrev() {} double Note::diff(double note, double n) { return remainder(n - note, 12.0); } diff --git a/game/notes.hh b/game/notes.hh index 4c67bae..ebc5daf 100644 --- a/game/notes.hh +++ b/game/notes.hh @@ -5,31 +5,7 @@ #include <vector> #include "color.hh" - -/// 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; -}; +#include "musicalscale.hh" /// stores duration of a note struct Duration { |
|
From: Tapio V. <aa...@us...> - 2011-10-25 19:11:48
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Oct 25 22:10:16 2011 +0300
Support for NoteGraph rendering to the screen bottom (preparation for duet).
---
game/notegraph.cc | 6 +++++-
game/notegraph.hh | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/game/notegraph.cc b/game/notegraph.cc
index 39f0fc8..c8ce4c6 100644
--- a/game/notegraph.cc
+++ b/game/notegraph.cc
@@ -95,6 +95,9 @@ void NoteGraph::draw(double time, Database const& database, Position position) {
case NoteGraph::TOP:
dimensions.stretch(1.0, 0.32).bottom(0.0);
break;
+ case NoteGraph::BOTTOM:
+ dimensions.stretch(1.0, 0.32).top(0.0);
+ break;
case NoteGraph::LEFT:
dimensions.stretch(0.50, 0.50).center().left(-0.5);
break;
@@ -128,7 +131,8 @@ void NoteGraph::draw(double time, Database const& database, Position position) {
float centery = m_baseY + (it->note + 0.4) * m_noteUnit; // Star is 0.4 notes higher than current note
float centerx = x + w - (player_star_offset + 1.2) * hh; // Star is 1.2 units from end
float rot = fmod(time * 5.0, 2.0 * M_PI); // They rotate!
- float zoom = (std::abs((rot-180) / 360.0f) * 0.8f + 0.6f) * (position == NoteGraph::TOP ? 2.3 : 2.0) * hh;
+ bool smallerNoteGraph = ((position == NoteGraph::TOP) || (position == NoteGraph::BOTTOM));
+ float zoom = (std::abs((rot-180) / 360.0f) * 0.8f + 0.6f) * (smallerNoteGraph ? 2.3 : 2.0) * hh;
using namespace glmath;
Transform trans(translate(vec3(centerx, centery, 0.0f)) * rotate(rot, vec3(0.0f, 0.0f, 1.0f)));
{
diff --git a/game/notegraph.hh b/game/notegraph.hh
index a552caf..f92db1c 100644
--- a/game/notegraph.hh
+++ b/game/notegraph.hh
@@ -10,7 +10,7 @@ class Database;
/// handles drawing of notes and waves
class NoteGraph {
public:
- enum Position {FULLSCREEN, TOP, LEFT, RIGHT};
+ enum Position {FULLSCREEN, TOP, BOTTOM, LEFT, RIGHT};
/// constructor
NoteGraph(VocalTrack const& vocal);
/// resets NoteGraph and Notes
|
|
From: Tapio V. <aa...@us...> - 2011-10-25 18:47:00
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Oct 25 21:46:20 2011 +0300
Added some additional codepages.
---
data/schema.xml | 9 ++++++++-
game/unicode.cc | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/data/schema.xml b/data/schema.xml
index 7d5530a..9f9a621 100644
--- a/data/schema.xml
+++ b/data/schema.xml
@@ -75,10 +75,17 @@ to save the current settings to XML.
<short>Hardware MIDI input device</short>
<long>Part of sound card name or its number or empty to use the first available device. Used currently for MIDI drum controllers.</long>
</entry>
- <entry name="game/fallback_encoding" type="int" value="1">
+ <entry name="game/fallback_encoding" type="int" value="2">
<limits>
<enum>CP1250</enum>
+ <enum>CP1251</enum>
<enum>CP1252</enum>
+ <enum>CP1253</enum>
+ <enum>CP1254</enum>
+ <enum>CP1255</enum>
+ <enum>CP1256</enum>
+ <enum>CP1257</enum>
+ <enum>CP1258</enum>
</limits>
<short>Fallback song encoding</short>
<long>Pick the text codec used for song files that are not UTF-8.</long>
diff --git a/game/unicode.cc b/game/unicode.cc
index 5fe8c4e..0afd382 100644
--- a/game/unicode.cc
+++ b/game/unicode.cc
@@ -9,7 +9,7 @@
namespace {
// Codepage choices from config
- static const char* codesets[] = { "CP1250", "CP1252" };
+ static const char* codesets[] = { "CP1250", "CP1251", "CP1252", "CP1253", "CP1254", "CP1255", "CP1256", "CP1257", "CP1258" };
// Convert a string using Glib, throw exception on error.
// This is in fact (slightly modified) Glib::convert from glibmm.
|
|
From: Tapio V. <aa...@us...> - 2011-10-25 18:46:52
|
Author: Tapio Vierros <tap...@gm...> Date: Tue Oct 25 21:43:23 2011 +0300 Update FI translation. --- lang/fi.po | 148 +++++++++++++++++++++++++++++++---------------------------- 1 files changed, 78 insertions(+), 70 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2011-10-25 18:22:11
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Oct 25 21:21:11 2011 +0300
Added config option to toggle fallback encoding between CP1250 and CP1252.
---
data/schema.xml | 12 ++++++++++--
game/unicode.cc | 11 +++++++++--
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/data/schema.xml b/data/schema.xml
index ac324e6..7d5530a 100644
--- a/data/schema.xml
+++ b/data/schema.xml
@@ -75,6 +75,14 @@ to save the current settings to XML.
<short>Hardware MIDI input device</short>
<long>Part of sound card name or its number or empty to use the first available device. Used currently for MIDI drum controllers.</long>
</entry>
+ <entry name="game/fallback_encoding" type="int" value="1">
+ <limits>
+ <enum>CP1250</enum>
+ <enum>CP1252</enum>
+ </limits>
+ <short>Fallback song encoding</short>
+ <long>Pick the text codec used for song files that are not UTF-8.</long>
+ </entry>
<!-- Graphic preferences -->
<entry name="graphic/window_width" type="int" value="800" hidden="true">
@@ -103,8 +111,8 @@ to save the current settings to XML.
<enum>Green/Magenta</enum>
<enum>Over/Under</enum>
</limits>
- <short>Stereo3D type</short>
- <long>Some modes may only get activated in fullscreen mode.</long>
+ <short>Stereo3D type</short>
+ <long>Some modes may only get activated in fullscreen mode.</long>
</entry>
<entry name="graphic/stereo3dseparation" type="float" value="50">
<ui unit=" %" />
diff --git a/game/unicode.cc b/game/unicode.cc
index 95053b0..5fe8c4e 100644
--- a/game/unicode.cc
+++ b/game/unicode.cc
@@ -1,4 +1,5 @@
#include "unicode.hh"
+#include "configuration.hh"
#include <boost/scoped_ptr.hpp>
#include <glibmm/ustring.h>
@@ -7,6 +8,9 @@
#include <stdexcept>
namespace {
+ // Codepage choices from config
+ static const char* codesets[] = { "CP1250", "CP1252" };
+
// Convert a string using Glib, throw exception on error.
// This is in fact (slightly modified) Glib::convert from glibmm.
std::string convert(const std::string& str, const std::string& to_codeset, const std::string& from_codeset) {
@@ -33,9 +37,12 @@ void convertToUTF8(std::stringstream &_stream, std::string _filename) {
_stream.str(data.substr(3)); // Remove BOM if there is one
}
} catch(...) {
- if (!_filename.empty()) std::clog << "unicode/warning: " << _filename << " is not UTF-8.\n Assuming CP1252 for now. Use recode CP1252..UTF-8 */*.txt to convert your files." << std::endl;
+ const char* codeset = codesets[config["game/fallback_encoding"].i()];
+ if (!_filename.empty())
+ std::clog << "unicode/warning: " << _filename << " is not UTF-8.\n Assuming " << codeset
+ << ". Use recode " << codeset << "..UTF-8 */*.txt to convert your files." << std::endl;
try {
- _stream.str(convert(_stream.str(), "UTF-8", "CP1252")); // Convert from Microsoft CP1252
+ _stream.str(convert(_stream.str(), "UTF-8", codeset)); // Convert from fallback encoding
} catch (...) {
// Filter out anything but ASCII
std::string tmp;
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-23 22:15:14
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Oct 24 01:12:19 2011 +0300
Prefer video instead of webcam when both are enabled (disable video in config to get the old functionality).
---
game/screen_sing.cc | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 92b460c..ff0f90c 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -436,12 +436,12 @@ void ScreenSing::draw() {
if (ar > arMax || (m_video && ar > arMin)) fillBG(); // Fill white background to avoid black borders
m_background->draw();
} else fillBG(); // Blank
+ // Webcam
+ if (m_cam && config["graphic/webcam"].b()) m_cam->render();
// Video
- if (m_video && (!m_cam || !m_cam->is_good())) {
+ if (m_video /* && (!m_cam || !m_cam->is_good()) */) {
m_video->render(time); double tmp = m_video->dimensions().ar(); if (tmp > 0.0) ar = tmp;
}
- // Webcam
- if (m_cam && config["graphic/webcam"].b()) m_cam->render();
// Top/bottom borders
ar = clamp(ar, arMin, arMax);
double offset = 0.5 / ar + 0.2;
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-23 12:12:33
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Sun Oct 23 15:07:27 2011 +0300 Bigger frequency range because some singers apparently need it --- game/pitch.hh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/game/pitch.hh b/game/pitch.hh index d7ca49e..37c03ca 100644 --- a/game/pitch.hh +++ b/game/pitch.hh @@ -71,7 +71,7 @@ class Analyzer { /** Get a list of all tones detected. **/ tones_t const& getTones() const { return m_tones; } /** Find a tone within the singing range; prefers strong tones around 200-400 Hz. **/ - Tone const* findTone(double minfreq = 70.0, double maxfreq = 700.0) const { + Tone const* findTone(double minfreq = 65.0, double maxfreq = 1000.0) const { if (m_tones.empty()) { m_oldfreq = 0.0; return NULL; } double db = std::max_element(m_tones.begin(), m_tones.end(), Tone::dbCompare)->db; Tone const* best = NULL; |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:37:48
|
Author: Lasse Karkkainen <tro...@tr...> Date: Sat Oct 22 22:34:04 2011 +0300 Merge branch 'master' into dance3d Conflicts: data/shaders/dancenote.vert --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:37:39
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Oct 22 22:29:18 2011 +0300
Reduce anaglyph saturation for better guitar gameplay
---
game/video_driver.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 37b8e56..07f796a 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -223,7 +223,7 @@ void Window::render(boost::function<void (void)> drawFunc) {
glerror.check("FBO->FB setup");
for (int num = 0; num < 2; ++num) {
{
- float saturation = 0.6; // (0..1)
+ float saturation = 0.5; // (0..1)
float col = (1.0 + 2.0 * saturation) / 3.0;
float gry = 0.5 * (1.0 - col);
bool out[3] = {}; // Which colors to output
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-10-22 19:37:31
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Oct 22 21:52:09 2011 +0300
Fix stereo3d anaglyph modes. Apparently the blend mode is messed up by something, so we now set it later.
---
game/video_driver.cc | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 1e8935a..37b8e56 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -239,15 +239,15 @@ void Window::render(boost::function<void (void)> drawFunc) {
}
}
}
+ // Render FBO with 1:1 pixels, properly filtered/positioned for 3d
+ ColorTrans c(colorMatrix);
+ Dimensions dim = Dimensions(double(w) / h).fixedWidth(1.0);
+ dim.center((num == 0 ? 0.25 : -0.25) * dim.h());
if (num == 1) {
// Right eye blends over the left eye
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
}
- // Render FBO with 1:1 pixels, properly filtered/positioned for 3d
- ColorTrans c(colorMatrix);
- Dimensions dim = Dimensions(double(w) / h).fixedWidth(1.0);
- dim.center((num == 0 ? 0.25 : -0.25) * dim.h());
fbo.getTexture().draw(dim, TexCoords(0.0, h, w, 0));
}
glerror.check("FBO->FB postcondition");
|