summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-01-22 04:07:53 +0000
committerDavid Robillard <d@drobilla.net>2007-01-22 04:07:53 +0000
commit216eef86b39515911234d0f1d3bb23334e8d29f2 (patch)
treee20b7374d808ec9fe031f4316d1ca3b24906bf63 /src
parent014ba4fb2d72bdc481c2ba76bd53901a39725b86 (diff)
downloadpatchage-216eef86b39515911234d0f1d3bb23334e8d29f2.tar.gz
patchage-216eef86b39515911234d0f1d3bb23334e8d29f2.tar.bz2
patchage-216eef86b39515911234d0f1d3bb23334e8d29f2.zip
Added atomic int/pointer classes to Raul.
Added multi-writer queue to Raul. Renamed Queue SRSWQueue (single-reader single-writer). Updated patchage/ingen for Raul changes. git-svn-id: http://svn.drobilla.net/lad/patchage@264 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/JackDriver.h6
-rw-r--r--src/Patchage.cpp10
2 files changed, 10 insertions, 6 deletions
diff --git a/src/JackDriver.h b/src/JackDriver.h
index 7acbad8..5f5777b 100644
--- a/src/JackDriver.h
+++ b/src/JackDriver.h
@@ -22,7 +22,7 @@
#include <boost/shared_ptr.hpp>
#include <jack/jack.h>
#include <jack/statistics.h>
-#include <raul/Queue.h>
+#include <raul/SRSWQueue.h>
#include "Driver.h"
class Patchage;
class PatchageEvent;
@@ -50,7 +50,7 @@ public:
bool is_attached() const { return (m_client != NULL); }
bool is_realtime() const { return m_client && jack_is_realtime(m_client); }
- Queue<PatchageEvent>& events() { return m_events; }
+ SRSWQueue<PatchageEvent>& events() { return m_events; }
void refresh();
@@ -106,7 +106,7 @@ private:
Patchage* m_app;
jack_client_t* m_client;
- Queue<PatchageEvent> m_events;
+ SRSWQueue<PatchageEvent> m_events;
bool m_is_activated;
jack_position_t m_last_pos;
diff --git a/src/Patchage.cpp b/src/Patchage.cpp
index 61a9abd..b7f601c 100644
--- a/src/Patchage.cpp
+++ b/src/Patchage.cpp
@@ -295,9 +295,13 @@ Patchage::attach()
bool
Patchage::idle_callback()
{
- if (m_jack_driver)
- while (m_jack_driver->events().fill() > 0)
- m_jack_driver->events().pop().execute();
+ if (m_jack_driver) {
+ while (!m_jack_driver->events().empty()) {
+ PatchageEvent& ev = m_jack_driver->events().front();
+ m_jack_driver->events().pop();
+ ev.execute();
+ }
+ }
bool refresh = m_refresh;