aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/Node.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-12-02 04:43:48 +0000
committerDavid Robillard <d@drobilla.net>2007-12-02 04:43:48 +0000
commit0e03c5f94d91086ac1b9f3b42cee4459290e353e (patch)
tree4ae2e6f69c5b127bc2d0ba2920a7e9a2741c0339 /src/engine/Node.cpp
parent377f82ab766acf2c52674c11d507aeaee4349f46 (diff)
downloadmachina-0e03c5f94d91086ac1b9f3b42cee4459290e353e.tar.gz
machina-0e03c5f94d91086ac1b9f3b42cee4459290e353e.tar.bz2
machina-0e03c5f94d91086ac1b9f3b42cee4459290e353e.zip
Ability to add notes to non-MIDI-note nodes (ie make noise with mouse only).
Fix note label display. Canvas prettiness ++. git-svn-id: http://svn.drobilla.net/lad/machina@937 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/Node.cpp')
-rw-r--r--src/engine/Node.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/engine/Node.cpp b/src/engine/Node.cpp
index cb1a8eb..77c6d00 100644
--- a/src/engine/Node.cpp
+++ b/src/engine/Node.cpp
@@ -47,6 +47,7 @@ Node::set_selector(bool yn)
for (Edges::iterator i = _outgoing_edges.begin(); i != _outgoing_edges.end(); ++i)
(*i)->set_probability((*i)->probability() / prob_sum);
}
+ _changed = true;
}
@@ -54,28 +55,15 @@ void
Node::set_enter_action(SharedPtr<Action> action)
{
_enter_action = action;
+ _changed = true;
}
void
-Node::remove_enter_action()
-{
- _enter_action.reset();
-}
-
-
-
-void
Node::set_exit_action(SharedPtr<Action> action)
{
_exit_action = action;
-}
-
-
-void
-Node::remove_exit_action()
-{
- _exit_action.reset();
+ _changed = true;
}
@@ -84,8 +72,10 @@ Node::enter(SharedPtr<Raul::MIDISink> sink, BeatTime time)
{
assert(!_is_active);
+ _changed = true;
_is_active = true;
_enter_time = time;
+
if (sink && _enter_action)
_enter_action->execute(sink, time);
}
@@ -98,6 +88,8 @@ Node::exit(SharedPtr<Raul::MIDISink> sink, BeatTime time)
if (sink && _exit_action)
_exit_action->execute(sink, time);
+
+ _changed = true;
_is_active = false;
_enter_time = 0;
}