2#include <Process/ProcessMetadata.hpp>
4#include <Crousti/Concepts.hpp>
8#include <avnd/concepts/all.hpp>
9#include <avnd/wrappers/metadatas.hpp>
15template <
typename Info>
19inline QString fromStringView(std::string_view v)
21 return QString::fromUtf8(v.data(), v.size());
27template <
typename Info>
30template <
typename Info>
31 requires avnd::has_name<Info>
34 static constexpr const char* get()
noexcept {
return avnd::get_name<Info>().data(); }
36template <
typename Info>
37 requires avnd::has_category<Info>
40 static constexpr const char* get()
noexcept
42 return avnd::get_category<Info>().data();
45template <
typename Info>
46 requires(!avnd::has_category<Info>)
49 static constexpr const char* get() noexcept {
return ""; }
52template <
typename Info>
55 static QStringList get()
noexcept
58 for(std::string_view tag : avnd::get_tags<Info>())
59 lst.push_back(QString::fromUtf8(tag.data(), tag.size()));
73 return Process::ProcessCategory::Other;
76template <
typename Info>
79 static std::vector<Process::PortType> inletDescription()
81 std::vector<Process::PortType> port;
94 static std::vector<Process::PortType> outletDescription()
96 std::vector<Process::PortType> port;
109 static Process::ProcessCategory kind()
noexcept
111 Process::ProcessCategory cat;
115 cat = Process::ProcessCategory::Other;
117 if constexpr(avnd::tag_deprecated<Info>)
118 cat = Process::ProcessCategory(cat | Process::ProcessCategory::Deprecated);
125#define if_exists(Expr, Else) \
132#define if_attribute(Attr) QString{}
134#define if_exists(Expr, Else) \
136 if constexpr(requires { Expr; }) \
141#define if_attribute(Attr) \
142 []() noexcept -> QString { \
143 if constexpr(avnd::has_##Attr<Info>) \
144 return fromStringView(avnd::get_##Attr<Info>()); \
152 if_attribute(category),
153 if_attribute(description),
154 if_attribute(author),
158 if_attribute(manual_url)};
162template <
typename Info>
167 if constexpr(
requires { Info::flags(); })
169 return Info::flags();
176 if constexpr(avnd::tag_temporal<Info>)
179 flags |= Process::ProcessFlags::SupportsLasting;
181 if constexpr(avnd::tag_single_exec<Info>)
184 if constexpr(avnd::tag_fully_custom_item<Info>)
191template <
typename Info>
194 static constexpr auto get()
noexcept {
return avnd::get_c_name<Info>().data(); }
196template <
typename Info>
201 return oscr::uuid_from_string<Info>();
Metadata to categorize objects: curves, audio, etc.
Metadata to get the key part of ObjectIdentifier.
Metadata to get the name that will be shown in the user interface.
Metadata to retrieve the ProcessFlags of a process.
Definition UuidKey.hpp:343
Definition score-plugin-avnd/Crousti/ProcessModel.hpp:77
Definition plugins/score-plugin-avnd/Crousti/Metadata.hpp:65
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1324
ProcessFlags
Various settings for processes.
Definition ProcessFlags.hpp:17
@ ControlSurface
The process supports being exposed to the ControlSurface.
Definition ProcessFlags.hpp:37
@ SupportsState
Can be loaded in a state.
Definition ProcessFlags.hpp:25
@ SupportsTemporal
Can be loaded as a process of an interval.
Definition ProcessFlags.hpp:19
@ FullyCustomItem
The process's item handles all the decoration (won't be title, etc)
Definition ProcessFlags.hpp:40
Definition Factories.hpp:19
Definition score-lib-process/Process/ProcessMetadata.hpp:37