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...> - 2011-03-12 18:20:15
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Mar 12 19:19:50 2011 +0100
Fix dancegraph transformations (gl2cleanup)
---
game/dancegraph.cc | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 7625a2e..3352d94 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -413,14 +413,10 @@ void DanceGraph::draw(double time) {
double offsetX = 0.5 * (dimensions.x1() + dimensions.x2());
{
- double frac = 0.75; // Adjustable: 1.0 means fully separated, 0.0 means fully attached
+ using namespace glmath;
// Some matrix magic to get the viewport right
- glutil::PushMatrixMode pmm(GL_PROJECTION);
- glTranslatef(frac * offsetX, 0.0f, 0.0f);
- glutil::PushMatrixMode pmb(GL_MODELVIEW);
- glTranslatef((1.0 - frac) * offsetX, dimensions.y1(), 0.0f);
float temp_s = dimensions.w() / 8.0f; // Allow for 8 pads to fit on a track
- glScalef(temp_s, temp_s, temp_s);
+ Transform trans(translate(vec3(offsetX, dimensions.y1(), 0.0)) * scale(temp_s));
// Draw the "neck" graph (beat lines)
drawBeats(time);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-12 18:20:09
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Mar 12 17:30:18 2011 +0100
Remove useless include
---
game/glmath.hh | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/game/glmath.hh b/game/glmath.hh
index 96bc1c3..2f1da54 100644
--- a/game/glmath.hh
+++ b/game/glmath.hh
@@ -5,7 +5,6 @@
#include <cmath>
#include <iomanip>
#include <iostream>
-#include <stdexcept>
#include <sstream>
namespace glmath {
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-07 01:13:28
|
Author: Lasse Karkkainen <tro...@tr...> Date: Mon Mar 7 02:11:01 2011 +0100 Transforms via a new helper class and video_driver, cover browser updated to use that. Uniforms separated from Shader class (new helper class) and code updated to use that. colorMatrix broken (old hack removed). --- game/dancegraph.cc | 22 ++++++++++-------- game/glshader.cc | 9 ++++--- game/glshader.hh | 50 +++++++++++++---------------------------- game/screen_songs.cc | 17 ++++++------- game/video_driver.cc | 59 ++++++++++++++++++++++++++++++------------------- game/video_driver.hh | 10 +++++++- 6 files changed, 86 insertions(+), 81 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-07 01:13:21
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Mar 7 00:03:41 2011 +0100
Normals need to be normalized in both vertex and fragment shaders for proper weighting and interpolation.
---
data/shaders/core.vert | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/data/shaders/core.vert b/data/shaders/core.vert
index d3b5f4f..ee16a3d 100644
--- a/data/shaders/core.vert
+++ b/data/shaders/core.vert
@@ -20,7 +20,7 @@ varying vec4 vColor;
void main() {
gl_Position = positionMatrix * vertPos;
vTexCoord = texCoord = vertTexCoord;
- vNormal = normal = normalMatrix * vertNormal;
+ vNormal = normal = normalize(normalMatrix * vertNormal);
vColor = color = vertColor;
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-06 22:48:25
|
Author: Lasse Karkkainen <tro...@tr...> Date: Sun Mar 6 23:15:10 2011 +0100 Re-enable bogus (the old problem remains) and improve the shader defines system. --- data/shaders/core.frag | 8 ++++++++ data/shaders/stereo3d.geom | 2 ++ game/glshader.hh | 2 +- game/video_driver.cc | 19 ++++++++++++++----- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/data/shaders/core.frag b/data/shaders/core.frag index 78a3c87..f7c7e28 100644 --- a/data/shaders/core.frag +++ b/data/shaders/core.frag @@ -5,6 +5,10 @@ uniform mat4 colorMatrix; +#ifdef ENABLE_BOGUS +in float bogus; // Workaround for http://www.nvnews.net/vbulletin/showthread.php?p=2401097 +#endif + in vec3 normal; in vec4 color; @@ -28,6 +32,10 @@ uniform sampler2D tex; void main() { vec4 frag = TEXFUNC; +#ifdef ENABLE_BOGUS + frag.a += 1e-14 * bogus; // Convince the compiler not to optimize away the bogus variable +#endif + #ifdef ENABLE_VERTEX_COLOR frag *= color; #endif diff --git a/data/shaders/stereo3d.geom b/data/shaders/stereo3d.geom index 4fa2f7a..c6522c1 100644 --- a/data/shaders/stereo3d.geom +++ b/data/shaders/stereo3d.geom @@ -11,6 +11,7 @@ in vec4 vTexCoord[]; in vec3 vNormal[]; in vec4 vColor[]; +out float bogus; // Workaround for http://www.nvnews.net/vbulletin/showthread.php?p=2401097 out vec4 texCoord; out vec3 normal; out vec4 color; @@ -28,6 +29,7 @@ void passthru() { #define PROCESS(code) i = 0; do { passthru(); code; EmitVertex(); } while (++i < gl_in.length()); EndPrimitive(); void main() { + bogus = 0.0; if (sepFactor == 0.0) { gl_ViewportIndex = 0; PROCESS(); // No stereo } else { diff --git a/game/glshader.hh b/game/glshader.hh index 4a08121..22f12ff 100644 --- a/game/glshader.hh +++ b/game/glshader.hh @@ -16,7 +16,7 @@ struct Shader: public boost::noncopyable { Shader(std::string const& name); ~Shader(); /// Set a string that will replace "//DEFINES" in anything loaded by compileFile - Shader& setDefines(std::string const& defines) { defs = defines; return *this; } + Shader& addDefines(std::string const& defines) { defs += defines; return *this; } /// Load shader from file Shader& compileFile(std::string const& filename); /** Compiles a shader of a given type. */ diff --git a/game/video_driver.cc b/game/video_driver.cc index 01c712d..47b9116 100644 --- a/game/video_driver.cc +++ b/game/video_driver.cc @@ -81,38 +81,47 @@ Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(widt shader("texture").compileFile(getThemePath("shaders/stereo3d.geom")); shader("3dobject").compileFile(getThemePath("shaders/stereo3d.geom")); shader("dancenote").compileFile(getThemePath("shaders/stereo3d.geom")); + if (!GLEW_VERSION_4_1) { + // Enable bugfix for some older Nvidia cards + for (ShaderMap::iterator it = m_shaders.begin(); it != m_shaders.end(); ++it) { + Shader& sh = *it->second; + sh.addDefines("#define ENABLE_BOGUS\n"); + } + } } shader("color") - .setDefines("#define ENABLE_VERTEX_COLOR\n") + .addDefines("#define ENABLE_VERTEX_COLOR\n") .compileFile(getThemePath("shaders/core.vert")) .compileFile(getThemePath("shaders/core.frag")) .link() .bind() .setUniformMat4("colorMatrix", glmath::mat4::identity()); shader("surface") - .setDefines("#define ENABLE_TEXTURING 1\n") + .addDefines("#define ENABLE_TEXTURING 1\n") .compileFile(getThemePath("shaders/core.vert")) .compileFile(getThemePath("shaders/core.frag")) .link() .bind() .setUniformMat4("colorMatrix", glmath::mat4::identity()); shader("texture") - .setDefines("#define ENABLE_TEXTURING 2\n#define ENABLE_VERTEX_COLOR\n") + .addDefines("#define ENABLE_TEXTURING 2\n") + .addDefines("#define ENABLE_VERTEX_COLOR\n") .compileFile(getThemePath("shaders/core.vert")) .compileFile(getThemePath("shaders/core.frag")) .link() .bind() .setUniformMat4("colorMatrix", glmath::mat4::identity()); shader("3dobject") - .setDefines("#define ENABLE_LIGHTING\n") + .addDefines("#define ENABLE_LIGHTING\n") .compileFile(getThemePath("shaders/core.vert")) .compileFile(getThemePath("shaders/core.frag")) .link() .bind() .setUniformMat4("colorMatrix", glmath::mat4::identity()); shader("dancenote") - .setDefines("#define ENABLE_TEXTURING 2\n#define ENABLE_VERTEX_COLOR\n") + .addDefines("#define ENABLE_TEXTURING 2\n") + .addDefines("#define ENABLE_VERTEX_COLOR\n") .compileFile(getThemePath("shaders/dancenote.vert")) .compileFile(getThemePath("shaders/core.frag")) .link() |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-06 10:46:10
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Mar 6 11:41:58 2011 +0100
Ignore UTF-8 BOMs (will issue a warning).
---
game/unicode.cc | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/game/unicode.cc b/game/unicode.cc
index b0c4016..95053b0 100644
--- a/game/unicode.cc
+++ b/game/unicode.cc
@@ -26,7 +26,12 @@ namespace {
void convertToUTF8(std::stringstream &_stream, std::string _filename) {
try {
- convert(_stream.str(), "UTF-8", "UTF-8"); // Test if input is UTF-8
+ std::string data = _stream.str();
+ convert(data, "UTF-8", "UTF-8"); // Test if input is UTF-8
+ if (data.substr(0, 3) == "\xEF\xBB\xBF") {
+ std::clog << "unicode/warning: " << _filename << " UTF-8 BOM ignored. Please avoid editors that use BOMs (e.g. Notepad)." << std::endl;
+ _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;
try {
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-06 10:42:13
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Mar 6 11:41:58 2011 +0100
Ignore UTF-8 BOMs (will issue a warning).
---
game/unicode.cc | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/game/unicode.cc b/game/unicode.cc
index b0c4016..95053b0 100644
--- a/game/unicode.cc
+++ b/game/unicode.cc
@@ -26,7 +26,12 @@ namespace {
void convertToUTF8(std::stringstream &_stream, std::string _filename) {
try {
- convert(_stream.str(), "UTF-8", "UTF-8"); // Test if input is UTF-8
+ std::string data = _stream.str();
+ convert(data, "UTF-8", "UTF-8"); // Test if input is UTF-8
+ if (data.substr(0, 3) == "\xEF\xBB\xBF") {
+ std::clog << "unicode/warning: " << _filename << " UTF-8 BOM ignored. Please avoid editors that use BOMs (e.g. Notepad)." << std::endl;
+ _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;
try {
|
|
From: Tapio V. <aa...@us...> - 2011-03-02 10:02:45
|
Author: Tapio Vierros <tap...@gm...>
Date: Wed Mar 2 12:01:50 2011 +0200
Allow opening .mid file directly instead of .ini
---
songparser-ini.cc | 5 +++++
songparser.cc | 4 +++-
songparser.hh | 2 ++
3 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/songparser-ini.cc b/songparser-ini.cc
index 371241a..46ed24e 100644
--- a/songparser-ini.cc
+++ b/songparser-ini.cc
@@ -14,6 +14,11 @@ bool SongParser::iniCheck(QString const& data) {
return data.startsWith("[song]");
}
+/// 'Magick' to check if this file looks like correct format
+bool SongParser::midiCheck(QString const& data) {
+ return data.startsWith("MThd");
+}
+
/// Parser
void SongParser::iniParse() {
// Some defaults
diff --git a/songparser.cc b/songparser.cc
index a01e013..a5f1029 100644
--- a/songparser.cc
+++ b/songparser.cc
@@ -28,7 +28,7 @@ SongParser::SongParser(Song& s):
m_tsPerBeat(),
m_tsEnd()
{
- enum { NONE, TXT, XML, INI, SM } type = NONE;
+ enum { NONE, TXT, XML, INI, MIDI, SM } type = NONE;
// Read the file, determine the type and do some initial validation checks
QFile file(m_song.path + m_song.filename);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
@@ -45,6 +45,7 @@ SongParser::SongParser(Song& s):
else if (txtCheck(data)) type = TXT;
else if (xmlCheck(data)) type = XML;
else if (iniCheck(data)) type = INI;
+ else if (midiCheck(data)) type = MIDI;
else throw SongParserException("Does not look like a song file (wrong header)", 1, true);
m_stream.setString(&data);
@@ -54,6 +55,7 @@ SongParser::SongParser(Song& s):
if (type == TXT) txtParse();
else if (type == XML) xmlParse();
else if (type == INI) iniParse();
+ else if (type == MIDI) midParse();
else if (type == SM) smParse();
} catch (std::runtime_error& e) {
throw SongParserException(e.what(), m_linenum);
diff --git a/songparser.hh b/songparser.hh
index 2aa7cc0..b3a3502 100644
--- a/songparser.hh
+++ b/songparser.hh
@@ -38,7 +38,9 @@ class SongParser {
static bool xmlCheck(QString const& data);
void xmlParse();
+ // Frets on Fire MIDI
static bool iniCheck(QString const& data);
+ static bool midiCheck(QString const& data);
void iniParse();
void iniParseField(QString const& line);
void midParse();
|
|
From: Tapio V. <aa...@us...> - 2011-03-02 10:02:39
|
Author: Tapio Vierros <tap...@gm...>
Date: Wed Mar 2 11:54:05 2011 +0200
Guess pitch also for note being timed.
---
notegraphwidget.cc | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index eecfcb9..919c9e4 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -334,9 +334,11 @@ void NoteGraphWidget::timeCurrent()
{
if (selectedNote()) {
Operation op("MOVE");
- op << getNoteLabelId(selectedNote())
- << px2s(m_seekHandle.curx()) << px2s(m_seekHandle.curx() + selectedNote()->width())
- << selectedNote()->note().note;
+ double begin = px2s(m_seekHandle.curx());
+ double end = px2s(m_seekHandle.curx() + selectedNote()->width());
+ int n = selectedNote()->note().note;
+ if (m_pitch) n = m_pitch->guessNote(begin, end, n);
+ op << getNoteLabelId(selectedNote()) << begin << end << n;
doOperation(op);
}
}
|
|
From: Tapio V. <aa...@us...> - 2011-03-01 22:02:18
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Mar 1 23:54:51 2011 +0200
Add quite a few missing const-qualifiers.
---
game/database.hh | 2 +-
game/ffmpeg.cc | 2 +-
game/ffmpeg.hh | 2 +-
game/joystick.hh | 14 +++++++-------
game/layout_singer.cc | 2 +-
game/layout_singer.hh | 2 +-
game/midifile.cc | 2 +-
game/opengl_text.hh | 8 ++++----
game/songparser-ini.cc | 2 +-
game/songparser-sm.cc | 2 +-
game/songparser-txt.cc | 2 +-
game/songparser.hh | 6 +++---
game/video_driver.cc | 2 +-
game/video_driver.hh | 2 +-
game/webcam.hh | 2 +-
15 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/game/database.hh b/game/database.hh
index 44f30fa..819f7ff 100644
--- a/game/database.hh
+++ b/game/database.hh
@@ -15,7 +15,7 @@ struct ScoreItem {
std::string track; // includes difficulty
std::string track_simple; // no difficulty
Color color;
- bool operator < (ScoreItem const& other) { return score < other.score; }
+ bool operator < (ScoreItem const& other) const { return score < other.score; }
};
/**Access to a database for performous which holds
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 7e1d129..1be7d7f 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -18,7 +18,7 @@ extern "C" {
/*static*/ boost::mutex FFmpeg::s_avcodec_mutex;
FFmpeg::FFmpeg(bool _decodeVideo, bool _decodeAudio, std::string const& _filename, unsigned int rate):
- m_filename(_filename), m_rate(rate), m_quit(), m_running(), m_eof(), m_seekTarget(getNaN()),
+ width(), height(), m_filename(_filename), m_rate(rate), m_quit(), m_running(), m_eof(), m_seekTarget(getNaN()),
pFormatCtx(), pResampleCtx(), img_convert_ctx(), pVideoCodecCtx(), pAudioCodecCtx(), pVideoCodec(), pAudioCodec(),
videoStream(-1), audioStream(-1), decodeVideo(_decodeVideo), decodeAudio(_decodeAudio), m_position(),
m_thread(new boost::thread(boost::ref(*this)))
diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh
index a3b4388..8006df8 100644
--- a/game/ffmpeg.hh
+++ b/game/ffmpeg.hh
@@ -125,7 +125,7 @@ class AudioBuffer {
/// set samples per second
void setSamplesPerSecond(unsigned sps) { m_sps = sps; }
/// get samples per second
- unsigned getSamplesPerSecond() { return m_sps; }
+ unsigned getSamplesPerSecond() const { return m_sps; }
void push(std::vector<int16_t> const& data, double timestamp) {
boost::mutex::scoped_lock l(m_mutex);
while (!condition()) m_cond.wait(l);
diff --git a/game/joystick.hh b/game/joystick.hh
index 83623ee..44f82b8 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -113,13 +113,13 @@ namespace input {
m_pressed[i] = _event.pressed[i];
}
};
- void clearEvents() {m_events.clear();};
- void assign() {m_assigned = true;};
- void unassign() {m_assigned = false; clearEvents();};
- bool assigned() {return m_assigned;};
- bool pressed(int _button) {return m_pressed[_button];};
- std::string name() {return m_instrument.name;};
- bool type_match(DevType _type) {
+ void clearEvents() { m_events.clear(); }
+ void assign() { m_assigned = true; }
+ void unassign() { m_assigned = false; clearEvents(); }
+ bool assigned() const { return m_assigned; }
+ bool pressed(int _button) const { return m_pressed[_button]; }
+ std::string name() const { return m_instrument.name; }
+ bool type_match(DevType _type) const {
return _type == m_instrument.type;
};
int buttonFromSDL(unsigned int sdl_button) {
diff --git a/game/layout_singer.cc b/game/layout_singer.cc
index 062f52c..70498c3 100644
--- a/game/layout_singer.cc
+++ b/game/layout_singer.cc
@@ -151,6 +151,6 @@ void LayoutSinger::draw(double time, Position position) {
if (!config["game/karaoke_mode"].b() ) drawScore(position); // draw score if not in karaoke mode
}
-double LayoutSinger::lyrics_begin() {
+double LayoutSinger::lyrics_begin() const {
return m_lyricit->begin;
}
diff --git a/game/layout_singer.hh b/game/layout_singer.hh
index 466ce50..cfa1b3a 100644
--- a/game/layout_singer.hh
+++ b/game/layout_singer.hh
@@ -55,7 +55,7 @@ class LayoutSinger {
void reset();
void draw(double time, Position position = LayoutSinger::BOTTOM);
void drawScore(Position position);
- double lyrics_begin();
+ double lyrics_begin() const;
void hideLyrics(bool hide = true) { m_hideLyrics = hide; };
private:
VocalTrack& m_vocal;
diff --git a/game/midifile.cc b/game/midifile.cc
index 5272165..cb1c735 100644
--- a/game/midifile.cc
+++ b/game/midifile.cc
@@ -45,7 +45,7 @@ class MidiStream {
size_t offset;
Riff(MidiStream& ms);
~Riff();
- bool has_more_data() { return offset < size; }
+ bool has_more_data() const { return offset < size; }
uint8_t read_uint8() { consume(1); return ms.f.get(); }
uint16_t read_uint16() { consume(2); return ms.read_uint16(); }
uint32_t read_uint32() { consume(4); return ms.read_uint32(); }
diff --git a/game/opengl_text.hh b/game/opengl_text.hh
index 5dc228c..29d33d2 100644
--- a/game/opengl_text.hh
+++ b/game/opengl_text.hh
@@ -49,13 +49,13 @@ class OpenGLText {
/// draws full texture
void draw();
/// @return x
- double x() {return m_x;};
+ double x() const { return m_x; }
/// @return y
- double y() {return m_y;};
+ double y() const { return m_y; }
/// @return x_advance
- double x_advance() {return m_x_advance;};
+ double x_advance() const { return m_x_advance; }
/// @return y_advance
- double y_advance() {return m_y_advance;};
+ double y_advance() const { return m_y_advance; }
/// @returns dimension of texture
Dimensions& dimensions() { return m_surface.dimensions; }
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 36e724b..38e163b 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -12,7 +12,7 @@
using namespace SongParserUtil;
/// 'Magick' to check if this file looks like correct format
-bool SongParser::iniCheck(std::vector<char> const& data) {
+bool SongParser::iniCheck(std::vector<char> const& data) const {
static const std::string header = "[song]";
return std::equal(header.begin(), header.end(), data.begin());
}
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index cb84732..a006b60 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -12,7 +12,7 @@
using namespace SongParserUtil;
/// 'Magick' to check if this file looks like correct format
-bool SongParser::smCheck(std::vector<char> const& data) {
+bool SongParser::smCheck(std::vector<char> const& data) const {
if (data[0] != '#' || data[1] < 'A' || data[1] > 'Z') return false;
for (std::vector<char>::const_iterator it = data.begin(); it != data.end(); ++it){
if (*it == '\n') return false;
diff --git a/game/songparser-txt.cc b/game/songparser-txt.cc
index 856ff9f..06221b3 100644
--- a/game/songparser-txt.cc
+++ b/game/songparser-txt.cc
@@ -11,7 +11,7 @@
using namespace SongParserUtil;
/// 'Magick' to check if this file looks like correct format
-bool SongParser::txtCheck(std::vector<char> const& data) {
+bool SongParser::txtCheck(std::vector<char> const& data) const {
return data[0] == '#' && data[1] >= 'A' && data[1] <= 'Z';
}
diff --git a/game/songparser.hh b/game/songparser.hh
index 601fbce..4232731 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -32,15 +32,15 @@ class SongParser {
double m_gap;
double m_bpm;
- bool txtCheck(std::vector<char> const& data);
+ bool txtCheck(std::vector<char> const& data) const;
void txtParseHeader();
void txtParse();
bool txtParseField(std::string const& line);
bool txtParseNote(std::string line, VocalTrack &vocal);
- bool iniCheck(std::vector<char> const& data);
+ bool iniCheck(std::vector<char> const& data) const;
void iniParseHeader();
void iniParse();
- bool smCheck(std::vector<char> const& data);
+ bool smCheck(std::vector<char> const& data) const;
void smParseHeader();
void smParse();
bool smParseField(std::string line);
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 56ad92b..7eebac7 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -122,7 +122,7 @@ void Window::setFullscreen(bool _fs) {
resize();
}
-bool Window::getFullscreen() {
+bool Window::getFullscreen() const {
return m_fullscreen;
}
diff --git a/game/video_driver.hh b/game/video_driver.hh
index 538fdb0..7e95b90 100644
--- a/game/video_driver.hh
+++ b/game/video_driver.hh
@@ -44,7 +44,7 @@ class Window {
*/
void setFullscreen(bool _fs);
/// gets fullscreen state
- bool getFullscreen();
+ bool getFullscreen() const;
/// take a screenshot
void screenshot();
diff --git a/game/webcam.hh b/game/webcam.hh
index 9566f2e..33e4358 100644
--- a/game/webcam.hh
+++ b/game/webcam.hh
@@ -30,7 +30,7 @@ class Webcam {
void operator()();
/// Is good?
- bool is_good() { return m_capture != 0 && m_running; }
+ bool is_good() const { return m_capture != 0 && m_running; }
/// When paused, does not get or render frames
void pause(bool do_pause = true);
/// Display frame
|
|
From: Tapio V. <aa...@us...> - 2011-03-01 08:56:28
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Mar 1 10:55:52 2011 +0200
Added a comment about bumping version.
---
CMakeLists.txt | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 752ad90..b4b705c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,8 @@ project("Composer" CXX C)
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
set(PROJECT_VERSION "1.0+")
+#FIXME: Changes in version number or project name must manually also be put to:
+# platform/mingw-cross-env/makeinstaller.py
set(EXENAME ${CMAKE_PROJECT_NAME})
if(UNIX)
|
|
From: Tapio V. <aa...@us...> - 2011-03-01 08:53:07
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Mar 1 10:52:41 2011 +0200
Bump version to 1.0+
---
CMakeLists.txt | 2 +-
platform/mingw-cross-env/makeinstaller.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ffcc3a..752ad90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
project("Composer" CXX C)
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
-set(PROJECT_VERSION "1.0")
+set(PROJECT_VERSION "1.0+")
set(EXENAME ${CMAKE_PROJECT_NAME})
if(UNIX)
diff --git a/platform/mingw-cross-env/makeinstaller.py b/platform/mingw-cross-env/makeinstaller.py
index 50eebd6..e146124 100755
--- a/platform/mingw-cross-env/makeinstaller.py
+++ b/platform/mingw-cross-env/makeinstaller.py
@@ -30,7 +30,7 @@ if not os.path.isdir('dist'):
os.chdir('stage')
app = 'Composer'
-version = '1.0'
+version = '1.0+'
makensis.stdin.write(r'''!include "MUI2.nsh"
|
|
From: Tapio V. <aa...@us...> - 2011-03-01 08:43:55
|
Author: Tapio Vierros <tap...@gm...> Date: Tue Mar 1 10:43:30 2011 +0200 Added MIDI export to the 1.0 composer changelog. --- htdocs-source/blog.txt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/htdocs-source/blog.txt b/htdocs-source/blog.txt index a72c1f2..1fae2d2 100644 --- a/htdocs-source/blog.txt +++ b/htdocs-source/blog.txt @@ -6,6 +6,7 @@ The 1.0 release of Composer song editor is now here. There are quite a few visib Piano keys Unified Note properties & Tools tab + FoF MIDI export Performance optimizations Synth now also on Windows More UI feedback using busy-dialogs |
|
From: Tapio V. <aa...@us...> - 2011-02-28 22:43:56
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Mar 1 00:09:49 2011 +0200
Bump version to 1.0
---
CMakeLists.txt | 2 +-
platform/mingw-cross-env/makeinstaller.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 71f5ab2..9ffcc3a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
project("Composer" CXX C)
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
-set(PROJECT_VERSION "1.0rc1+")
+set(PROJECT_VERSION "1.0")
set(EXENAME ${CMAKE_PROJECT_NAME})
if(UNIX)
diff --git a/platform/mingw-cross-env/makeinstaller.py b/platform/mingw-cross-env/makeinstaller.py
index f6cb638..50eebd6 100755
--- a/platform/mingw-cross-env/makeinstaller.py
+++ b/platform/mingw-cross-env/makeinstaller.py
@@ -30,7 +30,7 @@ if not os.path.isdir('dist'):
os.chdir('stage')
app = 'Composer'
-version = '1.0rc1+'
+version = '1.0'
makensis.stdin.write(r'''!include "MUI2.nsh"
|
|
From: Tapio V. <aa...@us...> - 2011-02-28 22:10:11
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Mar 1 00:09:49 2011 +0200
Bump version to 1.0
---
CMakeLists.txt | 2 +-
platform/mingw-cross-env/makeinstaller.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 71f5ab2..9ffcc3a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
project("Composer" CXX C)
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
-set(PROJECT_VERSION "1.0rc1+")
+set(PROJECT_VERSION "1.0")
set(EXENAME ${CMAKE_PROJECT_NAME})
if(UNIX)
diff --git a/platform/mingw-cross-env/makeinstaller.py b/platform/mingw-cross-env/makeinstaller.py
index f6cb638..50eebd6 100755
--- a/platform/mingw-cross-env/makeinstaller.py
+++ b/platform/mingw-cross-env/makeinstaller.py
@@ -30,7 +30,7 @@ if not os.path.isdir('dist'):
os.chdir('stage')
app = 'Composer'
-version = '1.0rc1+'
+version = '1.0'
makensis.stdin.write(r'''!include "MUI2.nsh"
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-02-28 21:46:22
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Feb 28 22:45:56 2011 +0100
Remove debug
---
songparser-ini.cc | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/songparser-ini.cc b/songparser-ini.cc
index 97e6455..371241a 100644
--- a/songparser-ini.cc
+++ b/songparser-ini.cc
@@ -73,7 +73,6 @@ void SongParser::midParse() {
bool newSentence = true;
std::string trackName, lyric;
for (Event ev; reader.parseEvent(ev); ) {
- ev.print();
timecode += ev.timecode;
if (ev.type == Event::NOTE_ON && ev.arg2 == 0) ev.type = Event::NOTE_OFF; // Note on with velocity 0 actually means off.
// Process any interesting events
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-02-28 21:46:15
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Feb 28 22:45:25 2011 +0100
Various songwriter fixes, NOW it works, for SURE!
---
songwriter-ini.cc | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/songwriter-ini.cc b/songwriter-ini.cc
index f8c8a16..6ae8e69 100644
--- a/songwriter-ini.cc
+++ b/songwriter-ini.cc
@@ -8,7 +8,7 @@ void FoFMIDIWriter::writeMIDI() const {
Notes const& notes = s.getVocalTrack().notes;
if (notes.empty()) throw std::runtime_error("No notes");
double tempo = s.bpm > 0 ? s.bpm : 120.0;
- unsigned division = 64; // Allow for very precise timing
+ unsigned division = 256; // Allow for very precise timing
unsigned endtc = round(tempo / 60.0 * division * notes.back().end);
midifile::Writer writer(1, 2, division);
using midifile::Event;
@@ -28,7 +28,6 @@ void FoFMIDIWriter::writeMIDI() const {
writer.writeEvent(ev);
// TODO: write Performous Composer and Title= & Artist= like FoF lyric converter does (note: it does on PART VOCALS but timing track seems more appropriate)
// End the timing track
- ev.timecode = endtc;
ev.arg1 = Event::META_ENDOFTRACK;
writer.writeEvent(ev);
// Vocals track begins
@@ -39,34 +38,40 @@ void FoFMIDIWriter::writeMIDI() const {
std::copy(partvocals.begin(), partvocals.end(), buf);
ev.end = ev.begin + partvocals.size();
writer.writeEvent(ev);
+ ev.begin = ev.end = NULL;
// Write notes
bool sentenceOn = false; // Sentence note 105 not playing
unsigned timecode = 0;
for (Notes::const_iterator it = notes.begin(), itend = notes.end(); it != itend; ++it) {
- // Lyric
- QByteArray bytes = it->syllable.toUtf8();
ev.timecode = round(tempo / 60.0 * division * it->begin) - timecode;
timecode += ev.timecode;
+ if (it->lineBreak) {
+ ev.type = Event::NOTE_ON;
+ ev.channel = 0;
+ ev.arg1 = 105; // Special note value for starting a new sentence
+ // End the previous sentence (if not at the beginning)
+ if (sentenceOn) { ev.arg2 = 0; writer.writeEvent(ev); } // Note OFF
+ sentenceOn = true;
+ // The same timecode for the rest
+ ev.timecode = 0;
+ // Begin a new one
+ ev.arg2 = 127; writer.writeEvent(ev); // Note ON
+ }
+ // Write lyric
+ QByteArray bytes = it->syllable.toUtf8();
ev.type = Event::SPECIAL;
ev.channel = 0x0F;
ev.arg1 = Event::META_LYRIC;
ev.begin = reinterpret_cast<unsigned char*>(bytes.data());
ev.end = ev.begin + bytes.size();
writer.writeEvent(ev);
+ ev.end = ev.begin = NULL;
// Prepare for writing note on/off events
ev.timecode = 0; // Same timecode as the lyric
ev.type = Event::NOTE_ON;
ev.channel = 0;
- if (it->lineBreak) {
- ev.arg1 = 105; // Special note value for starting a new sentence
- // End the previous sentence (if not at the beginning)
- if (sentenceOn) { ev.arg2 = 0; writer.writeEvent(ev); } // Note OFF
- sentenceOn = true;
- // Begin a new one
- ev.arg2 = 0; writer.writeEvent(ev); // Note OFF
- }
// Note begin
- ev.arg1 = it->note;
+ ev.arg1 = 36 + it->note; // FoF format uses offset for note values :(
ev.arg2 = 127; // Note ON
writer.writeEvent(ev);
// Note end
|
|
From: Tapio V. <aa...@us...> - 2011-02-28 21:11:56
|
Author: Tapio Vierros <tap...@gm...> Date: Mon Feb 28 23:11:15 2011 +0200 Draft editor 1.0 release announcement. --- htdocs-source/blog.txt | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/htdocs-source/blog.txt b/htdocs-source/blog.txt index 44e645b..a72c1f2 100644 --- a/htdocs-source/blog.txt +++ b/htdocs-source/blog.txt @@ -1,5 +1,20 @@ News +:h2:2011-02-28 - Song editor 1.0 released + +The 1.0 release of Composer song editor is now here. There are quite a few visible changes since rc1: + + Piano keys + Unified Note properties & Tools tab + Performance optimizations + Synth now also on Windows + More UI feedback using busy-dialogs + Small fixes and tweaks + +Unfortunately we couldn't provide a Mac bundle at this time due to a persisting bug, but the development continues. + +Downloads area once again available at <a href="http://sourceforge.net/projects/performous/files/editor/1.0/">SourceForge</a>. Composer also now has a little <a href="http://performous.org/composer">website</a> and a <a href="http://wiki.performous.org/index.php/Composer">wiki page</a>. Please provide feedback on our IRC channel. + :h2:2011-02-25 - Did someone say stereo3d? <img src="imgs/anaglyph.jpg" alt="Anaglyph screenshot"/> |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-02-28 19:55:39
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Mon Feb 28 20:53:29 2011 +0100 Fix a nasty bug in screen switching when song loading fails. --- game/screenmanager.cc | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/game/screenmanager.cc b/game/screenmanager.cc index 460b2b0..e24a4f2 100644 --- a/game/screenmanager.cc +++ b/game/screenmanager.cc @@ -27,11 +27,12 @@ void ScreenManager::activateScreen(std::string const& name) { void ScreenManager::updateScreen() { if (!newScreen) return; + Screen* s = newScreen; // A local copy in case exit() or enter() want to change screens again + newScreen = NULL; if (currentScreen) currentScreen->exit(); currentScreen = NULL; // Exception safety, do not remove - newScreen->enter(); - currentScreen = newScreen; - newScreen = NULL; + s->enter(); + currentScreen = s; } Screen* ScreenManager::getScreen(std::string const& name) { |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-02-28 19:55:32
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Mon Feb 28 20:53:29 2011 +0100 Fix a nasty bug in screen switching when song loading fails. --- game/screenmanager.cc | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/game/screenmanager.cc b/game/screenmanager.cc index 8f65292..0aa563c 100644 --- a/game/screenmanager.cc +++ b/game/screenmanager.cc @@ -26,11 +26,12 @@ void ScreenManager::activateScreen(std::string const& name) { void ScreenManager::updateScreen() { if (!newScreen) return; + Screen* s = newScreen; // A local copy in case exit() or enter() want to change screens again + newScreen = NULL; if (currentScreen) currentScreen->exit(); currentScreen = NULL; // Exception safety, do not remove - newScreen->enter(); - currentScreen = newScreen; - newScreen = NULL; + s->enter(); + currentScreen = s; } Screen* ScreenManager::getScreen(std::string const& name) { |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-02-28 19:50:41
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Mon Feb 28 20:49:46 2011 +0100 Fix lineBreak handling for MIDI export and improve compatibility with FoF lyric converter. --- songwriter-ini.cc | 49 ++++++++++++++++++++++++++++++++++--------------- 1 files changed, 34 insertions(+), 15 deletions(-) diff --git a/songwriter-ini.cc b/songwriter-ini.cc index bb2e09c..f8c8a16 100644 --- a/songwriter-ini.cc +++ b/songwriter-ini.cc @@ -18,16 +18,17 @@ void FoFMIDIWriter::writeMIDI() const { ev.channel = 0x0F; unsigned char buf[16]; ev.begin = ev.end = buf; - if (tempo != 120.0) { // MIDI defaults to 120 BPM - ev.arg1 = Event::META_TEMPO; - ev.end = ev.begin + 3; - unsigned val = 6e+7 / tempo; // Microseconds per beat - buf[0] = val >> 16; - buf[1] = val >> 8; - buf[2] = val; - writer.writeEvent(ev); - } - // TODO: write Performous Composer and title= & artist= like EoF does + // Write tempo info + ev.arg1 = Event::META_TEMPO; + ev.end = ev.begin + 3; + unsigned val = 6e+7 / tempo; // Microseconds per beat + buf[0] = val >> 16; + buf[1] = val >> 8; + buf[2] = val; + writer.writeEvent(ev); + // TODO: write Performous Composer and Title= & Artist= like FoF lyric converter does (note: it does on PART VOCALS but timing track seems more appropriate) + // End the timing track + ev.timecode = endtc; ev.arg1 = Event::META_ENDOFTRACK; writer.writeEvent(ev); // Vocals track begins @@ -39,6 +40,7 @@ void FoFMIDIWriter::writeMIDI() const { ev.end = ev.begin + partvocals.size(); writer.writeEvent(ev); // Write notes + bool sentenceOn = false; // Sentence note 105 not playing unsigned timecode = 0; for (Notes::const_iterator it = notes.begin(), itend = notes.end(); it != itend; ++it) { // Lyric @@ -51,20 +53,37 @@ void FoFMIDIWriter::writeMIDI() const { ev.begin = reinterpret_cast<unsigned char*>(bytes.data()); ev.end = ev.begin + bytes.size(); writer.writeEvent(ev); - // Note begin - ev.channel = 0; + // Prepare for writing note on/off events ev.timecode = 0; // Same timecode as the lyric ev.type = Event::NOTE_ON; + ev.channel = 0; + if (it->lineBreak) { + ev.arg1 = 105; // Special note value for starting a new sentence + // End the previous sentence (if not at the beginning) + if (sentenceOn) { ev.arg2 = 0; writer.writeEvent(ev); } // Note OFF + sentenceOn = true; + // Begin a new one + ev.arg2 = 0; writer.writeEvent(ev); // Note OFF + } + // Note begin ev.arg1 = it->note; - ev.arg2 = 64; + ev.arg2 = 127; // Note ON writer.writeEvent(ev); // Note end ev.timecode = round(tempo / 60.0 * division * it->end) - timecode; timecode += ev.timecode; - ev.type = Event::NOTE_OFF; - ev.arg2 = 0; + ev.arg2 = 0; // Note OFF writer.writeEvent(ev); } + ev.timecode = 0; + // Terminate the sentence note + if (sentenceOn) { + ev.type = Event::NOTE_ON; + ev.channel = 0; + ev.arg1 = 105; + ev.arg2 = 0; writer.writeEvent(ev); // Note OFF + } + // Terminate the vocal track ev.type = Event::SPECIAL; ev.channel = 0x0F; ev.arg1 = Event::META_ENDOFTRACK; |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-02-28 19:50:35
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Mon Feb 28 20:47:30 2011 +0100 Proper handling of sentence breaks for midparse. Allow either lineBreak or sleep notes to be used by all parsers. --- songparser-ini.cc | 4 ++++ songparser.cc | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/songparser-ini.cc b/songparser-ini.cc index 81d8fe8..97e6455 100644 --- a/songparser-ini.cc +++ b/songparser-ini.cc @@ -70,18 +70,22 @@ void SongParser::midParse() { while (++track, reader.startTrack()) { VocalTrack vt(""); unsigned timecode = 0; + bool newSentence = true; std::string trackName, lyric; for (Event ev; reader.parseEvent(ev); ) { + ev.print(); timecode += ev.timecode; if (ev.type == Event::NOTE_ON && ev.arg2 == 0) ev.type = Event::NOTE_OFF; // Note on with velocity 0 actually means off. // Process any interesting events if (ev.type == Event::NOTE_ON) { + if (ev.arg1 == 105) newSentence = true; // New sentence begins at next note if (ev.arg1 >= 100) continue; // Skip control signals vt.notes.push_back(Note(strConv(lyric))); lyric.clear(); Note& n = vt.notes.back(); n.begin = n.end = tsTime(timecode); n.note = ev.arg1; + n.lineBreak = newSentence; newSentence = false; vt.noteMin = std::min(vt.noteMin, n.note); vt.noteMax = std::max(vt.noteMax, n.note); continue; diff --git a/songparser.cc b/songparser.cc index 97e633c..a01e013 100644 --- a/songparser.cc +++ b/songparser.cc @@ -140,12 +140,15 @@ void SongParser::finalize() { if (vocal.notes.empty()) continue; // Set begin/end times vocal.beginTime = vocal.notes.front().begin, vocal.endTime = vocal.notes.back().end; - // Setup sentence start indicators + // Setup sentence start indicators and remove sleep notes bool sentenceStart = true; - for (Notes::iterator it = vocal.notes.begin(); it != vocal.notes.end(); ++it) { - it->lineBreak = sentenceStart; - if (it->type == Note::SLEEP) sentenceStart = true; - else sentenceStart = false; + for (Notes::iterator it = vocal.notes.begin(); it != vocal.notes.end();) { + if (sentenceStart) it->lineBreak = true; + sentenceStart = false; + if (it->type == Note::SLEEP) { + sentenceStart = true; + it = vocal.notes.erase(it); + } else ++it; } // Note normalization const int limLow = 1, limHigh = 47; |
|
From: Tapio V. <aa...@us...> - 2011-02-28 15:39:42
|
Author: Tapio Vierros <tap...@gm...>
Date: Mon Feb 28 17:39:09 2011 +0200
Added .desktop launcher.
---
CMakeLists.txt | 2 ++
platform/composer.desktop | 10 ++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e508a86..71f5ab2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,6 +73,8 @@ target_link_libraries(${EXENAME} ${LIBS})
# We don't currently have any assets, so on Windows, we just install to the root installation folder
if(UNIX)
install(TARGETS ${EXENAME} DESTINATION bin)
+ install(FILES "platform/composer.desktop" DESTINATION "share/applications/")
+ install(FILES "icons/composer.png" DESTINATION "share/pixmaps")
else()
install(TARGETS ${EXENAME} DESTINATION .)
endif()
diff --git a/platform/composer.desktop b/platform/composer.desktop
new file mode 100644
index 0000000..361492a
--- /dev/null
+++ b/platform/composer.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Composer
+Comment=Note creator for pitch-detecting karaoke games
+Exec=composer
+Icon=composer.png
+Terminal=false
+Type=Application
+Categories=Application;AudioVideo;Music;Qt;
+
|
|
From: Tapio V. <aa...@us...> - 2011-02-28 14:50:54
|
Author: Tapio Vierros <tap...@gm...>
Date: Mon Feb 28 16:50:20 2011 +0200
Added cmake packaging stuff (needs testing).
---
CMakeLists.txt | 2 +
platform/packaging.cmake | 109 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 111 insertions(+), 0 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e0098f..e508a86 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,8 @@ endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
+include(platform/packaging.cmake)
+
# Add a sensible build type default and warning because empty means no optimization and no debug info.
if(NOT CMAKE_BUILD_TYPE)
message("WARNING: CMAKE_BUILD_TYPE is not defined!\n Defaulting to CMAKE_BUILD_TYPE=RelWithDebInfo. Use ccmake to set a proper value.")
diff --git a/platform/packaging.cmake b/platform/packaging.cmake
new file mode 100644
index 0000000..402d1bf
--- /dev/null
+++ b/platform/packaging.cmake
@@ -0,0 +1,109 @@
+set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
+set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Application for creating song notes for pitch-detecting karaoke games.")
+set(CPACK_PACKAGE_CONTACT "http://performous.org/")
+set(CPACK_SOURCE_IGNORE_FILES
+ "/.cvsignore"
+ "/.gitignore"
+ "/songs/"
+ "/build/"
+ "/.svn/"
+ "/.git/"
+)
+set(CPACK_PACKAGE_EXECUTABLES composer)
+set(CPACK_SOURCE_GENERATOR "TBZ2")
+set(CPACK_GENERATOR "TBZ2")
+
+if("${CMAKE_BUILD_TYPE}" MATCHES "Release")
+ set(CPACK_STRIP_FILES TRUE)
+endif("${CMAKE_BUILD_TYPE}" MATCHES "Release")
+
+if(APPLE)
+ set(CPACK_GENERATOR "PACKAGEMAKER;OSXX11")
+endif(APPLE)
+if(UNIX)
+ # Try to find architecture
+ execute_process(COMMAND uname -m OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE)
+ string(STRIP "${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_ARCHITECTURE)
+ # Try to find distro name and distro-specific arch
+ execute_process(COMMAND lsb_release -is OUTPUT_VARIABLE LSB_ID)
+ execute_process(COMMAND lsb_release -rs OUTPUT_VARIABLE LSB_RELEASE)
+ string(STRIP "${LSB_ID}" LSB_ID)
+ string(STRIP "${LSB_RELEASE}" LSB_RELEASE)
+ set(LSB_DISTRIB "${LSB_ID}${LSB_RELEASE}")
+ if(NOT LSB_DISTRIB)
+ set(LSB_DISTRIB "unix")
+ endif(NOT LSB_DISTRIB)
+ # For Debian-based distros we want to create DEB packages.
+ if("${LSB_DISTRIB}" MATCHES "Ubuntu|Debian")
+ set(CPACK_GENERATOR "DEB")
+ set(CPACK_DEBIAN_PACKAGE_PRIORITY "extra")
+ set(CPACK_DEBIAN_PACKAGE_SECTION "universe/editors")
+ set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "performous")
+ # We need to alter the architecture names as per distro rules
+ if("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86")
+ set(CPACK_PACKAGE_ARCHITECTURE i386)
+ endif("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86")
+ if("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
+ set(CPACK_PACKAGE_ARCHITECTURE amd64)
+ endif("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
+
+ # Set the dependencies based on the distro version
+
+ # Ubuntu
+ if("${LSB_DISTRIB}" MATCHES "Ubuntu10.04")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqtcore4, libqtgui4, libqt4-xml, phonon, libavformat52|libavformat-extra-52")
+ endif("${LSB_DISTRIB}" MATCHES "Ubuntu10.04")
+
+ if("${LSB_DISTRIB}" MATCHES "Ubuntu10.10")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqtcore4, libqtgui4, libqt4-xml, phonon, libavformat52|libavformat-extra-52")
+ endif("${LSB_DISTRIB}" MATCHES "Ubuntu10.10")
+
+ # Debian
+ if("${LSB_DISTRIB}" MATCHES "Debian5.*")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqtcore4, libqtgui4, libqt4-xml, phonon, libavformat52|libavformat-extra-52")
+ endif("${LSB_DISTRIB}" MATCHES "Debian5.*")
+
+ if("${LSB_DISTRIB}" MATCHES "Debiantesting")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqtcore4, libqtgui4, libqt4-xml, phonon, libavformat52|libavformat-extra-52")
+ endif("${LSB_DISTRIB}" MATCHES "Debiantesting")
+
+ if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
+ message("WARNING: ${LSB_DISTRIB} not supported yet.\nPlease set deps in packaging.cmake before packaging.")
+ endif(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
+ string(TOLOWER "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${LSB_DISTRIB}_${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_FILE_NAME)
+ endif("${LSB_DISTRIB}" MATCHES "Ubuntu|Debian")
+ # For Fedora-based distros we want to create RPM packages.
+ if("${LSB_DISTRIB}" MATCHES "Fedora")
+ set(CPACK_GENERATOR "RPM")
+ set(CPACK_RPM_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
+ set(CPACK_RPM_PACKAGE_VERSION "${PROJECT_VERSION}")
+ set(CPACK_RPM_PACKAGE_RELEASE "1")
+# set(CPACK_RPM_PACKAGE_GROUP "Amusements/Games")
+ set(CPACK_RPM_PACKAGE_LICENSE "GPLv3+")
+ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "TODO")
+ set(CPACK_RPM_PACKAGE_DESCRIPTION "TODO")
+ # We need to alter the architecture names as per distro rules
+ if("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86")
+ set(CPACK_PACKAGE_ARCHITECTURE i386)
+ endif("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86")
+ if("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
+ set(CPACK_PACKAGE_ARCHITECTURE amd64)
+ endif("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
+ # Set the dependencies based on the distro version
+ if("${LSB_DISTRIB}" MATCHES "Fedora14")
+ #set(CPACK_RPM_PACKAGE_REQUIRES "TODO")
+ endif("${LSB_DISTRIB}" MATCHES "Fedora14")
+ if("${LSB_DISTRIB}" MATCHES "Fedora13")
+ #set(CPACK_RPM_PACKAGE_REQUIRES "TODO")
+ endif("${LSB_DISTRIB}" MATCHES "Fedora13")
+ if(NOT CPACK_RPM_PACKAGE_REQUIRES)
+ message("WARNING: ${LSB_DISTRIB} is not supported.\nPlease set deps in packaging.cmake before packaging.")
+ endif(NOT CPACK_RPM_PACKAGE_REQUIRES)
+ endif("${LSB_DISTRIB}" MATCHES "Fedora")
+ set(CPACK_SYSTEM_NAME "${LSB_DISTRIB}-${CPACK_PACKAGE_ARCHITECTURE}")
+ message(STATUS "Detected ${CPACK_SYSTEM_NAME}. Use make package to build packages (${CPACK_GENERATOR}).")
+endif(UNIX)
+
+include(CPack)
+
|
|
From: Yoda-JM <yo...@us...> - 2011-02-28 14:41:56
|
Author: Vincent Le Ligeour <yo...@us...> Date: Mon Feb 28 15:42:10 2011 +0100 Merge vertex array into master --- |