aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/JackDriver.cpp43
-rw-r--r--src/engine/LearnRequest.hpp3
-rw-r--r--src/engine/MachineBuilder.cpp2
-rw-r--r--src/engine/machina/Controller.hpp10
4 files changed, 25 insertions, 33 deletions
diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp
index 4b49103..4db9ad2 100644
--- a/src/engine/JackDriver.cpp
+++ b/src/engine/JackDriver.cpp
@@ -45,9 +45,8 @@ JackDriver::JackDriver(Raul::Forge& forge, SPtr<Machine> machine)
, _quantization(0.0f)
, _stop(0)
, _stop_flag(false)
- , _record_dur(_frames_unit)
- , // = 0
- _recording(false)
+ , _record_dur(_frames_unit) // = 0
+ , _recording(false)
, _is_activated(false)
{
_context.set_sink(this);
@@ -82,24 +81,22 @@ JackDriver::attach(const std::string& client_name)
_context.time().set_tick_rate(sample_rate());
- _input_port = jack_port_register(
- jack_client(),
- "in",
- JACK_DEFAULT_MIDI_TYPE,
- JackPortIsInput,
- 0);
+ _input_port = jack_port_register(jack_client(),
+ "in",
+ JACK_DEFAULT_MIDI_TYPE,
+ JackPortIsInput,
+ 0);
if (!_input_port) {
std::cerr << "WARNING: Failed to create MIDI input port."
<< std::endl;
}
- _output_port = jack_port_register(
- jack_client(),
- "out",
- JACK_DEFAULT_MIDI_TYPE,
- JackPortIsOutput,
- 0);
+ _output_port = jack_port_register(jack_client(),
+ "out",
+ JACK_DEFAULT_MIDI_TYPE,
+ JackPortIsOutput,
+ 0);
if (!_output_port) {
std::cerr << "WARNING: Failed to create MIDI output port."
@@ -227,10 +224,9 @@ JackDriver::read_input_playing(SPtr<Machine> machine,
const SPtr<LearnRequest> learn = machine->pending_learn();
if (learn && learn->started()) {
learn->exit_action()->set_event(ev.size, ev.buffer);
- learn->finish(
- TimeStamp(TimeUnit::frames(sample_rate()),
- jack_last_frame_time(_client) + ev.time,
- 0));
+ learn->finish(TimeStamp(TimeUnit::frames(sample_rate()),
+ jack_last_frame_time(_client) + ev.time,
+ 0));
const uint64_t id = Stateful::next_id();
write_set(_updates, id,
@@ -264,14 +260,15 @@ JackDriver::write_event(Raul::TimeStamp time,
if (slice.beats_to_ticks(time) + slice.offset_ticks() <
slice.start_ticks()) {
std::cerr << "ERROR: Missed event by "
- << slice.start_ticks()
- - (slice.beats_to_ticks(time) + slice.offset_ticks())
+ << (slice.start_ticks()
+ - slice.beats_to_ticks(time)
+ + slice.offset_ticks())
<< " ticks"
<< "\n\tbpm: " << slice.bpm()
<< "\n\tev time: " << slice.beats_to_ticks(time)
<< "\n\tcycle_start: " << slice.start_ticks()
- << "\n\tcycle_end: " << slice.start_ticks()
- + slice.length_ticks()
+ << "\n\tcycle_end: " << (slice.start_ticks()
+ + slice.length_ticks())
<< "\n\tcycle_length: " << slice.length_ticks()
<< std::endl << std::endl;
return;
diff --git a/src/engine/LearnRequest.hpp b/src/engine/LearnRequest.hpp
index a5773ad..5021e00 100644
--- a/src/engine/LearnRequest.hpp
+++ b/src/engine/LearnRequest.hpp
@@ -35,8 +35,7 @@ class MidiAction;
class LearnRequest : public Raul::Maid::Manageable
{
public:
- static SPtr<LearnRequest>create(SPtr<Raul::Maid> maid,
- SPtr<Node> node);
+ static SPtr<LearnRequest> create(SPtr<Raul::Maid> maid, SPtr<Node> node);
void start(double q, Raul::TimeStamp time);
void finish(TimeStamp time);
diff --git a/src/engine/MachineBuilder.cpp b/src/engine/MachineBuilder.cpp
index a6ecb32..d8fcff1 100644
--- a/src/engine/MachineBuilder.cpp
+++ b/src/engine/MachineBuilder.cpp
@@ -44,7 +44,7 @@ MachineBuilder::MachineBuilder(SPtr<Machine> machine, double q, bool step)
void
MachineBuilder::reset()
{
- _time = TimeStamp(_machine->time().unit()); // = 0
+ _time = TimeStamp(_machine->time().unit()); // = 0
_initial_node = SPtr<Node>(new Node(_time, true)); // duration 0
_connect_node = _initial_node;
_connect_node_end_time = _time; // = 0
diff --git a/src/engine/machina/Controller.hpp b/src/engine/machina/Controller.hpp
index c77ee16..67402f1 100644
--- a/src/engine/machina/Controller.hpp
+++ b/src/engine/machina/Controller.hpp
@@ -52,9 +52,7 @@ public:
uint64_t create(const client::ClientObject& obj);
uint64_t connect(uint64_t tail_id, uint64_t head_id);
- void set_property(uint64_t object_id,
- URIInt key,
- const Raul::Atom& value);
+ void set_property(uint64_t object_id, URIInt key, const Raul::Atom& value);
void learn(SPtr<Raul::Maid> maid, uint64_t node_id);
void disconnect(uint64_t tail_id, uint64_t head_id);
@@ -68,11 +66,9 @@ private:
SPtr<Stateful> find(uint64_t id);
struct StatefulComparator {
- inline bool operator()(SPtr<Stateful> lhs,
- SPtr<Stateful> rhs) const {
- return lhs->id() < rhs->id();
+ inline bool operator()(SPtr<Stateful> a, SPtr<Stateful> b) const {
+ return a->id() < b->id();
}
-
};
typedef std::set<SPtr<Stateful>, StatefulComparator> Objects;