Pulp
1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
host_version.hpp
Go to the documentation of this file.
1
#pragma once
2
10
11
#include <
pulp/format/host_type.hpp
>
12
13
#include <optional>
14
#include <string_view>
15
16
namespace
pulp::format
{
17
23
struct
HostVersion
{
24
int
major
= 0;
25
int
minor
= 0;
26
int
patch
= 0;
27
28
constexpr
HostVersion
() =
default
;
29
constexpr
HostVersion
(
int
maj,
int
min = 0,
int
pat = 0)
30
:
major
(maj),
minor
(min),
patch
(pat) {}
31
33
constexpr
bool
is_at_least
(
int
maj,
int
min = 0,
int
pat = 0)
const
{
34
if
(
major
!= maj)
return
major
> maj;
35
if
(
minor
!= min)
return
minor
> min;
36
return
patch
>= pat;
37
}
38
40
constexpr
bool
is_before
(
int
maj,
int
min = 0,
int
pat = 0)
const
{
41
return
!
is_at_least
(maj, min, pat);
42
}
43
45
constexpr
bool
is_unknown
()
const
{
46
return
major
== 0 &&
minor
== 0 &&
patch
== 0;
47
}
48
};
49
53
std::optional<HostVersion>
parse_host_version
(std::string_view version_string);
54
62
HostVersion
detect_host_version
(
HostType
type);
63
68
bool
host_type_uses_version
(
HostType
type)
noexcept
;
69
72
struct
HostInfo
{
73
HostType
type
=
HostType::Unknown
;
74
HostVersion
version
;
75
};
76
77
HostInfo
detect_host_info
();
78
79
}
// namespace pulp::format
host_type.hpp
pulp::format
What the product grants a device: the quota table indexed by capability tier and live thermal state.
Definition
aax_editor.hpp:31
pulp::format::detect_host_info
HostInfo detect_host_info()
pulp::format::host_type_uses_version
bool host_type_uses_version(HostType type) noexcept
Whether any host quirk for type is version-gated.
pulp::format::parse_host_version
std::optional< HostVersion > parse_host_version(std::string_view version_string)
Best-effort parse of a version string like "10.0.50", "12.0", or "Pro Tools 2024.6".
pulp::format::detect_host_version
HostVersion detect_host_version(HostType type)
Detect the running host's major/minor version, best-effort.
pulp::format::HostType
HostType
Definition
host_type.hpp:11
pulp::format::HostType::Unknown
@ Unknown
Definition
host_type.hpp:12
pulp::format::HostInfo
Combined accessor: detect both type and version in one call.
Definition
host_version.hpp:72
pulp::format::HostInfo::type
HostType type
Definition
host_version.hpp:73
pulp::format::HostInfo::version
HostVersion version
Definition
host_version.hpp:74
pulp::format::HostVersion
Semver-ish host version.
Definition
host_version.hpp:23
pulp::format::HostVersion::patch
int patch
Definition
host_version.hpp:26
pulp::format::HostVersion::is_unknown
constexpr bool is_unknown() const
Returns true if all components are zero (unknown / undetected).
Definition
host_version.hpp:45
pulp::format::HostVersion::HostVersion
constexpr HostVersion()=default
pulp::format::HostVersion::is_at_least
constexpr bool is_at_least(int maj, int min=0, int pat=0) const
True when this version is >= the comparison target.
Definition
host_version.hpp:33
pulp::format::HostVersion::HostVersion
constexpr HostVersion(int maj, int min=0, int pat=0)
Definition
host_version.hpp:29
pulp::format::HostVersion::is_before
constexpr bool is_before(int maj, int min=0, int pat=0) const
True when this version is strictly less than the comparison target.
Definition
host_version.hpp:40
pulp::format::HostVersion::major
int major
Definition
host_version.hpp:24
pulp::format::HostVersion::minor
int minor
Definition
host_version.hpp:25
core
format
include
pulp
format
host_version.hpp
Generated by
1.15.0