diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SMFDriver.cpp | 2 | ||||
-rw-r--r-- | src/engine/machina/SMFDriver.hpp | 6 | ||||
-rw-r--r-- | src/gui/main.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/engine/SMFDriver.cpp b/src/engine/SMFDriver.cpp index d2fcabb..70756d1 100644 --- a/src/engine/SMFDriver.cpp +++ b/src/engine/SMFDriver.cpp @@ -111,7 +111,7 @@ SMFDriver::learn_track(SharedPtr<Machine> m, while (reader.read_event(4, buf, &ev_size, &ev_time) >= 0) { t += ev_time / (double)reader.ppqn(); - if (t > max_duration) + if (max_duration != 0 && t > max_duration) break; //cerr << "t = " << t << endl; diff --git a/src/engine/machina/SMFDriver.hpp b/src/engine/machina/SMFDriver.hpp index 28d2277..17c196e 100644 --- a/src/engine/machina/SMFDriver.hpp +++ b/src/engine/machina/SMFDriver.hpp @@ -35,8 +35,8 @@ class Machine; class SMFDriver : public Raul::SMFWriter, public boost::enable_shared_from_this<SMFDriver> { public: - SharedPtr<Machine> learn(const Glib::ustring& uri, Raul::BeatTime max_duration); - SharedPtr<Machine> learn(const Glib::ustring& uri, unsigned track, Raul::BeatTime max_duration); + SharedPtr<Machine> learn(const Glib::ustring& uri, Raul::BeatTime max_duration=0); + SharedPtr<Machine> learn(const Glib::ustring& uri, unsigned track, Raul::BeatTime max_duration=0); void run(SharedPtr<Machine> machine, Raul::BeatTime max_time); @@ -44,7 +44,7 @@ private: void learn_track(SharedPtr<Machine> machine, Raul::SMFReader& reader, unsigned track, - Raul::BeatTime max_duration); + Raul::BeatTime max_duration=0); }; diff --git a/src/gui/main.cpp b/src/gui/main.cpp index cb9b7e9..20f75b9 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -38,7 +38,7 @@ main(int argc, char** argv) string filename = argv[1]; cout << "Building machine from MIDI file " << filename << endl; SharedPtr<Machina::SMFDriver> file_driver(new Machina::SMFDriver()); - machine = file_driver->learn(string("file://") + filename, 16.0); + machine = file_driver->learn(string("file://") + filename, 0.0); } // Build engine |