summaryrefslogtreecommitdiffstats
path: root/src/server/PortImpl.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-08-20 20:59:48 +0000
committerDavid Robillard <d@drobilla.net>2011-08-20 20:59:48 +0000
commit769fd5a2c60ef39f0af68664b35c99f90b8d715b (patch)
treecfaeacafbeba957a349bc1511da86c988685f6e2 /src/server/PortImpl.cpp
parentc2d440f132983a1068caa23e6c3832ddecbabaa9 (diff)
downloadingen-769fd5a2c60ef39f0af68664b35c99f90b8d715b.tar.gz
ingen-769fd5a2c60ef39f0af68664b35c99f90b8d715b.tar.bz2
ingen-769fd5a2c60ef39f0af68664b35c99f90b8d715b.zip
Fix crash when sending port notifications (fix #741).
Use a simpler system for port change notifications (abusing Event, which is virtual and thus can't be ringbuffered safely, was the cause of this crash). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3438 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/PortImpl.cpp')
-rw-r--r--src/server/PortImpl.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index a448916e..d7b7e569 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -15,19 +15,22 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "lv2/lv2plug.in/ns/ext/contexts/contexts.h"
+
#include "raul/Array.hpp"
#include "raul/Maid.hpp"
+
#include "shared/LV2URIMap.hpp"
-#include "lv2/lv2plug.in/ns/ext/contexts/contexts.h"
+
#include "ingen/PortType.hpp"
-#include "events/SendPortValue.hpp"
-#include "events/SendPortActivity.hpp"
+
#include "AudioBuffer.hpp"
#include "BufferFactory.hpp"
#include "Engine.hpp"
#include "EventBuffer.hpp"
#include "LV2Atom.hpp"
#include "NodeImpl.hpp"
+#include "Notification.hpp"
#include "ObjectBuffer.hpp"
#include "PortImpl.hpp"
#include "ThreadManager.hpp"
@@ -208,20 +211,24 @@ PortImpl::broadcast_value(Context& context, bool force)
break;
case PortType::EVENTS:
if (((EventBuffer*)buffer(0).get())->event_count() > 0) {
- const Events::SendPortActivity ev(context.engine(), context.start(), this);
- context.event_sink().write(sizeof(ev), &ev);
+ const Notification note(Notification::PORT_ACTIVITY,
+ context.start(), this, Atom(true));
+ context.event_sink().write(sizeof(note), &note);
}
break;
case PortType::VALUE:
case PortType::MESSAGE:
- Ingen::Shared::LV2Atom::to_atom(_bufs.uris(), ((ObjectBuffer*)buffer(0).get())->atom(), val);
+ Ingen::Shared::LV2Atom::to_atom(_bufs.uris(),
+ ((ObjectBuffer*)buffer(0).get())->atom(),
+ val);
break;
}
if (val.is_valid() && (force || val != _last_broadcasted_value)) {
_last_broadcasted_value = val;
- const Events::SendPortValue ev(context.engine(), context.start(), this, true, 0, val);
- context.event_sink().write(sizeof(ev), &ev);
+ const Notification note(Notification::PORT_VALUE,
+ context.start(), this, val);
+ context.event_sink().write(sizeof(note), &note);
}
}