|
Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
|
String utilities. More...
Namespaces | |
| namespace | compression |
| Compression utilities. | |
| namespace | exceptions |
| Exception handling utilities. | |
| namespace | math |
| Math utils. | |
| namespace | version_keys |
| Key constants for version JSON serialization. | |
Data Structures | |
| class | AppSettings |
| class | AudioFileWriter |
| class | Backtrace |
| class | ConstBidirectionalMap |
| A read-only bidirectional map that maintains key-value and value-key mappings. More... | |
| class | Color |
| class | Debouncer |
| Generic debouncer that delays execution of a callback until a specified time period has elapsed without the debounce being called again. More... | |
| class | ExpandableTickRange |
| class | FilePathList |
| class | IObjectRegistry |
| Abstract interface for a UUID-keyed object registry. More... | |
| class | ISettingsBackend |
| Interface for an app settings provider. More... | |
| class | MonotonicTimeProvider |
| class | QElapsedTimeProvider |
| class | ObjectRegistry |
| Concrete IObjectRegistry with QObject parent-child ownership and reference counting. More... | |
| struct | OptionalRef |
| Wrapper around std::optional<std::reference_wrapper<T>> that provides a more convenient API. More... | |
| class | PlaybackCacheScheduler |
| Cache request handler for a tick range, with built-in debouncing and expanding of the range. More... | |
| class | QSettingsBackend |
| Interface for an app settings provider. More... | |
| class | QObjectUniquePtr |
| A unique pointer for QObject objects that also works with QObject-based ownership. More... | |
| struct | is_derived_from_template |
| struct | dependent_false |
| struct | remove_smart_pointer |
| struct | remove_smart_pointer< std::unique_ptr< T, Deleter > > |
| struct | remove_smart_pointer< std::shared_ptr< T > > |
| struct | remove_smart_pointer< std::weak_ptr< T > > |
| struct | is_unique_ptr |
| struct | is_unique_ptr< std::unique_ptr< T > > |
| struct | is_shared_ptr |
| struct | is_shared_ptr< std::shared_ptr< T > > |
| class | TypedUuidReference |
| Typed, reference-counted UUID reference into an IObjectRegistry. More... | |
| class | Utf8String |
| Lightweight UTF-8 string wrapper with safe conversions. More... | |
| class | CStringRAII |
| C string RAII wrapper. More... | |
| class | UuidIdentifiableBase |
| QObject-based base for all UUID-identifiable objects. More... | |
| class | UuidIdentifiableObject |
| CRTP base that adds a typed UUID strong-typedef to a class hierarchy. More... | |
| class | UuidReference |
| Untyped, reference-counted UUID reference into an IObjectRegistry. More... | |
| struct | is_in_variant |
| struct | is_in_variant< T, std::variant< Ts... >, std::void_t< decltype(std::variant< Ts... >())> > |
| struct | merge_variants |
| struct | merge_variants< Variant > |
| struct | merge_variants< std::variant< Types1... >, std::variant< Types2... >, Rest... > |
| struct | to_reference_variant_impl |
| Helper struct to convert a variant to a variant of references. More... | |
| struct | to_reference_variant_impl< std::variant< Ts... > > |
| Specialization for std::variant. More... | |
| struct | to_const_reference_variant_impl |
| struct | to_const_reference_variant_impl< std::variant< Ts... > > |
| struct | to_unique_ptr_variant_impl |
| Helper struct to convert a variant to a variant of unique_ptr's. More... | |
| struct | to_unique_ptr_variant_impl< std::variant< Ts... > > |
| Specialization for std::variant. More... | |
| struct | to_pointer_variant_impl |
| Helper struct to convert a variant to a variant of pointers. More... | |
| struct | to_pointer_variant_impl< std::variant< Ts... > > |
| Specialization for std::variant. More... | |
| struct | overload |
| Overload pattern. More... | |
| struct | wrap_variant_impl |
| Helper struct to convert a variant to a variant of ArrangerObjectOwner<T>. More... | |
| struct | wrap_variant_impl< std::variant< Ts... >, Wrapper > |
| Specialization for std::variant. More... | |
| struct | Version |
| Represents a semantic version with major, minor, and optional patch. More... | |
| class | TestObject |
| Simple QObject test object with a name, for testing UuidReference and TypedUuidReference. More... | |
| class | DerivedTestObject |
| class | MockObjectRegistry |
| Mock IObjectRegistry for testing reference behavior in isolation. More... | |
| class | ContainerTestObject |
| Test object that holds a TypedUuidReference to another object. More... | |
Concepts | |
| concept | CloneableObject |
| Concept that checks if a type is cloneable. | |
| concept | CloneableDefaultInitializableObject |
| Concept that checks if a type is cloneable. | |
| concept | InheritsFromBase |
| Concept to check if a type inherits from a base class. | |
| concept | AllInheritFromBase |
| Concept to ensure all types in a variant inherit from a base class. | |
| concept | QObjectDerived |
| concept | ContainerType |
| concept | FinalClass |
| concept | CompleteType |
| concept | IsRawPointer |
| concept | StdVariant |
| concept | VariantOfPointers |
| concept | OptionalType |
| concept | StrongTypedef |
| concept | StdArray |
| concept | SmartPtr |
| concept | DerivedButNotBase |
| concept | DerivedFromCRTPBase |
| concept | RangeOf |
| concept | ObjectBuilder |
| Concept that checks if a type is a builder for objects. | |
| concept | EnumType |
| concept | UuidIdentifiable |
| Concept: T has a UUID identity from a UuidIdentifiableObject hierarchy. | |
| concept | IsInVariant |
Typedefs | |
| using | MonotonicTime = qint64 |
| template<typename... Ts> | |
| using | dependent_false_t = typename dependent_false<Ts...>::type |
| template<typename T> | |
| using | remove_smart_pointer_t = typename remove_smart_pointer<T>::type |
| template<typename T> | |
| using | base_type |
| An improved version of std::decay_t that also removes raw and smart pointers. | |
| template<typename... Variants> | |
| using | merge_variants_t = typename merge_variants<Variants...>::type |
| template<typename Variant> | |
| using | to_reference_variant = typename to_reference_variant_impl<Variant>::type |
| Converts a variant to a variant of reference_wrappers. | |
| template<typename Variant> | |
| using | to_const_reference_variant |
| template<typename Variant> | |
| using | to_unique_ptr_variant = typename to_unique_ptr_variant_impl<Variant>::type |
| Converts a variant to a variant of reference_wrappers. | |
| template<typename Variant> | |
| using | to_pointer_variant = typename to_pointer_variant_impl<Variant>::type |
| Converts a variant to a variant of pointers. | |
| template<typename Variant, template< typename > class Wrapper> | |
| using | wrap_variant_t = typename wrap_variant_impl<Variant, Wrapper>::type |
| Converts a variant to a variant where each type is wrapped by Wrapper<T>. | |
Enumerations | |
| enum class | ObjectCloneType { Snapshot , NewIdentity } |
| enum class | LoggerType { GUI , Test } |
| enum class | LogLevel { Trace = 0 , Debug = 1 , Info = 2 , Warning = 3 , Error = 4 , Critical = 5 } |
Functions | |
| auto | format_as (const ExpandableTickRange &range) -> std::string |
| template<CloneableObject Derived, typename... Args> | |
| std::unique_ptr< Derived > | clone_unique (const Derived &obj, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) |
| template<CloneableObject Derived, typename... Args> | |
| std::shared_ptr< Derived > | clone_shared (const Derived &obj, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) |
| template<CloneableObject Derived, typename... Args> | |
| Derived * | clone_raw_ptr (const Derived &obj, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) |
| template<CloneableObject Derived, typename... Args> requires utils::QObjectDerived<Derived> | |
| Derived * | clone_qobject (const Derived &obj, QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) |
| template<CloneableObject Derived, typename... Args> requires utils::QObjectDerived<Derived> | |
| utils::QObjectUniquePtr< Derived > | clone_unique_qobject (const Derived &obj, QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) |
| template<typename T, std::size_t N> | |
| void | clone_unique_ptr_array (std::array< std::unique_ptr< T >, N > &dest, const std::array< std::unique_ptr< T >, N > &src, ObjectCloneType clone_type=ObjectCloneType::Snapshot) |
| Clones the elements of a std::array of std::unique_ptr into the destination array. | |
| template<typename T, template< typename... > class Ptr> | |
| void | clone_ptr_vector (std::vector< Ptr< T > > &dest, const std::vector< Ptr< T > > &src, ObjectCloneType clone_type=ObjectCloneType::Snapshot) |
| Clones the elements of a std::vector of std::unique_ptr or std::shared_ptr into the destination vector. | |
| template<typename Container> | |
| void | clone_unique_ptr_container (Container &dest, const Container &src, ObjectCloneType clone_type=ObjectCloneType::Snapshot) |
| Clones the elements of a container of std::unique_ptr into the destination container. | |
| template<typename Container, typename Variant, typename Base> | |
| void | clone_variant_container (Container &dest, const Container &src, ObjectCloneType clone_type=ObjectCloneType::Snapshot) |
| template<typename Variant, typename Container> | |
| void | clone_variant_container (Container &dest, const Container &src, ObjectCloneType clone_type=ObjectCloneType::Snapshot) |
| Clones a container of variants. | |
| void | init_logging (LoggerType type) |
| bool | is_logging_initialized () |
| std::vector< Utf8String > | get_last_log_entries (size_t count) |
| std::filesystem::path | get_log_file_path () |
| template<typename... Args> | |
| void | log_trace (std::source_location loc, fmt::format_string< Args... > fmt, Args &&... args) |
| template<typename... Args> | |
| void | log_debug (std::source_location loc, fmt::format_string< Args... > fmt, Args &&... args) |
| template<typename... Args> | |
| void | log_info (std::source_location loc, fmt::format_string< Args... > fmt, Args &&... args) |
| template<typename... Args> | |
| void | log_warning (std::source_location loc, fmt::format_string< Args... > fmt, Args &&... args) |
| template<typename... Args> | |
| void | log_error (std::source_location loc, fmt::format_string< Args... > fmt, Args &&... args) |
| template<typename... Args> | |
| void | log_critical (std::source_location loc, fmt::format_string< Args... > fmt, Args &&... args) |
| template<class T> | |
| constexpr bool | values_equal_for_qproperty_type (const T &a, const T &b) |
| Helper that checks if 2 values are equal. | |
| template<typename T, typename... Args> | |
| QObjectUniquePtr< T > | make_qobject_unique (Args &&... args) |
| template<UuidIdentifiable T, typename... Args> | |
| auto | create_object (IObjectRegistry ®istry, Args &&... args) |
| template<UuidIdentifiable T> | |
| auto | clone_object (const T &source, IObjectRegistry ®istry, ObjectCloneType clone_type, auto &&... extra_args) |
| template<UuidIdentifiable T> | |
| T & | get_typed (IObjectRegistry ®istry, const typename UuidIdentifiableObject< T >::Uuid &id) |
| template<UuidType T> | |
| bool | contains (IObjectRegistry ®istry, const T &id) |
| std::string | get_current_thread_name () |
| Returns the name of the current thread as set by the OS or threading library. | |
| template<typename Variant, typename Base> | |
| auto | convert_to_variant (const Base *base_ptr) -> Variant |
| Converts a base pointer to a variant of pointers using dynamic_cast. | |
| template<typename Variant, typename Base> | |
| auto | convert_to_variant_qobj (const Base *base_ptr) -> Variant |
| Converts a QObject base pointer to a variant of pointers using qobject_cast. | |
| void | to_json (nlohmann::json &j, const Version &v) |
| void | from_json (const nlohmann::json &j, Version &v) |
Variables | |
| template<template< typename... > class BaseTemplateT, typename DerivedT> | |
| constexpr bool | is_derived_from_template_v |
| template<typename... Ts> | |
| constexpr auto | dependent_false_v = dependent_false<Ts...>::value |
| template<typename T> | |
| constexpr bool | is_unique_ptr_v = is_unique_ptr<T>::value |
| template<typename T> | |
| constexpr bool | is_shared_ptr_v = is_shared_ptr<T>::value |
String utilities.
| using zrythm::utils::base_type |
| using zrythm::utils::dependent_false_t = typename dependent_false<Ts...>::type |
| using zrythm::utils::merge_variants_t = typename merge_variants<Variants...>::type |
Definition at line 48 of file variant_helpers.h.
| using zrythm::utils::MonotonicTime = qint64 |
Definition at line 10 of file monotonic_time_provider.h.
| using zrythm::utils::remove_smart_pointer_t = typename remove_smart_pointer<T>::type |
| using zrythm::utils::to_const_reference_variant |
Definition at line 95 of file variant_helpers.h.
| using zrythm::utils::to_pointer_variant = typename to_pointer_variant_impl<Variant>::type |
Converts a variant to a variant of pointers.
| Variant | The original variant type |
Definition at line 130 of file variant_helpers.h.
| using zrythm::utils::to_reference_variant = typename to_reference_variant_impl<Variant>::type |
Converts a variant to a variant of reference_wrappers.
| Variant | The original variant type |
Definition at line 85 of file variant_helpers.h.
| using zrythm::utils::to_unique_ptr_variant = typename to_unique_ptr_variant_impl<Variant>::type |
Converts a variant to a variant of reference_wrappers.
| Variant | The original variant type |
Definition at line 113 of file variant_helpers.h.
| using zrythm::utils::wrap_variant_t = typename wrap_variant_impl<Variant, Wrapper>::type |
Converts a variant to a variant where each type is wrapped by Wrapper<T>.
| Variant | The original variant type |
| Wrapper | The template class to wrap each type with |
Definition at line 240 of file variant_helpers.h.
|
strong |
| Enumerator | |
|---|---|
| Snapshot | Creates a snapshot of the object with the same identity. |
| NewIdentity | Creates a separately identified object. To be used only when duplicating objects as part of a user action. |
Definition at line 18 of file icloneable.h.
|
nodiscard |
Definition at line 26 of file registry_utils.h.
| void zrythm::utils::clone_ptr_vector | ( | std::vector< Ptr< T > > & | dest, |
| const std::vector< Ptr< T > > & | src, | ||
| ObjectCloneType | clone_type = ObjectCloneType::Snapshot ) |
Clones the elements of a std::vector of std::unique_ptr or std::shared_ptr into the destination vector.
| T | The type of the elements in the vector. |
| Ptr | The pointer type (std::unique_ptr or std::shared_ptr). |
| dest | The destination vector to clone into. |
| src | The source vector to clone from. |
Definition at line 178 of file icloneable.h.
| Derived * zrythm::utils::clone_qobject | ( | const Derived & | obj, |
| QObject * | parent, | ||
| ObjectCloneType | clone_type = ObjectCloneType::Snapshot, | ||
| Args &&... | args ) |
Definition at line 82 of file icloneable.h.
| Derived * zrythm::utils::clone_raw_ptr | ( | const Derived & | obj, |
| ObjectCloneType | clone_type = ObjectCloneType::Snapshot, | ||
| Args &&... | args ) |
Definition at line 71 of file icloneable.h.
| std::shared_ptr< Derived > zrythm::utils::clone_shared | ( | const Derived & | obj, |
| ObjectCloneType | clone_type = ObjectCloneType::Snapshot, | ||
| Args &&... | args ) |
Definition at line 58 of file icloneable.h.
| std::unique_ptr< Derived > zrythm::utils::clone_unique | ( | const Derived & | obj, |
| ObjectCloneType | clone_type = ObjectCloneType::Snapshot, | ||
| Args &&... | args ) |
Definition at line 45 of file icloneable.h.
| void zrythm::utils::clone_unique_ptr_array | ( | std::array< std::unique_ptr< T >, N > & | dest, |
| const std::array< std::unique_ptr< T >, N > & | src, | ||
| ObjectCloneType | clone_type = ObjectCloneType::Snapshot ) |
Clones the elements of a std::array of std::unique_ptr into the destination array.
| T | The type of the elements in the array. |
| N | The size of the array. |
| dest | The destination array to clone into. |
| src | The source array to clone from. |
Definition at line 142 of file icloneable.h.
| void zrythm::utils::clone_unique_ptr_container | ( | Container & | dest, |
| const Container & | src, | ||
| ObjectCloneType | clone_type = ObjectCloneType::Snapshot ) |
Clones the elements of a container of std::unique_ptr into the destination container.
| Container | The type of the container. |
| dest | The destination container to clone into. |
| src | The source container to clone from. |
Definition at line 231 of file icloneable.h.
| utils::QObjectUniquePtr< Derived > zrythm::utils::clone_unique_qobject | ( | const Derived & | obj, |
| QObject * | parent, | ||
| ObjectCloneType | clone_type = ObjectCloneType::Snapshot, | ||
| Args &&... | args ) |
Definition at line 99 of file icloneable.h.
| void zrythm::utils::clone_variant_container | ( | Container & | dest, |
| const Container & | src, | ||
| ObjectCloneType | clone_type = ObjectCloneType::Snapshot ) |
Clones a container of variants.
| Variant | The variant type containing possible derived classes. |
| Container | The container type (deduced automatically). |
Definition at line 298 of file icloneable.h.
| void zrythm::utils::clone_variant_container | ( | Container & | dest, |
| const Container & | src, | ||
| ObjectCloneType | clone_type = ObjectCloneType::Snapshot ) |
Definition at line 249 of file icloneable.h.
| bool zrythm::utils::contains | ( | IObjectRegistry & | registry, |
| const T & | id ) |
Definition at line 54 of file registry_utils.h.
| auto zrythm::utils::convert_to_variant | ( | const Base * | base_ptr | ) | -> Variant |
Converts a base pointer to a variant of pointers using dynamic_cast.
If the base pointer is null, returns a default-constructed variant (null pointer of the first alternative type). Throws if no cast succeeds.
| Variant | A std::variant of pointer types. |
| Base | The base type of the pointer. |
| base_ptr | The base pointer to convert. |
Definition at line 182 of file variant_helpers.h.
| auto zrythm::utils::convert_to_variant_qobj | ( | const Base * | base_ptr | ) | -> Variant |
Converts a QObject base pointer to a variant of pointers using qobject_cast.
If the base pointer is null, returns a default-constructed variant (null pointer of the first alternative type). Throws if no cast succeeds.
| Variant | A std::variant of pointer types. |
| Base | The base type of the pointer. |
| base_ptr | The base pointer to convert. |
Definition at line 199 of file variant_helpers.h.
|
nodiscard |
Definition at line 15 of file registry_utils.h.
| std::string zrythm::utils::get_current_thread_name | ( | ) |
Returns the name of the current thread as set by the OS or threading library.
Falls back to the numeric thread ID if no name is available.
| T & zrythm::utils::get_typed | ( | IObjectRegistry & | registry, |
| const typename UuidIdentifiableObject< T >::Uuid & | id ) |
Definition at line 42 of file registry_utils.h.
| void zrythm::utils::log_critical | ( | std::source_location | loc, |
| fmt::format_string< Args... > | fmt, | ||
| Args &&... | args ) |
| void zrythm::utils::log_debug | ( | std::source_location | loc, |
| fmt::format_string< Args... > | fmt, | ||
| Args &&... | args ) |
| void zrythm::utils::log_error | ( | std::source_location | loc, |
| fmt::format_string< Args... > | fmt, | ||
| Args &&... | args ) |
| void zrythm::utils::log_info | ( | std::source_location | loc, |
| fmt::format_string< Args... > | fmt, | ||
| Args &&... | args ) |
| void zrythm::utils::log_trace | ( | std::source_location | loc, |
| fmt::format_string< Args... > | fmt, | ||
| Args &&... | args ) |
| void zrythm::utils::log_warning | ( | std::source_location | loc, |
| fmt::format_string< Args... > | fmt, | ||
| Args &&... | args ) |
| QObjectUniquePtr< T > zrythm::utils::make_qobject_unique | ( | Args &&... | args | ) |
|
constexpr |
|
constexpr |
|
inlineconstexpr |
|
constexpr |
|
constexpr |