ScoreLayer.hpp
1 #pragma once
2 #include <Process/ProcessFactory.hpp>
3 
4 #include <Effect/EffectLayer.hpp>
5 
6 namespace oscr
7 {
8 template <typename T>
9 concept has_ossia_layer = requires { sizeof(typename T::Layer); };
10 
11 template <has_ossia_layer T>
13 {
14 public:
15  virtual ~ScoreLayerFactory() = default;
16 
17 private:
18  std::optional<double> recommendedHeight() const noexcept override
19  {
20  if constexpr(requires { T::recommended_height(); })
21  {
22  return T::recommended_height();
23  }
24  return LayerFactory::recommendedHeight();
25  }
26 
27  UuidKey<Process::ProcessModel> concreteKey() const noexcept override
28  {
30  }
31 
32  bool matches(const UuidKey<Process::ProcessModel>& p) const override
33  {
35  }
36 
37  Process::LayerView* makeLayerView(
38  const Process::ProcessModel& proc, const Process::Context& context,
39  QGraphicsItem* parent) const final override
40  {
41  return new typename T::Layer{proc, context, parent};
42  }
43 
44  Process::LayerPresenter* makeLayerPresenter(
46  const Process::Context& context, QObject* parent) const final override
47  {
48  auto view = static_cast<typename T::Layer*>(v);
49  return new Process::EffectLayerPresenter{lm, view, context, parent};
50  }
51 
52  score::ResizeableItem* makeItem(
53  const Process::ProcessModel& proc, const Process::Context& ctx,
54  QGraphicsItem* parent) const final override
55  {
56  return nullptr;
57  }
58 };
59 }
Definition: EffectLayer.hpp:27
Definition: score-lib-process/Process/ProcessFactory.hpp:58
Definition: LayerPresenter.hpp:34
Definition: LayerView.hpp:21
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
Definition: ScoreLayer.hpp:13
Definition: RectItem.hpp:12
Definition: Factories.hpp:19
Static metadata implementation.
Definition: lib/score/tools/Metadata.hpp:36
Definition: ProcessContext.hpp:12
Definition: ObjectMatches.hpp:6