Audacity 3.2.0
ProjectFormatVersion.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ProjectFormatVersion.cpp
6
7 Dmitry Vedenko
8
9**********************************************************************/
10
12
13#include <tuple>
14
16{
17 return std::tie(lhs.Major, lhs.Minor, lhs.Revision, lhs.ModLevel) ==
18 std::tie(rhs.Major, rhs.Minor, rhs.Revision, rhs.ModLevel);
19}
20
22{
23 return !(lhs == rhs);
24}
25
27{
28 return std::tie(lhs.Major, lhs.Minor, lhs.Revision, lhs.ModLevel) <
29 std::tie(rhs.Major, rhs.Minor, rhs.Revision, rhs.ModLevel);
30}
31
33{
34 return {
35 static_cast<uint8_t>((packedVersion >> 24) & 0xFF),
36 static_cast<uint8_t>((packedVersion >> 16) & 0xFF),
37 static_cast<uint8_t>((packedVersion >> 8 ) & 0xFF),
38 static_cast<uint8_t>((packedVersion ) & 0xFF),
39 };
40}
41
42uint32_t ProjectFormatVersion::GetPacked() const noexcept
43{
44 return (Major << 24) | (Minor << 16) | (Revision << 8) | ModLevel;
45}
46
47bool ProjectFormatVersion::IsValid() const noexcept
48{
49 return Major != 0;
50}
51
53 AUDACITY_VERSION, AUDACITY_RELEASE, AUDACITY_REVISION, AUDACITY_MODLEVEL
54};
55
56const ProjectFormatVersion BaseProjectFormatVersion = { AUDACITY_VERSION, AUDACITY_RELEASE, 0, 0 };
bool operator!=(ProjectFormatVersion lhs, ProjectFormatVersion rhs) noexcept
bool operator==(ProjectFormatVersion lhs, ProjectFormatVersion rhs) noexcept
const ProjectFormatVersion BaseProjectFormatVersion
This is a helper constant for the "most compatible" project version which is the current MAJ....
bool operator<(ProjectFormatVersion lhs, ProjectFormatVersion rhs) noexcept
const ProjectFormatVersion SupportedProjectFormatVersion
This constant represents the current version of Audacity.
A structure that holds the project version.
static ProjectFormatVersion FromPacked(uint32_t) noexcept
bool IsValid() const noexcept
Returns true if version is valid, i.e. Major != 0.
uint32_t GetPacked() const noexcept
Returns a version packed to 32-bit integer.