summaryrefslogtreecommitdiffstats
path: root/src/server/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/events')
-rw-r--r--src/server/events/Mark.cpp27
-rw-r--r--src/server/events/Mark.hpp3
2 files changed, 28 insertions, 2 deletions
diff --git a/src/server/events/Mark.cpp b/src/server/events/Mark.cpp
index 32648649..11690487 100644
--- a/src/server/events/Mark.cpp
+++ b/src/server/events/Mark.cpp
@@ -29,6 +29,7 @@ Mark::Mark(Engine& engine,
Type type)
: Event(engine, client, id, timestamp)
, _type(type)
+ , _depth(0)
{}
bool
@@ -40,10 +41,10 @@ Mark::pre_process()
switch (_type) {
case Type::BUNDLE_START:
- stack->start_entry();
+ _depth = stack->start_entry();
break;
case Type::BUNDLE_END:
- stack->finish_entry();
+ _depth = stack->finish_entry();
break;
}
@@ -60,6 +61,28 @@ Mark::post_process()
respond();
}
+Event::Execution
+Mark::get_execution() const
+{
+ if (!_engine.atomic_bundles()) {
+ return Execution::NORMAL;
+ }
+
+ switch (_type) {
+ case Type::BUNDLE_START:
+ if (_depth == 1) {
+ return Execution::BLOCK;
+ }
+ break;
+ case Type::BUNDLE_END:
+ if (_depth == 0) {
+ return Execution::UNBLOCK;
+ }
+ break;
+ }
+ return Execution::NORMAL;
+}
+
} // namespace Events
} // namespace Server
} // namespace Ingen
diff --git a/src/server/events/Mark.hpp b/src/server/events/Mark.hpp
index db5550a0..a68e3b3b 100644
--- a/src/server/events/Mark.hpp
+++ b/src/server/events/Mark.hpp
@@ -48,8 +48,11 @@ public:
void execute(RunContext& context);
void post_process();
+ Execution get_execution() const override;
+
private:
Type _type;
+ int _depth;
};
} // namespace Events