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: Lasse Kärkkäi. <tr...@us...> - 2009-10-26 19:26:43
|
Module: performous
Branch: master
Commit: 370e897cbed963d155132c89fe85ae3da1866b1f
Author: Lasse Kärkkäinen <tro...@tr...>
Date: Mon Oct 26 21:26:04 2009 +0200
Windows compatibility fixes.
---
libs/libda/CMakeLists.txt | 6 +++++-
libs/libda/include/libda/audio.hpp | 4 ++--
libs/libda/src/CMakeLists.txt | 5 -----
libs/libda/src/audio.cpp | 4 ++--
libs/plugin++/CMakeLists.txt | 5 ++++-
libs/plugin++/include/plugin++/loader.hpp | 3 +++
libs/plugin++/include/plugin++/plugin.hpp | 4 ++--
7 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/libs/libda/CMakeLists.txt b/libs/libda/CMakeLists.txt
index 1770cc5..e058461 100644
--- a/libs/libda/CMakeLists.txt
+++ b/libs/libda/CMakeLists.txt
@@ -4,13 +4,17 @@ cmake_minimum_required(VERSION 2.6)
set(LIBDA_PLUGIN_DIR "lib${LIB_SUFFIX}/libda")
include_directories(include)
+include_directories(../plugin++/include)
FILE(GLOB HEADER_FILES "include/libda/*")
install(FILES ${HEADER_FILES} DESTINATION include/libda)
if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++98 -Wall -Wextra -fvisibility=hidden -fvisibility-inlines-hidden")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -Wall -Wextra")
+ if(NOT WIN32)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -fvisibility=hidden -fvisibility-inlines-hidden")
+ endif(NOT WIN32)
endif(CMAKE_COMPILER_IS_GNUCXX)
add_subdirectory(src)
diff --git a/libs/libda/include/libda/audio.hpp b/libs/libda/include/libda/audio.hpp
index 9c2a0cf..10e5cf5 100644
--- a/libs/libda/include/libda/audio.hpp
+++ b/libs/libda/include/libda/audio.hpp
@@ -74,8 +74,8 @@ namespace da {
typedef boost::function<bool (pcm_data& it)> callback_t;
struct settings {
- static const std::size_t low;
- static const std::size_t high;
+ DLL_PUBLIC static const std::size_t low;
+ DLL_PUBLIC static const std::size_t high;
settings(std::string const& devstr = ""):
m_channels(high),
m_channels_near(true),
diff --git a/libs/libda/src/CMakeLists.txt b/libs/libda/src/CMakeLists.txt
index 549dcb6..e2bb1b5 100644
--- a/libs/libda/src/CMakeLists.txt
+++ b/libs/libda/src/CMakeLists.txt
@@ -4,11 +4,6 @@ set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREAD ON)
find_package(Boost 1.34 REQUIRED COMPONENTS thread filesystem)
-if(CMAKE_COMPILER_IS_GNUCXX)
- message(STATUS "GCC detected, adding compile flags")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++98 -pedantic -Wall -Wextra -fvisibility=hidden")
-endif(CMAKE_COMPILER_IS_GNUCXX)
-
include_directories(${Boost_INCLUDE_DIRS})
add_library(da SHARED audio.cpp)
target_link_libraries(da plugin++ ${Boost_LIBRARIES})
diff --git a/libs/libda/src/audio.cpp b/libs/libda/src/audio.cpp
index 3bd843a..8374a66 100644
--- a/libs/libda/src/audio.cpp
+++ b/libs/libda/src/audio.cpp
@@ -7,8 +7,8 @@
#include <limits>
namespace da {
- DLL_PUBLIC const std::size_t settings::low = std::numeric_limits<std::size_t>::min();
- DLL_PUBLIC const std::size_t settings::high = std::numeric_limits<std::size_t>::max();
+ const std::size_t settings::low = std::numeric_limits<std::size_t>::min();
+ const std::size_t settings::high = std::numeric_limits<std::size_t>::max();
class init_impl {
plugin::loader m_loader;
diff --git a/libs/plugin++/CMakeLists.txt b/libs/plugin++/CMakeLists.txt
index f460392..ee49943 100644
--- a/libs/plugin++/CMakeLists.txt
+++ b/libs/plugin++/CMakeLists.txt
@@ -5,7 +5,10 @@ include_directories(include)
if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -pedantic -Wall -Wextra -fvisibility=hidden -fvisibility-inlines-hidden")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -Wall -Wextra")
+ if(NOT WIN32)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
+ endif(NOT WIN32)
endif(CMAKE_COMPILER_IS_GNUCXX)
if (WIN32)
diff --git a/libs/plugin++/include/plugin++/loader.hpp b/libs/plugin++/include/plugin++/loader.hpp
index 373688a..89519e6 100644
--- a/libs/plugin++/include/plugin++/loader.hpp
+++ b/libs/plugin++/include/plugin++/loader.hpp
@@ -9,6 +9,7 @@
#include <sstream>
#include <boost/filesystem.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
+#include <stdexcept>
namespace plugin {
namespace fs = boost::filesystem;
@@ -33,6 +34,8 @@ namespace plugin {
dlls.push_back(new dll(it->string()));
} catch (std::runtime_error const& e) {
std::cerr << e.what() << std::endl;
+ } catch (...) {
+ std::cerr << "WTF?" << std::endl;
}
}
}
diff --git a/libs/plugin++/include/plugin++/plugin.hpp b/libs/plugin++/include/plugin++/plugin.hpp
index 32be7ee..b1fa2f0 100644
--- a/libs/plugin++/include/plugin++/plugin.hpp
+++ b/libs/plugin++/include/plugin++/plugin.hpp
@@ -34,7 +34,7 @@ namespace plugin {
template <typename Base,
typename Arg = std::string const&,
typename Key = std::string>
- class registry {
+ class DLL_PUBLIC registry {
public:
typedef Base base_type;
typedef Arg arg_type;
@@ -49,7 +49,7 @@ namespace plugin {
// being a static member variable of this class to ensure that it gets
// initialized when it is used the first time. If it were static member,
// the initialization (on program startup) might occur too late.
- DLL_PUBLIC static map_t& map() {
+ static map_t& map() {
static map_t m;
return m;
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-10-26 19:22:36
|
Module: performous Branch: master Commit: 0156848b38229a15a0cae367ac91caafc766904a Author: Lasse Kärkkäinen <tro...@tr...> Date: Mon Oct 26 21:22:18 2009 +0200 Fix path --- data/performous.xml | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/data/performous.xml b/data/performous.xml index 1c2810e..a555ac7 100644 --- a/data/performous.xml +++ b/data/performous.xml @@ -1,4 +1,13 @@ <?xml version="1.0"?> +<!-- +DO NOT EDIT THIS FILE! +This is a config schema with built-in defaults for Performous. + +System-wide settings go to /etc/xdg/performous/performous.xml and user settings +go to ~/.config/performous.xml but you should generally let Performous modify +them instead of touching the XML yourself. Press Ctrl+S in config menu to save +the current settings to XML. +--> <performous> <!-- Menu definitions. All config entries with the same prefix as the menu entry are displayed in the menu, |
|
From: Yoda-JM <yo...@us...> - 2009-10-25 16:37:55
|
Module: performous
Branch: master
Commit: aaeec2e9f18a00d6d030ce021d1a728bc1e63cc7
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Oct 25 17:37:31 2009 +0100
Fixed player config file, getSharePath cannot return correct path if the file does not exists
---
game/main.cc | 2 +-
game/players.cc | 8 ++++----
game/players.hh | 5 +++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 7171f12..cc8993a 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -140,7 +140,7 @@ void mainLoop() {
Audio audio;
audioSetup(capture, audio);
Songs songs(songlist);
- Players players(getSharePath("performous.xml"));
+ Players players(getHomeDir() / ".config" / "performous-players.xml");
ScreenManager sm;
Window window(config["graphic/window_width"].i(), config["graphic/window_height"].i(), config["graphic/fullscreen"].b());
sm.addScreen(new ScreenIntro("Intro", audio, capture));
diff --git a/game/players.cc b/game/players.cc
index 2327493..4fe825b 100644
--- a/game/players.cc
+++ b/game/players.cc
@@ -9,7 +9,7 @@
#include <boost/regex.hpp>
#include <libxml++/libxml++.h>
-Players::Players(std::string filename):
+Players::Players(fs::path filename):
m_players(),
m_filtered(),
m_filename(filename),
@@ -29,7 +29,7 @@ Players::~Players() {
}
void Players::load() {
- xmlpp::DomParser domParser(m_filename);
+ xmlpp::DomParser domParser(m_filename.string());
xmlpp::NodeSet n = domParser.get_document()->get_root_node()->find("/performous/players/player");
for (xmlpp::NodeSet::const_iterator it = n.begin(); it != n.end(); ++it)
@@ -64,7 +64,7 @@ void Players::save() {
}
}
- doc.write_to_file_formatted(m_filename, "UTF-8");
+ doc.write_to_file_formatted(m_filename.string(), "UTF-8");
}
void Players::update() {
@@ -72,7 +72,7 @@ void Players::update() {
}
std::string Players::file() {
- return m_filename;
+ return m_filename.string();
}
void Players::addPlayer (std::string const& name, std::string const& picture) {
diff --git a/game/players.hh b/game/players.hh
index 17ea7a1..191dfe5 100644
--- a/game/players.hh
+++ b/game/players.hh
@@ -6,6 +6,7 @@
#include "player.hh"
#include "animvalue.hh"
+#include "fs.hh"
/**A collection of all Players.
@@ -22,7 +23,7 @@ class Players: boost::noncopyable {
players_t m_players;
players_t m_filtered;
- std::string m_filename;
+ fs::path m_filename;
std::string m_filter;
AnimAcceleration math_cover;
@@ -33,7 +34,7 @@ class Players: boost::noncopyable {
cur_scores_t scores;
public:
- Players(std::string filename);
+ Players(fs::path filename);
~Players();
void load();
|
|
From: Tapio V. <aa...@us...> - 2009-10-23 19:18:59
|
Module: performous
Branch: master
Commit: 5aaf2b1b15010389aacb274599a19a6ac9298040
Author: Tapio Vierros <tap...@gm...>
Date: Fri Oct 23 22:14:36 2009 +0300
Singers now get a textual feedback after each lyrics row.
---
game/layout_singer.cc | 24 ++++++++++++++++++++++++
game/layout_singer.hh | 1 +
game/player.cc | 16 +++++++++++++++-
game/player.hh | 6 ++++++
4 files changed, 46 insertions(+), 1 deletions(-)
diff --git a/game/layout_singer.cc b/game/layout_singer.cc
index c4b31a0..e99c79b 100644
--- a/game/layout_singer.cc
+++ b/game/layout_singer.cc
@@ -14,6 +14,10 @@ LayoutSinger::LayoutSinger(Song &_song, Players& _players, boost::shared_ptr<The
m_score_text[1].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
m_score_text[2].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
m_score_text[3].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
+ m_line_rank_text[0].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
+ m_line_rank_text[1].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
+ m_line_rank_text[2].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
+ m_line_rank_text[3].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
m_player_icon.reset(new Surface(getThemePath("sing_pbox.svg")));
}
@@ -49,6 +53,26 @@ void LayoutSinger::drawScore(Position position) {
break;
}
m_score_text[i%4]->draw();
+ // Give some feedback on how well the last lyricss row went
+ if (p->m_maxLineScore > 0) {
+ std::string prevLineRank;
+ if (p->m_prevLineScore > 0.9) { prevLineRank = "Perfect"; glColor4f(0.5, 1.0, 0.0, act); }
+ else if (p->m_prevLineScore > 0.8) { prevLineRank = "Excellent"; glColor4f(0.2, 0.8, 0.2, act); }
+ else if (p->m_prevLineScore > 0.6) { prevLineRank = "Good"; glColor4f(0.6, 1.0, 0.2, act); }
+ else if (p->m_prevLineScore > 0.5) { prevLineRank = "Ok"; glColor4f(0.6, 1.0, 0.2, act); }
+ else if (p->m_prevLineScore > 0.3) { prevLineRank = "Poor"; glColor4f(0.6, 0.8, 0.2, act); }
+ else { prevLineRank = "Horrible"; glColor4f(0.5, 0.5, 0.3, act); }
+ m_line_rank_text[i%4]->render(prevLineRank);
+ switch(position) {
+ case LayoutSinger::BOTTOM:
+ m_line_rank_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.055).screenTop(0.11);
+ break;
+ case LayoutSinger::MIDDLE:
+ m_line_rank_text[i%4]->dimensions().right(0.45).fixedHeight(0.04).screenTop(0.060 + 0.050 * i);
+ break;
+ }
+ m_line_rank_text[i%4]->draw();
+ }
glColor4f(1.0, 1.0, 1.0, 1.0);
}
}
diff --git a/game/layout_singer.hh b/game/layout_singer.hh
index e91aba2..85823a1 100644
--- a/game/layout_singer.hh
+++ b/game/layout_singer.hh
@@ -61,6 +61,7 @@ class LayoutSinger {
std::deque<LyricRow> m_lyrics;
boost::scoped_ptr<Surface> m_player_icon;
boost::scoped_ptr<SvgTxtThemeSimple> m_score_text[4];
+ boost::scoped_ptr<SvgTxtThemeSimple> m_line_rank_text[4];
Players& m_players;
boost::shared_ptr<ThemeSing> m_theme;
};
diff --git a/game/player.cc b/game/player.cc
index 697ad5e..02df7d9 100644
--- a/game/player.cc
+++ b/game/player.cc
@@ -11,7 +11,21 @@ void Player::update() {
m_pitch[m_pos++] = std::make_pair(t->freq, t->stabledb);
double endTime = Engine::TIMESTEP * m_pos;
while (m_scoreIt != m_song.notes.end()) {
- m_score += m_song.m_scoreFactor * m_scoreIt->score(m_song.scale.getNote(t->freq), beginTime, endTime);
+ double score_addition = m_song.m_scoreFactor * m_scoreIt->score(m_song.scale.getNote(t->freq), beginTime, endTime);
+ m_score += score_addition;
+ m_lineScore += score_addition;
+ // If a row of lyrics ends, calculate how well it went
+ if (m_scoreIt->type == Note::SLEEP && m_lineScore > 0) {
+ m_prevLineScore = m_lineScore;
+ if (m_maxLineScore > 0) m_prevLineScore /= m_maxLineScore;
+ m_lineScore = 0;
+ m_maxLineScore = 0;
+ Notes::const_iterator maxScoreIt = m_scoreIt + 1;
+ while (maxScoreIt != m_song.notes.end() && maxScoreIt->type != Note::SLEEP) {
+ m_maxLineScore += m_song.m_scoreFactor * maxScoreIt->maxScore();
+ maxScoreIt++;
+ }
+ }
if (endTime < m_scoreIt->end) break;
++m_scoreIt;
}
diff --git a/game/player.hh b/game/player.hh
index 885b7b7..48c2588 100644
--- a/game/player.hh
+++ b/game/player.hh
@@ -22,6 +22,12 @@ struct Player {
size_t m_pos;
/// score for current song
double m_score;
+ /// score for current line
+ double m_lineScore;
+ /// maximum score for the current line
+ double m_maxLineScore;
+ /// score for the previous line (normalized)
+ double m_prevLineScore;
/// activity timer
unsigned m_activitytimer;
/// score iterator
|
|
From: Tapio V. <aa...@us...> - 2009-10-23 19:18:58
|
Module: performous
Branch: master
Commit: 7d0879b652d6c32e5a80472fd6093922f67cdc59
Author: Tapio Vierros <tap...@gm...>
Date: Fri Oct 23 22:09:55 2009 +0300
Added streak counter for instruments, including longest tracking.
Also moved the score texts to make them fit inside the screen.
---
game/guitargraph.cc | 17 +++++++++++++++--
game/guitargraph.hh | 2 ++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 4a48dc5..34bbc42 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -58,7 +58,9 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, std::string track):
m_dead(1000),
m_text(getThemePath("sing_timetxt.svg"), config["graphic/text_lod"].f()),
m_correctness(0.0, 5.0),
- m_score()
+ m_score(),
+ m_streak(),
+ m_longestStreak()
{
unsigned int sr = m_audio.getSR();
if (g_samplesD.empty()) {
@@ -149,6 +151,7 @@ void GuitarGraph::engine() {
else level = m_chordIt->status ? 1.0 : 0.0;
m_correctness.setTarget(level);
}
+ if (m_correctness.get() == 0) m_streak = 0;
if (!m_drums) {
// Processing holds
for (int fret = 0; fret < 5; ++fret) {
@@ -180,6 +183,7 @@ void GuitarGraph::fail(double time, int fret) {
std::vector<Sample> const& samples = (m_drums ? g_samplesD : g_samplesG);
m_audio.play(samples[unsigned(fret) % samples.size()], "audio/fail_volume");
m_score -= 50;
+ m_streak = 0;
}
void GuitarGraph::drumHit(double time, int fret) {
@@ -200,6 +204,7 @@ void GuitarGraph::drumHit(double time, int fret) {
for (; best != m_chordIt; ++m_chordIt) {
if (m_chordIt->status == m_chordIt->polyphony) continue;
std::cout << "SKIPPED, ";
+ m_streak = 0;
}
++m_chordIt->status;
Duration const* dur = m_chordIt->dur[fret];
@@ -212,6 +217,8 @@ void GuitarGraph::drumHit(double time, int fret) {
m_score -= m_chordIt->score;
m_chordIt->score *= m_chordIt->polyphony;
m_score += m_chordIt->score;
+ m_streak += 1;
+ if (m_streak > m_longestStreak) m_longestStreak = m_streak;
std::cout << "FULL HIT!" << std::endl;
} else {
std::cout << "HIT" << std::endl;
@@ -262,6 +269,8 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
score *= m_chordIt->polyphony;
m_chordIt->status = 1 + picked;
m_score += score;
+ m_streak += 1;
+ if (m_streak > m_longestStreak) m_longestStreak = m_streak;
m_correctness.setTarget(1.0, true); // Instantly go to one
for (int fret = 0; fret < 5; ++fret) {
if (!m_chordIt->fret[fret]) continue;
@@ -316,14 +325,18 @@ void GuitarGraph::draw(double time) {
dimensions.screenBottom().middle(m_cx.get()).fixedWidth(m_width.get());
double offsetX = 0.5 * (dimensions.x1() + dimensions.x2());
double frac = 0.75; // Adjustable: 1.0 means fully separated, 0.0 means fully attached
+ // Draw scores
if (time < -0.5) {
std::string txt;
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 {
- m_text.dimensions.screenBottom(-0.15).middle(0.4 * dimensions.w() + offsetX);
+ m_text.dimensions.screenBottom(-0.30).middle(0.32 * dimensions.w() + offsetX);
m_text.draw(boost::lexical_cast<std::string>(unsigned(m_score)));
+ m_text.dimensions.screenBottom(-0.27).middle(0.32 * dimensions.w() + offsetX);
+ m_text.draw(boost::lexical_cast<std::string>(unsigned(m_streak)) + "/"
+ + boost::lexical_cast<std::string>(unsigned(m_longestStreak)));
}
glutil::PushMatrixMode pmm(GL_PROJECTION);
glTranslatef(frac * 2.0 * offsetX, 0.0f, 0.0f);
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 51fb05b..288aed4 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -108,5 +108,7 @@ class GuitarGraph {
NoteStatus m_notes;
AnimValue m_correctness;
double m_score;
+ int m_streak;
+ int m_longestStreak;
};
|
|
From: Yoda-JM <yo...@us...> - 2009-10-22 14:54:39
|
Module: performous
Branch: master
Commit: 2e2105eb7a199dad68ae0b422d72b181ec3377ba
Author: Vincent Le Ligeour <yo...@us...>
Date: Thu Oct 22 16:54:23 2009 +0200
Added editor use flag (used in other ebuilds of games)
---
.../performous/performous-0.4.0.ebuild | 4 ++--
.../games-arcade/performous/performous-9999.ebuild | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/portage-overlay/games-arcade/performous/performous-0.4.0.ebuild b/portage-overlay/games-arcade/performous/performous-0.4.0.ebuild
index 4c32872..c692990 100644
--- a/portage-overlay/games-arcade/performous/performous-0.4.0.ebuild
+++ b/portage-overlay/games-arcade/performous/performous-0.4.0.ebuild
@@ -32,7 +32,7 @@ LICENSE="GPL-2
SLOT="0"
KEYWORDS="~x86 ~amd64 ~ppc ~ppc64"
-IUSE="debug alsa portaudio pulseaudio jack songs gstreamer tools"
+IUSE="debug alsa portaudio pulseaudio jack songs gstreamer tools editor"
RDEPEND="gnome-base/librsvg
dev-libs/boost
@@ -73,7 +73,7 @@ src_configure() {
$(cmake-utils_use portaudio LIBDA_PLUGIN_PORTAUDIO)
$(cmake-utils_use pulseaudio LIBDA_PLUGIN_PULSEAUDIO)
$(cmake-utils_use_enable tools TOOLS)
- $(cmake-utils_use_enable tools EDITOR)
+ $(cmake-utils_use_enable editor EDITOR)
-DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}
-DSHARE_INSTALL=share/
-DLIBDA_AUTODETECT_PLUGINS=false
diff --git a/portage-overlay/games-arcade/performous/performous-9999.ebuild b/portage-overlay/games-arcade/performous/performous-9999.ebuild
index 594ad73..8e0fcb7 100644
--- a/portage-overlay/games-arcade/performous/performous-9999.ebuild
+++ b/portage-overlay/games-arcade/performous/performous-9999.ebuild
@@ -28,7 +28,7 @@ LICENSE="GPL-2
SLOT="0"
KEYWORDS="~x86 ~amd64 ~ppc ~ppc64"
-IUSE="debug alsa portaudio pulseaudio jack songs gstreamer tools"
+IUSE="debug alsa portaudio pulseaudio jack songs gstreamer tools editor"
RDEPEND="gnome-base/librsvg
dev-libs/boost
@@ -67,7 +67,7 @@ src_configure() {
$(cmake-utils_use portaudio LIBDA_PLUGIN_PORTAUDIO)
$(cmake-utils_use pulseaudio LIBDA_PLUGIN_PULSEAUDIO)
$(cmake-utils_use_enable tools TOOLS)
- $(cmake-utils_use_enable tools EDITOR)
+ $(cmake-utils_use_enable editor EDITOR)
-DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}
-DSHARE_INSTALL=share/
-DLIBDA_AUTODETECT_PLUGINS=false
|
|
From: Yoda-JM <yo...@us...> - 2009-10-22 14:29:43
|
Module: performous
Branch: master
Commit: 238611a3b575ced044ddda1a32a9a5236d31438e
Author: Vincent Le Ligeour <yo...@us...>
Date: Thu Oct 22 16:28:57 2009 +0200
Fixed git gentoo ebuild / Added 0.4.0 gentoo ebuild / Make current git 0.4-pre5
---
CMakeLists.txt | 2 +-
.../performous/performous-0.4.0.ebuild | 100 ++++++++++++++++++++
.../games-arcade/performous/performous-9999.ebuild | 20 ++---
3 files changed, 108 insertions(+), 14 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e2ce01e..efeac79 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-pre4")
+set(PROJECT_VERSION "0.4-pre5")
# Avoid source tree pollution
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
diff --git a/portage-overlay/games-arcade/performous/performous-0.4.0.ebuild b/portage-overlay/games-arcade/performous/performous-0.4.0.ebuild
new file mode 100644
index 0000000..4c32872
--- /dev/null
+++ b/portage-overlay/games-arcade/performous/performous-0.4.0.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /cvsroot/ultrastar-ng/UltraStar-ng/portage-overlay/games-arcade/performous/performous-9999.ebuild,v 1.10 2007/09/29 13:04:19 yoda-jm Exp $
+
+EAPI=2
+inherit cmake-utils games
+
+RESTRICT="nostrip"
+
+SONGS_PN=ultrastar-songs
+MY_PN=Performous
+MY_P=${MY_PN}-${PV}-Source
+SONGS_PN=ultrastar-songs
+
+DESCRIPTION="Karaoke game similar to Singstar"
+HOMEPAGE="http://performous.org"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2
+ songs? (
+ mirror://sourceforge/${PN}/${SONGS_PN}-jc-1.zip
+ mirror://sourceforge/${PN}/${SONGS_PN}-libre-3.zip
+ mirror://sourceforge/${PN}/${SONGS_PN}-restricted-3.zip
+ mirror://sourceforge/${PN}/${SONGS_PN}-shearer-1.zip
+ )"
+
+EGIT_REPO_URI="git://performous.git.sourceforge.net/gitroot/performous/performous"
+
+LICENSE="GPL-2
+ songs? (
+ CCPL-Attribution-ShareAlike-NonCommercial-2.5
+ CCPL-Attribution-NonCommercial-NoDerivs-2.5
+ )"
+SLOT="0"
+KEYWORDS="~x86 ~amd64 ~ppc ~ppc64"
+
+IUSE="debug alsa portaudio pulseaudio jack songs gstreamer tools"
+
+RDEPEND="gnome-base/librsvg
+ dev-libs/boost
+ x11-libs/pango
+ dev-cpp/libxmlpp
+ media-libs/glew
+ media-libs/libsdl[joystick,opengl]
+ media-gfx/imagemagick[png]
+ >=media-video/ffmpeg-0.4.9_p20070616-r20
+ alsa? ( media-libs/alsa-lib )
+ jack? ( media-sound/jack-audio-connection-kit )
+ portaudio? ( media-libs/portaudio )
+ gstreamer? ( media-libs/gstreamer )
+ pulseaudio? ( media-sound/pulseaudio )
+ sys-apps/help2man
+ !games-arcade/ultrastar-ng"
+DEPEND="${RDEPEND}
+ >=dev-util/cmake-2.6.0"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+ unpack "${MY_P}.tar.bz2"
+ if use songs; then
+ cd "${S}"
+ unpack "${SONGS_PN}-jc-1.zip"
+ unpack "${SONGS_PN}-libre-3.zip"
+ unpack "${SONGS_PN}-restricted-3.zip"
+ unpack "${SONGS_PN}-shearer-1.zip"
+ fi
+}
+
+src_configure() {
+ local mycmakeargs="
+ $(cmake-utils_use alsa LIBDA_PLUGIN_ALSA)
+ $(cmake-utils_use jack LIBDA_PLUGIN_JACK)
+ $(cmake-utils_use gstreamer LIBDA_PLUGIN_GSTREAMER)
+ $(cmake-utils_use portaudio LIBDA_PLUGIN_PORTAUDIO)
+ $(cmake-utils_use pulseaudio LIBDA_PLUGIN_PULSEAUDIO)
+ $(cmake-utils_use_enable tools TOOLS)
+ $(cmake-utils_use_enable tools EDITOR)
+ -DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}
+ -DSHARE_INSTALL=share/
+ -DLIBDA_AUTODETECT_PLUGINS=false
+ -DLIBDA_PLUGIN_TESTING=false
+ -DCMAKE_BUILD_TYPE=Release"
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ DOCS="docs/*.txt" cmake-utils_src_install
+
+ if use songs; then
+ insinto "/usr/share/games/ultrastar"
+ doins -r "${S}/songs" || die "doins songs failed"
+ fi
+ doicon "${S}/data/${PN}.xpm"
+ domenu "${S}/data/${PN}.desktop"
+ prepgamesdirs
+}
diff --git a/portage-overlay/games-arcade/performous/performous-9999.ebuild b/portage-overlay/games-arcade/performous/performous-9999.ebuild
index e858642..594ad73 100644
--- a/portage-overlay/games-arcade/performous/performous-9999.ebuild
+++ b/portage-overlay/games-arcade/performous/performous-9999.ebuild
@@ -48,12 +48,6 @@ RDEPEND="gnome-base/librsvg
DEPEND="${RDEPEND}
>=dev-util/cmake-2.6.0"
-pkg_setup() {
- if ! built_with_use --missing true dev-libs/boost threads ; then
- eerror "Please emerge dev-libs/boost with USE=threads"
- fi
-}
-
src_unpack() {
git_src_unpack
if use songs; then
@@ -62,18 +56,18 @@ src_unpack() {
unpack "${SONGS_PN}-libre-3.zip"
unpack "${SONGS_PN}-restricted-3.zip"
unpack "${SONGS_PN}-shearer-1.zip"
- pwd
fi
}
-src_compile() {
+src_configure() {
local mycmakeargs="
- $(cmake-utils_use_enable alsa LIBDA_PLUGIN_ALSA)
- $(cmake-utils_use_enable jack LIBDA_PLUGIN_ALSA)
- $(cmake-utils_use_enable gstreamer LIBDA_PLUGIN_GSTREAMER)
- $(cmake-utils_use_enable portaudio LIBDA_PLUGIN_PORTAUDIO)
- $(cmake-utils_use_enable pulseaudio LIBDA_PLUGIN_PULSEAUDIO)
+ $(cmake-utils_use alsa LIBDA_PLUGIN_ALSA)
+ $(cmake-utils_use jack LIBDA_PLUGIN_JACK)
+ $(cmake-utils_use gstreamer LIBDA_PLUGIN_GSTREAMER)
+ $(cmake-utils_use portaudio LIBDA_PLUGIN_PORTAUDIO)
+ $(cmake-utils_use pulseaudio LIBDA_PLUGIN_PULSEAUDIO)
$(cmake-utils_use_enable tools TOOLS)
+ $(cmake-utils_use_enable tools EDITOR)
-DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}
-DSHARE_INSTALL=share/
-DLIBDA_AUTODETECT_PLUGINS=false
|
|
From: Tapio V. <aa...@us...> - 2009-10-21 16:35:32
|
Module: performous Branch: master Commit: 2e8b39e95d6891f475de64c4707a091d8c6a29c1 Author: Tapio Vierros <tap...@gm...> Date: Wed Oct 21 19:27:10 2009 +0300 Added background to instrumenthelp's keyboard and borders to texts to make them readable on all kinds of surfaces. --- themes/default/instrumenthelp.svg | 129 ++++++++++++++++++++++-------------- 1 files changed, 79 insertions(+), 50 deletions(-) |
|
From: Yoda-JM <yo...@us...> - 2009-10-21 07:49:06
|
Module: performous Branch: master Commit: 6bd76fa509e0c20bee895d8e4cb1a709e7af89a9 Author: Vincent Le Ligeour <yo...@us...> Date: Wed Oct 21 09:48:29 2009 +0200 Changed default user share directory --- data/performous.xml | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/data/performous.xml b/data/performous.xml index aa7cca9..1c2810e 100644 --- a/data/performous.xml +++ b/data/performous.xml @@ -222,7 +222,7 @@ </locale> </entry> <entry name="system/path_share" type="string_list"> - <stringvalue>~/.local/share</stringvalue> + <stringvalue>~/.local/share/performous</stringvalue> <stringvalue>../share</stringvalue><!-- For Windows where the program is started in bin/ --> <stringvalue>~/.performous/share</stringvalue> <locale name="C"> |
|
From: Tapio V. <aa...@us...> - 2009-10-20 15:08:12
|
Module: performous
Branch: master
Commit: 7b366d14095da548e67e40a7d509641c1ce84192
Author: Tapio Vierros <tap...@gm...>
Date: Tue Oct 20 18:04:38 2009 +0300
Added (unofficial) support for images and videos to the FoF ini file format.
---
game/songparser-ini.cc | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 1b1bc35..4b53e57 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -1,8 +1,10 @@
#include "songparser.hh"
+#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
#include <boost/regex.hpp>
+#include <stdexcept>
#include "midifile.hh"
/// @file
@@ -21,6 +23,14 @@ namespace {
std::string f = s.path + filename;
if (boost::filesystem::exists(f)) s.music[trackid] = f;
}
+ void assign(double& var, std::string str) {
+ std::replace(str.begin(), str.end(), ',', '.'); // Fix decimal separators
+ try {
+ var = boost::lexical_cast<double>(str);
+ } catch (...) {
+ throw std::runtime_error("\"" + str + "\" is not valid floating point value");
+ }
+ }
}
void SongParser::iniParse() {
@@ -36,6 +46,12 @@ void SongParser::iniParse() {
boost::trim(value);
if (key == "name") s.title = value;
else if (key == "artist") s.artist = value;
+ // These are added features (not part of FoF)
+ else if (key == "cover") s.cover = value;
+ else if (key == "background") s.background = value;
+ else if (key == "video") m_song.video = value;
+ else if (key == "videogap") assign(m_song.videoGap, value);
+ // End of added features
}
if (s.title.empty() || s.artist.empty()) throw std::runtime_error("Required header fields missing");
|
|
From: Tapio V. <aa...@us...> - 2009-10-20 15:08:10
|
Module: performous
Branch: master
Commit: e3f54d22f711e9b01a4025d377d517400203229a
Author: Tapio Vierros <tap...@gm...>
Date: Tue Oct 20 18:01:46 2009 +0300
Songparser searches song's dir for images/videos to use if they weren't specified.
---
game/songparser.hh | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/game/songparser.hh b/game/songparser.hh
index c372e35..7be9ee4 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -4,6 +4,8 @@
#include "unicode.hh"
#include <fstream>
#include <sstream>
+#include <boost/filesystem.hpp>
+#include <boost/regex.hpp>
/// parses songfiles
class SongParser {
@@ -43,6 +45,27 @@ class SongParser {
} catch (std::runtime_error& e) {
throw SongParserException(e.what(), m_linenum);
}
+
+ // In case no images/videos were specified, try to guess them
+ if (m_song.cover.empty() || (m_song.background.empty() && m_song.video.empty())) {
+ boost::regex coverfile("((cover|album|label|\\[co\\])\\.(png|jpeg|jpg|svg|bmp|gif))$", boost::regex_constants::icase);
+ boost::regex backgroundfile("((background|bg||\\[bg\\])\\.(png|jpeg|jpg|svg|bmp|gif))$", boost::regex_constants::icase);
+ boost::regex videofile("(.*\\.(avi|mpg|mpeg|flv|mov))$", boost::regex_constants::icase);
+ boost::cmatch match;
+
+ for (boost::filesystem::directory_iterator dirIt(s.path), dirEnd; dirIt != dirEnd; ++dirIt) {
+ boost::filesystem::path p = dirIt->path();
+ std::string name = p.leaf(); // File basename
+ if (m_song.cover.empty() && regex_match(name.c_str(), match, coverfile)) {
+ m_song.cover = name;
+ } else if (m_song.background.empty() && regex_match(name.c_str(), match, backgroundfile)) {
+ m_song.background = name;
+ } else if (m_song.background.empty() && m_song.video.empty() && regex_match(name.c_str(), match, videofile)) {
+ m_song.video = name;
+ }
+ }
+ }
+
// Adjust negative notes
if (m_song.noteMin <= 0) {
unsigned int shift = (1 - m_song.noteMin / 12) * 12;
|
|
From: Yoda-JM <yo...@us...> - 2009-10-17 12:27:01
|
Module: performous
Branch: master
Commit: c0827faa96e70b6b5a1f43116d0eba4f0a35341a
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Oct 17 14:26:41 2009 +0200
Fixed man page generation
---
docs/CMakeLists.txt | 2 +-
editor/main.cc | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 0a4269d..24da6af 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -7,7 +7,7 @@ if(UNIX)
if(HELP2MAN AND GZIP)
set(MANFILE ${CMAKE_CURRENT_BINARY_DIR}/performous.6.gz)
set(H2MFILE ${CMAKE_CURRENT_SOURCE_DIR}/performous.h2m)
- set(PERFORMOUS_EXEC ${CMAKE_BINARY_DIR}/game/performous)
+ set(PERFORMOUS_EXEC ${CMAKE_BINARY_DIR}/game/performous.bin)
add_custom_command(
OUTPUT ${MANFILE}
COMMAND ${HELP2MAN} ${PERFORMOUS_EXEC} -s 6 -i ${H2MFILE} -N | ${GZIP} > ${MANFILE}
diff --git a/editor/main.cc b/editor/main.cc
index f5970f6..0c1eb4f 100644
--- a/editor/main.cc
+++ b/editor/main.cc
@@ -1,10 +1,11 @@
#include "pitch.hh"
#include "ffmpeg.hh"
#include "notes.hh"
-//#include <boost/math/special_functions/fpclassify.hpp>
#include <cmath>
+#include <Magick++.h>
+
int main(int argc, char **argv) {
if (argc < 2)
@@ -33,7 +34,6 @@ int main(int argc, char **argv) {
da::pcm_data data(&sample[0], 1500, 2, 48000);
usleep(500000);
while( mpeg.audioQueue(data, position) ) {
- usleep(500000);
std::cout << i << ": " << position << " " << double(position) / double(48000*2)<< std::endl;
analyzer.input(data.begin(0), data.end(0));
@@ -47,7 +47,7 @@ int main(int argc, char **argv) {
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;
+ std::cout << " " << t->freq << " -> " << t->db << std::endl;
int note = scale.getNoteId(t->freq);
if (note < 0) continue;
// Here I could spot X=position, Y=note, Z=t->db
|
|
From: Yoda-JM <yo...@us...> - 2009-10-17 11:34:09
|
Module: performous
Branch: master
Commit: 18defa3839d0a9361025a99b78372f8429288429
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Oct 17 13:33:48 2009 +0200
Always build launcher script, renamed performous binanary to performous.bin
---
CMakeLists.txt | 33 +++++--------------
game/CMakeLists.txt | 6 ++--
.../games-arcade/performous/performous-9999.ebuild | 6 ---
3 files changed, 12 insertions(+), 33 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 37833e6..e2ce01e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,27 +49,12 @@ if (ENABLE_TOOLS)
add_subdirectory(tools)
endif (ENABLE_TOOLS)
-if(NOT WIN32)
- if(NOT "${CMAKE_INSTALL_PREFIX}" MATCHES "^(/usr|/usr/local)$")
- message(STATUS "Non-standard installation prefix. Configuring performous.sh.")
- set(LAUNCHER_SCRIPT TRUE)
- endif(NOT "${CMAKE_INSTALL_PREFIX}" MATCHES "^(/usr|/usr/local)$")
-
- if(NOT "${SHARE_INSTALL}" MATCHES "^(share/performous|share/games/performous)$")
- message(STATUS "Non-standard data file install path. Configuring performous.sh.")
- set(LAUNCHER_SCRIPT TRUE)
- endif(NOT "${SHARE_INSTALL}" MATCHES "^(share/performous|share/games/performous)$")
-endif(NOT WIN32)
-
-if(LAUNCHER_SCRIPT)
- set(FULL_PREFIX ${CMAKE_INSTALL_PREFIX})
- if(UNIX AND NOT "${FULL_PREFIX}" MATCHES "^/")
- set(FULL_PREFIX "${CMAKE_BINARY_DIR}/${FULL_PREFIX}")
- endif(UNIX AND NOT "${FULL_PREFIX}" MATCHES "^/")
- set(PERFORMOUS_PLUGIN_PATH "${FULL_PREFIX}/lib${LIB_SUFFIX}/libda")
- set(PERFORMOUS_EXECUTABLE "${FULL_PREFIX}/bin/performous")
- configure_file("${PROJECT_SOURCE_DIR}/cmake/performous.sh.cmake" "${PROJECT_BINARY_DIR}/performous.sh" ESCAPE_QUOTES @ONLY)
- install(PROGRAMS "${PROJECT_BINARY_DIR}/performous.sh" DESTINATION bin)
- install(SCRIPT "${PROJECT_SOURCE_DIR}/cmake/performous-launcher.cmake")
-endif(LAUNCHER_SCRIPT)
-
+set(FULL_PREFIX ${CMAKE_INSTALL_PREFIX})
+if(UNIX AND NOT "${FULL_PREFIX}" MATCHES "^/")
+ set(FULL_PREFIX "${CMAKE_BINARY_DIR}/${FULL_PREFIX}")
+endif(UNIX AND NOT "${FULL_PREFIX}" MATCHES "^/")
+set(PERFORMOUS_PLUGIN_PATH "${FULL_PREFIX}/lib${LIB_SUFFIX}/libda")
+set(PERFORMOUS_EXECUTABLE "${FULL_PREFIX}/bin/performous.bin")
+configure_file("${PROJECT_SOURCE_DIR}/cmake/performous.sh.cmake" "${PROJECT_BINARY_DIR}/performous" ESCAPE_QUOTES @ONLY)
+install(PROGRAMS "${PROJECT_BINARY_DIR}/performous" DESTINATION bin)
+install(SCRIPT "${PROJECT_SOURCE_DIR}/cmake/performous-launcher.cmake")
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index 4bca0db..18a4c11 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -35,12 +35,12 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions("-D__STDC_CONSTANT_MACROS")
endif(CMAKE_COMPILER_IS_GNUCXX)
-add_executable(performous ${SOURCES} ${SDL_SOURCES})
-target_link_libraries(performous da ${LIBS})
+add_executable(performous.bin ${SOURCES} ${SDL_SOURCES})
+target_link_libraries(performous.bin da ${LIBS})
# Generate config.hh
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.hh" "${CMAKE_CURRENT_BINARY_DIR}/config.hh" @ONLY)
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
-install(TARGETS performous DESTINATION bin)
+install(TARGETS performous.bin DESTINATION bin)
diff --git a/portage-overlay/games-arcade/performous/performous-9999.ebuild b/portage-overlay/games-arcade/performous/performous-9999.ebuild
index 39ba488..e858642 100644
--- a/portage-overlay/games-arcade/performous/performous-9999.ebuild
+++ b/portage-overlay/games-arcade/performous/performous-9999.ebuild
@@ -90,12 +90,6 @@ src_compile() {
src_install() {
DOCS="docs/*.txt" cmake-utils_src_install
- if test -f "${D}/usr/bin/performous.sh" ; then
- perl -pi -e "s+bin/performous+bin/performous.bin+" "${D}/usr/bin/performous.sh"
- mv "${D}/usr/bin/performous" "${D}/usr/bin/performous.bin"
- mv "${D}/usr/bin/performous.sh" "${D}/usr/bin/performous"
- fi
-
if use songs; then
insinto "/usr/share/games/ultrastar"
doins -r "${S}/songs" || die "doins songs failed"
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-10-16 16:11:49
|
Module: performous Branch: master Commit: 4ba2bc52b6d6f04f760d243ac542944ebb9e35ac Author: Lasse Karkkainen <tro...@tr...> Date: Fri Oct 16 19:11:34 2009 +0300 WIP MIDI drum support --- cmake/Modules/FindPortMidi.cmake | 21 +++++++++++++++++++++ data/performous.xml | 6 ++++++ game/CMakeLists.txt | 7 +++++++ game/joystick.cc | 24 ++++++++++++++++++++++++ game/joystick.hh | 20 ++++++++++++++++++-- game/portmidi.hh | 29 +++++++++++++++++++++++++++++ 6 files changed, 105 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/FindPortMidi.cmake b/cmake/Modules/FindPortMidi.cmake new file mode 100644 index 0000000..f5126d8 --- /dev/null +++ b/cmake/Modules/FindPortMidi.cmake @@ -0,0 +1,21 @@ +# - Try to find PortMidi +# Once done, this will define +# +# PortMidi_FOUND - system has PortMidi +# PortMidi_INCLUDE_DIRS - the PortMidi include directories +# PortMidi_LIBRARIES - link these to use PortMidi +# PortMidi_VERSION - detected version of PortMidi +# +# See documentation on how to write CMake scripts at +# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries + +include(LibFindMacros) + +find_path(PortMidi_INCLUDE_DIR NAMES portmidi.h) +find_library(PortMidi_LIBRARY NAMES portmidi) +find_library(PortTime_LIBRARY NAMES porttime) + +set(PortMidi_PROCESS_INCLUDES PortMidi_INCLUDE_DIR) +set(PortMidi_PROCESS_LIBS PortMidi_LIBRARY PortTime_LIBRARY) +libfind_process(PortMidi) + diff --git a/data/performous.xml b/data/performous.xml index e0577a8..aa7cca9 100644 --- a/data/performous.xml +++ b/data/performous.xml @@ -63,6 +63,12 @@ <long>Enable keyboard as guitar (Frets on Fire mode).</long> </locale> </entry> + <entry name="game/midi_drums" type="string"> + <locale name="C"> + <short>MIDI drum mapping</short> + <long>Mapping of hardware MIDI device: devID:kick,pad1,pad2,pad3,pad4</long> + </locale> + </entry> <entry name="game/instruments" type="string_list"> <!-- Should be SDL_ID:{GUITAR_GUITARHERO|GUITAR_ROCKBAND|DRUMS_GUITARHERO|DRUMS_ROCKBAND} example: diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index e4e484a..4bca0db 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -19,6 +19,13 @@ foreach(lib SDL PangoCairo LibRSVG LibXML++ Magick++ GLEW AVFormat SWScale OpenG add_definitions(${${lib}_DEFINITIONS}) endforeach(lib) +find_package(PortMidi) +if(PortMidi_FOUND) + include_directories(PortMidi_INCLUDE_DIRS) + set(LIBS ${LIBS} ${PortMidi_LIBRARIES}) + add_definitions("-DHAVE_PORTMIDI") +endif(PortMidi_FOUND) + # Set default compile flags for GCC if(CMAKE_COMPILER_IS_GNUCXX) message(STATUS "GCC detected, adding compile flags") diff --git a/game/joystick.cc b/game/joystick.cc index 17f6fb8..d79396e 100644 --- a/game/joystick.cc +++ b/game/joystick.cc @@ -3,6 +3,26 @@ #include <boost/lexical_cast.hpp> +#ifdef HAVE_PORTMIDI +input::MidiDrums::MidiDrums(int devId): stream(devId) { + Private::devices[0x8000] = Private::InputDevPrivate(Private::DRUMS_MIDI); + event.type = Event::PRESS; + for (unsigned int i = 0; i < BUTTONS; ++i) event.pressed[i] = false; +} + +void input::MidiDrums::process() { + PmEvent ev; + while (Pm_Read(stream, &ev, 1) == 1) { + if ((ev.message & 0xFF) != 0x99) continue; + unsigned char ch = ev.message >> 8; + //unsigned char vel = ev.message >> 16; + event.button = ch % 5; + event.time = now(); + Private::devices[0x8000].addEvent(event); + } +} +#endif + static const unsigned SDL_BUTTONS = 6; int buttonFromSDL(input::Private::Type _type, unsigned int _sdl_button) { @@ -110,6 +130,9 @@ void input::SDL::init() { case input::Private::DRUMS_RB: std::cout << " Detected as: RockBand Drums (forced)" << std::endl; break; + case input::Private::DRUMS_MIDI: + std::cout << " Detected as: MIDI Drums (forced)" << std::endl; + break; } input::Private::devices[i] = input::Private::InputDevPrivate(forced_type[i]); } else if( name.find("Guitar Hero3") != std::string::npos ) { @@ -292,3 +315,4 @@ bool input::SDL::pushEvent(SDL_Event _e) { } return true; } + diff --git a/game/joystick.hh b/game/joystick.hh index d4ca2df..7499232 100644 --- a/game/joystick.hh +++ b/game/joystick.hh @@ -11,6 +11,10 @@ #include "xtime.hh" #include "configuration.hh" +#ifdef HAVE_PORTMIDI +#include "portmidi.hh" +#endif + namespace input { enum DevType { GUITAR, DRUMS }; @@ -26,7 +30,7 @@ namespace input { }; namespace Private { - enum Type {GUITAR_RB, DRUMS_RB, GUITAR_GH, DRUMS_GH}; + enum Type {GUITAR_RB, DRUMS_RB, GUITAR_GH, DRUMS_GH, DRUMS_MIDI}; static unsigned int KEYBOARD_ID = UINT_MAX; class InputDevPrivate { public: @@ -73,7 +77,7 @@ namespace input { (m_type == input::Private::GUITAR_GH || m_type == input::Private::GUITAR_RB) ) { return true; } else if( _type == input::DRUMS && - (m_type == input::Private::DRUMS_GH || m_type == input::Private::DRUMS_RB) ) { + (m_type == input::Private::DRUMS_GH || m_type == input::Private::DRUMS_RB || m_type == input::Private::DRUMS_MIDI) ) { return true; } else { return false; @@ -135,5 +139,17 @@ namespace input { // Returns true if event is taken, feed an InputDev by transforming SDL_Event into Event bool pushEvent(SDL_Event); } + +#ifdef HAVE_PORTMIDI + class MidiDrums { + public: + MidiDrums(int devId); + void process(); + private: + pm::Input stream; + Event event; + }; +#endif + }; diff --git a/game/portmidi.hh b/game/portmidi.hh new file mode 100644 index 0000000..848c0f2 --- /dev/null +++ b/game/portmidi.hh @@ -0,0 +1,29 @@ +#pragma once + +#include <portmidi.h> +#include <stdexcept> + +namespace pm { + struct Initialize { + Initialize() { Pm_Initialize(); } + ~Initialize() { Pm_Terminate(); } + }; + class Stream { + public: + operator PortMidiStream*() { return m_handle; } + + protected: + PortMidiStream* m_handle; + Stream(): m_handle() {} + ~Stream() { if (m_handle) Pm_Close(m_handle); } + }; + + class Input: public Stream { + public: + Input(int devId) { + PmError err = Pm_OpenInput(&m_handle, devId, 0, 1024, 0, 0); + if (err) throw std::runtime_error("Pm_OpenInput failed"); + } + }; +} + |
|
From: Yoda-JM <yo...@us...> - 2009-10-14 15:50:34
|
Module: performous
Branch: master
Commit: 598ad3b77868a5cfd6000c3a0dd36e709b667421
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Oct 14 17:50:16 2009 +0200
Used cmake-utils eclass (WIP)
---
.../games-arcade/performous/performous-9999.ebuild | 84 +++++++-------------
1 files changed, 28 insertions(+), 56 deletions(-)
diff --git a/portage-overlay/games-arcade/performous/performous-9999.ebuild b/portage-overlay/games-arcade/performous/performous-9999.ebuild
index bd908b0..39ba488 100644
--- a/portage-overlay/games-arcade/performous/performous-9999.ebuild
+++ b/portage-overlay/games-arcade/performous/performous-9999.ebuild
@@ -3,7 +3,7 @@
# $Header: /cvsroot/ultrastar-ng/UltraStar-ng/portage-overlay/games-arcade/performous/performous-9999.ebuild,v 1.10 2007/09/29 13:04:19 yoda-jm Exp $
EAPI=2
-inherit games git cmake-utils
+inherit git games cmake-utils
RESTRICT="nostrip"
@@ -49,7 +49,6 @@ DEPEND="${RDEPEND}
>=dev-util/cmake-2.6.0"
pkg_setup() {
- games_pkg_setup
if ! built_with_use --missing true dev-libs/boost threads ; then
eerror "Please emerge dev-libs/boost with USE=threads"
fi
@@ -68,67 +67,40 @@ src_unpack() {
}
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
- plugins="$plugins -DLIBDA_PLUGIN_ALSA=false"
- fi
- if use jack ; then
- plugins="$plugins -DLIBDA_PLUGIN_JACK=true"
- else
- plugins="$plugins -DLIBDA_PLUGIN_JACK=false"
- fi
- if use gstreamer ; then
- plugins="$plugins -DLIBDA_PLUGIN_GSTREAMER=true"
- else
- plugins="$plugins -DLIBDA_PLUGIN_GSTREAMER=false"
- fi
- if use portaudio ; then
- plugins="$plugins -DLIBDA_PLUGIN_PORTAUDIO=true"
- else
- plugins="$plugins -DLIBDA_PLUGIN_PORTAUDIO=false"
- fi
- if use pulseaudio ; then
- plugins="$plugins -DLIBDA_PLUGIN_PULSE=true"
- else
- plugins="$plugins -DLIBDA_PLUGIN_PULSE=false"
- fi
- if [[ $(get_libdir) = "lib64" ]]; then
- libdir_suffix="64"
- fi
- cmake \
- -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
- -DCMAKE_INSTALL_PREFIX="${GAMES_PREFIX}" \
- -DLIB_SUFFIX="$libdir_suffix" \
- -DSHARE_INSTALL="share/" \
- $plugins \
- .. || die "cmake failed"
- emake || die "emake failed"
+ local mycmakeargs="
+ $(cmake-utils_use_enable alsa LIBDA_PLUGIN_ALSA)
+ $(cmake-utils_use_enable jack LIBDA_PLUGIN_ALSA)
+ $(cmake-utils_use_enable gstreamer LIBDA_PLUGIN_GSTREAMER)
+ $(cmake-utils_use_enable portaudio LIBDA_PLUGIN_PORTAUDIO)
+ $(cmake-utils_use_enable pulseaudio LIBDA_PLUGIN_PULSEAUDIO)
+ $(cmake-utils_use_enable tools TOOLS)
+ -DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}
+ -DSHARE_INSTALL=share/
+ -DLIBDA_AUTODETECT_PLUGINS=false
+ -DLIBDA_PLUGIN_TESTING=false
+ -DCMAKE_BUILD_TYPE=Release"
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
}
src_install() {
- cd build
- emake DESTDIR="${D}" install || die "make install failed"
+ DOCS="docs/*.txt" cmake-utils_src_install
- perl -pi -e "s+bin/performous+bin/performous.bin+" "${D}/${GAMES_PREFIX}/bin/performous.sh"
- mv "${D}/${GAMES_PREFIX}/bin/performous" "${D}/${GAMES_PREFIX}/bin/performous.bin"
- mv "${D}/${GAMES_PREFIX}/bin/performous.sh" "${D}/${GAMES_PREFIX}/bin/performous"
+ if test -f "${D}/usr/bin/performous.sh" ; then
+ perl -pi -e "s+bin/performous+bin/performous.bin+" "${D}/usr/bin/performous.sh"
+ mv "${D}/usr/bin/performous" "${D}/usr/bin/performous.bin"
+ mv "${D}/usr/bin/performous.sh" "${D}/usr/bin/performous"
+ fi
- keepdir "/usr/ultrastar/songs"
if use songs; then
insinto "/usr/share/games/ultrastar"
- doins -r ../songs || die "doins songs failed"
+ doins -r "${S}/songs" || die "doins songs failed"
fi
- doicon data/${PN}.xpm
- domenu data/${PN}.desktop
- dodoc ../docs/*.txt
+ doicon "${S}/data/${PN}.xpm"
+ domenu "${S}/data/${PN}.desktop"
prepgamesdirs
}
|
|
From: Yoda-JM <yo...@us...> - 2009-10-14 13:33:25
|
Module: performous Branch: master Commit: 7e7d2dceeb6ffe5aa6d8fb09b451c84752ce2bf7 Author: Vincent Le Ligeour <yo...@us...> Date: Wed Oct 14 15:33:08 2009 +0200 Fixed some installation stuffs (see http://bugs.gentoo.org/show_bug.cgi?id=245452) --- CMakeLists.txt | 4 +++- .../games-arcade/performous/performous-9999.ebuild | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dac5015..37833e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,9 @@ endif(NOT CMAKE_BUILD_TYPE) if(WIN32) set(SHARE_INSTALL "." CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.") else(WIN32) - set(SHARE_INSTALL "share/games/performous" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.") + if(NOT SHARE_INSTALL) + set(SHARE_INSTALL "share/games/performous" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.") + endif(NOT SHARE_INSTALL) endif(WIN32) mark_as_advanced(SHARE_INSTALL) diff --git a/portage-overlay/games-arcade/performous/performous-9999.ebuild b/portage-overlay/games-arcade/performous/performous-9999.ebuild index 110650c..bd908b0 100644 --- a/portage-overlay/games-arcade/performous/performous-9999.ebuild +++ b/portage-overlay/games-arcade/performous/performous-9999.ebuild @@ -2,6 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /cvsroot/ultrastar-ng/UltraStar-ng/portage-overlay/games-arcade/performous/performous-9999.ebuild,v 1.10 2007/09/29 13:04:19 yoda-jm Exp $ +EAPI=2 inherit games git cmake-utils RESTRICT="nostrip" @@ -100,9 +101,14 @@ src_compile() { else plugins="$plugins -DLIBDA_PLUGIN_PULSE=false" fi + if [[ $(get_libdir) = "lib64" ]]; then + libdir_suffix="64" + fi cmake \ -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ - -DCMAKE_INSTALL_PREFIX="/usr" \ + -DCMAKE_INSTALL_PREFIX="${GAMES_PREFIX}" \ + -DLIB_SUFFIX="$libdir_suffix" \ + -DSHARE_INSTALL="share/" \ $plugins \ .. || die "cmake failed" emake || die "emake failed" @@ -111,8 +117,12 @@ src_compile() { src_install() { cd build emake DESTDIR="${D}" install || die "make install failed" + + perl -pi -e "s+bin/performous+bin/performous.bin+" "${D}/${GAMES_PREFIX}/bin/performous.sh" + mv "${D}/${GAMES_PREFIX}/bin/performous" "${D}/${GAMES_PREFIX}/bin/performous.bin" + mv "${D}/${GAMES_PREFIX}/bin/performous.sh" "${D}/${GAMES_PREFIX}/bin/performous" + keepdir "/usr/ultrastar/songs" - rm -rf "${D}/usr/share/${PN}"/{applications,pixmaps} if use songs; then insinto "/usr/share/games/ultrastar" doins -r ../songs || die "doins songs failed" |
|
From: Yoda-JM <yo...@us...> - 2009-10-12 21:31:12
|
Module: performous
Branch: master
Commit: b11066ea5a09a1b4ad432e38bd2a86e7dceb4424
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Oct 12 23:30:56 2009 +0200
Moved input event timing into SDL specific code, so that each input event backend is reponsible for setting event time
---
game/joystick.cc | 2 ++
game/joystick.hh | 2 --
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index e799a21..17f6fb8 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -145,6 +145,8 @@ bool input::SDL::pushEvent(SDL_Event _e) {
using namespace input::Private;
Event event;
+ // Add event time
+ event.time = now();
static bool pickPressed[2] = {}; // HACK for tracking enter and rshift status
switch(_e.type) {
case SDL_KEYDOWN: {
diff --git a/game/joystick.hh b/game/joystick.hh
index e370668..d4ca2df 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -47,8 +47,6 @@ namespace input {
return true;
};
void addEvent(Event _event) {
- // Add event time
- _event.time = now();
// only add event if the device is assigned
if( m_assigned ) m_events.push_back(_event);
/*
|
|
From: Yoda-JM <yo...@us...> - 2009-10-12 20:18:39
|
Module: performous
Branch: master
Commit: e523e2a78471acfd5c85efe3fc73bb82be7bbc71
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Oct 12 22:18:21 2009 +0200
Added joystick events timing
---
game/joystick.hh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/game/joystick.hh b/game/joystick.hh
index 4e35779..e370668 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -8,6 +8,7 @@
#include "SDL_events.h"
#include "SDL_joystick.h"
+#include "xtime.hh"
#include "configuration.hh"
namespace input {
@@ -21,6 +22,7 @@ namespace input {
int button; // Translated button number for press/release events. 0 for pick down, 1 for pick up (NOTE: these are NOT pick press/release events but rather different directions)
bool pressed[BUTTONS]; // All events tell the button state right after the event happened
// More stuff later, when it is actually used
+ boost::xtime time;
};
namespace Private {
@@ -45,6 +47,8 @@ namespace input {
return true;
};
void addEvent(Event _event) {
+ // Add event time
+ _event.time = now();
// only add event if the device is assigned
if( m_assigned ) m_events.push_back(_event);
/*
|
|
From: Yoda-JM <yo...@us...> - 2009-10-10 12:49:17
|
Module: performous
Branch: master
Commit: 980885eb2b1b79941b4e4f220f638b20a999cc0e
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Oct 10 14:49:00 2009 +0200
Catched exception in practice screen when no drumkit is found
---
game/screen_practice.cc | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/game/screen_practice.cc b/game/screen_practice.cc
index db655b7..79c2baf 100644
--- a/game/screen_practice.cc
+++ b/game/screen_practice.cc
@@ -17,7 +17,9 @@ void ScreenPractice::enter() {
m_vumeters.push_back(b = new ProgressBar(getThemePath("vumeter_bg.svg"), getThemePath("vumeter_fg.svg"), ProgressBar::VERTICAL, 0.136, 0.023));
b->dimensions.screenBottom().left(-0.4 + i * 0.2).fixedWidth(0.04);
}
- drums.reset(new input::InputDev(input::DRUMS));
+ try {
+ drums.reset(new input::InputDev(input::DRUMS));
+ } catch (std::runtime_error&) {drums.reset();}
unsigned int sr = m_audio.getSR();
m_samples.push_back(Sample(getDataPath("sounds/drum_bass.ogg"), sr));
m_samples.push_back(Sample(getDataPath("sounds/drum_snare.ogg"), sr));
|
|
From: Yoda-JM <yo...@us...> - 2009-10-10 10:34:14
|
Module: performous Branch: master Commit: e848958d2977c594ba4165a6d8ab3d21b4d5eb0d Author: Vincent Le Ligeour <yo...@us...> Date: Sat Oct 10 12:33:56 2009 +0200 Made non-standard prefix work again --- cmake/performous.sh.cmake | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cmake/performous.sh.cmake b/cmake/performous.sh.cmake index 7326c21..06a4c9e 100644 --- a/cmake/performous.sh.cmake +++ b/cmake/performous.sh.cmake @@ -1,4 +1,4 @@ #!/bin/sh -env PERFORMOUS_DATA_DIR='@CMAKE_INSTALL_PREFIX@/@SHARE_INSTALL@' PLUGIN_PATH='@PERFORMOUS_PLUGIN_PATH@' '@PERFORMOUS_EXECUTABLE@' "$@" +env LD_LIBRARY_PATH='@CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@:$LD_LIBRARY_PATH' PERFORMOUS_DATA_DIR='@CMAKE_INSTALL_PREFIX@/@SHARE_INSTALL@' PLUGIN_PATH='@PERFORMOUS_PLUGIN_PATH@' '@PERFORMOUS_EXECUTABLE@' "$@" |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-10-10 10:05:46
|
Module: performous
Branch: master
Commit: 01db62c64e4db0401a4c92446bd3bdbb842bd9d0
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Oct 10 13:05:07 2009 +0300
Move local lib include path definitions to root level CMakeLists.txt.
---
CMakeLists.txt | 4 ++++
editor/CMakeLists.txt | 2 --
game/CMakeLists.txt | 2 --
libs/libda/CMakeLists.txt | 1 -
tools/CMakeLists.txt | 2 --
5 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ff8338..dac5015 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,10 @@ endif(WIN32)
mark_as_advanced(SHARE_INSTALL)
+# Need to find the headers even if they haven't been installed yet:
+include_directories(libs/plugin++/include)
+include_directories(libs/libda/include)
+
add_subdirectory(libs)
add_subdirectory(themes)
add_subdirectory(data)
diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt
index 65e7065..c6ecbe8 100644
--- a/editor/CMakeLists.txt
+++ b/editor/CMakeLists.txt
@@ -7,8 +7,6 @@ set(SOURCES ${SOURCE_FILES} ${HEADER_FILES})
# Libraries
-include_directories(${CMAKE_SOURCE_DIR}/libs/libda/include)
-
find_package(Boost 1.34 REQUIRED COMPONENTS thread)
include_directories(${Boost_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Boost_LIBRARIES})
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index 035021d..e4e484a 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -7,8 +7,6 @@ set(SOURCES ${SOURCE_FILES} ${HEADER_FILES})
# Libraries
-include_directories(${CMAKE_SOURCE_DIR}/libs/libda/include)
-
find_package(Boost 1.34 REQUIRED COMPONENTS thread date_time program_options regex filesystem)
include_directories(${Boost_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Boost_LIBRARIES})
diff --git a/libs/libda/CMakeLists.txt b/libs/libda/CMakeLists.txt
index 350aaa6..1770cc5 100644
--- a/libs/libda/CMakeLists.txt
+++ b/libs/libda/CMakeLists.txt
@@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 2.6)
set(LIBDA_PLUGIN_DIR "lib${LIB_SUFFIX}/libda")
include_directories(include)
-include_directories(../plugin++/include)
FILE(GLOB HEADER_FILES "include/libda/*")
install(FILES ${HEADER_FILES} DESTINATION include/libda)
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 9a26670..5798c96 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6)
# Libraries
-include_directories(${CMAKE_SOURCE_DIR}/libda)
-
find_package(Boost 1.34 REQUIRED COMPONENTS filesystem program_options)
include_directories(${Boost_INCLUDE_DIRS})
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-10-10 08:44:16
|
Module: performous
Branch: master
Commit: dd85fff3cb17562468ec3711e3e54d5a9b078c4b
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Oct 10 11:42:00 2009 +0300
Made libda and libplugin++ shared libraries to make them easier to use.
Be sure to remove all installed libplugin++.a and libda.a files.
Fixed libda capture example and wrote stand-alone CMakeLists.txt for it.
Linkage visibility fixes (I believe this could actually work on Windows now).
---
libs/libda/examples/CMakeLists.txt | 7 ++++
libs/libda/examples/capture.cpp | 45 ++++++++++++++++-------------
libs/libda/include/libda/audio.hpp | 7 ++--
libs/libda/src/CMakeLists.txt | 2 +-
libs/plugin++/CMakeLists.txt | 5 ++-
libs/plugin++/include/plugin++/dll.hpp | 5 ++-
libs/plugin++/include/plugin++/loader.hpp | 2 +-
libs/plugin++/src/dll-posix.cpp | 2 +
libs/plugin++/src/dll-windows.cpp | 2 +
9 files changed, 48 insertions(+), 29 deletions(-)
diff --git a/libs/libda/examples/CMakeLists.txt b/libs/libda/examples/CMakeLists.txt
new file mode 100644
index 0000000..fe6d273
--- /dev/null
+++ b/libs/libda/examples/CMakeLists.txt
@@ -0,0 +1,7 @@
+project("Libda examples" CXX)
+cmake_minimum_required(VERSION 2.4)
+
+add_executable(da_capture capture.cpp)
+target_link_libraries(da_capture da)
+install(TARGETS da_capture DESTINATION bin)
+
diff --git a/libs/libda/examples/capture.cpp b/libs/libda/examples/capture.cpp
index 4643240..4848061 100644
--- a/libs/libda/examples/capture.cpp
+++ b/libs/libda/examples/capture.cpp
@@ -1,3 +1,4 @@
+#include <boost/format.hpp>
#include <libda/audio.hpp>
#include <fstream>
#include <iomanip>
@@ -19,48 +20,52 @@ class FileOut {
<< channels << " -r" << rate << " " << filename << std::endl;
}
/** Callback function **/
- void operator()(audio::pcm_data& data, audio::settings const& s) {
+ bool operator()(da::pcm_data& data) {
channels = data.channels;
- rate = s.rate;
+ rate = data.rate;
// std::cout << data.frames << " frames received" << std::endl;
for (std::size_t fr = 0; fr < data.frames; ++fr) {
for (std::size_t ch = 0; ch < data.channels; ++ch) {
- audio::sample_t s = data(fr, ch);
+ da::sample_t s = data(fr, ch);
file.write(reinterpret_cast<char*>(&s), sizeof(s));
}
}
frames += data.frames;
+ return true;
}
};
int main(int argc, char** argv) {
// Print the list of devices
{
- std::vector<std::string> dev = audio::record::devices();
- std::cout << "Available audio devices: ";
- std::copy(dev.begin(), dev.end(), std::ostream_iterator<std::string>(std::cout, " "));
- std::cout << std::endl;
+ std::vector<da::devinfo> l = da::record::devices();
+ std::cout << "Capture devices available:" << std::endl;
+ for (da::record::devlist_t::const_iterator it = l.begin(); it != l.end(); ++it) {
+ std::cout << boost::format(" %1% %|10t|%2%\n") % it->name() % it->desc();
+ }
}
// Create output file
FileOut fileout("testout.raw");
// Construct settings
- audio::settings rs(argc > 1 ? argv[1] : "");
- rs.callback = boost::ref(fileout);
- rs.channels = 2;
- rs.rate = 48000;
- rs.frames = 1024;
- rs.debug = &std::cerr;
- {
+ da::settings rs(argc > 1 ? argv[1] : "");
+ rs.set_callback(boost::ref(fileout))
+ .set_channels(2)
+ .set_rate(48000)
+ .set_frames(1024)
+ .set_debug(std::cerr);
+ da::initialize dainit; // Load da plugins
+ try {
// Start recording (may modify settings)
- audio::record r(rs);
- std::cout << "# Device: " << rs.device << ":" << rs.subdev << std::endl;
- std::cout << "# Sampling rate: " << rs.rate << std::endl;
- std::cout << "# Channels: " << rs.channels << std::endl;
- std::cout << "# Frames per block: " << rs.frames << std::endl;
+ da::record r(rs);
+ std::cout << "# Device: " << rs.device() << ":" << rs.subdev() << std::endl;
+ std::cout << "# Sampling rate: " << rs.rate() << std::endl;
+ std::cout << "# Channels: " << rs.channels() << std::endl;
+ std::cout << "# Frames per block: " << rs.frames() << std::endl;
std::cout << "PRESS ENTER TO STOP" << std::endl;
std::cin.get();
// Stop recording (r goes out of scope)
+ } catch (std::exception& e) {
+ std::cout << "Unable to record: " << e.what() << std::endl;
}
- std::cout << "EXITING" << std::endl;
}
diff --git a/libs/libda/include/libda/audio.hpp b/libs/libda/include/libda/audio.hpp
index 2fa7187..9c2a0cf 100644
--- a/libs/libda/include/libda/audio.hpp
+++ b/libs/libda/include/libda/audio.hpp
@@ -15,6 +15,7 @@ Link with libda when you use this.
#include "sample.hpp"
#include <boost/function.hpp>
#include <boost/scoped_ptr.hpp>
+#include <plugin++/dllhelper.hpp>
#include <cmath>
#include <cstddef>
#include <iosfwd>
@@ -31,7 +32,7 @@ namespace da {
* so that you can create multiple da::initialize objects.
* Do not, however, destroy the object while audio devices are still in use!
**/
- class initialize {
+ class DLL_PUBLIC initialize {
init_impl* m_impl;
public:
initialize();
@@ -143,7 +144,7 @@ namespace da {
bool special() const { return !m_name.empty() && m_name[0] == '~'; }
};
- class record {
+ class DLL_PUBLIC record {
public:
typedef std::vector<devinfo> devlist_t;
static devlist_t devices();
@@ -154,7 +155,7 @@ namespace da {
dev* m_handle;
};
- class playback {
+ class DLL_PUBLIC playback {
public:
typedef std::vector<devinfo> devlist_t;
static devlist_t devices();
diff --git a/libs/libda/src/CMakeLists.txt b/libs/libda/src/CMakeLists.txt
index fc6ea31..549dcb6 100644
--- a/libs/libda/src/CMakeLists.txt
+++ b/libs/libda/src/CMakeLists.txt
@@ -10,6 +10,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif(CMAKE_COMPILER_IS_GNUCXX)
include_directories(${Boost_INCLUDE_DIRS})
-add_library(da audio.cpp)
+add_library(da SHARED audio.cpp)
target_link_libraries(da plugin++ ${Boost_LIBRARIES})
install(TARGETS da DESTINATION lib${LIB_SUFFIX})
diff --git a/libs/plugin++/CMakeLists.txt b/libs/plugin++/CMakeLists.txt
index f2837f2..f460392 100644
--- a/libs/plugin++/CMakeLists.txt
+++ b/libs/plugin++/CMakeLists.txt
@@ -9,9 +9,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif(CMAKE_COMPILER_IS_GNUCXX)
if (WIN32)
- add_library(plugin++ STATIC src/dll-windows.cpp)
+ add_library(plugin++ SHARED src/dll-windows.cpp)
else (WIN32)
- add_library(plugin++ STATIC src/dll-posix.cpp)
+ add_library(plugin++ SHARED src/dll-posix.cpp)
+ target_link_libraries(plugin++ dl)
endif (WIN32)
install(TARGETS plugin++ DESTINATION lib${LIB_SUFFIX})
diff --git a/libs/plugin++/include/plugin++/dll.hpp b/libs/plugin++/include/plugin++/dll.hpp
index 19100f5..ed4a7b6 100644
--- a/libs/plugin++/include/plugin++/dll.hpp
+++ b/libs/plugin++/include/plugin++/dll.hpp
@@ -1,11 +1,12 @@
#ifndef DLL_HPP_INCLUDED
#define DLL_HPP_INCLUDED
+#include "dllhelper.hpp"
#include <string>
namespace plugin {
- /** @short RAII wrapper to load and unload dynamic library **/
- class dll {
+ /** @short RAII wrapper to load and unload dynamic library **/
+ class DLL_PUBLIC dll {
void* lib;
public:
dll(std::string const& filename);
diff --git a/libs/plugin++/include/plugin++/loader.hpp b/libs/plugin++/include/plugin++/loader.hpp
index 5ad0e69..373688a 100644
--- a/libs/plugin++/include/plugin++/loader.hpp
+++ b/libs/plugin++/include/plugin++/loader.hpp
@@ -13,7 +13,7 @@
namespace plugin {
namespace fs = boost::filesystem;
- /** @short A helper for loading all matching libraries in a folder. **/
+ /** @short A helper for loading all matching libraries in a folder. **/
class loader {
boost::ptr_vector<dll> dlls;
void parse(std::set<fs::path>& paths, char const* var, fs::path const& folder = fs::path()) {
diff --git a/libs/plugin++/src/dll-posix.cpp b/libs/plugin++/src/dll-posix.cpp
index 1f71043..41d88e4 100644
--- a/libs/plugin++/src/dll-posix.cpp
+++ b/libs/plugin++/src/dll-posix.cpp
@@ -1,4 +1,6 @@
+#define BUILDING_DLL
#include <plugin++/dll.hpp>
+#undef BUILDING_DLL
#include <dlfcn.h>
#include <stdexcept>
diff --git a/libs/plugin++/src/dll-windows.cpp b/libs/plugin++/src/dll-windows.cpp
index ecbe37b..a514ff7 100644
--- a/libs/plugin++/src/dll-windows.cpp
+++ b/libs/plugin++/src/dll-windows.cpp
@@ -1,4 +1,6 @@
+#define BUILDING_DLL
#include <plugin++/dll.hpp>
+#undef BUILDING_DLL
#include <windows.h>
#include <stdexcept>
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-10-10 05:05:38
|
Module: performous Branch: master Commit: 87029ea410e1de451d3e5382f1f321b8ca1b22bc Author: Lasse Karkkainen <tro...@tr...> Date: Sat Oct 10 08:03:26 2009 +0300 This might actually fix it on Windows, needs testing. --- libs/libda/src/audio.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/libs/libda/src/audio.cpp b/libs/libda/src/audio.cpp index 4f29b39..3bd843a 100644 --- a/libs/libda/src/audio.cpp +++ b/libs/libda/src/audio.cpp @@ -1,5 +1,7 @@ +#define BUILDING_DLL // So that we get dllexports everywhere instead of dllimports (this is some Windows crap) #include <libda/audio_dev.hpp> -#include <plugin++/dllhelper.hpp> +#undef BUILDING_DLL + #include <plugin++/loader.hpp> #include <ostream> #include <limits> |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-10-10 05:05:37
|
Module: performous Branch: master Commit: f0bf064e0809e95704d8d8825eb0522f972bf9c1 Author: Lasse Karkkainen <tro...@tr...> Date: Sat Oct 10 08:05:21 2009 +0300 Merge branch 'master' of ssh://tronic@git.performous.org/gitroot/performous/performous --- |
|
From: Yoda-JM <yo...@us...> - 2009-10-09 09:40:13
|
Module: performous
Branch: master
Commit: 20144c78f4469978a537738519d1c4bf47b83d3c
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Oct 9 11:39:54 2009 +0200
Patched for yet another ffmpeg API change
---
editor/ffmpeg.cc | 8 ++++++++
game/ffmpeg.cc | 8 ++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/editor/ffmpeg.cc b/editor/ffmpeg.cc
index 1c167f4..1f0d80b 100644
--- a/editor/ffmpeg.cc
+++ b/editor/ffmpeg.cc
@@ -231,7 +231,11 @@ void FFmpeg::decodeNextFrame() {
while (packetSize) {
if (packetSize < 0) throw std::logic_error("negative video packet size?!");
if (m_quit || m_seekTarget == m_seekTarget) return;
+#if LIBAVCODEC_VERSION_INT > ((52<<16)+(25<<8)+0)
+ int decodeSize = avcodec_decode_video2(pVideoCodecCtx, videoFrame, &frameFinished, &packet);
+#else
int decodeSize = avcodec_decode_video(pVideoCodecCtx, videoFrame, &frameFinished, packetData, packetSize);
+#endif
if (decodeSize < 0) throw std::runtime_error("cannot decode video frame");
// Move forward within the packet
packetSize -= decodeSize;
@@ -259,7 +263,11 @@ void FFmpeg::decodeNextFrame() {
if (m_quit || m_seekTarget == m_seekTarget) return;
AudioBuffer audioFrames(AVCODEC_MAX_AUDIO_FRAME_SIZE);
int outsize = AVCODEC_MAX_AUDIO_FRAME_SIZE*sizeof(int16_t);
+#if LIBAVCODEC_VERSION_INT > ((52<<16)+(25<<8)+0)
+ int decodeSize = avcodec_decode_audio3(pAudioCodecCtx, audioFrames, &outsize, &packet);
+#else
int decodeSize = avcodec_decode_audio2(pAudioCodecCtx, audioFrames, &outsize, packetData, packetSize);
+#endif
// Handle special cases
if (decodeSize == 0) break;
if (outsize == 0) continue;
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 1c167f4..1f0d80b 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -231,7 +231,11 @@ void FFmpeg::decodeNextFrame() {
while (packetSize) {
if (packetSize < 0) throw std::logic_error("negative video packet size?!");
if (m_quit || m_seekTarget == m_seekTarget) return;
+#if LIBAVCODEC_VERSION_INT > ((52<<16)+(25<<8)+0)
+ int decodeSize = avcodec_decode_video2(pVideoCodecCtx, videoFrame, &frameFinished, &packet);
+#else
int decodeSize = avcodec_decode_video(pVideoCodecCtx, videoFrame, &frameFinished, packetData, packetSize);
+#endif
if (decodeSize < 0) throw std::runtime_error("cannot decode video frame");
// Move forward within the packet
packetSize -= decodeSize;
@@ -259,7 +263,11 @@ void FFmpeg::decodeNextFrame() {
if (m_quit || m_seekTarget == m_seekTarget) return;
AudioBuffer audioFrames(AVCODEC_MAX_AUDIO_FRAME_SIZE);
int outsize = AVCODEC_MAX_AUDIO_FRAME_SIZE*sizeof(int16_t);
+#if LIBAVCODEC_VERSION_INT > ((52<<16)+(25<<8)+0)
+ int decodeSize = avcodec_decode_audio3(pAudioCodecCtx, audioFrames, &outsize, &packet);
+#else
int decodeSize = avcodec_decode_audio2(pAudioCodecCtx, audioFrames, &outsize, packetData, packetSize);
+#endif
// Handle special cases
if (decodeSize == 0) break;
if (outsize == 0) continue;
|