OSSIA
Open Scenario System for Interactive Application
qml_context.hpp
1 #pragma once
2 #include <ossia/detail/config.hpp>
3 
4 #include <ossia/preset/preset.hpp>
5 
6 #include <ossia-qt/score/qml_util.hpp>
7 
8 #include <QDebug>
9 #include <QFile>
10 #include <QObject>
11 #include <QQmlEngine>
12 #include <QUrl>
13 
14 #include <verdigris>
15 namespace spdlog
16 {
17 class logger;
18 }
19 namespace ossia::qt
20 {
21 class qml_device;
22 class OSSIA_EXPORT qml_val_type
23 {
24  W_GADGET(qml_val_type)
25 public:
26  enum val_type
27  {
28  Float,
29  Int,
30  Vec2f,
31  Vec3f,
32  Vec4f,
33  Impulse,
34  Bool,
35  String,
36  List,
37  Map
38  };
39  W_ENUM(val_type, Float, Int, Vec2f, Vec3f, Vec4f, Impulse, Bool, String, List, Map)
40 };
41 
42 class OSSIA_EXPORT qml_access_mode
43 {
44  W_GADGET(qml_access_mode)
45 public:
46  enum access_mode
47  {
48  Bi,
49  Get,
50  Set
51  };
52  W_ENUM(access_mode, Bi, Get, Set)
53 };
54 
55 class OSSIA_EXPORT qml_bounding_mode
56 {
57  W_GADGET(qml_bounding_mode)
58 public:
59  enum bounding_mode
60  {
61  Free,
62  Clip,
63  Wrap,
64  Fold,
65  Low,
66  High
67  };
68  W_ENUM(bounding_mode, Free, Clip, Wrap, Fold, Low, High)
69 };
70 
71 class OSSIA_EXPORT qml_rep_filter
72 {
73  W_GADGET(qml_rep_filter)
74 public:
76  {
77  Unfiltered,
78  Filtered
79  };
80 
81  W_ENUM(repetition_filter, Unfiltered, Filtered)
82 };
83 
84 class OSSIA_EXPORT qml_duration
85 {
86  W_GADGET(qml_duration)
87 public:
88  enum duration : qint32
89  {
90  Infinite = ossia::qt::infinite()
91  };
92 
93  W_ENUM(duration, Infinite)
94 };
95 }
96 
97 Q_DECLARE_METATYPE(ossia::qt::qml_val_type::val_type)
98 Q_DECLARE_METATYPE(ossia::qt::qml_access_mode::access_mode)
99 Q_DECLARE_METATYPE(ossia::qt::qml_bounding_mode::bounding_mode)
100 Q_DECLARE_METATYPE(ossia::qt::qml_rep_filter::repetition_filter)
101 Q_DECLARE_METATYPE(ossia::qt::qml_duration::duration)
102 
103 W_REGISTER_ARGTYPE(ossia::qt::qml_val_type::val_type)
104 W_REGISTER_ARGTYPE(ossia::qt::qml_access_mode::access_mode)
105 W_REGISTER_ARGTYPE(ossia::qt::qml_bounding_mode::bounding_mode)
106 W_REGISTER_ARGTYPE(ossia::qt::qml_rep_filter::repetition_filter)
107 W_REGISTER_ARGTYPE(ossia::qt::qml_duration::duration)
Definition: impulse.hpp:5
@ Set
Definition: ossia-cpp98.hpp:68
@ Bi
Definition: ossia-cpp98.hpp:69
@ Get
Definition: ossia-cpp98.hpp:67
@ Low
Definition: ossia-cpp98.hpp:80
@ Fold
Definition: ossia-cpp98.hpp:79
@ High
Definition: ossia-cpp98.hpp:81
@ Wrap
Definition: ossia-cpp98.hpp:78
@ Clip
Definition: ossia-cpp98.hpp:77
@ Free
Definition: ossia-cpp98.hpp:76
val_type
Enum to represent the types that a value can take.
Definition: parameter_properties.hpp:16
repetition_filter
If enabled, sending twice the same value will only send it once by network.
Definition: parameter_properties.hpp:70
bounding_mode
Address behaviors at crossing domain boundaries.
Definition: parameter_properties.hpp:56
spdlog::logger & logger() noexcept
Where the errors will be logged. Default is stderr.
Definition: context.cpp:104
access_mode
Address behaviors at crossing domain boundaries time.
Definition: parameter_properties.hpp:46