From 2ee0bc08ac0ab14c870542ea182abf7bf0031dcc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 12 Mar 2007 23:03:14 +0000 Subject: Max duration loading optional. git-svn-id: http://svn.drobilla.net/lad/machina@360 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/SMFDriver.cpp | 2 +- src/engine/machina/SMFDriver.hpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/engine') 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 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 { public: - SharedPtr learn(const Glib::ustring& uri, Raul::BeatTime max_duration); - SharedPtr learn(const Glib::ustring& uri, unsigned track, Raul::BeatTime max_duration); + SharedPtr learn(const Glib::ustring& uri, Raul::BeatTime max_duration=0); + SharedPtr learn(const Glib::ustring& uri, unsigned track, Raul::BeatTime max_duration=0); void run(SharedPtr machine, Raul::BeatTime max_time); @@ -44,7 +44,7 @@ private: void learn_track(SharedPtr machine, Raul::SMFReader& reader, unsigned track, - Raul::BeatTime max_duration); + Raul::BeatTime max_duration=0); }; -- cgit v1.2.1