summaryrefslogtreecommitdiffstats
path: root/ingen
diff options
context:
space:
mode:
Diffstat (limited to 'ingen')
-rw-r--r--ingen/Atom.hpp18
-rw-r--r--ingen/Log.hpp2
2 files changed, 18 insertions, 2 deletions
diff --git a/ingen/Atom.hpp b/ingen/Atom.hpp
index e26462a5..4015e59e 100644
--- a/ingen/Atom.hpp
+++ b/ingen/Atom.hpp
@@ -72,7 +72,7 @@ public:
_body.ptr = (LV2_Atom*)malloc(sizeof(LV2_Atom) + _atom.size);
memcpy(_body.ptr, copy._body.ptr, sizeof(LV2_Atom) + _atom.size);
} else {
- memcpy(&_body.val, &copy._body.val, sizeof(_body.val));
+ _body.val = copy._body.val;
}
}
@@ -86,7 +86,7 @@ public:
_body.ptr = (LV2_Atom*)malloc(sizeof(LV2_Atom) + _atom.size);
memcpy(_body.ptr, other._body.ptr, sizeof(LV2_Atom) + _atom.size);
} else {
- memcpy(&_body.val, &other._body.val, sizeof(_body.val));
+ _body.val = other._body.val;
}
return *this;
}
@@ -116,6 +116,20 @@ public:
return type() < other.type();
}
+ /** Like assignment, but only works for value atoms (not references).
+ * Always real-time safe.
+ * @return true iff set succeeded.
+ */
+ inline bool set_rt(const Atom& other) {
+ if (is_reference()) {
+ return false;
+ } else {
+ _atom = other._atom;
+ _body.val = other._body.val;
+ return true;
+ }
+ }
+
inline uint32_t size() const { return _atom.size; }
inline LV2_URID type() const { return _atom.type; }
inline bool is_valid() const { return _atom.type; }
diff --git a/ingen/Log.hpp b/ingen/Log.hpp
index 189754e2..8063d4e5 100644
--- a/ingen/Log.hpp
+++ b/ingen/Log.hpp
@@ -50,6 +50,8 @@ public:
};
};
+ void rt_error(const char* msg);
+
void error(const std::string& msg);
void info(const std::string& msg);
void warn(const std::string& msg);