aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-10 21:37:09 +0000
committerDavid Robillard <d@drobilla.net>2011-01-10 21:37:09 +0000
commite2babea8aa8b87ca930cc53fd5ee7cce4eff3206 (patch)
treeae7e594220f50bd708192e67a4e43513d1743d74
parentf293da6bc4f0f631c086d35666e3e8bfef19b8f2 (diff)
downloadmachina-e2babea8aa8b87ca930cc53fd5ee7cce4eff3206.tar.gz
machina-e2babea8aa8b87ca930cc53fd5ee7cce4eff3206.tar.bz2
machina-e2babea8aa8b87ca930cc53fd5ee7cce4eff3206.zip
Remove Raul::Command (mostly useless thin wrapper around a semaphore).
Remove Semaphore::has_waiter (not portable). git-svn-id: http://svn.drobilla.net/lad/trunk/machina@2822 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/engine/JackDriver.cpp11
-rw-r--r--src/engine/JackDriver.hpp4
2 files changed, 9 insertions, 6 deletions
diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp
index ca86111..018dd59 100644
--- a/src/engine/JackDriver.cpp
+++ b/src/engine/JackDriver.cpp
@@ -44,6 +44,8 @@ JackDriver::JackDriver(SharedPtr<Machine> machine)
, _cycle_time(48000, MACHINA_PPQN, 120.0)
, _bpm(120.0)
, _quantization(0.0f)
+ , _stop(0)
+ , _stop_flag(false)
, _record_dur(_frames_unit) // = 0
, _recording(0)
, _is_activated(false)
@@ -332,7 +334,7 @@ JackDriver::on_process(jack_nframes_t nframes)
machine->set_sink(shared_from_this());
- if (_stop.pending())
+ if (_stop_flag)
machine->reset(_cycle_time.start_beats());
process_input(machine, _cycle_time);
@@ -372,10 +374,10 @@ end:
* we need to finalize it next cycle. */
_last_machine = machine;
- if (_stop.pending()) {
+ if (_stop_flag) {
_cycle_time.set_slice(TimeStamp(_frames_unit, 0, 0),
TimeStamp(_frames_unit, 0, 0));
- _stop.finish();
+ _stop_flag = false;
}
}
@@ -386,7 +388,8 @@ JackDriver::stop()
if (recording())
finish_record();
- _stop(); // waits
+ _stop_flag= true;
+ _stop.wait();
_machine->deactivate();
}
diff --git a/src/engine/JackDriver.hpp b/src/engine/JackDriver.hpp
index 133c7ed..f1d38b8 100644
--- a/src/engine/JackDriver.hpp
+++ b/src/engine/JackDriver.hpp
@@ -23,7 +23,6 @@
#include <jack/jack.h>
#include <jack/midiport.h>
-#include "raul/Command.hpp"
#include "raul/DoubleBuffer.hpp"
#include "raul/Semaphore.hpp"
#include "raul/SharedPtr.hpp"
@@ -113,7 +112,8 @@ private:
Raul::DoubleBuffer<double> _bpm;
Raul::DoubleBuffer<double> _quantization;
- Raul::Command _stop;
+ Raul::Semaphore _stop;
+ bool _stop_flag;
Raul::TimeDuration _record_dur;
Raul::AtomicInt _recording;