aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/SMFDriver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SMFDriver.cpp')
-rw-r--r--src/engine/SMFDriver.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/engine/SMFDriver.cpp b/src/engine/SMFDriver.cpp
index cba814d..e3e95b8 100644
--- a/src/engine/SMFDriver.cpp
+++ b/src/engine/SMFDriver.cpp
@@ -20,24 +20,24 @@
#include <glibmm/convert.h>
-#include "raul/Quantizer.hpp"
#include "raul/SharedPtr.hpp"
-#include "raul/SMFWriter.hpp"
-#include "raul/SMFReader.hpp"
#include "machina/Machine.hpp"
#include "Edge.hpp"
+#include "Quantizer.hpp"
#include "SMFDriver.hpp"
+#include "SMFReader.hpp"
+#include "SMFWriter.hpp"
using namespace std;
namespace Machina {
-SMFDriver::SMFDriver(Raul::TimeUnit unit)
- : Driver(SharedPtr<Machine>())
+SMFDriver::SMFDriver(Raul::Forge& forge, Raul::TimeUnit unit)
+ : Driver(forge, SharedPtr<Machine>())
{
- _writer = SharedPtr<Raul::SMFWriter>(new Raul::SMFWriter(unit));
+ _writer = SharedPtr<SMFWriter>(new SMFWriter(unit));
}
/** Learn a single track from the MIDI file at @a uri
@@ -51,9 +51,9 @@ SharedPtr<Machine>
SMFDriver::learn(const string& filename, unsigned track, double q, Raul::TimeDuration max_duration)
{
//assert(q.unit() == max_duration.unit());
- SharedPtr<Machine> m(new Machine(max_duration.unit()));
+ SharedPtr<Machine> m(new Machine(_forge, max_duration.unit()));
SharedPtr<MachineBuilder> builder = SharedPtr<MachineBuilder>(new MachineBuilder(m, q, false));
- Raul::SMFReader reader;
+ SMFReader reader;
if (!reader.open(filename)) {
cerr << "Unable to open MIDI file " << filename << endl;
@@ -80,9 +80,9 @@ SMFDriver::learn(const string& filename, unsigned track, double q, Raul::TimeDur
SharedPtr<Machine>
SMFDriver::learn(const string& filename, double q, Raul::TimeStamp max_duration)
{
- SharedPtr<Machine> m(new Machine(max_duration.unit()));
+ SharedPtr<Machine> m(new Machine(_forge, max_duration.unit()));
SharedPtr<MachineBuilder> builder = SharedPtr<MachineBuilder>(new MachineBuilder(m, q, false));
- Raul::SMFReader reader;
+ SMFReader reader;
if (!reader.open(filename)) {
cerr << "Unable to open MIDI file " << filename << endl;
@@ -104,7 +104,7 @@ SMFDriver::learn(const string& filename, double q, Raul::TimeStamp max_duration)
void
SMFDriver::learn_track(SharedPtr<MachineBuilder> builder,
- Raul::SMFReader& reader,
+ SMFReader& reader,
unsigned track,
double q,
Raul::TimeDuration max_duration)
@@ -122,7 +122,7 @@ SMFDriver::learn_track(SharedPtr<MachineBuilder> builder,
while (reader.read_event(4, buf, &ev_size, &ev_delta_time) >= 0) {
unquantized_t += ev_delta_time;
- t = Raul::Quantizer::quantize(q, unquantized_t);
+ t = Quantizer::quantize(q, unquantized_t);
builder->set_time(TimeStamp(max_duration.unit(), (double)t));