2 #include <Process/ProcessMetadata.hpp>
4 #include <Crousti/Concepts.hpp>
8 #include <avnd/concepts/all.hpp>
9 #include <avnd/wrappers/metadatas.hpp>
11 #include <string_view>
15 template <
typename Info>
19 inline QString fromStringView(std::string_view v)
21 return QString::fromUtf8(v.data(), v.size());
27 template <
typename Info>
30 template <
typename Info>
31 requires avnd::has_name<Info>
34 static constexpr
const char* get() noexcept {
return avnd::get_name<Info>().data(); }
36 template <
typename Info>
37 requires avnd::has_category<Info>
40 static constexpr
const char* get() noexcept
42 return avnd::get_category<Info>().data();
45 template <
typename Info>
46 requires(!avnd::has_category<Info>)
49 static constexpr
const char* get() noexcept {
return ""; }
52 template <
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()));
65 concept has_kind = requires { T::kind(); };
70 if constexpr(has_kind<T>)
73 return Process::ProcessCategory::Other;
76 template <
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;
112 if constexpr(has_kind<Info>)
115 cat = Process::ProcessCategory::Other;
117 if constexpr(avnd::tag_deprecated<Info>)
118 cat = Process::ProcessCategory(cat | Process::ProcessCategory::Deprecated);
124 #if defined(_MSC_VER)
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)};
162 template <
typename Info>
167 if constexpr(requires { Info::flags(); })
169 return Info::flags();
174 flags |= Process::ProcessFlags::ControlSurface;
176 if constexpr(avnd::tag_temporal<Info>)
177 flags |= Process::ProcessFlags::SupportsTemporal;
179 flags |= Process::ProcessFlags::SupportsLasting;
181 if constexpr(avnd::tag_single_exec<Info>)
182 flags |= Process::ProcessFlags::SupportsState;
184 if constexpr(avnd::tag_fully_custom_item<Info>)
185 flags |= Process::ProcessFlags::FullyCustomItem;
191 template <
typename Info>
194 static constexpr
auto get() noexcept {
return avnd::get_c_name<Info>().data(); }
196 template <
typename Info>
201 return oscr::uuid_from_string<Info>();
Metadata to categorize objects: curves, audio, etc.
Definition: lib/score/tools/Metadata.hpp:61
Metadata to get the key part of ObjectIdentifier.
Definition: lib/score/tools/Metadata.hpp:36
Metadata to get the name that will be shown in the user interface.
Definition: lib/score/tools/Metadata.hpp:42
Metadata to retrieve the ProcessFlags of a process.
Definition: score-plugin-avnd/Crousti/ProcessModel.hpp:77
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
ProcessFlags
Various settings for processes.
Definition: ProcessFlags.hpp:17
Definition: Factories.hpp:19
Definition: score-lib-process/Process/ProcessMetadata.hpp:37