hydrogen 1.2.6
Version.cpp
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2025 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23#include <core/config.h>
24#include "Version.h"
25
26namespace H2Core {
27
28static const std::string version = H2CORE_VERSION;
29
30std::string get_version() {
31 return version;
32}
33
34bool version_older_than( int major, int minor, int patch ) {
35 if ( H2CORE_VERSION_MAJOR > major ) {
36 return true;
37 } else if ( H2CORE_VERSION_MAJOR < major ) {
38 return false;
39 } else {
40 if ( H2CORE_VERSION_MINOR > minor ) {
41 return true;
42 } else if ( H2CORE_VERSION_MINOR < minor ) {
43 return false;
44 } else {
45 if ( H2CORE_VERSION_PATCH > patch ) {
46 return true;
47 } else {
48 return false;
49 }
50 }
51 }
52}
53
54QString getAboutText() {
55 return QString( "\nHydrogen %1 [%2] [http://www.hydrogen-music.org]\nCopyright 2002-2008 Alessandro Cominu\nCopyright 2008-2025 The hydrogen development team\nHydrogen comes with ABSOLUTELY NO WARRANTY\nThis is free software, and you are welcome to redistribute it under certain conditions. See the file COPYING for details.\n" )
56 .arg( QString::fromStdString( H2Core::get_version() ) )
57 .arg( QString::fromStdString( __DATE__ ) );
58}
59
60};
61
62/* vim: set softtabstop=4 noexpandtab: */
#define H2CORE_VERSION_PATCH
Will contain the current patch version number of Hydrogen and is set by cmake.
Definition config.dox:53
#define H2CORE_VERSION_MAJOR
Will contain the current major version number of Hydrogen and is set by cmake.
Definition config.dox:43
#define H2CORE_VERSION_MINOR
Will contain the current minor version number of Hydrogen and is set by cmake.
Definition config.dox:48
#define H2CORE_VERSION
A concatenation of H2CORE_VERSION_MAJOR, H2CORE_VERSION_MINOR, H2CORE_VERSION_PATCH,...
Definition config.dox:63
QString getAboutText()
Definition Version.cpp:54
std::string get_version()
Returns the current Hydrogen version string.
Definition Version.cpp:30
bool version_older_than(int major, int minor, int patch)
return true of the current version is older than the given values
Definition Version.cpp:34
static const std::string version
Definition Version.cpp:28