OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
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>
15namespace spdlog
16{
17class logger;
18}
19namespace ossia::qt
20{
21class qml_device;
22class OSSIA_EXPORT qml_val_type
23{
24 W_GADGET(qml_val_type)
25public:
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
42class OSSIA_EXPORT qml_access_mode
43{
44 W_GADGET(qml_access_mode)
45public:
46 enum access_mode
47 {
48 Bi,
49 Get,
50 Set
51 };
52 W_ENUM(access_mode, Bi, Get, Set)
53};
54
55class OSSIA_EXPORT qml_bounding_mode
56{
57 W_GADGET(qml_bounding_mode)
58public:
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
71class OSSIA_EXPORT qml_rep_filter
72{
73 W_GADGET(qml_rep_filter)
74public:
76 {
77 Unfiltered,
78 Filtered
79 };
80
81 W_ENUM(repetition_filter, Unfiltered, Filtered)
82};
83
84class OSSIA_EXPORT qml_duration
85{
86 W_GADGET(qml_duration)
87public:
88 enum duration : qint32
89 {
90 Infinite = ossia::qt::infinite()
91 };
92
93 W_ENUM(duration, Infinite)
94};
95}
96
97Q_DECLARE_METATYPE(ossia::qt::qml_val_type::val_type)
98Q_DECLARE_METATYPE(ossia::qt::qml_access_mode::access_mode)
99Q_DECLARE_METATYPE(ossia::qt::qml_bounding_mode::bounding_mode)
100Q_DECLARE_METATYPE(ossia::qt::qml_rep_filter::repetition_filter)
101Q_DECLARE_METATYPE(ossia::qt::qml_duration::duration)
102
103W_REGISTER_ARGTYPE(ossia::qt::qml_val_type::val_type)
104W_REGISTER_ARGTYPE(ossia::qt::qml_access_mode::access_mode)
105W_REGISTER_ARGTYPE(ossia::qt::qml_bounding_mode::bounding_mode)
106W_REGISTER_ARGTYPE(ossia::qt::qml_rep_filter::repetition_filter)
107W_REGISTER_ARGTYPE(ossia::qt::qml_duration::duration)
access_mode
Defines Write (Set), Read (Get) or Read/Write (Bi) access to the parameter's value.
Definition ossia-cpp98.hpp:66
@ Set
Definition ossia-cpp98.hpp:68
@ Bi
Definition ossia-cpp98.hpp:69
@ Get
Definition ossia-cpp98.hpp:67
bounding_mode
Behaviour at the bounds of the value.
Definition ossia-cpp98.hpp:75
@ 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
spdlog::logger & logger() noexcept
Where the errors will be logged. Default is stderr.
Definition context.cpp:118