/* This file is part of Machina. * Copyright 2007-2011 David Robillard * * Machina is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Machina is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Machina. If not, see . */ #ifndef MACHINA_ENGINE_HPP #define MACHINA_ENGINE_HPP #include #include #include "raul/SharedPtr.hpp" #include "machina/Driver.hpp" #include "machina/Loader.hpp" namespace Machina { class Machine; class Engine { public: Engine(SharedPtr driver, Sord::World& rdf_world); Sord::World& rdf_world() { return _rdf_world; } static SharedPtr new_driver(const std::string& name, SharedPtr machine); SharedPtr driver() { return _driver; } SharedPtr machine() { return _driver->machine(); } SharedPtr load_machine(const Glib::ustring& uri); SharedPtr load_machine_midi(const Glib::ustring& uri, double q, Raul::TimeDuration dur); void import_machine(SharedPtr machine); void export_midi(const Glib::ustring& filename, Raul::TimeDuration dur); void set_bpm(double bpm); void set_quantization(double beat_fraction); private: SharedPtr _driver; Sord::World& _rdf_world; Loader _loader; }; } // namespace Machina #endif // MACHINA_ENGINE_HPP