OpenShot Library | libopenshot  0.1.9
Version.h
Go to the documentation of this file.
1 /**
2  * @file
3  * @brief Header file that includes the version number of libopenshot
4  * @author Jonathan Thomas <jonathan@openshot.org>
5  *
6  * @section LICENSE
7  *
8  * Copyright (c) 2008-2014 OpenShot Studios, LLC
9  * <http://www.openshotstudios.com/>. This file is part of
10  * OpenShot Library (libopenshot), an open-source project dedicated to
11  * delivering high quality video editing and animation solutions to the
12  * world. For more information visit <http://www.openshot.org/>.
13  *
14  * OpenShot Library (libopenshot) is free software: you can redistribute it
15  * and/or modify it under the terms of the GNU Lesser General Public License
16  * as published by the Free Software Foundation, either version 3 of the
17  * License, or (at your option) any later version.
18  *
19  * OpenShot Library (libopenshot) is distributed in the hope that it will be
20  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public License
25  * along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
26  */
27 
28 #ifndef OPENSHOT_VERSION_H
29 #define OPENSHOT_VERSION_H
30 
31 // Crazy c++ macro to convert an integer into a string
32 #ifndef STRINGIZE
33  #define STRINGIZE_(x) #x
34  #define STRINGIZE(x) STRINGIZE_(x)
35 #endif
36 
37 #define OPENSHOT_VERSION_MAJOR 0; /// Major version number is incremented when huge features are added or improved.
38 #define OPENSHOT_VERSION_MINOR 1; /// Minor version is incremented when smaller (but still very important) improvements are added.
39 #define OPENSHOT_VERSION_BUILD 9; /// Build number is incremented when minor bug fixes and less important improvements are added.
40 #define OPENSHOT_VERSION_SO 14; /// Shared object version number. This increments any time the API and ABI changes (so old apps will no longer link)
41 #define OPENSHOT_VERSION_MAJOR_MINOR STRINGIZE(OPENSHOT_VERSION_MAJOR) "." STRINGIZE(OPENSHOT_VERSION_MINOR); /// A string of the "Major.Minor" version
42 #define OPENSHOT_VERSION_ALL STRINGIZE(OPENSHOT_VERSION_MAJOR) "." STRINGIZE(OPENSHOT_VERSION_MINOR) "." STRINGIZE(OPENSHOT_VERSION_BUILD); /// A string of the entire version "Major.Minor.Build"
43 
44 #include <sstream>
45 using namespace std;
46 
47 namespace openshot
48 {
49  /// This struct holds version number information. Use the GetVersion() method to access the current version of libopenshot.
50  struct OpenShotVersion {
51  int major; /// Major version number
52  int minor; /// Minor version number
53  int build; /// Build number
54  int so; /// Shared Object Number (incremented when API or ABI changes)
55 
56  /// Get a string version of the version (i.e. "Major.Minor.Build")
57  string ToString() {
58  stringstream version_string;
59  version_string << major << "." << minor << "." << build;
60  return version_string.str();
61  }
62  };
63 
64  /// Get the current version number of libopenshot (major, minor, and build number)
65  static OpenShotVersion GetVersion() {
66  OpenShotVersion version;
67 
68  // Set version info
69  version.major = OPENSHOT_VERSION_MAJOR;
70  version.minor = OPENSHOT_VERSION_MINOR;
71  version.build = OPENSHOT_VERSION_BUILD;
72  version.so = OPENSHOT_VERSION_SO;
73 
74  return version;
75  }
76 }
77 #endif
#define OPENSHOT_VERSION_MAJOR
Definition: Version.h:37
string ToString()
Shared Object Number (incremented when API or ABI changes)
Definition: Version.h:57
#define OPENSHOT_VERSION_BUILD
Definition: Version.h:39
int minor
Major version number.
Definition: Version.h:52
#define OPENSHOT_VERSION_MINOR
Definition: Version.h:38
#define OPENSHOT_VERSION_SO
Definition: Version.h:40
This struct holds version number information. Use the GetVersion() method to access the current versi...
Definition: Version.h:50
int so
Build number.
Definition: Version.h:54
This namespace is the default namespace for all code in the openshot library.
int build
Minor version number.
Definition: Version.h:53