aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/Node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/Node.cpp')
-rw-r--r--src/engine/Node.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/engine/Node.cpp b/src/engine/Node.cpp
index 962a3c7..9aba95a 100644
--- a/src/engine/Node.cpp
+++ b/src/engine/Node.cpp
@@ -131,29 +131,29 @@ Node::set_exit_action(SPtr<Action> action)
void
Node::enter(MIDISink* sink, TimeStamp time)
{
- assert(!_is_active);
+ if (!_is_active) {
+ _changed = true;
+ _is_active = true;
+ _enter_time = time;
- _changed = true;
- _is_active = true;
- _enter_time = time;
-
- if (sink && _enter_action) {
- _enter_action->execute(sink, time);
+ if (sink && _enter_action) {
+ _enter_action->execute(sink, time);
+ }
}
}
void
Node::exit(MIDISink* sink, TimeStamp time)
{
- assert(_is_active);
+ if (_is_active) {
+ if (sink && _exit_action) {
+ _exit_action->execute(sink, time);
+ }
- if (sink && _exit_action) {
- _exit_action->execute(sink, time);
+ _changed = true;
+ _is_active = false;
+ _enter_time = 0;
}
-
- _changed = true;
- _is_active = false;
- _enter_time = 0;
}
SPtr<Edge>
@@ -208,7 +208,7 @@ void
Node::set(URIInt key, const Raul::Atom& value)
{
if (key == URIs::instance().machina_initial) {
- set_initial(value.get_bool());
+ std::cerr << "error: Attempt to change node initial state" << std::endl;
} else if (key == URIs::instance().machina_selector) {
set_selector(value.get_bool());
}